PDA

View Full Version : glutMouseFunc



vivek vyas
05-25-2009, 09:27 PM
i am a beginner please please please please help me
i want to use glutMouseFunc();
in my program
and i found that there are few macros
#define GLUT_LEFT_BUTTON 0x0000
#define GLUT_MIDDLE_BUTTON 0x0001
#define GLUT_RIGHT_BUTTON 0x0002
#define GLUT_DOWN 0x0000
#define GLUT_UP 0x0001
#define GLUT_LEFT 0x0000
#define GLUT_ENTERED 0x0001
and not got the favorable thing(with click object rotate)

and fragment of my code is

void MouseF(int state,int button,int x,int y)
{
switch(state)
{
case GLUT_ENTERED:
Cx = x;
Cy = y;
break;
}
}
Please help me regarding to this problem
Q Rotation without click just on mouse move

ZbuffeR
05-26-2009, 12:52 AM
Register your function to a passive move :



void MouseF(int x,int y) '
Cx = x;
Cy = y;
}

//main glut init section :
glutPassiveMotionFunc(MouseF);

vivek vyas
05-26-2009, 01:26 AM
thanks thats work