attempt to implement fghPlatformGetCursorPos on X11

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1378 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2012-07-29 05:28:10 +00:00
parent 89df7d96ed
commit 3173417248
2 changed files with 15 additions and 0 deletions

View File

@ -115,6 +115,8 @@ void fgPlatformWarpPointer ( int x, int y )
void fghPlatformGetCursorPos(SFG_XYUse *mouse_pos)
{
/* Get current pointer location in screen coordinates
*/
POINT pos;
GetCursorPos(&pos);

View File

@ -149,3 +149,16 @@ void fgPlatformWarpPointer ( int x, int y )
XFlush( fgDisplay.pDisplay.Display );
}
void fghPlatformGetCursorPos(SFG_XYUse *mouse_pos)
{
/* Get current pointer location in screen coordinates
*/
Window junk_window;
unsigned int junk_mask;
int junk_pos;
XQueryPointer(fgDisplay.pDisplay.Display, fgDisplay.pDisplay.RootWindow,
&junk_window, &junk_window,
&mouse_pos->X, &mouse_pos->Y,
&junk_pos, &junk_pos, &junk_mask);
}