Jump to content
  • Advertisement
Sign in to follow this  
EternityZA

OpenGL capturing mouse movement for a first person veiw 3D app

This topic is 3783 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

i have a opengl game that can run fullscreen or in a window, i want to detect movement of my mouse but i dont want do be limited by the bounderies of my screen, nor do i want to see the normal windows pointer while im ingame.right now im using the keybord to look around and move around but what i want is to look around with the mouse and move around with the keybord (like a standerd first person shooter game), how can i do this

Share this post


Link to post
Share on other sites
Advertisement
You can use DirectInput. Although, it's part of the DirectX library, you can easily use that inside an OpenGL application without any problems. DirectInput directly talks to the input device driver and is specifically designed for fast retrieval of user input inside real-time applications.

Share this post


Link to post
Share on other sites
For the camera movement, here is some source code i found googling: http://www.flipcode.com/archives/GL_Export_For_3DS_Max_Users.shtml
go down the the CCamera functions, I use this and it is great.


As for hiding the mouse, I use SDL and use:

SDL_ShowCursor(SDL_DISABLE); //hides cursor
SDL_ShowCursor(SDL_ENABLE); //shows cursor

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!