Jump to content
  • Advertisement
Sign in to follow this  
VitaliBR

[SDL] MouseMotion

This topic is 2998 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 searched a lot about, but found nothing detailed about the function SDL_MOUSEMOTION.

I know he provides four values, they being the mouse position absolute (x and y) and x and y relative.
But do not get it until now, it is this value 'relative' of X and Y?

Neither the SDL documentation explains

Thanks

Share this post


Link to post
Share on other sites
Advertisement
The relative value is relative to the cursors last position. So if the user moved his cursor 10 pixels to the right, the relative X value of the event would be 10. If he moved the cursor 15 pixels to the left, and 26 pixels down the relative X would be -15 and the relative Y would be 26.

Hope this helps :)

Share this post


Link to post
Share on other sites
Thanks! I understand.

I'm trying to use this function to move(w/ mouse) my camera with OpenGL.
If anyone know any tutorial or example of how to do this thanks.

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!