Function to access the real cursor position from Ghost (useful when cursor is grabbed and warped)
This commit is contained in:
parent
149b3bc7f2
commit
78f87c8bdf
@ -972,6 +972,13 @@ void wm_window_swap_buffers(wmWindow *win)
|
||||
#endif
|
||||
}
|
||||
|
||||
void wm_get_cursor_position(wmWindow *win, int *x, int *y)
|
||||
{
|
||||
GHOST_GetCursorPosition(g_system, x, y);
|
||||
GHOST_ScreenToClient(win->ghostwin, *x, *y, x, y);
|
||||
*y = (win->sizey-1) - *y;
|
||||
}
|
||||
|
||||
/* ******************* exported api ***************** */
|
||||
|
||||
|
||||
|
@ -55,6 +55,8 @@ void wm_window_get_position (wmWindow *win, int *posx_r, int *posy_r);
|
||||
void wm_window_set_title (wmWindow *win, char *title);
|
||||
void wm_window_swap_buffers (wmWindow *win);
|
||||
|
||||
void wm_get_cursor_position (wmWindow *win, int *x, int *y);
|
||||
|
||||
wmWindow *wm_window_copy (bContext *C, wmWindow *winorig);
|
||||
|
||||
void wm_window_testbreak (void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user