OpenGL Programming Guide for Mac OS X
PDF
Introduction
OpenGL on the Mac Platform
Structure of OpenGL in Mac OS X
Programming Interfaces
OpenGL APIs Specific to Mac OS X
Apple-Implemented OpenGL Libraries
Terminology
Renderer
Renderer and Buffer Attributes
Pixel Format Objects
Rendering Contexts
Drawable Objects
Virtual Screens
Running an OpenGL Program in Mac OS X
See Also
Drawing to a Window or View
General Approach
Drawing to a Cocoa View
Drawing to an NSOpenGLView Class: A Tutorial
Drawing OpenGL Content to a Custom View
Drawing to a Carbon Window
What's Next
See Also
Drawing to the Full Screen
General Approach
Using Cocoa to Create a Full-Screen Context
Using AGL to Create a Full-Screen Context
Using CGL to Create a Full-Screen Context
Adjusting Display Modes
What's Next?
See Also
Drawing Offscreen
Setting Up an Offscreen Drawable Object
Using a Hidden View or Window
Rendering to a Pixel Buffer
Setting Up a Pixel Buffer for Offscreen Drawing
Using a Pixel Buffer as a Texture Source
Rendering to a Pixel Buffer on a Remote System
Rendering to a Framebuffer Object
Drawing a Texture Offscreen
Drawing a Renderbuffer Image Offscreen
See Also
Determining the OpenGL Capabilities Supported by the Hardware
Detecting Functionality
Guidelines for Code That Checks for Functionality
See Also
Techniques for Working with Rendering Contexts
Context Parameters
Swap Interval
Surface Opacity
Surface Drawing Order
Vertex and Fragment Processing
Back Buffer Size Control
Updating a Rendering Context
Tracking Renderer Changes
Updating a Rendering Context for a Custom Cocoa View
Updating a Rendering Context for a Carbon Window
Updating Full-screen AGL and CGL Rendering Contexts
Sharing Rendering Contexts
See Also
Techniques for Choosing Attributes
Buffer Size Attribute Selection Tips
Attributes that are not Recommended
Ensuring that Back Buffer Contents Remain the Same
Ensuring a Valid Pixel Format Object
Ensuring a Specific Type of Renderer
Ensuring a Single Renderer for a Display
See Also
Techniques for Working with Vertex Data
Best Practices for Working with Vertex Data
Using Extensions to Improve Performance
Vertex Array Range Extension
Vertex Buffer Object Extension
Fence Extension
Double Buffering Vertex Data
See Also
Techniques for Working with Texture Data
Using Extensions to Optimize
Apple Client Storage
Apple Texture Range and Rectangle Texture
Combining Extensions
Optimal Data Formats and Types
Working with NonâÂÂPower-of-Two Textures
Creating Textures from Image Data
Creating a Texture from a Cocoa View
Creating a Texture from a Quartz Image Source
Getting Decompressed Raw Pixel Data from a Source Image
Downloading Texture Data
Double Buffering Texture Data
See Also
Techniques for Scene Anti-Aliasing
Guidelines
General Approach
Hinting for a Specific Anti-Aliasing Technique
Setting Up Full Scene Anti-Aliasing
See Also
Multithreading and OpenGL
Program Design
Guidelines for Threading OpenGL Applications
When Things Go Wrong
Threading APIs
See Also
Improving Performance
Best Practices
Use Flush and Finish Routines Effectively
Be Mindful of OpenGL State Variables
Draw Only When Necessary
Synchronize with the Screen Refresh Rate
Use OpenGL Macros
Use the CPU and the GPU Asynchronously
Use Appropriate Routines for Images and Pixel Data
Retrieve Error Information Only When Debugging
Use Optimal Data Types and Formats
Gathering and Analyzing Baseline Performance Data
Identifying Bottlenecks with Shark
See Also
Appendix A: OpenGL Functionality by Version
Version 1.1
Version 1.2
Version 1.3
Version 1.4
Version 1.5
Version 2.0
Appendix B: Setting Up Function Pointers to OpenGL Routines
Obtaining a Function Pointer to an Arbitrary OpenGL Entry Point
Initializing Entry Points
Appendix C: Quartz Display Services and Full-Screen Mode
Displays and Display Modes
Fading the Display
Controlling the Pointer
See Also
Glossary
Revision History