Chapter 8. Platform-Specific Interfaces


As a platform-independent API, OpenGL leaves framebuffer and state management up to the underlying window system.

The window system determines how the final rendered image appears in the presence of overlapping windows. It also provides access to several framebuffer configurations. If the window system is network transparent, it provides local and remote access to OpenGL rendering contexts.

Although GLUT is an excellent tool for developing small platform-independent demos, it has its limitations. Most notably, it limits the application to one rendering context per window. Applications often use multiple rendering contexts, and share OpenGL objects and display lists between them. To access this functionality, you'll need to write platform-specific code.

This chapter leaves GLUT behind and describes the platform-specific interfaces for three popular OpenGL runtime environments.

What You'll Learn

Topics covered in this chapter include the following:

  • Apple Mac OS X, Linux, and Microsoft WindowsIn addition, you can apply what you learn regarding Linux to any Unix platform that supports the X Window System.

  • Configuring the framebufferThis chapter covers how to request a double-buffered, RGBA window with a depth buffer.

  • Onscreen renderingMost OpenGL applications render to a visible window, and this chapter focuses primarily on window rendering.

  • Creating, using, and deleting GL contexts.

  • Sharing objects between contextsThe chapter shows how to share display lists, texture objects, and buffer objects between contexts.

  • Swapping buffers.

What You Won't Learn

This chapter omits the following information:

  • Offscreen renderingThis chapter covers only onscreen rendering.

  • Copying rendering contexts, or copying state from one rendering context to another.

  • Query routinesThe chapter does not cover platform-specific interfaces for querying a platform for state, version, or extension information.

  • Commands unrelated to OpenGLThis is not a full platform reference and does not document all platform-specific commands that you might need to use. Creating windows, for example, is discussed but not documented.

Covering interfaces for all platforms is outside the scope of this book. One noteworthy omission is EGL, designed to be implemented on a variety of platforms and currently available in many embedded systems for use with OpenGL ES. Obtain the EGL spec from the OpenGL Web site.

See the platform-specific documentation for information on the topics not covered in this chapter.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net