Inaccurate mouse movement in OSX?

mwaness wrote on Tuesday, May 29, 2012:

Hi,
I’ve been using the following code to create a FPS style camera movement in my
program.
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
GLFW_MOUSE_CURSOR enable.

mwaness wrote on Wednesday, May 30, 2012:

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