1GLXCHOOSEVISUAL(3G)              OpenGL Manual             GLXCHOOSEVISUAL(3G)
2
3
4

NAME

6       glXChooseVisual - return a visual that matches specified attributes
7

C SPECIFICATION

9       XVisualInfo* glXChooseVisual(Display * dpy, int screen,
10                                    int * attribList);
11

PARAMETERS

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

DESCRIPTION

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

EXAMPLES

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

NOTES

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

ERRORS

171       NULL is returned if an undefined GLX attribute is encountered in
172       attribList.
173

SEE ALSO

175       glXCreateContext(), glXGetConfig()
176
178       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
179       under the SGI Free Software B License. For details, see
180       http://oss.sgi.com/projects/FreeB/.
181

AUTHORS

183       opengl.org
184
185
186
187opengl.org                        06/10/2014               GLXCHOOSEVISUAL(3G)
Impressum