Chapter 2. State Management and Drawing Geometric Objects

Chapter Objectives

After reading this chapter, you’ll be able to do the following:

• Clear the window to an arbitrary color

• Force any pending drawing to complete

• Draw with any geometric primitive—point, line, or polygon—in two or three dimensions

• Turn states on and off and query state variables

• Control the display of geometric primitives—for example, draw dashed lines or outlined polygons

• Specify normal vectors at appropriate points on the surfaces of solid objects

• Use vertex arrays and buffer objects to store and access geometric data with fewer function calls

• Save and restore several state variables at once

Although you can draw complex and interesting pictures ...

Get OpenGL Programming Guide: The Official Guide to Learning OpenGL, Versions 3.0 and 3.1, Seventh Edition 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.