- glViewport(0, 0, Width, Height); // Set the viewport for the OpenGL window
- glMatrixMode(GL_PROJECTION); // Change Matrix Mode to Projection
- glLoadIdentity(); // Reset View
- // Do the perspective calculations. Last value = max clipping depth
- gluPerspective(fFovy, Width / Height, fZNear, fZFar);
- glMatrixMode(GL_MODELVIEW); // Return to the modelview matrix
- glLoadIdentity(); // Reset View