1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 20:28:49 -05:00

wayland: Implement glfwGetCursorPos

Closes #499.
This commit is contained in:
Emmanuel Gil Peyrot 2015-04-15 18:18:42 +02:00 committed by Camilla Berglund
parent 9021e52a6f
commit e253beaa2b
3 changed files with 10 additions and 2 deletions

View File

@ -86,6 +86,11 @@ static void pointerHandleMotion(void* data,
"Wayland: GLFW_CURSOR_DISABLED not supported");
return;
}
else
{
window->wl.cursorPosX = wl_fixed_to_double(sx);
window->wl.cursorPosY = wl_fixed_to_double(sy);
}
_glfwInputCursorMotion(window,
wl_fixed_to_double(sx),

View File

@ -66,6 +66,7 @@ typedef struct _GLFWwindowWayland
struct wl_shell_surface* shell_surface;
struct wl_callback* callback;
_GLFWcursor* currentCursor;
double cursorPosX, cursorPosY;
} _GLFWwindowWayland;

View File

@ -379,8 +379,10 @@ void _glfwPlatformPostEmptyEvent(void)
void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos)
{
// TODO
fprintf(stderr, "_glfwPlatformGetCursorPos not implemented yet\n");
if (xpos)
*xpos = window->wl.cursorX;
if (ypos)
*ypos = window->wl.cursorY;
}
void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)