Reputation: 67950
I know that I can use a Mouse callback function for when a user clicks the mouse, but what if I want to know the current x/y position without the user clicking?
Will I have to use a different callback that gets called on any mouse movement and keep track of the x/y myself or is there a function I can call within GLUT/OpenGL to get it?
Upvotes: 3
Views: 20021
Reputation: 46051
Register a glutPassiveMotionFunc callback function
See info about callbacks
Upvotes: 9
Reputation: 28563
You need to use the glutMotionFunc/glutPassiveMotionFunc callback to track mouse movement independent of mouse clicks.
7.6 glutMotionFunc, glutPassiveMotionFunc
Upvotes: 4