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

Removed centered flag.

This commit is contained in:
Camilla Berglund 2013-04-30 17:30:24 +02:00
parent 98c16700a5
commit 161c73ea66
2 changed files with 1 additions and 7 deletions

View File

@ -85,7 +85,6 @@ typedef struct _GLFWwindowX11
GLboolean overrideRedirect; // True if window is OverrideRedirect
GLboolean cursorGrabbed; // True if cursor is currently grabbed
GLboolean cursorHidden; // True if cursor is currently hidden
GLboolean cursorCentered; // True if cursor was moved since last poll
// The last received cursor position, regardless of source
double cursorPosX, cursorPosY;

View File

@ -301,7 +301,6 @@ static void captureCursor(_GLFWwindow* window)
GrabSuccess)
{
window->x11.cursorGrabbed = GL_TRUE;
window->x11.cursorCentered = GL_FALSE;
}
}
}
@ -601,7 +600,6 @@ static void processEvent(XEvent *event)
y = event->xmotion.y;
}
window->x11.cursorCentered = GL_FALSE;
_glfwInputCursorMotion(window, x, y);
}
@ -764,7 +762,6 @@ static void processEvent(XEvent *event)
y = data->event_y;
}
window->x11.cursorCentered = GL_FALSE;
_glfwInputCursorMotion(window, x, y);
}
@ -1052,13 +1049,11 @@ void _glfwPlatformPollEvents(void)
window = _glfw.focusedWindow;
if (window)
{
if (window->cursorMode == GLFW_CURSOR_CAPTURED &&
!window->x11.cursorCentered)
if (window->cursorMode == GLFW_CURSOR_CAPTURED)
{
int width, height;
_glfwPlatformGetWindowSize(window, &width, &height);
_glfwPlatformSetCursorPos(window, width / 2, height / 2);
window->x11.cursorCentered = GL_TRUE;
// NOTE: This is a temporary fix. It works as long as you use
// offsets accumulated over the course of a frame, instead of