View Full Version : Mouse

06-04-2001, 12:56 PM
I need determine the position of the mouse, using glut functions, if possible...
Please could someone help me?
Thanks... Pera...

06-04-2001, 03:38 PM

06-05-2001, 04:14 PM
Thank you very much for the link, sorry if I didn't find it on the page, but I'm Looking for a function like glutGetMousePos (it's just a name I imagined), that returns me the position of the mouse.
I can do what I need with the glutPassiveMotionFunc, but if the function like the one I described exists, it will be very nicer.

Thanks again... Pera

06-05-2001, 04:32 PM
Why don't you just keep track of the mouse position yourself whenever you get a callback?

06-06-2001, 02:48 AM
in the passive func just do...

/** global **/
int mouse_x, mouse_y;
myPassiveMotionFunc(int x, int y)
mouse_x = x;
mouse_y = y;

the posn's are there any time you want top check them then.

also use the motion func for when you are using mouse events (button pushes)

06-06-2001, 04:47 AM
Thanks everybody...
I think that now I can do what need in a nice way...

Thanks again... Pera