[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glXGetConfig Subroutine

Purpose

Returns information about GLX visuals.

Library

OpenGL C bindings library: libGL.a

C Syntax

int glXGetConfig(Display *dpy
      XVisualInfo *Visual
      int Attribute
      int *Value)

Description

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:

Attribute Definition
GLX_USE_GL This attribute is True if OpenGL rendering is supported by this visual. Otherwise, it is False.
GLX_BUFFER_SIZE This attribute defines the number of bits per color buffer. For red, green, blue, and alpha (RGBA) visuals, it is the sum of GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_BLUE_SIZE, and GLX_ALPHA_SIZE. For color index visuals, this attribute is the size of the color indexes.
GLX_LEVEL This attribute defines the frame buffer level of the visual. Level 0 is the default frame buffer. Positive levels correspond to frame buffers that overlay the default buffer; negative levels correspond to frame buffers that underlay the default buffer.
GLX_RGBA This attribute is True if color buffers store RGBA values. It is False if they store color indexes.
GLX_DOUBLEBUFFER This attribute is True if color buffers exist in front/back pairs that can be swapped. Otherwise, it is False.
GLX_STEREO This attribute is True if color buffers exist in left/right pairs. Otherwise, it is False.
GLX_AUX_BUFFERS This attribute defines the number of auxiliary color buffers available. Zero indicates that no auxiliary color buffers exist.
GLX_RED_SIZE This attribute defines the number of red bits stored in each color buffer. If GLX_RGBA is False, the GLX_RED_SIZE attribute is undefined.
GLX_GREEN_SIZE This attribute defines the number of green bits stored in each color buffer. If GLX_RGBA is False, the GLX_GREEN_SIZE attribute is undefined.
GLX_BLUE_SIZE This attribute defines the number of blue bits stored in each color buffer. If GLX_RGBA is False, the GLX_BLUE_SIZE attribute is undefined.
GLX_ALPHA_SIZE This attribute defines the number of alpha bits stored in each color buffer. If GLX_RGBA is False, the GLX_ALPHA_SIZE attribute is undefined.
GLX_DEPTH_SIZE This attribute defines the number of bits in the depth buffer.
GLX_STENCIL_SIZE This attribute defines the number of bits in the stencil buffer.
GLX_ACCUM_RED_SIZE This attribute defines the number of red bits stored in the accumulation buffer.
GLX_ACCUM_GREEN_SIZE This attribute defines the number of green bits stored in the accumulation buffer.
GLX_ACCUM_BLUE_SIZE This attribute defines the number of blue bits stored in the accumulation buffer.
GLX_ACCUM_ALPHA_SIZE This attribute defines the number of alpha bits stored in the accumulation buffer.
GLX_TRANSPARENT_TYPE_EXT This attribute defines the type of transparency (if any) in the visual. Return values are:

GLX_NONE_EXT
no transparency
GLX_TRANSPARENT_INDEX_EXT
PseudoColor transparency
GLX_TRANSPARENT_RGB_EXT
RGB Transparency
GLX_TRANSPARENT_RED_VALUE_EXT This attribute returns the red value of the transparent pixel when the transparency type is GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_GREEN_VALUE_EXT This attribute returns the green value of the transparent pixel when the transparency type is GLX_TRANSPARENT_RGB_EXT
GLX_TRANSPARENT_BLUE_VALUE_EXT This attribute returns the blue value of the transparent pixel when the transparency type is GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_ALPHA_VALUE_EXT This attribute returns the alpha value of the transparent pixel when the transparency type is GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_INDEX_VALUE_EXT This attribute returns the index value of the transparent pixel when the transparency type is GLX_TRANSPARENT_INDEX_EXT.
GLX_X_VISUAL_TYPE_EXT This attribute returns the visual type:

GLX_TRUE_COLOR_EXT
TrueColor colormap
GLX_DIRECT_COLOR_EXT
DirectColor colormap
GLX_PSEUDO_COLOR_EXT
PseudoColor colormap
GLX_STATIC_COLOR_EXT
StaticColor colormap
GLX_GRAY_SCALE_EXT
Grayscale colormap
GLX_STATIC_GRAY_EXT
StaticGray colormap
GLX_VISUAL_CAVEAT_EXT This attribute returns the visual rating:

0 or GLX_NONE_EXT
no rating
GLX_SLOW_VISUAL_EXT
not an optimal visual

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.

Parameters

dpy Specifies the connection to the X server.
Visual Specifies the visual to be queried. Visual is a pointer to an XVisualInfo structure, not a visual ID or a pointer to a Visual structure.
Attribute Specifies the visual attribute to be returned.
Value Returns the requested value.

Notes

XVisualInfo is defined in the Xutil.h file. It is a structure that includes Visual, VisualID, Screen, and Depth elements.

Return Values

GLXNoExtension dpy does not support the GLX extension.
GLXBadScreen The Visual screen does not correspond to a valid screen.
GLXBadAttrib Attribute is not a valid GLX attribute.
GLXBadVisual Visual does not support GLX and an attribute other than GLX_USE_GL is requested.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glXChooseVisual subroutine, glXCreateContext subroutine.

OpenGL in the AIXwindows (GLX) Environment.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]