我知道我可以使用鼠标的回调函数,当用户点击鼠标,但什么,如果我想知道,而用户点击当前x / y位置?

我将不得不使用不同的回调被调用任何鼠标移动,并保持x的轨道/ Y自己还是有一个功能,我可以GLUT / OpenGL的内部调用得到它?

有帮助吗?

解决方案

注册一个glutPassiveMotionFunc回调函数

请参阅有关回调

信息

其他提示

您需要使用glutMotionFunc / glutPassiveMotionFunc回调来跟踪独立的鼠标点击的鼠标移动。

7.6 glutMotionFunc,glutPassiveMotionFunc

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top