Esempio n. 1
0
File: Ex10.cpp Progetto: Valodim/cg2
void updateGL() {
  GLfloat aspectRatio = (GLfloat)windowWidth / windowHeight;
  
  glViewport(0, 0, windowWidth, windowHeight);
  
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(fov, aspectRatio, zNear, zFar);
  
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  
  trackball.rotateView();
  
  // render  //
  renderScene();
  
  // swap render and screen buffer //
  glutSwapBuffers();
}