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;
}