Jump to content
  • Advertisement
Sign in to follow this  
leo77

GLUT - using the "mouse wheel"

This topic is 5010 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!