PDA

View Full Version : Using the Mouse



Real World
08-02-2001, 08:08 AM
I have a float called "angleX" which I want to change with the mouse.
What I need to do is change this angle by clicking and holding the mouse button down then dragging from left to right. The more you drag, the more the angle will increase or decrease.
Anyone know what I need to do and how? At present I have a

glutMouseFunc(command_mouse);

line in main() and a

void command_mouse(int button, int state, int x, int y)

function. It only seems to recognise the first click though and not that it's still held down and the mouse is moving.

Cheers

gtada
08-02-2001, 10:19 AM
Check out glutMotionFunc()

Real World
08-02-2001, 10:56 AM
Where do I get information on this function?

rael
08-02-2001, 11:26 AM
http://reality.sgi.com/mjk_asd/spec3/spec3.html Entry 7.6

Real World
08-02-2001, 11:35 AM
Cheers guys that's great http://www.opengl.org/discussion_boards/ubb/smile.gif