projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
can now set the font used for a menu
[freeglut]
/
src
/
mswin
/
fg_cursor_mswin.c
diff --git
a/src/mswin/fg_cursor_mswin.c
b/src/mswin/fg_cursor_mswin.c
index
d14da59
..
7bc5cae
100644
(file)
--- a/
src/mswin/fg_cursor_mswin.c
+++ b/
src/mswin/fg_cursor_mswin.c
@@
-128,13
+128,18
@@
void fgPlatformWarpPointer ( int x, int y )
}
}
-void fghPlatformGetCursorPos(SFG_XYUse *mouse_pos)
+void fghPlatformGetCursorPos(const SFG_Window *window, GLboolean client, SFG_XYUse *mouse_pos)
{
{
- /* Get current pointer location in screen coordinates
+ /* Get current pointer location in screen coordinates (if client is false or window is NULL), else
+ * Get current pointer location relative to top-left of client area of window (if client is true and window is not NULL)
*/
POINT pos;
GetCursorPos(&pos);
*/
POINT pos;
GetCursorPos(&pos);
+ /* convert to client coords if wanted */
+ if (client && window && window->Window.Handle)
+ ScreenToClient(window->Window.Handle,&pos);
+
mouse_pos->X = pos.x;
mouse_pos->Y = pos.y;
mouse_pos->Use = GL_TRUE;
mouse_pos->X = pos.x;
mouse_pos->Y = pos.y;
mouse_pos->Use = GL_TRUE;