Glut and mice

HI there

I’m looking for a way to figure out in GLUT how much the mouse have moved, but not in relation to the window size, but in relation to actual mouse-movement (not cursor).

The obvious solution of remembering the last position is not good because what can I do when the mouse cursor is next to edges of the screen - glutPassiveMotionFunc only returns position.

Is there a way of doing that without using Windows routines -only glut etc. ?

If you can live without the cursor being visible, you can use GLFW instead of GLUT. Just:

glfwDisable( GLFW_MOUSE_CURSOR );

…and you get an “infinite” range, just telling how the mouse moves, without being limited by window or screen bounds.

The standard solution in GLUT is to glutWarpPointer to the middle of the window each frame, giving you effectively infinite range.