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

graphics/26fig02.gif

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.



    Part I: Software Engineering and Computer Games
    Part II: Software Engineering and Computer Games Reference