Jump to content
  • Advertisement
Sign in to follow this  
judge dreadz

click and drag mouse functions in GLUT

This topic is 4489 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'm having difficulty implementing click and drag using the GLUT mouse functions. glutMotionFunc does the dragging part, but there doesnt seem a way to monitor which button initiates the call. glutMouseFunc gives the button, but i cant get it to do the dragging (it moves in one jump when you release the button). i'm trying to make it so dragging the mouse moves the camera position. i want dragging with the left button clicked to rotate the camera about the origin, and dragging with the right button clicked to zoom in/out.

Share this post


Link to post
Share on other sites
Advertisement
You need to record which button was pressed when glutMouseFunc() fired and use that information to process the dragging accordingly in glutMotionFunc().

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!