Skip to main content
gamedev.net
🔒 Locked

[SDL] MouseMotion

Started by VitaliBR 1 reply 950+ views
Original Post
VitaliBR
VitaliBR
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
http://mateusvitali.wordpress.com/
magorian
magorian
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 :)
"Buy heaps of coffee, Coffee is a boon to all programmers." - elegantmoron
VitaliBR
VitaliBR
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.
http://mateusvitali.wordpress.com/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.