Returns information about GLX visuals.
OpenGL C bindings library: libGL.a
int glXGetConfig(Display *dpy XVisualInfo *Visual int Attribute int *Value)
The glXGetConfig subroutine sets the Value provided to the Attribute value of the windows or GLX pixmaps created with respect to the Visual parameter. The glXGetConfig subroutine returns an error code if for any reason it is unsuccessful. If it is successful, 0 (zero) is returned.
The Attribute parameter can be one of the following:
The X protocol allows a single visual ID to be instantiated with different numbers of bits per pixel. However, windows or GLX pixmaps that will be rendered with OpenGL must be instantiated with a color buffer depth of GLX_BUFFER_SIZE.
Although a GLX implementation can export many visuals that support OpenGL rendering, it must support at least two. The first required visual must be an RGBA visual with at least one color buffer, a stencil buffer of at least 1 bit, a depth buffer of at least 12 bits, and an accumulation buffer. Alpha bitplanes are optional in this required visual. However, the color buffer size of this visual must be as great as the deepest TrueColor, DirectColor, PseudoColor, or StaticColor visual supported on level 0. The visual itself must also be available on level 0.
The other required visual is a color index one with at least one color buffer, a stencil buffer of at least 1 bit, and a depth buffer of at least 12 bits. This visual must have as many color bitplanes as the deepest PseudoColor or StaticColor visual supported on level 0. The visual itself must also be available on level 0.
An application is most effective when written to select the visual most closely meeting its requirements. Creating windows or GLX pixmaps with unnecessary buffers can result in reduced rendering performance and poor resource allocation.
XVisualInfo is defined in the Xutil.h file. It is a structure that includes Visual, VisualID, Screen, and Depth elements.
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glXChooseVisual subroutine, glXCreateContext subroutine.
OpenGL in the AIXwindows (GLX) Environment.