like this, when i press a key, the following function will be called:
//---------------------------------------------
static void move(int dir) //dir means direction
{
int i;
for(i=0; i<30; i++){
//recalculate some angle value
angle=(angle+degree)%360;
glutPostRedisplay();
}
}
//------------------------------------------------
angle is a static global variable, assum degree is set to 1.
the strange behaviour i can't understand is only the last angle value will be pass to display() that is 30! the value 1~29 are all ignored! Why this happen?
and I also found many variable-pass problems in glut. I really wonder if the glut is a good choice for opengl programming??