本文整理汇总了C++中IDirectFBDisplayLayer::GetCursorPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBDisplayLayer::GetCursorPosition方法的具体用法?C++ IDirectFBDisplayLayer::GetCursorPosition怎么用?C++ IDirectFBDisplayLayer::GetCursorPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBDisplayLayer
的用法示例。
在下文中一共展示了IDirectFBDisplayLayer::GetCursorPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
einfo->info.flags = DSDRAW_BLEND;
evas_engine_info_set(evas, (Evas_Engine_Info *) einfo);
}
setup();
evas_render(evas);
start_time = get_time();
}
while (!quit) {
static IDirectFBWindow* active = NULL;
static int grabbed = 0;
static int startx = 0;
static int starty = 0;
static int endx = 0;
static int endy = 0;
DFBWindowEvent evt;
buffer->WaitForEventWithTimeout( buffer, 0, 10 );
while (buffer->GetEvent( buffer, DFB_EVENT(&evt) ) == DFB_OK) {
IDirectFBWindow* window;
if (evt.window_id == id1)
window = window1;
else
window = window2;
if (active) {
switch (evt.type) {
case DWET_BUTTONDOWN:
if (!grabbed && evt.button == DIBI_LEFT) {
grabbed = 1;
layer->GetCursorPosition( layer,
&startx, &starty );
window->GrabPointer( window );
}
break;
case DWET_BUTTONUP:
switch (evt.button) {
case DIBI_LEFT:
if (grabbed) {
window->UngrabPointer( window );
grabbed = 0;
}
break;
case DIBI_MIDDLE:
upper->LowerToBottom( upper );
upper = (upper == window1) ? window2 : window1;
break;
case DIBI_RIGHT:
quit = DIKS_DOWN;
break;
default:
break;
}
break;
case DWET_KEYDOWN:
if (grabbed)
break;
switch (evt.key_id) {
case DIKI_RIGHT:
active->Move (active, 1, 0);
break;