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:
parent
89df7d96ed
commit
3173417248
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user