Fichier source : Animation1.cpp
/* Fonction executee lors d'un rafraichissement */
/* de la fenetre de dessin */
static void display(void) {
glClearColor(0.5F,0.5F,0.5F,0.5F);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
gluLookAt(0.0,0.0,18.0,0.0,0.0,0.0,0.0,1.0,0.0);
glLightfv(GL_LIGHT0,GL_POSITION,light0_position);
glLightfv(GL_LIGHT1,GL_POSITION,light1_position);
glLightfv(GL_LIGHT2,GL_POSITION,light2_position);
glRotatef(r,0.0F,1.0F,0.0F);
mobile();
glPopMatrix();
glFlush();
glutSwapBuffers();
int error = glGetError();
if ( error != GL_NO_ERROR )
printf("Attention erreur %d\n",error);
}
/* Fonction executee lorsqu'aucun evenement */
/* n'est en file d'attente */
static void idle(void) {
r += 1.0F;
glutPostRedisplay();
}