Up: OpenGL Quick
Previous: Basic Information
The following procedures are typically invoked once in the main
program, before the graphics processing begins.
- glutInit(int *argcp, char **argv):
- Initialize GLUT and OpenGL. Pass in command-line arguments.
- glutInitDisplayMode(unsigned int mode):
Set GLUT's display mode. The mode is the logical-or "|"
of one or more of the following:
There are a number of other options, which we have omitted.
This last option make depth-buffering possible. It is also
necessary to enable the operation (see glEnable() below).
- Select one of the following three:
- GLUT_RGB: use RGB colors.
- GLUT_RGBA: use RGBA colors.
- GLUT_INDEX: use color-mapped colors (not
- Select one of the following two:
- GLUT_SINGLE: use single-buffering.
- GLUT_DOUBLE: allow double-buffering (for
- Select the following for hidden surface removal:
- GLUT_DEPTH: allow depth-buffering.
- glutInitWindowSize(int width, int height):
Set the initial window size. Also see:
- glutCreateWindow(char *title):
Create window with the given title (argv sets the
name to the program's name).
This starts the main event loop. Control returns only
through one of the callback functions given below.
Please report any errors or send comments to
Last updated: Sat, Feb 8, 2003.