X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_cursor_x11.c;h=ab5e01562d9c59bb0a176ea83465a29606d3eeae;hb=757e1ba2f548e903b960b19a39c3752a3be621f7;hp=3098e53d9b6868b7652b2d859f44a0b33b6705ec;hpb=5b3d339481bac6dbaeb599bffc1325f716585bfe;p=freeglut diff --git a/src/x11/fg_cursor_x11.c b/src/x11/fg_cursor_x11.c index 3098e53..ab5e015 100644 --- a/src/x11/fg_cursor_x11.c +++ b/src/x11/fg_cursor_x11.c @@ -149,3 +149,18 @@ 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); + + mouse_pos->Use = GL_TRUE; +}