1.2. GLUTThe "State and Queries" section earlier in this chapter mentions that platform-specific window libraries are responsible for creating OpenGL rendering contexts to encapsulate state. Sadly, this impedes platform-independent code. The OpenGL Utility Toolkit (GLUT) is a platform-independent library for managing windows, input, and rendering contexts. It isn't a complete replacement for platform-specific code, but it does implement a subset of functionality that is useful for examples and demos, as well as some simple applications. GLUT function names have the form glut*(). The GLUT function for swapping buffers, for example, is glutSwapBuffers(). The current GLUT version is 3.7. GLUT allows OpenGL® Distilled to focus on OpenGL rather than the details of platform-specific window and rendering context creation and management. Chapter 8, "Platform-Specific Interfaces," covers these details after you've become more comfortable with OpenGL concepts. The definitive guide to GLUT (and also GLX) is OpenGL Programming for the X Window System (Kilgard 1996). GLUT information is also available from the OpenGL Web site. http://www.opengl.org/resources/libraries/index.html The section "A Simple Example" later in this chapter describes the use of some basic GLUT functions. |