1GLXCHOOSEVISUAL()                                            GLXCHOOSEVISUAL()
2
3
4

NAME

6       glXChooseVisual - return a visual that matches specified attributes
7
8

C SPECIFICATION

10       XVisualInfo* glXChooseVisual( Display *dpy,
11                                     int screen,
12                                     int *attribList )
13
14       delim $$
15

PARAMETERS

17       dpy         Specifies the connection to the X server.
18
19       screen      Specifies the screen number.
20
21       attribList  Specifies   a   list  of  boolean  attributes  and  integer
22                   attribute/value pairs.  The last attribute must be None.
23

DESCRIPTION

25       glXChooseVisual returns a pointer to an XVisualInfo structure  describ‐
26       ing  the  visual  that best meets a minimum specification.  The boolean
27       GLX attributes of the visual that is returned will match the  specified
28       values,  and  the integer GLX attributes will meet or exceed the speci‐
29       fied minimum values.  If all  other  attributes  are  equivalent,  then
30       TrueColor  and  PseudoColor  visuals have priority over DirectColor and
31       StaticColor visuals, respectively.  If  no  conforming  visual  exists,
32       NULL  is  returned.   To  free  the data returned by this function, use
33       XFree.
34
35       All boolean GLX attributes default to False  except  GLX_USE_GL,  which
36       defaults to True.  All integer GLX attributes default to zero.  Default
37       specifications are superseded by  attributes  included  in  attribList.
38       Boolean  attributes  included  in attribList are understood to be True.
39       Integer attributes and enumerated type attributes are followed  immedi‐
40       ately  by the corresponding desired or minimum value.  The list must be
41       terminated with None.
42
43       The interpretations of the various GLX visual attributes  are  as  fol‐
44       lows:
45
46       GLX_USE_GL            Ignored.   Only visuals that can be rendered with
47                             GLX are considered.
48
49       GLX_BUFFER_SIZE       Must be followed by a  nonnegative  integer  that
50                             indicates  the  desired  color index buffer size.
51                             The smallest index buffer of at least the  speci‐
52                             fied  size  is preferred.  Ignored if GLX_RGBA is
53                             asserted.
54
55       GLX_LEVEL             Must be followed by an integer buffer-level spec‐
56                             ification.    This   specification   is   honored
57                             exactly.  Buffer level zero  corresponds  to  the
58                             main  frame  buffer of the display.  Buffer level
59                             one is the first overlay frame buffer, level  two
60                             the second overlay frame buffer, and so on.  Neg‐
61                             ative buffer levels correspond to underlay  frame
62                             buffers.
63
64       GLX_RGBA              If  present, only TrueColor and DirectColor visu‐
65                             als are considered.  Otherwise, only  PseudoColor
66                             and StaticColor visuals are considered.
67
68       GLX_DOUBLEBUFFER      If present, only double-buffered visuals are con‐
69                             sidered.   Otherwise, only single-buffered  visu‐
70                             als are considered.
71
72       GLX_STEREO            If  present,  only stereo visuals are considered.
73                             Otherwise, only monoscopic  visuals  are  consid‐
74                             ered.
75
76       GLX_AUX_BUFFERS       Must  be  followed  by a nonnegative integer that
77                             indicates the desired number  of  auxiliary  buf‐
78                             fers.   Visuals with the  smallest number of aux‐
79                             iliary buffers that meets or exceeds  the  speci‐
80                             fied number are preferred.
81
82       GLX_RED_SIZE          Must  be  followed  by a nonnegative minimum size
83                             specification.  If this value is zero, the small‐
84                             est  available  red  buffer is preferred.  Other‐
85                             wise, the largest  available  red  buffer  of  at
86                             least the minimum size is preferred.
87
88       GLX_GREEN_SIZE        Must  be  followed  by a nonnegative minimum size
89                             specification.  If this value is zero, the small‐
90                             est  available green buffer is preferred.  Other‐
91                             wise, the largest available green  buffer  of  at
92                             least the minimum size is preferred.
93
94       GLX_BLUE_SIZE         Must  be  followed  by a nonnegative minimum size
95                             specification.  If this value is zero, the small‐
96                             est  available  blue buffer is preferred.  Other‐
97                             wise, the largest available  blue  buffer  of  at
98                             least the minimum size is preferred.
99
100       GLX_ALPHA_SIZE        Must  be  followed  by a nonnegative minimum size
101                             specification.  If this value is zero, the small‐
102                             est  available alpha buffer is preferred.  Other‐
103                             wise, the largest available alpha  buffer  of  at
104                             least the minimum size is preferred.
105
106       GLX_DEPTH_SIZE        Must  be  followed  by a nonnegative minimum size
107                             specification.  If this value  is  zero,  visuals
108                             with  no  depth buffer are preferred.  Otherwise,
109                             the largest available depth buffer  of  at  least
110                             the minimum size is preferred.
111
112       GLX_STENCIL_SIZE      Must  be  followed  by a nonnegative integer that
113                             indicates the  desired  number  of  stencil  bit‐
114                             planes.   The smallest stencil buffer of at least
115                             the specified size is preferred.  If the  desired
116                             value is zero, visuals with no stencil buffer are
117                             preferred.
118
119       GLX_ACCUM_RED_SIZE    Must be followed by a  nonnegative  minimum  size
120                             specification.   If  this  value is zero, visuals
121                             with no red accumulation  buffer  are  preferred.
122                             Otherwise,  the largest possible red accumulation
123                             buffer of at least the minimum size is preferred.
124
125       GLX_ACCUM_GREEN_SIZE  Must be followed by a  nonnegative  minimum  size
126                             specification.   If  this  value is zero, visuals
127                             with no green accumulation buffer are  preferred.
128                             Otherwise,  the  largest possible green accumula‐
129                             tion buffer of at least the minimum size is  pre‐
130                             ferred.
131
132       GLX_ACCUM_BLUE_SIZE   Must  be  followed  by a nonnegative minimum size
133                             specification.  If this value  is  zero,  visuals
134                             with  no  blue accumulation buffer are preferred.
135                             Otherwise, the largest possible blue accumulation
136                             buffer of at least the minimum size is preferred.
137
138       GLX_ACCUM_ALPHA_SIZE  Must  be  followed  by a nonnegative minimum size
139                             specification.  If this value  is  zero,  visuals
140                             with  no alpha accumulation buffer are preferred.
141                             Otherwise, the largest possible  alpha  accumula‐
142                             tion  buffer of at least the minimum size is pre‐
143                             ferred.
144

