26.2 The OpenGL state machine

It's useful to think of OpenGL as a state machine that has a special button on it to send images to the screen. The 'draw-the-picture' button represents the OpenGL function ::glFinish() . Figure 26.2 illustrates the process.

Figure 26.2. The OpenGL state machine


Before calling ::glFinish() , we prepare the state of the OpenGL machine by feeding in real number position coordinates, real number color triples or quadruples (with the fourth value a standing for transparency), and bitmap files. In addition, we can set the state by various ::gl... functions that tell the state machine to combine the coordinates into a triangle, into a quadrilateral, or the like.

Software Engineering and Computer Games
Software Engineering and Computer Games
Year: 2002
Pages: 272

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net