OpenGL Distilled
8.1. Concepts
Platform-specific OpenGL code, by definition, differs from platform to platform. The concepts and coding tasks involved are very similar, however. On every platform, applications typically perform the following tasks:
In most of the example source code, GLUT performs these tasks. The example source code also includes a platform-specific example, however, to demonstrate how applications can perform these tasks using interfaces specific to Apple Mac OS X, Linux, and Microsoft Windows. In addition to window (onscreen) rendering, all platforms provide offscreen rendering capabilities. Because rendering to a buffer in host RAM usually invokes a software rendering path, most OpenGL implementations support the concept of pbuffersoffscreen buffers in graphics-card RAM that support hardware-accelerated rendering. Pbuffers are allocated by the operating system, so each platform-specific interface supports a pbuffer extension. More recently, implementations have moved to support the GL_EXT_framebuffer_object extension. Like pbuffers, this extension enables hardware-accelerated rendering to offscreen buffers. GL_EXT_framebuffer_object is an extension to OpenGL and not to the platform-specific interface, however. Therefore, applications access its features using (platform-independent) OpenGL extension commands rather than different commands for each platform. GL_EXT_framebuffer_object also provides additional capabilities, such as streamlined render-to-texture, that are not available in the pbuffer feature. Finally, all platforms also provide a mechanism to share all OpenGL objects, including display lists, texture objects, and buffer objects. |
Категории