OpenGL programs draw offscreen for many reasons. They may need to store intermediate rendering results as a scene is built or they may need to store data that is used repeatedly, such as a texture. Mac OS X provides several options for rendering offscreen:
Offscreen drawable objects. The Apple-specific OpenGL APIs provide routines that support drawing to CPU memory and are supported only by the software renderer. These objects are available in Mac OS X v10.0 and later, but are not recommended for performance-critical applications. See “Setting Up an Offscreen Drawable Object.”
Hidden Cocoa views or Carbon windows. Starting in Mac OS X v10.2, the NSOpenGLContext class and AGL API provide routines that use the GPU to draw to hidden windows or views and then draw that content to an onscreen rendering context. See “Using a Hidden View or Window.”
Pixel buffer drawable objects. Each of the Apple-specific OpenGL APIs provides routines for drawing to offscreen memory that's located on the GPU. An application can render an image into a pixel buffer once and then use the buffer contents multiple times to texture a variety of surfaces without copying the image data. Pixel buffers are available starting in Mac OS X v10.3. See “Rendering to a Pixel Buffer.”
Framebuffer objects. A recently added OpenGL extension, these objects allow you to draw to buffers other than the usual buffers provided by OpenGL or the Mac OS X windowing system. Because these objects are window-system agnostic, they are easier to set up and more efficient to use than pixel buffers. Framebuffer objects are available in Mac OS X v10.4.3 and later, but not all hardware supports their use. See “Rendering to a Framebuffer Object.”
Last updated: 2008-06-09