NAME

glXGetConfig - return information about GLX visuals

C SPECIFICATION

int ggllXXGGeettCCoonnffiigg( Display _*_d_p_y,
                  XVisualInfo _*_v_i_s,
                  int _a_t_t_r_i_b,
                  int _*_v_a_l_u_e )

delim $$

PARAMETERS

_d_p_y
Specifies the connection to the X server.
_v_i_s
Specifies the visual to be queried. It is a pointer to an XXVViissuuaallIInnffoo structure, not a visual ID or a pointer to a VViissuuaall.
_a_t_t_r_i_b
Specifies the visual attribute to be returned.
_v_a_l_u_e
Returns the requested value.

DESCRIPTION

ggllXXGGeettCCoonnffiigg sets _v_a_l_u_e to the _a_t_t_r_i_b value of windows or GLX pixmaps created with respect to _v_i_s. ggllXXGGeettCCoonnffiigg returns an error code if it fails for any reason. Otherwise, zero is returned.

_a_t_t_r_i_b is one of the following:

GGLLXX__UUSSEE__GGLL
TTrruuee if OpenGL rendering is supported by this visual, FFaallssee otherwise.
GGLLXX__BBUUFFFFEERR__SSIIZZEE
Number of bits per color buffer. For RGBA visuals, GGLLXX__BBUUFFFFEERR__SSIIZZEE is the sum of GGLLXX__RREEDD__SSIIZZEE, GGLLXX__GGRREEEENN__SSIIZZEE, GGLLXX__BBLLUUEE__SSIIZZEE, and GGLLXX__AALLPPHHAA__SSIIZZEE. For color index visuals, GGLLXX__BBUUFFFFEERR__SSIIZZEE is the size of the color indexes.
GGLLXX__LLEEVVEELL
Frame buffer level of the visual. Level zero is the default frame buffer. Positive levels correspond to frame buffers that overlay the default buffer, and negative levels correspond to frame buffers that underlay the default buffer.
GGLLXX__RRGGBBAA
TTrruuee if color buffers store red, green, blue, and alpha values. FFaallssee if they store color indexes.
GGLLXX__DDOOUUBBLLEEBBUUFFFFEERR
TTrruuee if color buffers exist in front/back pairs that can be swapped, FFaallssee otherwise.
GGLLXX__SSTTEERREEOO
TTrruuee if color buffers exist in left/right pairs, FFaallssee otherwise.
GGLLXX__AAUUXX__BBUUFFFFEERRSS
Number of auxiliary color buffers that are available. Zero indicates that no auxiliary color buffers exist.
GGLLXX__RREEDD__SSIIZZEE
Number of bits of red stored in each color buffer. Undefined if GGLLXX__RRGGBBAA is FFaallssee.
GGLLXX__GGRREEEENN__SSIIZZEE
Number of bits of green stored in each color buffer. Undefined if GGLLXX__RRGGBBAA is FFaallssee.
GGLLXX__BBLLUUEE__SSIIZZEE
Number of bits of blue stored in each color buffer. Undefined if GGLLXX__RRGGBBAA is FFaallssee.
GGLLXX__AALLPPHHAA__SSIIZZEE
Number of bits of alpha stored in each color buffer. Undefined if GGLLXX__RRGGBBAA is FFaallssee.
GGLLXX__DDEEPPTTHH__SSIIZZEE
Number of bits in the depth buffer.
GGLLXX__SSTTEENNCCIILL__SSIIZZEE
Number of bits in the stencil buffer.
GGLLXX__AACCCCUUMM__RREEDD__SSIIZZEE
Number of bits of red stored in the accumulation buffer.
GGLLXX__AACCCCUUMM__GGRREEEENN__SSIIZZEE
Number of bits of green stored in the accumulation buffer.
GGLLXX__AACCCCUUMM__BBLLUUEE__SSIIZZEE
Number of bits of blue stored in the accumulation buffer.
GGLLXX__AACCCCUUMM__AALLPPHHAA__SSIIZZEE
Number of bits of alpha stored in the accumulation buffer.

The X protocol allows a single visual ID to be instantiated with different numbers of bits per pixel. Windows or GLX pixmaps that will be rendered with OpenGL, however, must be instantiated with a color buffer depth of GGLLXX__BBUUFFFFEERR__SSIIZZEE.

Although a GLX implementation can export many visuals that support GL rendering, it must support at least one RGBA visual. This visual must have 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 visual. However, its color buffer size must be as great as that of the deepest TTrruueeCCoolloorr, DDiirreeccttCCoolloorr, PPsseeuuddooCCoolloorr, or SSttaattiiccCCoolloorr visual supported on level zero, and it must itself be made available on level zero.

In addition, if the X server exports a PPsseeuuddooCCoolloorr or SSttaattiiccCCoolloorr visual on framebuffer level 0, a color index visual is also required on that level. It must have 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 PPsseeuuddooCCoolloorr or SSttaattiiccCCoolloorr visual supported on level 0.

Applications are best written to select the visual that most closely meets their requirements. Creating windows or GLX pixmaps with unnecessary buffers can result in reduced rendering performance as well as poor resource allocation.

NOTES

XXVViissuuaallIInnffoo is defined in _X_u_t_i_l_._h_. It is a structure that includes _v_i_s_u_a_l, _v_i_s_u_a_l_I_D, _s_c_r_e_e_n, and _d_e_p_t_h elements.

ERRORS

GGLLXX__NNOO__EEXXTTEENNSSIIOONN is returned if _d_p_y does not support the GLX extension.

GGLLXX__BBAADD__SSCCRREEEENN is returned if the screen of _v_i_s does not correspond to a screen.

GGLLXX__BBAADD__AATTTTRRIIBBUUTTEE is returned if _a_t_t_r_i_b is not a valid GLX attribute.

GGLLXX__BBAADD__VVIISSUUAALL is returned if _v_i_s doesn't support GLX and an attribute other than GGLLXX__UUSSEE__GGLL is requested.

SEE ALSO

ggllXXCChhoooosseeVViissuuaall, ggllXXCCrreeaatteeCCoonntteexxtt