Current location - Loan Platform Complete Network - Big data management - OpenGL zooms in and out by pressing the middle mouse button.
OpenGL zooms in and out by pressing the middle mouse button.
OpenGL is just a set of graphical interfaces, and it doesn't support mouse/keyboard input and output, as you must know.

There are two solutions:

1, using MFC or Win32 API function, please refer to msdn for specific usage.

2. When using the glut function library, you need to pay attention to:

The old glut library doesn't support the response of the middle mouse button message, so you should update the three files glut.lib, glut.h and glut.dll glut.dll to the new version. Then use glutMouseFunc () to register your own mouse callback function, and then respond to the messages of GLUT_WHEEL_UP and GLUT_WHEEL_DOWN, which are scrolling up and down respectively.