next up previous
Next: 2.2 Using Rendering Contexts Up: 2 GLX Operation Previous: 2 GLX Operation

2.1 Rendering Contexts and Drawing Surfaces

The OpenGL specification is intentionally vague on how a rendering context (an abstract OpenGL state machine) is created. One of the purposes of GLX is to provide a means to create an OpenGL context and associate it with a drawing surface.

In X, a rendering surface is called a Drawable. Windows, one type of Drawable, are associated with a Visual.gif The X protocol allows for a single VisualID to be instantiated at multiple depths. The GLX bindings allow only one depth for an OpenGL renderer for any given VisualID. In GLX the definition of Visual has been extended to include the types, quantities and sizes of the ancillary buffers (depth, accumulation, auxiliary, and stencil). Double buffering capability is also fixed by the Visual.gif The ancillary buffers have no meaning within the core X environment. The set of extended Visuals is fixed at server startup time. One result is that a server can export multiple Visuals that differ only in the extended attributes.

The other type of X Drawable is a Pixmap, a drawing surface that is maintained off screen. The GLX equivalent to an X Pixmap is a GLXPixmap. A GLXPixmap is created using the Visual along with its extended attributes. The Visual is used to define the type and size of the Ancillary buffers associated with the Pixmap. The Pixmap is used as the front-left color buffer. A GLXDrawable is the union { Window, GLXPixmap }.

Ancillary buffers are associated with a GLXDrawable, not with a rendering context. If several OpenGL renderers are all writing to the same window, they will share those buffers. Rendering operations to one window never affect the unobscured pixels of another window, or of the corresponding pixels of ancillary buffers of that window. If an Expose event is received by the client, the values in the ancillary buffers and in the back buffers for regions corresponding to the exposed region become undefined.

A rendering context can be used with multiple GLXDrawables as long as those Drawables are similar. Similar means that the rendering contexts and GLXDrawables are created with the same XVisualInfo.

An application can use any rendering context (subject to the restrictions discussed in the section on address spaces) to render into any similar GLXDrawable. An implication is that multiple applications can render into the same window, each using a different rendering context.



next up previous
Next: 2.2 Using Rendering Contexts Up: 2 GLX Operation Previous: 2 GLX Operation



Mark Segal
Wed Jan 11 18:38:15 PST 1995