PDA

View Full Version : Glut and mice



srebyoav
05-12-2003, 11:56 PM
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. ?

marcus256
05-14-2003, 09:38 PM
If you can live without the cursor being visible, you can use GLFW (http://hem.passagen.se/opengl/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.

OneSadCookie
05-14-2003, 10:07 PM
The standard solution in GLUT is to glutWarpPointer to the middle of the window each frame, giving you effectively infinite range.