• Advertisement
Sign in to follow this  

No Drag and Drop support for Glut?

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

Is it true there is no drag and drop support for glut? For instance, if I define my Mouse Move and Mouse Click functions like so: Glut.glutPassiveMotionFunc(new Glut.PassiveMotionCallback(MouseMove)); Glut.glutMouseFunc(new Glut.MouseCallback(OnMouseClick)); The MouseMove event does not get fired if any of the mouse buttons are down. This prevents me from implementing Drag and Drop :( Does anyone have any ideas how to do this?

Share this post


Link to post
Share on other sites
Advertisement
Use a boolean to keep tabs on whether the mouse is currently down or not, Glut should have both an OnMouseDown and OnMouseup event if I'm not mistaken.


bool IsMouseDown = false;

...
//Mouse down event
IsMouseDown = true;


...
//Mouse up event
IsMouseDown = false;


...
//Game loop
if(IsMouseDown) DoSomethingFunky();





This should keep the OnMouseClick out of use, and keep the OnMouseMove free.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement