
268 7. Real-time 3D: OpenGL
working in compatib ility mode, this can be handled by some utility functions,
gluPerspective( ), glOrtho(); and glFrustum(); but in the core mod e the
task of building these various matrices is left to the application program.
How the projection is mapped into the integer window/screen coordinates
is defined by the API function glViewport();. Correctly matching the aspect
ratio with the window size is important so that circles don’t become ellipses if
the user changes the dimensions of the output window. This is an essential part
of any OpenGL program and will require an adjustment to the Viewport and
the projection’s prop ...