glXChooseVisual  -  return a visual that matches specified
       attributes



C SPECIFICATION

       XVisualInfo* glXChooseVisual( Display *dpy,
                                     int screen,
                                     int *attribList )



PARAMETERS

       dpy         Specifies the connection to the X server.

       screen      Specifies the screen number.

       attribList  Specifies a list  of  boolean  attributes  and
                   integer   attribute/value   pairs.   The  last
                   attribute must be None.


DESCRIPTION

       glXChooseVisual returns a pointer to an XVisualInfo struc-
       ture describing the visual that best meets a minimum spec-
       ification.  The boolean GLX attributes of the visual  that
       is returned will match the specified values, and the inte-
       ger GLX attributes will meet or exceed the specified mini-
       mum  values.  If all other attributes are equivalent, then
       TrueColor  and  PseudoColor  visuals  have  priority  over
       DirectColor  and StaticColor visuals, respectively.  If no
       conforming visual exists, NULL is returned.  To  free  the
       data returned by this function, use XFree.

       All   boolean  GLX  attributes  default  to  False  except
       GLX_USE_GL, which  defaults  to  True.   All  integer  GLX
       attributes  default  to  zero.  Default specifications are
       superseded by attributes included in attribList.   Boolean
       attributes  included  in  attribList  are understood to be
       True.  Integer attributes and enumerated  type  attributes
       are  followed  immediately by the corresponding desired or
       minimum value.  The list must be terminated with None.

       The interpretations of the various GLX  visual  attributes
       are as follows:

       GLX_USE_GL            Ignored.   Only  visuals that can be
                             rendered with GLX are considered.

       GLX_BUFFER_SIZE       Must be followed  by  a  nonnegative
                             integer  that  indicates the desired
                             color index buffer size.  The small-
                             est  index  buffer  of  at least the
                             specified   size    is    preferred.
                             Ignored if GLX_RGBA is asserted.
                             Otherwise,  only   PseudoColor   and
                             StaticColor  visuals are considered.

       GLX_DOUBLEBUFFER      If  present,  only   double-buffered
                             visuals are considered.   Otherwise,
                             only  single-buffered  visuals   are
                             considered.

       GLX_STEREO            If  present, only stereo visuals are
                             considered.  Otherwise,  only  mono-
                             scopic visuals are considered.

       GLX_AUX_BUFFERS       Must  be  followed  by a nonnegative
                             integer that indicates  the  desired
                             number  of auxiliary buffers.  Visu-
                             als with the    smallest  number  of
                             auxiliary   buffers  that  meets  or
                             exceeds  the  specified  number  are
                             preferred.

       GLX_RED_SIZE          Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value  is  zero, the smallest avail-
                             able red buffer is preferred.   Oth-
                             erwise,  the  largest  available red
                             buffer of at least the minimum  size
                             is preferred.

       GLX_GREEN_SIZE        Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value  is  zero, the smallest avail-
                             able  green  buffer  is   preferred.
                             Otherwise,   the  largest  available
                             green buffer of at least the minimum
                             size is preferred.

       GLX_BLUE_SIZE         Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value  is  zero, the smallest avail-
                             able blue buffer is preferred.  Oth-
                             erwise,  the  largest available blue
                             buffer of at least the minimum  size
                             is preferred.

       GLX_ALPHA_SIZE        Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value  is  zero, the smallest avail-
                             able  alpha  buffer  is   preferred.
                             Otherwise,   the  largest  available
                             alpha buffer of at least the minimum
                             size is preferred.

                             with  no  stencil  buffer  are  pre-
                             ferred.

       GLX_ACCUM_RED_SIZE    Must be followed  by  a  nonnegative
                             minimum size specification.  If this
                             value is zero, visuals with  no  red
                             accumulation  buffer  are preferred.
                             Otherwise, the largest possible  red
                             accumulation  buffer of at least the
                             minimum size is preferred.

       GLX_ACCUM_GREEN_SIZE  Must be followed  by  a  nonnegative
                             minimum size specification.  If this
                             value is zero, visuals with no green
                             accumulation  buffer  are preferred.
                             Otherwise,  the   largest   possible
                             green   accumulation  buffer  of  at
                             least the minimum size is preferred.

       GLX_ACCUM_BLUE_SIZE   Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value  is zero, visuals with no blue
                             accumulation buffer  are  preferred.
                             Otherwise, the largest possible blue
                             accumulation buffer of at least  the
                             minimum size is preferred.

       GLX_ACCUM_ALPHA_SIZE  Must  be  followed  by a nonnegative
                             minimum size specification.  If this
                             value is zero, visuals with no alpha
                             accumulation buffer  are  preferred.
                             Otherwise,   the   largest  possible
                             alpha  accumulation  buffer  of   at
                             least the minimum size is preferred.


EXAMPLES

       attribList =
                   {GLX_RGBA, GLX_RED_SIZE, 4, GLX_GREEN_SIZE, 4,
                   GLX_BLUE_SIZE, 4, None};

       Specifies a single-buffered RGB visual in the normal frame
       buffer, not an overlay or underlay buffer.   The  returned
       visual supports at least four bits each of red, green, and
       blue, and possibly no bits of alpha.  It does not  support
       color index mode, double-buffering, or stereo display.  It
       may or may not have one or more auxiliary color buffers, a
       depth buffer, a stencil buffer, or an accumulation buffer.


NOTES

       XVisualInfo is defined in Xutil.h.  It is a structure that
       includes visual, visualID, screen, and depth elements.

       ported by the X server.


ERRORS

       NULL  is returned if an undefined GLX attribute is encoun-
       tered in attribList.


SEE ALSO

       glXCreateContext, glXGetConfig



                                                                1