Jump to content
  • Advertisement
Sign in to follow this  
doutmost

Anyone knows how to get Mouse position ( without click the mouse button )?

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

Hi, I want to implement the function that I can move a paddle in my game with the movement of my mouse but without clicking the mouse button ( clicking only means to begin the game ). Anyone knows how to do this? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If you are using Windows, you can call GetCursorPos(LPPOINT *point). If you are using dos, you can use the int 33h fun 0003 (see Ralf Brown's interrupt list (hey ! I'm so happy to see it's still available on the web !!!). If you are using SDL then check the SDL documentation.

Er...

I forgot to ask : what OS / lib areyou using ? :)

HTH

Share this post


Link to post
Share on other sites
Tracking the WM_MOUSEMOVE message is possible too - this will allow you to respond to mouse mouve - although I don't really know how an OpenGL windows may work with that.

With OpenGLUT it is possible to use glutMouseFunc to track mouse events. You may want to try this.

HTH

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!