PDA

View Full Version : Mouse positions



mdog1234
02-19-2003, 02:32 PM
is there a function in glut like the windows functions GetCursorPos and SetCursorPos. If not what would be the best way of simulating these functions using glut. In other words I would like my app to be cross platform windows/unix

nexusone
02-19-2003, 03:17 PM
Yes

glutMouseFunc Read mouse on button press
glutMotionFunc Read mouse on button and motion
glutPassiveMotionFunc Read mouse when in
window

There is a set mouse location, but can not think of the call.


Originally posted by mdog1234:
is there a function in glut like the windows functions GetCursorPos and SetCursorPos. If not what would be the best way of simulating these functions using glut. In other words I would like my app to be cross platform windows/unix



[This message has been edited by nexusone (edited 02-19-2003).]

jebus
02-20-2003, 05:52 AM
to set the mouse position in glut use glutWarpPointer(int x, int y). i don't think there is an equivalent get routine, so use the callbacks mentioned by nexusone.

jebus