void wm_cursor_position_to_ghost(wmWindow *win, int *x, int *y) { float fac = GHOST_GetNativePixelSize(win->ghostwin); *x /= fac; *y /= fac; *y = win->sizey - *y - 1; GHOST_ClientToScreen(win->ghostwin, *x, *y, x, y); }
/* This function requires access to the GHOST_SystemHandle (g_system) */ void WM_cursor_warp(wmWindow *win, int x, int y) { if (win && win->ghostwin) { int oldx = x, oldy = y; y = win->sizey - y - 1; GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y); GHOST_SetCursorPosition(g_system, x, y); win->eventstate->prevx = oldx; win->eventstate->prevy = oldy; } }
/* This function requires access to the GHOST_SystemHandle (g_system) */ void WM_cursor_warp(wmWindow *win, int x, int y) { if (win && win->ghostwin) { float f = GHOST_GetNativePixelSize(win->ghostwin); int oldx = x, oldy = y; x = x / f; y = y / f; y = win->sizey - y - 1; GHOST_ClientToScreen(win->ghostwin, x, y, &x, &y); GHOST_SetCursorPosition(g_system, x, y); win->eventstate->prevx = oldx; win->eventstate->prevy = oldy; win->eventstate->x = oldx; win->eventstate->y = oldy; } }