Skip to content

Commit

Permalink
wayland: Implement glfwGetCursorPos
Browse files Browse the repository at this point in the history
  • Loading branch information
linkmauve committed Apr 16, 2015
1 parent 5b6e671 commit 3219b6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/input.c
Expand Up @@ -205,6 +205,11 @@ void _glfwInputCursorMotion(_GLFWwindow* window, double x, double y)
x = window->cursorPosX;
y = window->cursorPosY;
}
else
{
window->cursorPosX = x;
window->cursorPosY = y;
}

if (window->callbacks.cursorPos)
window->callbacks.cursorPos((GLFWwindow*) window, x, y);
Expand Down
6 changes: 4 additions & 2 deletions src/wl_window.c
Expand Up @@ -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->cursorPosX;
if (ypos)
*ypos = window->cursorPosY;
}

void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
Expand Down

0 comments on commit 3219b6a

Please sign in to comment.