Skip to main content
GameDev.net gamedev.net
🔒 Locked

Tracking mouse movement

Started by fallout01 Nov 26, 2004 at 11:51 PM 1 replies 350+ views
Original Post
fallout01
fallout01
Hi, So my problem is, I need keep track of the mouse coordinates while a moust button (say the left button) is being pressed. So I need to keep track of x0,y0,x1,y1 When a user fist clicks the mouse button, x0 and y0 become that position. (This is easy enough) Now, the user must hold the mouse button down and move the mouse (like a drag and drop/click and drag). While the user is moving the mouse, I need to continually be getting feedback of the current mouse position. IE x1,y1 must be getting continually updated to the current mouse position. I don't know how to continually be getting the current mouse position while the mouse button is down. I can only seem to get the position of the initial click. Does anybody know how to accomplish this? (the mouse function is being called using: glutMouseFunc( mouseFunc ) from main ) Thanks.
fallout01
fallout01

Thanks zedzeek. glutMotionFunc did the trick.

Topic Locked

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

Sign in to reply to this topic.