GLUT Mouse Interaction

Started by
3 comments, last by Corfe 22 years, 10 months ago
I''d like to get relative coordinates for the mouse each frame instead of absolute, as GLUT seems to give. The problem is that using the mouse for mouse look, when the mouse cursor reaches the edge of the screen, the camera won''t look in that direction any further, so I need a workaround. I''m trying to do this completely platform-independent, so somebody help me out please Thanks in advance! Hope this post wasn''t too unclear hehe
Advertisement
GLUT gives relative coordinates in respect to the window. After each reading and updating of your variables can you reset the pointer to the center. Take a look at NeHe tutorial 23 for an example.
Thanks for the quick reply, but this isn''t quite what I''m looking for... I meant relative coordinates as in relative to the previous frame, not relative to the window. I would use Directinput, but I don''t want to use anything Win32-specific, I''m trying to be completely platform-independent, at least as much as possible. I know a simple SetCursorPos(x,y) would work for Windows, but I want it to be platform-independent, so I''m trying to avoid that. E.g. if you move the mouse left 2 pixels from the last frame, you would get (-2,0), as opposed to (468,234) or whatever the new cursor position is. The other thing that might help would be a setcursorpos() function equivalent in GLUT... thanks in advance, hope someone knows the answer.
glutWarpPointer or similar.
Cool name sounds like Star Trek.
Thanks a lot for your help, that''s exactly what I was looking for : )

This topic is closed to new replies.

Advertisement