Grabbing the mouse and not letting go
In games like Quake 3 or whatever, they capture the mouse to the window so that the pointer cannot go outside its borders when you're moving the mouse to spin the camera or whatnot. Can anyone tell me what I would need to do to get that sort of functionality in my OpenGL/GLUT program? Or is it OS-specific? If so, how would I tell Windows to capture the mouse in that manner? (I'm trying to be as OS-agnostic as possible for now).
Thanks!
set mouse position to window position + window width/2, window height/2 each frame, after you get the mouse deltas. Usually only if the app has focus or it can be very annoying.
Quote:Original post by DrEvil
set mouse position to window position + window width/2, window height/2 each frame, after you get the mouse deltas. Usually only if the app has focus or it can be very annoying.
Okay, thanks. I know Windows has SetCursorPos() to do that, but are there any more OS-independent options (such as in opengl/GLUT or something)?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement