Jump to content
  • Advertisement
Sign in to follow this  
Ledneh

OpenGL Grabbing the mouse and not letting go

This topic is 4350 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!