Jump to content
  • Advertisement
Sign in to follow this  
leo77

GLUT - using the "mouse wheel"

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

Advertisement
From what I've seen, the *latest* version of the Win32 port of GLUT does not have the scroll button functionality. After a little looking I've come across this. It is an updated version of GLUT that has it built in. You will want to get the "GLUT 3.7.6 Binary (DLL+Lib)" package.

Now you need to install it. Make sure to copy over the new .dll into your system32 diretory or equivilant if you are not on XP. Make sure to move the library file to where the old one was and overwrite it.

Once you do all of that you can use it like this:


// Our mouse callback function called in the main function
glutMouseFunc(processMouse);
......
void processMouse(int button, int state, int x, int y)
{
// Used for wheels, has to be up
if (state == GLUT_UP )
{
if ( button == GLUT_WHEEL_UP )
{
printf("Wheel Up\n");
}
else if( button == GLUT_WHEEL_DOWN )
{
printf("Wheel Down\n");
}
}
}




And that's it! If you have any troubles with that feel free to ask. It should work right away, I just tried it to be sure. Good luck!

- Drew

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!