[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25176] trunk/blender/source/blender/ windowmanager: Function to access the real cursor position from Ghost ( useful when cursor is grabbed and warped)
Martin Poirier
theeth at yahoo.com
Mon Dec 7 19:06:37 CET 2009
Revision: 25176
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25176
Author: theeth
Date: 2009-12-07 19:06:37 +0100 (Mon, 07 Dec 2009)
Log Message:
-----------
Function to access the real cursor position from Ghost (useful when cursor is grabbed and warped)
Modified Paths:
--------------
trunk/blender/source/blender/windowmanager/intern/wm_window.c
trunk/blender/source/blender/windowmanager/wm_window.h
Modified: trunk/blender/source/blender/windowmanager/intern/wm_window.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_window.c 2009-12-07 18:05:51 UTC (rev 25175)
+++ trunk/blender/source/blender/windowmanager/intern/wm_window.c 2009-12-07 18:06:37 UTC (rev 25176)
@@ -972,6 +972,13 @@
#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 ***************** */
Modified: trunk/blender/source/blender/windowmanager/wm_window.h
===================================================================
--- trunk/blender/source/blender/windowmanager/wm_window.h 2009-12-07 18:05:51 UTC (rev 25175)
+++ trunk/blender/source/blender/windowmanager/wm_window.h 2009-12-07 18:06:37 UTC (rev 25176)
@@ -55,6 +55,8 @@
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);
More information about the Bf-blender-cvs
mailing list