Inaccurate mouse movement in OSX?

Using GLFW
  • Lexi

    Lexi - 2012-05-29

    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;
  • Camilla Löwy

    Camilla Löwy - 2012-05-29

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

  • Lexi

    Lexi - 2012-05-30

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


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks