PDA

View Full Version : Mouse



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

06-04-2001, 02:38 PM
http://www.fatech.com/tech/opengl/glut/index.php3?9

pera
06-05-2001, 03: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

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

Gavin
06-06-2001, 01: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)

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

Thanks again... Pera