Missing OpenGL Geometry
There are many things that can keep portions of OpenGL geometry from drawing on the screen. However, two of the most common are as follows:
If your view is completely black, chances are your camera is pointed in the wrong direction entirely. Usually this is due to positioning the camera too far up or down the z-axis or having the camera looking at the wrong view coordinates. Note that the default camera position is (0.0, 0.0, 0.0) pointed down the negative Z-axis.
QuickTime Movie Output
To use OpenGL as an output for a QuickTime movie, each frame of
the QuickTime movie should be loaded into a
You have to extract each frame from the movie as a texture and then apply it to a polygon in OpenGL. Note that you'll have to invert your v-coordinate on the texture, or load it in reverse order, otherwise your movie will play upside down. See the sample called "OpenGL Movie" on the Apple Developer web site for more information.
"Native" Pixel Format
The native pixel format is
Enabling packed pixels
Packed pixels is supported in OpenGL 1.2 or later on the Macintosh. This can be verified by checking the version string of the renderer. Renderers may also support packed pixels via the extension "GL_APPLE_PACKED_PIXELS" (note that it the actual string returned by the ATI drivers is "GL_APPLE_PACKED_PIXEL").
When a pixel format is chosen, you must use 'AGL_NO_RECOVERY' in order to ensure that the pixels are passed through OpenGL in the specified format.
The following are the optimal choices for pixel formats in OpenGL:
Synchronize the frame rate of my application to the monitor's refresh rate (VBL syncing) can be enabled with the following:
Note that this will lock your frame rate to a divisible integer of your monitor's current refresh rate.
ATI drivers currently enable page flipping on RAGE 128-based systems with a full-screen, non-occluded drawable. Window-mode page flipping is not supported.
Note that the benefits of page flipping have become less and less pronounced as hardware and software technology has advanced. The typical gain is only a few frames per second since VRAM to VRAM blitting is so fast on modern hardware.
Frame tears are a synchronization issue unrelated to swap speeds, contrary to popular belief. A tear occurs when the buffers are swapped while the electron beam is in the middle of painting on the screen. VBL synching should solve this problem.
Using OpenGL with DrawSprocket
See the full screen sample at the following URL: http://developer.apple.com/samplecode/Sample_Code/Graphics_3D/
Using OpenGL with QuickDraw
To draw to the front buffer with QuickDraw, you must synchronize your drawing with OpenGL, which entails stalling the OpenGL pipeline (not recommended for performance reasons).
This can be achieved by calling
Buffer Allocation on Mac OS 9 and OS X
OS 9 allocates buffers on a per-context basis; each next context
that is created has its own set of independent buffers that are
exclusive to that context. Buffers can be shared among contexts on
Mac OS 9 by specifying context to share with in
Stencil, AUX (auxiliary) and accumulation buffers are not supported in hardware on Mac OS 9.
Mac OS X allocates buffers on a per-surface basis; a "surface" is the equivalent of a drawable on Mac OS X. You may create and attach multiple contexts to a single surface in Mac OS X. All contexts created on a given surface will share the same set of buffers.
Mac OS X also supports AUX (auxiliary) buffers and an 8-bit stencil buffer. Accumulation buffers are not supported in hardware on Mac OS X.
More to Come
The following issues will be addressed in the future:
OpenGL ARB OpenGL Programming Guide, 3rd Edition Addision-Wesley
OpenGL ARB OpenGL Reference Manual, 3rd Edition Addision-Wesley
Foley, van Dam, Feiner, Hughes Computer Graphics - Principles and Practices Addision-Wesley
Contact ADC | ADC Site Map | ADC Advanced Search
|For information about Apple Products, please visit Apple.com.|
Contact Apple | Privacy Notice
Copyright © 2002 Apple Computer, Inc. All rights reserved.