Sign in to follow this  
grayaii

No Drag and Drop support for Glut?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this