EXAMPLES

146       attribList =
147                   {GLX_RGBA,    GLX_RED_SIZE,    4,    GLX_GREEN_SIZE,     4,
148                   GLX_BLUE_SIZE, 4, None};
149
150       Specifies  a single-buffered RGB visual in the normal frame buffer, not
151       an overlay or underlay buffer.  The returned visual supports  at  least
152       four  bits each of red, green, and blue, and possibly no bits of alpha.
153       It does not support color index mode, double-buffering, or stereo  dis‐
154       play.   It  may  or may not have one or more auxiliary color buffers, a
155       depth buffer, a stencil buffer, or an accumulation buffer.
156

NOTES

158       XVisualInfo is defined in Xutil.h.  It is  a  structure  that  includes
159       visual, visualID, screen, and depth elements.
160
161       glXChooseVisual  is  implemented  as  a  client-side utility using only
162       XGetVisualInfo and glXGetConfig.  Calls to these two  routines  can  be
163       used  to  implement  selection  algorithms  other  than the generic one
164       implemented by glXChooseVisual.
165
166       GLX implementers are strongly discouraged,  but  not  proscribed,  from
167       changing  the  selection algorithm used by glXChooseVisual.  Therefore,
168       selections may change  from  release  to  release  of  the  client-side
169       library.
170
171       There  is  no  direct filter for picking only visuals that support GLX‐
172       Pixmaps.  GLXPixmaps are supported for visuals whose GLX_BUFFER_SIZE is
173       one of the pixmap depths supported by the X server.
174

ERRORS

176       NULL is returned if an undefined GLX attribute is encountered in attri‐
177       bList.
178

SEE ALSO

180       glXCreateContext, glXGetConfig
181
182
183
184                                                             GLXCHOOSEVISUAL()
Impressum