GLXgetconfig(3G) GLXgetconfig(3G)
GLXgetconfig - Get configuration information for GL rendering into an X
window
#include <gl/glws.h>
typedef struct _GLXconfig { /* from <gl/glws.h> */
int buffer;
int mode;
int arg;
} GLXconfig;
GLXconfig *
GLXgetconfig(xDisplay, xScreenNo, sdesc)
Display* xDisplay;
int screenNo;
GLXconfig* sdesc;
GLXgetconfig takes the display, screen, and configuration information and
returns the data needed to create and render GL into an X window.
The "sdesc" input parameter is a null terminated array of "GLXconfig"
triples, describing the configuration needed for GL rendering.
The return value is a complete description of the actual configuration
available. This is useful to check what configuration was available, but
it is also needed as an argument to GLXlink(3G). It can be freed with
free(3) when it is no longer needed.
GLXconfig [Toc] [Back]
Values for GLXconfig.buffer specify which buffer the configuration is
affecting. Possible values are GLX_NORMAL, GLX_POPUP, GLX_OVERLAY and
GLX_UNDERLAY.
Values for GLXconfig.mode specify which attributes of the buffer are
being configured. The interpretation of GLXconfig.arg is dependent on
the "mode" word.
GLX_DOUBLE In the input configuration single buffer is assumed unless
GLX_DOUBLE, True is specified. On output, if double
buffering is not available, the "arg" field for GLX_DOUBLE
will be false.
GLX_RGB In the input configuration color index is assumed unless
"GLX_RGB, True" is specified. On output, if RGB is not
available, the "arg" field for GLX_RGB will be false.
Page 1
GLXgetconfig(3G) GLXgetconfig(3G)
GLX_BUFSIZE If not specified, or the "arg" is GLX_NOCONFIG, then the
largest available number will be allocated. On return the
"arg" field will contain the number allocated.
GLX_RGBSIZE The minimum of the requested size and the largest available
size will be returned. If not specified, or the "arg" is
GLX_NOCONFIG, then the largest available size will be
returned.
GLX_STENSIZE
GLX_ACSIZE
GLX_ZSIZE If not specified none will be allocated. If the "arg" is
GLX_NOCONFIG then the largest available number will be
allocated. On return the "arg" field will contain the
number allocated.
GLX_VISUAL Ignored on input, in the output it contains the correct
visual id for the window to be created for that buffer.
GLX_COLORMAP Ignored on input, in the output the value is the colormap
that traditional "winopen()" style GL windows will use for
that buffer. This is for information only; colors in this
colormap may be queried, and this colormap id may be used in
creating windows. But it's forbidden to write into this
colormap using XStoreColor(s). If a client wants to do
XStoreColor(s), it needs to create its own colormap. But
even if a client does not do XStoreColor(s), it is free to
create windows with a colormap other than the one returned
in GLX_COLORMAP.
GLX_WINDOW Ignored on input, in the output, for a supported buffer
request, a placeholder with value GLX_NONE. Before the
output buffer is passed to GLXlink(3G), the value should be
replaced with the window which was created.
GLX_MSSAMPLE On input, the "arg" field should contain the requested
number of multisample samples to be stored at each
framebuffer pixel location. On output, the "arg" will
contain the allocated number of samples. If not specified,
no samples will be allocated.
GLX_MSZSIZE On input, the "arg" field should contain the requested
number of bits per depth component desired in the
multisample buffer. On output, the "arg" will contain the
allocated number of bits. If not specified, no bits will be
allocated.
GLX_MSSSIZE On input, the "arg" field should contain the requested
number of bits per stencil field desired in the multisample
buffer. On output, the "arg" will contain the allocated
number of bits. If not specified, no bits will be
allocated.
Page 2
GLXgetconfig(3G) GLXgetconfig(3G)
GLX_STEREOBUF
Monoscopic buffering is assumed unless GLX_STEREOBUF is
specified. On input, the "arg" field is ignored. On
output, the "arg" field will be true if stereoscopic
buffering is available, and false otherwise.
A return of 0 means that no visual was found which matched the request.
SEE ALSO
GLXwinset(3G), GLXlink(3G), GLXunlink(3G), ~4Dgifts/examples/GLX
Page 3
glXGetConfig(3G) OpenGL Reference - GLX glXGetConfig(3G)
glXGetConfig - return information about GLX visuals
int glXGetConfig( Display *dpy,
XVisualInfo *vis,
int attrib,
int *value )
dpy Specifies the connection to the X server.
vis Specifies the visual to be queried. It is a pointer to an
XVisualInfo structure, not a visual ID or a pointer to a Visual.
attrib Specifies the visual attribute to be returned.
value Returns the requested value.
glXGetConfig sets value to the attrib value of windows or GLX pixmaps
created with respect to vis. glXGetConfig returns an error code if it
fails for any reason. Otherwise, zero is returned.
attrib is one of the following:
GLX_USE_GL True if OpenGL rendering is supported by this
visual, False otherwise.
GLX_BUFFER_SIZE Number of bits per color buffer. For RGBA visuals,
GLX_BUFFER_SIZE is the sum of GLX_RED_SIZE,
GLX_GREEN_SIZE, GLX_BLUE_SIZE, and GLX_ALPHA_SIZE.
For color index visuals, GLX_BUFFER_SIZE is the
size of the color indexes.
GLX_LEVEL 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.
GLX_RGBA True if color buffers store red, green, blue, and
alpha values. False if they store color indexes.
GLX_DOUBLEBUFFER True if color buffers exist in front/back pairs
that can be swapped, False otherwise.
GLX_STEREO True if color buffers exist in left/right pairs,
False otherwise.
Page 1
glXGetConfig(3G) OpenGL Reference - GLX glXGetConfig(3G)
GLX_AUX_BUFFERS Number of auxiliary color buffers that are
available. Zero indicates that no auxiliary color
buffers exist.
GLX_RED_SIZE Number of bits of red stored in each color buffer.
Undefined if GLX_RGBA is False.
GLX_GREEN_SIZE Number of bits of green stored in each color
buffer. Undefined if GLX_RGBA is False.
GLX_BLUE_SIZE Number of bits of blue stored in each color buffer.
Undefined if GLX_RGBA is False.
GLX_ALPHA_SIZE Number of bits of alpha stored in each color
buffer. Undefined if GLX_RGBA is False.
GLX_DEPTH_SIZE Number of bits in the depth buffer.
GLX_STENCIL_SIZE Number of bits in the stencil buffer.
GLX_ACCUM_RED_SIZE Number of bits of red stored in the accumulation
buffer.
GLX_ACCUM_GREEN_SIZE Number of bits of green stored in the accumulation
buffer.
GLX_ACCUM_BLUE_SIZE Number of bits of blue stored in the accumulation
buffer.
GLX_ACCUM_ALPHA_SIZE Number of bits of alpha stored in the accumulation
buffer.
GLX_SAMPLE_BUFFERS_SGIS [Toc] [Back]
Number of multisample buffers. (Note that
multisampling is supported only on RealityEngine.)
GLX_SAMPLES_SGIS Number of samples per pixel in multisample buffers.
GLX_X_VISUAL_TYPE_EXT X Visual type. One of GLX_TRUE_COLOR_EXT,
GLX_DIRECT_COLOR_EXT, GLX_PSEUDO_COLOR_EXT,
GLX_STATIC_COLOR_EXT, GLX_GRAY_SCALE_EXT,
GLX_STATIC_GRAY_EXT.
GLX_TRANSPARENT_TYPE_EXT [Toc] [Back]
One of GLX_NONE_EXT, GLX_TRANSPARENT_RGB_EXT,
GLX_TRANSPARENT_INDEX_EXT, indicating that the
visual is opaque, is transparent for particular
values of red, green and blue or is transparent for
particular index values, respectively.
Page 2
glXGetConfig(3G) OpenGL Reference - GLX glXGetConfig(3G)
GLX_TRANSPARENT_INDEX_VALUE_EXT [Toc] [Back]
Integer value between 0 and the maximum frame
buffer value for indices, indicating the
transparent index value for the visual. Undefined
if GLX_TRANSPARENT_TYPE_EXT is not
GLX_TRANSPARENT_INDEX_EXT.
GLX_TRANSPARENT_RED_VALUE_EXT [Toc] [Back]
Integer value between 0 and the maximum frame
buffer value for red, indicating the transparent
red value for the visual. Undefined if
GLX_TRANSPARENT_TYPE_EXT is not
GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_GREEN_VALUE_EXT [Toc] [Back]
Integer value between 0 and the maximum frame
buffer value for green, indicating the transparent
green value for the visual. Undefined if
GLX_TRANSPARENT_TYPE_EXT is not
GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_BLUE_VALUE_EXT [Toc] [Back]
Integer value between 0 and the maximum frame
buffer value for blue, indicating the transparent
blue value for the visual. Undefined if
GLX_TRANSPARENT_TYPE_EXT is not
GLX_TRANSPARENT_RGB_EXT.
GLX_TRANSPARENT_ALPHA_VALUE_EXT [Toc] [Back]
Currently unused.
GLX_VISUAL_CAVEAT_EXT One of GLX_NONE_EXT, GLX_SLOW_VISUAL_EXT,
GLX_NON_CONFORMANT_EXT indicating that the visual
has no caveats, some aspect of the visual runs
slower than other visuals, or some aspect of the
visual is non-confomant, respectively.
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 GLX_BUFFER_SIZE.
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 TrueColor, DirectColor,
PseudoColor, or StaticColor visual supported on level zero, and it must
itself be made available on level zero.
Page 3
glXGetConfig(3G) OpenGL Reference - GLX glXGetConfig(3G)
In addition, if the X server exports a PseudoColor or StaticColor 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 PseudoColor or StaticColor
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.
XVisualInfo is defined in Xutil.h. It is a structure that includes
visual, visualID, screen, and depth elements.
GLX_SAMPLE_BUFFERS_SGIS and GLX_SAMPLES_SGIS are not valid attributes
unless the SGIS_multisample extension is supported.
GLX_X_VISUAL_TYPE_EXT, GLX_TRANSPARENT_TYPE_EXT,
GLX_TRANSPARENT_INDEX_VALUE_EXT, GLX_TRANSPARENT_RED_VALUE_EXT,
GLX_TRANSPARENT_GREEN_VALUE_EXT, GLX_TRANSPARENT_BLUE_VALUE_EXT, and
GLX_TRANSPARENT_ALPHA_VALUE_EXT are not valid attributes unless the
EXT_visual_info extension is supported.
GLX_VISUAL_CAVEAT_EXT is not a valid attribute unless the
EXT_visual_rating extension is supported.
GLX_NO_EXTENSION is returned if dpy does not support the GLX extension.
GLX_BAD_SCREEN is returned if the screen of vis does not correspond to a
screen.
GLX_BAD_ATTRIBUTE is returned if attrib is not a valid GLX attribute.
GLX_BAD_VISUAL is returned if vis doesn't support GLX and an attribute
other than GLX_USE_GL is requested.
MACHINE DEPENDENCIES
The SGIS_multisample extension is supported only on RealityEngine,
RealityEngine2, and VTX systems and InfiniteReality systems.
glXChooseVisual, glXCreateContext
PPPPaaaaggggeeee 4444 [ Back ]
|