views:

2851

answers:

2

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?

+4  A: 

Register a glutPassiveMotionFunc callback function

See info about callbacks

epatel
+1  A: 

You need to use the glutMotionFunc/glutPassiveMotionFunc callback to track mouse movement independent of mouse clicks.

7.6 glutMotionFunc, glutPassiveMotionFunc

crashmstr