List of Examples

| Table of Contents | List of Figures | List of Examples | List of Tables |

Example 2-1. Chunk of OpenGL Code
Example 2-2. Simple OpenGL Program Using GLUT: hello.c
Example 2-3. Double-Buffered Program: double.c
Example 3-1. Reshape Callback Function
Example 3-2. Legal Uses of glVertex*()
Example 3-3. Filled Polygon
Example 3-4. Other Constructs between glBegin() and glEnd()
Example 3-5. Line Stipple Patterns: lines.c
Example 3-6. Polygon Stipple Patterns: polys.c
Example 3-7. Marking Polygon Boundary Edges
Example 3-8. Surface Normals at Vertices
Example 3-9. Enabling and Loading Vertex Arrays: varray.c
Example 3-10. Using glArrayElement() to Define Colors and Vertices
Example 3-11. Two Ways to Use glDrawElements()
Example 3-12. Effect of glInterleavedArrays(format, stride, pointer)
Example 3-13. Drawing an Icosahedron
Example 3-14. Generating Normal Vectors for a Surface
Example 3-15. Calculating the Normalized Cross Product of Two Vectors
Example 3-16. Single Subdivision
Example 3-17. Recursive Subdivision
Example 3-18. Generalized Subdivision
Example 4-1. Transformed Cube: cube.c
Example 4-2. Using Modeling Transformations: model.c
Example 4-3. Calculating Field of View
Example 4-4. Pushing and Popping the Matrix
Example 4-5. Wireframe Sphere with Two Clipping Planes: clip.c
Example 4-6. Planetary System: planet.c
Example 4-7. Robot Arm: robot.c
Example 4-8. Reversing the Geometric Processing Pipeline: unproject.c
Example 5-1. Drawing a Smooth-Shaded Triangle: smooth.c
Example 6-1. Drawing a Lit Sphere: light.c
Example 6-2. Defining Colors and Position for a Light Source
Example 6-3. Second Light Source
Example 6-4. Stationary Light Source
Example 6-5. Independently Moving Light Source
Example 6-6. Moving a Light with Modeling Transformations: movelight.c
Example 6-7. Light Source That Moves with the Viewpoint
Example 6-8. Different Material Properties: material.c
Example 6-9. Using glColorMaterial(): colormat.c
Example 7-1. Blending Example: alpha.c
Example 7-2. Three-Dimensional Blending: alpha3D.c
Example 7-3. Antialiased lines: aargb.c
Example 7-4. Antialiasing in Color-Index Mode: aaindex.c
Example 7-5. Antialiasing Filled Polygons: aapoly.c
Example 7-6. Five Fogged Spheres in RGBA Mode: fog.c
Example 7-7. Fog in Color-Index Mode: fogindex.c
Example 7-8. Polygon Offset to Eliminate Visual Artifacts: polyoff.c
Example 8-1. Creating a Display List: torus.c
Example 8-2. Using a Display List: list.c
Example 8-3. Hierarchical Display List
Example 8-4. Defining Multiple Display Lists
Example 8-5. Multiple Display Lists to Define a Stroked Font: stroke.c
Example 8-6. Persistence of State Changes after Execution of a Display List
Example 8-7. Restoring State Variables within a Display List
Example 8-8. The Display List May or May Not Affect drawLine()
Example 8-9. Display Lists for Mode Changes
Example 9-1. Drawing a Bitmapped Character: drawf.c
Example 9-2. Drawing a Complete Font: font.c
Example 9-3. Use of glDrawPixels(): image.c
Example 9-4. Drawing, Copying, and Zooming Pixel Data: image.c
Example 10-1. Texture-Mapped Checkerboard: checker.c
Example 10-2. Querying Texture Resources with a Texture Proxy
Example 10-3. Replacing a Texture Subimage: texsub.c
Example 10-4. Mipmap Textures: mipmap.c
Example 10-5. Binding Texture Objects: texbind.c
Example 10-6. Automatic Texture-Coordinate Generation: texgen.c
Example 11-1. Using the Stencil Test: stencil.c
Example 11-2. Routines for Jittering the Viewing Volume: accpersp.c
Example 11-3. Scene Antialiasing: accpersp.c
Example 11-4. Jittering with an Orthographic Projection: accanti.c
Example 11-5. Depth-of-Field Effect: dof.c
Example 12-1. Registering Tessellation Callbacks: tess.c
Example 12-2. Vertex and Combine Callbacks: tess.c
Example 12-3. Polygon Definition: tess.c
Example 12-4. Quadrics Objects: quadric.c
Example 13-1. Bézier Curve with Four Control Points: bezcurve.c
Example 13-2. Bézier Surface: bezsurf.c
Example 13-3. Lit, Shaded Bézier Surface Using a Mesh: bezmesh.c
Example 13-4. Using Evaluators for Textures: texturesurf.c
Example 13-5. NURBS Surface: surface.c
Example 13-6. Trimming a NURBS Surface: trim.c
Example 14-1. Creating a Name Stack
Example 14-2. Selection Example: select.c
Example 14-3. Picking Example: picksquare.c
Example 14-4. Creating Multiple Names
Example 14-5. Using Multiple Names
Example 14-6. Picking with Depth Values: pickdepth.c
Example 14-7. Feedback Mode: feedback.c
Example 15-1. Querying and Printing an Error
Example 15-2. Find Out If An Extension Is Supported