0

可能重复:
在 GLUT 中使用鼠标滚轮

正如标题所说,你如何在 Glut 中实现这一点?

4

1 回答 1

1

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.

于 2012-07-29T19:55:44.120 回答