I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom in and out of a scene? How do I do that?
Using the mouse scrollwheel in GLUT
glutopenglscrollwheel
glutopenglscrollwheel
I want to use the mouse scrollwheel in my OpenGL GLUT program to zoom in and out of a scene? How do I do that?
Best Solution
Freeglut's glutMouseWheelFunc callback is version dependant and not reliable in X. Use standard mouse function and test for buttons 3 and 4.
The OpenGlut notes on glutMouseWheelFunc state:
Using standard GLUT mouse reporting:
As the OP stated, it is "dead simple". He was just wrong.