Inaccurate mouse movement in OSX?

mwaness wrote on Tuesday, May 29, 2012:

I’ve been using the following code to create a FPS style camera movement in my
On Windows and Linux, the results are smooth, but when I tried porting to OSX,
I got extremely jagged movements, with no input for about a second, then a
burst of (small) movement, then no input again.
Am I doing something wrong?

    // Mouse events
    if (glfwGetWindowParam(GLFW_ACTIVE) == GL_TRUE) {
        if (lostFocus) {
            lostFocus = false;
            // Reset the mouse for the next call
        } else {
            int x = 0, y = 0;
            glfwGetMousePos(&x, &y);
            data.DeltaViewX = static_cast<float>(x - centerx);
            data.DeltaViewY = static_cast<float>(y - centery);
        glfwSetMousePos(centerx, centery);
    } else {
        // Ignore the mouse if the window's not in focus.
        lostFocus = true;

elmindreda wrote on Tuesday, May 29, 2012:

Instead of centering the mouse cursor manually, you should likely be using the

mwaness wrote on Wednesday, May 30, 2012:

Odd, I’m sure I remember that directive only being available for fullscreen
That solved it though, thanks!