Skip to main content
GameDev.net gamedev.net
🔒 Locked

GLUT Mouse Interaction

Started by Corfe Jun 16, 2001 at 9:37 PM 3 replies 3.1k views
Original Post
Corfe
Corfe
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
Corfe
Corfe
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.
Corfe
Corfe
Thanks a lot for your help, that''s exactly what I was looking for : )

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.