Possible Duplicate:
Using the mouse scrollwheel in GLUT
Like the title says, how do you achieve this in Glut ?
Possible Duplicate:
Using the mouse scrollwheel in GLUT
Like the title says, how do you achieve this in Glut ?
The scrollwheel usually shows up as two mouse buttons glut, so you can track the scrollwheel with glutMouseFunc
tracking the appropriate mouse events. The tricky part is figuring out WHICH mouse buttons correspond to the scrollwheel. You can use glutDeviceGet(GLUT_NUM_MOUSE_BUTTONS)
to find out how many buttons the mouse device supports and guess based on that, but its probably best to make this configurable in your program by asking the user to twiddle the scrollwheel and see which button events you get back.