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 α 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 ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.