01/21/2003
15-462 Computer Graphics I
35
Step 5: Display Callback
•Clear, rotate, draw, flush, swap
GLfloat theta[3] = {0.0, 0.0, 0.0};
void display(void)
{ glClear(GL_COLOR_BUFFER_BIT
              | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glRotatef(theta[0], 1.0, 0.0, 0.0);
  glRotatef(theta[1], 0.0, 1.0, 0.0);
  glRotatef(theta[2], 0.0, 0.0, 1.0);
  colorcube(); glFlush();
  glutSwapBuffers(); }