From: <dc...@us...> - 2012-07-29 05:18:42
|
Revision: 1377 http://freeglut.svn.sourceforge.net/freeglut/?rev=1377&view=rev Author: dcnieho Date: 2012-07-29 05:18:36 +0000 (Sun, 29 Jul 2012) Log Message: ----------- fg_cursor is a much better place for code reading the mouse position Modified Paths: -------------- trunk/freeglut/freeglut/src/fg_menu.c trunk/freeglut/freeglut/src/mswin/fg_cursor_mswin.c trunk/freeglut/freeglut/src/mswin/fg_window_mswin.c Modified: trunk/freeglut/freeglut/src/fg_menu.c =================================================================== --- trunk/freeglut/freeglut/src/fg_menu.c 2012-07-29 05:11:53 UTC (rev 1376) +++ trunk/freeglut/freeglut/src/fg_menu.c 2012-07-29 05:18:36 UTC (rev 1377) @@ -76,6 +76,7 @@ extern GLvoid fgPlatformGetGameModeVMaxExtent( SFG_Window* window, int* x, int* y ); +extern void fghPlatformGetCursorPos(SFG_XYUse *mouse_pos); /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ @@ -721,7 +722,7 @@ { /* Get cursor position on screen and convert to relative to parent_window's client area */ SFG_XYUse mouse_pos; - fghPlatformGetMousePos(&mouse_pos); + fghPlatformGetCursorPos(&mouse_pos); mouse_pos.X -= glutGet( GLUT_WINDOW_X ); mouse_pos.Y -= glutGet( GLUT_WINDOW_Y ); Modified: trunk/freeglut/freeglut/src/mswin/fg_cursor_mswin.c =================================================================== --- trunk/freeglut/freeglut/src/mswin/fg_cursor_mswin.c 2012-07-29 05:11:53 UTC (rev 1376) +++ trunk/freeglut/freeglut/src/mswin/fg_cursor_mswin.c 2012-07-29 05:18:36 UTC (rev 1377) @@ -113,3 +113,12 @@ } +void fghPlatformGetCursorPos(SFG_XYUse *mouse_pos) +{ + POINT pos; + GetCursorPos(&pos); + + mouse_pos->X = pos.x; + mouse_pos->Y = pos.y; + mouse_pos->Use = GL_TRUE; +} \ No newline at end of file Modified: trunk/freeglut/freeglut/src/mswin/fg_window_mswin.c =================================================================== --- trunk/freeglut/freeglut/src/mswin/fg_window_mswin.c 2012-07-29 05:11:53 UTC (rev 1376) +++ trunk/freeglut/freeglut/src/mswin/fg_window_mswin.c 2012-07-29 05:18:36 UTC (rev 1377) @@ -371,16 +371,6 @@ } -void fghPlatformGetMousePos(SFG_XYUse *mouse_pos) -{ - POINT pos; - GetCursorPos(&pos); - - mouse_pos->X = pos.x; - mouse_pos->Y = pos.y; - mouse_pos->Use = GL_TRUE; -} - /* Returns the width of the window borders based on the window's style. */ void fghGetBorderWidth(const DWORD windowStyle, int* xBorderWidth, int* yBorderWidth) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |