Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-12-07 21:06:37 +0300
committerMartin Poirier <theeth@yahoo.com>2009-12-07 21:06:37 +0300
commit78f87c8bdf3bdb2115f9ab3e2a333fb76a5d2cfc (patch)
treefdc8702c74c3b30659b6c13677eab3a5913afcc3
parent149b3bc7f2791e61d94dd91390b66fce7ff45aac (diff)
Function to access the real cursor position from Ghost (useful when cursor is grabbed and warped)
-rw-r--r--source/blender/windowmanager/intern/wm_window.c7
-rw-r--r--source/blender/windowmanager/wm_window.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index d9b6117cbb3..542520ce1b0 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -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 ***************** */
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index 4328f915101..84e246937e4 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -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);