Game Development Reference
In-Depth Information
The following section provides a brief description of each of the previous function
calls.
glutInit
The glutInit function performs first-step initialization of the FreeGLUT library,
passing in the application's parameters. There are several low-level options one can
play with here (such as enabling debugging in FreeGLUT itself), but we're not inter-
ested in them for our demos. Check the documentation for more information about
the available options.
glutInitDisplayMode
The glutInitDisplayMode function sets the initial display mode of the window,
mostly in terms of what kind of buffers are available. It uses a bitmask to set
the values and the call shown previously enables a double-buffered window
( GLUT_DOUBLE ), make these buffers include an alpha channel ( GLUT_RGBA ), and
also include a separate depth buffer ( GLUT_DEPTH ). We'll explain these concepts
more throughout the topic. There are many more options available, so those who are
curious can check the online documentation.
Tip
Note that RGBA is a short form for the three primary colors; red, green, and blue,
and A is short form for alpha, or transparency. This is a common form of describ-
ing a single color value in computer graphics.
glutInitWindowPosition/glutInitWindowSize
The glutInitWindowPosition and glutInitWindowSize functions set the ini-
tial position and size of the window in pixels. The position is set relative to the top-left
of the main screen.
Search WWH ::




Custom Search