update upstream sources
[clinton/guile-figl.git] / doc / low-level-glx.texi
CommitLineData
8925f36f
AW
1
2@c %start of fragment
3
3c9b6116
AW
4The functions from this section may be had by loading the module:
5
6@example
7ec693ed 7(use-modules (figl glx low-level)
3c9b6116
AW
8@end example
9
8925f36f
AW
10@copying
11This section of the manual was derived from the upstream OpenGL
c7b31271
DH
12documentation. Each function's documentation has its own copyright
13statement; for full details, see the upstream documentation. The
8925f36f
AW
14copyright notices and licenses present in this section are as follows.
15
c7b31271
DH
16Copyright @copyright{} 1991-2006 Silicon Graphics, Inc. This document
17is licensed under the SGI Free Software B License. For details, see
8925f36f
AW
18@uref{http://oss.sgi.com/projects/FreeB/,http://oss.sgi.com/projects/FreeB/}.
19
20@end copying
21
00239761 22@deftypefun GLXFBConfig-* glXChooseFBConfig dpy screen attrib_list nelements
3c9b6116
AW
23Return a list of GLX frame buffer configurations that match the
24specified attributes.
25
8925f36f
AW
26@table @asis
27@item @var{dpy}
28Specifies the connection to the X server.
29
30@item @var{screen}
31Specifies the screen number.
32
33@item @var{attrib_list}
c7b31271 34Specifies a list of attribute/value pairs. The last attribute must be
8925f36f
AW
35@code{None}.
36
37@item @var{nelements}
38Returns the number of elements in the list returned by
39@code{glXChooseFBConfig}.
40
41@end table
42
8925f36f
AW
43@code{glXChooseFBConfig} returns GLX frame buffer configurations that
44match the attributes specified in @var{attrib_list}, or @code{NULL} if
c7b31271 45no matches are found. If @var{attrib_list} is @code{NULL}, then
8925f36f 46@code{glXChooseFBConfig} returns an array of GLX frame buffer
c7b31271 47configurations that are available on the specified screen. If an error
8925f36f
AW
48occurs, no frame buffer configurations exist on the specified screen, or
49if no frame buffer configurations match the specified attributes, then
c7b31271
DH
50@code{NULL} is returned. Use @code{XFree} to free the memory returned
51by @code{glXChooseFBConfig}.
8925f36f
AW
52
53All attributes in @var{attrib_list}, including boolean attributes, are
c7b31271
DH
54immediately followed by the corresponding desired value. The list is
55terminated with @code{None}. If an attribute is not specified in
8925f36f 56@var{attrib_list}, then the default value (see below) is used (and the
c7b31271 57attribute is said to be specified implicitly). For example, if
8925f36f 58@code{GLX_STEREO} is not specified, then it is assumed to be
c7b31271 59@code{False}. For some attributes, the default is @code{GLX_DONT_CARE},
8925f36f
AW
60meaning that any value is OK for this attribute, so the attribute will
61not be checked.
62
c7b31271 63Attributes are matched in an attribute-specific manner. Some of the
8925f36f
AW
64attributes, such as @code{GLX_LEVEL}, must match the specified value
65exactly; others, such as, @code{GLX_RED_SIZE} must meet or exceed the
c7b31271 66specified minimum values. If more than one GLX frame buffer
8925f36f 67configuration is found, then a list of configurations, sorted according
c7b31271
DH
68to the ``best'' match criteria, is returned. The match criteria for
69each attribute and the exact sorting order is defined below.
8925f36f
AW
70
71The interpretations of the various GLX visual attributes are as follows:
72
73@table @asis
74@item @code{GLX_FBCONFIG_ID}
75
76
77Must be followed by a valid XID that indicates the desired GLX frame
c7b31271
DH
78buffer configuration. When a @code{GLX_FBCONFIG_ID} is specified, all
79attributes are ignored. The default value is @code{GLX_DONT_CARE}.
8925f36f
AW
80
81@item @code{GLX_BUFFER_SIZE}
82
83
84Must be followed by a nonnegative integer that indicates the desired
c7b31271
DH
85color index buffer size. The smallest index buffer of at least the
86specified size is preferred. This attribute is ignored if
87@code{GLX_COLOR_INDEX_BIT} is not set in @code{GLX_RENDER_TYPE}. The
8925f36f
AW
88default value is 0.
89
90@item @code{GLX_LEVEL}
91
92
c7b31271
DH
93Must be followed by an integer buffer-level specification. This
94specification is honored exactly. Buffer level 0 corresponds to the
95default frame buffer of the display. Buffer level 1 is the first
96overlay frame buffer, level two the second overlay frame buffer, and so
97on. Negative buffer levels correspond to underlay frame buffers. The
98default value is 0.
8925f36f
AW
99
100@item @code{GLX_DOUBLEBUFFER}
101
102
c7b31271 103Must be followed by @code{True} or @code{False}. If @code{True} is
8925f36f
AW
104specified, then only double-buffered frame buffer configurations are
105considered; if @code{False} is specified, then only single-buffered
c7b31271 106frame buffer configurations are considered. The default value is
8925f36f
AW
107@code{GLX_DONT_CARE}.
108
109@item @code{GLX_STEREO}
110
111
c7b31271 112Must be followed by @code{True} or @code{False}. If @code{True} is
8925f36f
AW
113specified, then only stereo frame buffer configurations are considered;
114if @code{False} is specified, then only monoscopic frame buffer
c7b31271 115configurations are considered. The default value is @code{False}.
8925f36f
AW
116
117@item @code{GLX_AUX_BUFFERS}
118
119
120Must be followed by a nonnegative integer that indicates the desired
c7b31271 121number of auxiliary buffers. Configurations with the smallest number of
8925f36f 122auxiliary buffers that meet or exceed the specified number are
c7b31271 123preferred. The default value is 0.
8925f36f
AW
124
125@item @code{GLX_RED_SIZE}, @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, @code{GLX_ALPHA_SIZE}
126
127
128Each attribute, if present, must be followed by a nonnegative minimum
c7b31271 129size specification or @code{GLX_DONT_CARE}. The largest available total
8925f36f
AW
130RGBA color buffer size (sum of @code{GLX_RED_SIZE},
131@code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and @code{GLX_ALPHA_SIZE})
132of at least the minimum size specified for each color component is
c7b31271
DH
133preferred. If the requested number of bits for a color component is 0
134or @code{GLX_DONT_CARE}, it is not considered. The default value for
135each color component is 0.
8925f36f
AW
136
137@item @code{GLX_DEPTH_SIZE}
138
139
c7b31271 140Must be followed by a nonnegative minimum size specification. If this
8925f36f 141value is zero, frame buffer configurations with no depth buffer are
c7b31271
DH
142preferred. Otherwise, the largest available depth buffer of at least
143the minimum size is preferred. The default value is 0.
8925f36f
AW
144
145@item @code{GLX_STENCIL_SIZE}
146
147
148Must be followed by a nonnegative integer that indicates the desired
c7b31271
DH
149number of stencil bitplanes. The smallest stencil buffer of at least
150the specified size is preferred. If the desired value is zero, frame
151buffer configurations with no stencil buffer are preferred. The default
152value is 0.
8925f36f
AW
153
154@item @code{GLX_ACCUM_RED_SIZE}
155
156
c7b31271 157Must be followed by a nonnegative minimum size specification. If this
8925f36f 158value is zero, frame buffer configurations with no red accumulation
c7b31271
DH
159buffer are preferred. Otherwise, the largest possible red accumulation
160buffer of at least the minimum size is preferred. The default value is
8925f36f
AW
1610.
162
163@item @code{GLX_ACCUM_GREEN_SIZE}
164
165
c7b31271 166Must be followed by a nonnegative minimum size specification. If this
8925f36f 167value is zero, frame buffer configurations with no green accumulation
c7b31271
DH
168buffer are preferred. Otherwise, the largest possible green
169accumulation buffer of at least the minimum size is preferred. The
170default value is 0.
8925f36f
AW
171
172@item @code{GLX_ACCUM_BLUE_SIZE}
173
174
c7b31271 175Must be followed by a nonnegative minimum size specification. If this
8925f36f 176value is zero, frame buffer configurations with no blue accumulation
c7b31271
DH
177buffer are preferred. Otherwise, the largest possible blue accumulation
178buffer of at least the minimum size is preferred. The default value is
8925f36f
AW
1790.
180
181@item @code{GLX_ACCUM_ALPHA_SIZE}
182
183
c7b31271 184Must be followed by a nonnegative minimum size specification. If this
8925f36f 185value is zero, frame buffer configurations with no alpha accumulation
c7b31271
DH
186buffer are preferred. Otherwise, the largest possible alpha
187accumulation buffer of at least the minimum size is preferred. The
188default value is 0.
8925f36f
AW
189
190@item @code{GLX_RENDER_TYPE}
191
192
193Must be followed by a mask indicating which OpenGL rendering modes the
c7b31271
DH
194frame buffer configuration must support. Valid bits are
195@code{GLX_RGBA_BIT} and @code{GLX_COLOR_INDEX_BIT}. If the mask is set
8925f36f
AW
196to @code{GLX_RGBA_BIT} | @code{GLX_COLOR_INDEX_BIT}, then only frame
197buffer configurations that can be bound to both RGBA contexts and color
c7b31271 198index contexts will be considered. The default value is
8925f36f
AW
199@code{GLX_RGBA_BIT}.
200
201@item @code{GLX_DRAWABLE_TYPE}
202
203
204Must be followed by a mask indicating which GLX drawable types the frame
c7b31271
DH
205buffer configuration must support. Valid bits are
206@code{GLX_WINDOW_BIT}, @code{GLX_PIXMAP_BIT}, and
207@code{GLX_PBUFFER_BIT}. For example, if mask is set to
208@code{GLX_WINDOW_BIT} | @code{GLX_PIXMAP_BIT}, only frame buffer
209configurations that support both windows and GLX pixmaps will be
210considered. The default value is @code{GLX_WINDOW_BIT}.
8925f36f
AW
211
212@item @code{GLX_X_RENDERABLE}
213
214
c7b31271 215Must be followed by @code{True} or @code{False}. If @code{True} is
8925f36f
AW
216specified, then only frame buffer configurations that have associated X
217visuals (and can be used to render to Windows and/or GLX pixmaps) will
c7b31271 218be considered. The default value is @code{GLX_DONT_CARE}.
8925f36f
AW
219
220@item @code{GLX_X_VISUAL_TYPE}
221
222
223Must be followed by one of @code{GLX_TRUE_COLOR},
224@code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
225@code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, or
c7b31271
DH
226@code{GLX_STATIC_GRAY}, indicating the desired X visual type. Not all
227frame buffer configurations have an associated X visual. If
8925f36f
AW
228@code{GLX_DRAWABLE_TYPE} is specified in @var{attrib_list} and the mask
229that follows does not have @code{GLX_WINDOW_BIT} set, then this value is
c7b31271
DH
230ignored. It is also ignored if @code{GLX_X_RENDERABLE} is specified as
231@code{False}. RGBA rendering may be supported for visuals of type
8925f36f
AW
232@code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
233or @code{GLX_STATIC_COLOR}, but color index rendering is only supported
234for visuals of type @code{GLX_PSEUDO_COLOR} or @code{GLX_STATIC_COLOR}
c7b31271 235(i.e., single-channel visuals). The tokens @code{GLX_GRAY_SCALE} and
8925f36f 236@code{GLX_STATIC_GRAY} will not match current OpenGL enabled visuals,
c7b31271 237but are included for future use. The default value for
8925f36f
AW
238@code{GLX_X_VISUAL_TYPE} is @code{GLX_DONT_CARE}.
239
240@item @code{GLX_CONFIG_CAVEAT}
241
242
243Must be followed by one of @code{GLX_NONE}, @code{GLX_SLOW_CONFIG},
c7b31271 244@code{GLX_NON_CONFORMANT_CONFIG}. If @code{GLX_NONE} is specified, then
8925f36f
AW
245only frame buffer configurations with no caveats will be considered; if
246@code{GLX_SLOW_CONFIG} is specified, then only slow frame buffer
247configurations will be considered; if @code{GLX_NON_CONFORMANT_CONFIG}
248is specified, then only nonconformant frame buffer configurations will
c7b31271 249be considered. The default value is @code{GLX_DONT_CARE}.
8925f36f
AW
250
251@item @code{GLX_TRANSPARENT_TYPE}
252
253
254Must be followed by one of @code{GLX_NONE}, @code{GLX_TRANSPARENT_RGB},
c7b31271
DH
255@code{GLX_TRANSPARENT_INDEX}. If @code{GLX_NONE} is specified, then
256only opaque frame buffer configurations will be considered; if
8925f36f
AW
257@code{GLX_TRANSPARENT_RGB} is specified, then only transparent frame
258buffer configurations that support RGBA rendering will be considered; if
259@code{GLX_TRANSPARENT_INDEX} is specified, then only transparent frame
260buffer configurations that support color index rendering will be
c7b31271 261considered. The default value is @code{GLX_NONE}.
8925f36f
AW
262
263@item @code{GLX_TRANSPARENT_INDEX_VALUE}
264
265
266Must be followed by an integer value indicating the transparent index
267value; the value must be between 0 and the maximum frame buffer value
c7b31271
DH
268for indices. Only frame buffer configurations that use the specified
269transparent index value will be considered. The default value is
270@code{GLX_DONT_CARE}. This attribute is ignored unless
8925f36f
AW
271@code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
272specified as @code{GLX_TRANSPARENT_INDEX}.
273
274@item @code{GLX_TRANSPARENT_RED_VALUE}
275
276
277Must be followed by an integer value indicating the transparent red
278value; the value must be between 0 and the maximum frame buffer value
c7b31271
DH
279for red. Only frame buffer configurations that use the specified
280transparent red value will be considered. The default value is
281@code{GLX_DONT_CARE}. This attribute is ignored unless
8925f36f
AW
282@code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
283specified as @code{GLX_TRANSPARENT_RGB}.
284
285@item @code{GLX_TRANSPARENT_GREEN_VALUE}
286
287
288Must be followed by an integer value indicating the transparent green
289value; the value must be between 0 and the maximum frame buffer value
c7b31271
DH
290for green. Only frame buffer configurations that use the specified
291transparent green value will be considered. The default value is
292@code{GLX_DONT_CARE}. This attribute is ignored unless
8925f36f
AW
293@code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
294specified as @code{GLX_TRANSPARENT_RGB}.
295
296@item @code{GLX_TRANSPARENT_BLUE_VALUE}
297
298
299Must be followed by an integer value indicating the transparent blue
300value; the value must be between 0 and the maximum frame buffer value
c7b31271
DH
301for blue. Only frame buffer configurations that use the specified
302transparent blue value will be considered. The default value is
303@code{GLX_DONT_CARE}. This attribute is ignored unless
8925f36f
AW
304@code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
305specified as @code{GLX_TRANSPARENT_RGB}.
306
307@item @code{GLX_TRANSPARENT_ALPHA_VALUE}
308
309
310Must be followed by an integer value indicating the transparent alpha
311value; the value must be between 0 and the maximum frame buffer value
c7b31271
DH
312for alpha. Only frame buffer configurations that use the specified
313transparent alpha value will be considered. The default value is
8925f36f
AW
314@code{GLX_DONT_CARE}.
315
316@end table
317
318When more than one GLX frame buffer configuration matches the specified
c7b31271 319attributes, a list of matching configurations is returned. The list is
8925f36f
AW
320sorted according to the following precedence rules, which are applied in
321ascending order (i.e., configurations that are considered equal by a
322lower numbered rule are sorted by the higher numbered rule):
323
324@table @asis
325@item 1.
326By @code{GLX_CONFIG_CAVEAT} where the precedence is @code{GLX_NONE},
327@code{GLX_SLOW_CONFIG}, and @code{GLX_NON_CONFORMANT_CONFIG}.
328
329@item 2.
330Larger total number of RGBA color components (@code{GLX_RED_SIZE},
331@code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, plus @code{GLX_ALPHA_SIZE})
c7b31271 332that have higher number of bits. If the requested number of bits in
8925f36f
AW
333@var{attrib_list} is zero or @code{GLX_DONT_CARE} for a particular color
334component, then the number of bits for that component is not considered.
335
336@item 3.
337Smaller @code{GLX_BUFFER_SIZE}.
338
339@item 4.
340Single buffered configuration (@code{GLX_DOUBLEBUFFER} being
341@code{False} precedes a double buffered one.
342
343@item 5.
344Smaller @code{GLX_AUX_BUFFERS}.
345
346@item 6.
347Larger @code{GLX_DEPTH_SIZE}.
348
349@item 7.
350Smaller @code{GLX_STENCIL_SIZE}.
351
352@item 8.
353Larger total number of accumulation buffer color components
354(@code{GLX_ACCUM_RED_SIZE}, @code{GLX_ACCUM_GREEN_SIZE},
355@code{GLX_ACCUM_BLUE_SIZE}, plus @code{GLX_ACCUM_ALPHA_SIZE}) that have
c7b31271 356higher number of bits. If the requested number of bits in
8925f36f
AW
357@var{attrib_list} is zero or @code{GLX_DONT_CARE} for a particular color
358component, then the number of bits for that component is not considered.
359
360@item 9.
361By @code{GLX_X_VISUAL_TYPE} where the precedence order is
362@code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
363@code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, @code{GLX_STATIC_GRAY}.
364
365@end table
366
8925f36f
AW
367@code{NULL} is returned if an undefined GLX attribute is encountered in
368@var{attrib_list}, if @var{screen} is invalid, or if @var{dpy} does not
369support the GLX extension.
370
bb894c9d 371@end deftypefun
8925f36f 372
00239761 373@deftypefun XVisualInfo* glXChooseVisual dpy screen attribList
3c9b6116
AW
374Return a visual that matches specified attributes.
375
8925f36f
AW
376@table @asis
377@item @var{dpy}
378Specifies the connection to the X server.
379
380@item @var{screen}
381Specifies the screen number.
382
383@item @var{attribList}
384Specifies a list of boolean attributes and integer attribute/value
c7b31271 385pairs. The last attribute must be @code{None}.
8925f36f
AW
386
387@end table
388
8925f36f 389@code{glXChooseVisual} returns a pointer to an XVisualInfo structure
c7b31271 390describing the visual that best meets a minimum specification. The
8925f36f
AW
391boolean GLX attributes of the visual that is returned will match the
392specified values, and the integer GLX attributes will meet or exceed the
c7b31271 393specified minimum values. If all other attributes are equivalent, then
8925f36f 394TrueColor and PseudoColor visuals have priority over DirectColor and
c7b31271
DH
395StaticColor visuals, respectively. If no conforming visual exists,
396@code{NULL} is returned. To free the data returned by this function,
397use @code{XFree}.
8925f36f
AW
398
399All boolean GLX attributes default to @code{False} except
c7b31271
DH
400@code{GLX_USE_GL}, which defaults to @code{True}. All integer GLX
401attributes default to zero. Default specifications are superseded by
402attributes included in @var{attribList}. Boolean attributes included in
403@var{attribList} are understood to be @code{True}. Integer attributes
8925f36f 404and enumerated type attributes are followed immediately by the
c7b31271
DH
405corresponding desired or minimum value. The list must be terminated
406with @code{None}.
8925f36f
AW
407
408The interpretations of the various GLX visual attributes are as follows:
409
410@table @asis
411@item @code{GLX_USE_GL}
c7b31271 412Ignored. Only visuals that can be rendered with GLX are considered.
8925f36f
AW
413
414@item @code{GLX_BUFFER_SIZE}
415Must be followed by a nonnegative integer that indicates the desired
c7b31271
DH
416color index buffer size. The smallest index buffer of at least the
417specified size is preferred. Ignored if @code{GLX_RGBA} is asserted.
8925f36f
AW
418
419@item @code{GLX_LEVEL}
c7b31271
DH
420Must be followed by an integer buffer-level specification. This
421specification is honored exactly. Buffer level zero corresponds to the
422main frame buffer of the display. Buffer level one is the first overlay
8925f36f
AW
423frame buffer, level two the second overlay frame buffer, and so on.
424Negative buffer levels correspond to underlay frame buffers.
425
426@item @code{GLX_RGBA}
427If present, only TrueColor and DirectColor visuals are considered.
428Otherwise, only PseudoColor and StaticColor visuals are considered.
429
430@item @code{GLX_DOUBLEBUFFER}
c7b31271
DH
431If present, only double-buffered visuals are considered. Otherwise,
432only single-buffered visuals are considered.
8925f36f
AW
433
434@item @code{GLX_STEREO}
c7b31271 435If present, only stereo visuals are considered. Otherwise, only
8925f36f
AW
436monoscopic visuals are considered.
437
438@item @code{GLX_AUX_BUFFERS}
439Must be followed by a nonnegative integer that indicates the desired
c7b31271 440number of auxiliary buffers. Visuals with the smallest number of
8925f36f
AW
441auxiliary buffers that meets or exceeds the specified number are
442preferred.
443
444@item @code{GLX_RED_SIZE}
c7b31271 445Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
446value is zero, the smallest available red buffer is preferred.
447Otherwise, the largest available red buffer of at least the minimum size
448is preferred.
449
450@item @code{GLX_GREEN_SIZE}
c7b31271 451Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
452value is zero, the smallest available green buffer is preferred.
453Otherwise, the largest available green buffer of at least the minimum
454size is preferred.
455
456@item @code{GLX_BLUE_SIZE}
c7b31271 457Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
458value is zero, the smallest available blue buffer is preferred.
459Otherwise, the largest available blue buffer of at least the minimum
460size is preferred.
461
462@item @code{GLX_ALPHA_SIZE}
c7b31271 463Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
464value is zero, the smallest available alpha buffer is preferred.
465Otherwise, the largest available alpha buffer of at least the minimum
466size is preferred.
467
468@item @code{GLX_DEPTH_SIZE}
c7b31271
DH
469Must be followed by a nonnegative minimum size specification. If this
470value is zero, visuals with no depth buffer are preferred. Otherwise,
8925f36f
AW
471the largest available depth buffer of at least the minimum size is
472preferred.
473
474@item @code{GLX_STENCIL_SIZE}
475Must be followed by a nonnegative integer that indicates the desired
c7b31271
DH
476number of stencil bitplanes. The smallest stencil buffer of at least
477the specified size is preferred. If the desired value is zero, visuals
478with no stencil buffer are preferred.
8925f36f
AW
479
480@item @code{GLX_ACCUM_RED_SIZE}
c7b31271 481Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
482value is zero, visuals with no red accumulation buffer are preferred.
483Otherwise, the largest possible red accumulation buffer of at least the
484minimum size is preferred.
485
486@item @code{GLX_ACCUM_GREEN_SIZE}
c7b31271 487Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
488value is zero, visuals with no green accumulation buffer are preferred.
489Otherwise, the largest possible green accumulation buffer of at least
490the minimum size is preferred.
491
492@item @code{GLX_ACCUM_BLUE_SIZE}
c7b31271 493Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
494value is zero, visuals with no blue accumulation buffer are preferred.
495Otherwise, the largest possible blue accumulation buffer of at least the
496minimum size is preferred.
497
498@item @code{GLX_ACCUM_ALPHA_SIZE}
c7b31271 499Must be followed by a nonnegative minimum size specification. If this
8925f36f
AW
500value is zero, visuals with no alpha accumulation buffer are preferred.
501Otherwise, the largest possible alpha accumulation buffer of at least
502the minimum size is preferred.
503
504@end table
505
8925f36f
AW
506@code{NULL} is returned if an undefined GLX attribute is encountered in
507@var{attribList}.
508
bb894c9d 509@end deftypefun
8925f36f 510
bb894c9d 511@deftypefun void glXCopyContext dpy src dst mask
3c9b6116
AW
512Copy state from one rendering context to another.
513
8925f36f
AW
514@table @asis
515@item @var{dpy}
516Specifies the connection to the X server.
517
518@item @var{src}
519Specifies the source context.
520
521@item @var{dst}
522Specifies the destination context.
523
524@item @var{mask}
525Specifies which portions of @var{src} state are to be copied to
526@var{dst}.
527
528@end table
529
8925f36f 530@code{glXCopyContext} copies selected groups of state variables from
c7b31271
DH
531@var{src} to @var{dst}. @var{mask} indicates which groups of state
532variables are to be copied. @var{mask} contains the bitwise OR of the
8925f36f 533same symbolic names that are passed to the GL command
c7b31271 534@code{glPushAttrib}. The single symbolic constant
8925f36f
AW
535@code{GLX_ALL_ATTRIB_BITS} can be used to copy the maximum possible
536portion of rendering state.
537
538The copy can be done only if the renderers named by @var{src} and
c7b31271 539@var{dst} share an address space. Two rendering contexts share an
8925f36f 540address space if both are nondirect using the same server, or if both
c7b31271 541are direct and owned by a single process. Note that in the nondirect
8925f36f
AW
542case it is not necessary for the calling threads to share an address
543space, only for their related rendering contexts to share an address
544space.
545
c7b31271 546Not all values for GL state can be copied. For example, pixel pack and
8925f36f 547unpack state, render mode state, and select and feedback state are not
c7b31271 548copied. The state that can be copied is exactly the state that is
8925f36f
AW
549manipulated by the GL command @code{glPushAttrib}.
550
551An implicit @code{glFlush} is done by @code{glXCopyContext} if @var{src}
552is the current context for the calling thread.
553
8925f36f
AW
554@code{BadMatch} is generated if rendering contexts @var{src} and
555@var{dst} do not share an address space or were not created with respect
556to the same screen.
557
558@code{BadAccess} is generated if @var{dst} is current to any thread
559(including the calling thread) at the time @code{glXCopyContext} is
560called.
561
562@code{GLXBadCurrentWindow} is generated if @var{src} is the current
563context and the current drawable is a window that is no longer valid.
564
565@code{GLXBadContext} is generated if either @var{src} or @var{dst} is
566not a valid GLX context.
567
bb894c9d 568@end deftypefun
8925f36f 569
bb894c9d 570@deftypefun GLXContext glXCreateContext dpy vis shareList direct
3c9b6116
AW
571Create a new GLX rendering context.
572
8925f36f
AW
573@table @asis
574@item @var{dpy}
575Specifies the connection to the X server.
576
577@item @var{vis}
578Specifies the visual that defines the frame buffer resources available
c7b31271 579to the rendering context. It is a pointer to an @code{XVisualInfo}
8925f36f
AW
580structure, not a visual ID or a pointer to a @code{Visual}.
581
582@item @var{shareList}
c7b31271 583Specifies the context with which to share display lists. @code{NULL}
8925f36f
AW
584indicates that no sharing is to take place.
585
586@item @var{direct}
587Specifies whether rendering is to be done with a direct connection to
588the graphics system if possible (@code{True}) or through the X server
589(@code{False}).
590
591@end table
592
8925f36f 593@code{glXCreateContext} creates a GLX rendering context and returns its
c7b31271
DH
594handle. This context can be used to render into both windows and GLX
595pixmaps. If @code{glXCreateContext} fails to create a rendering
596context, @code{NULL} is returned.
8925f36f
AW
597
598If @var{direct} is @code{True}, then a direct rendering context is
599created if the implementation supports direct rendering, if the
600connection is to an X server that is local, and if a direct rendering
c7b31271 601context is available. (An implementation may return an indirect context
8925f36f
AW
602when @var{direct} is @code{True}.) If @var{direct} is @code{False}, then
603a rendering context that renders through the X server is always created.
604Direct rendering provides a performance advantage in some
c7b31271 605implementations. However, direct rendering contexts cannot be shared
8925f36f
AW
606outside a single process, and they may be unable to render to GLX
607pixmaps.
608
609If @var{shareList} is not @code{NULL}, then all display-list indexes and
610definitions are shared by context @var{shareList} and by the newly
c7b31271
DH
611created context. An arbitrary number of contexts can share a single
612display-list space. However, all rendering contexts that share a single
613display-list space must themselves exist in the same address space. Two
8925f36f
AW
614rendering contexts share an address space if both are nondirect using
615the same server, or if both are direct and owned by a single process.
616Note that in the nondirect case, it is not necessary for the calling
617threads to share an address space, only for their related rendering
618contexts to share an address space.
619
620If the GL version is 1.1 or greater, then all texture objects except
621object 0 are shared by any contexts that share display lists.
622
8925f36f
AW
623@code{NULL} is returned if execution fails on the client side.
624
625@code{BadMatch} is generated if the context to be created would not
626share the address space or the screen of the context specified by
627@var{shareList}.
628
629@code{BadValue} is generated if @var{vis} is not a valid visual (for
630example, if a particular GLX implementation does not support it).
631
632@code{GLXBadContext} is generated if @var{shareList} is not a GLX
633context and is not @code{NULL}.
634
635@code{BadAlloc} is generated if the server does not have enough
636resources to allocate the new context.
637
bb894c9d 638@end deftypefun
8925f36f 639
bb894c9d 640@deftypefun GLXPixmap glXCreateGLXPixmap dpy vis pixmap
3c9b6116
AW
641Create an off-screen GLX rendering area.
642
8925f36f
AW
643@table @asis
644@item @var{dpy}
645Specifies the connection to the X server.
646
647@item @var{vis}
648Specifies the visual that defines the structure of the rendering area.
649It is a pointer to an @code{XVisualInfo} structure, not a visual ID or a
650pointer to a @code{Visual}.
651
652@item @var{pixmap}
653Specifies the X pixmap that will be used as the front left color buffer
654of the off-screen rendering area.
655
656@end table
657
8925f36f 658@code{glXCreateGLXPixmap} creates an off-screen rendering area and
c7b31271
DH
659returns its XID. Any GLX rendering context that was created with
660respect to @var{vis} can be used to render into this off-screen area.
661Use @code{glXMakeCurrent} to associate the rendering area with a GLX
8925f36f
AW
662rendering context.
663
664The X pixmap identified by @var{pixmap} is used as the front left buffer
c7b31271 665of the resulting off-screen rendering area. All other buffers specified
8925f36f 666by @var{vis}, including color buffers other than the front left buffer,
c7b31271
DH
667are created without externally visible names. GLX pixmaps with
668double-buffering are supported. However, @code{glXSwapBuffers} is
8925f36f
AW
669ignored by these pixmaps.
670
671Some implementations may not support GLX pixmaps with direct rendering
672contexts.
673
8925f36f
AW
674@code{BadMatch} is generated if the depth of @var{pixmap} does not match
675the depth value reported by core X11 for @var{vis}, or if @var{pixmap}
676was not created with respect to the same screen as @var{vis}.
677
678@code{BadValue} is generated if @var{vis} is not a valid XVisualInfo
679pointer (for example, if a particular GLX implementation does not
680support this visual).
681
682@code{BadPixmap} is generated if @var{pixmap} is not a valid pixmap.
683
684@code{BadAlloc} is generated if the server cannot allocate the GLX
685pixmap.
686
bb894c9d 687@end deftypefun
8925f36f 688
bb894c9d 689@deftypefun GLXContext glXCreateNewContext dpy config render_type share_list direct
3c9b6116
AW
690Create a new GLX rendering context.
691
8925f36f
AW
692@table @asis
693@item @var{dpy}
694Specifies the connection to the X server.
695
696@item @var{config}
697Specifies the GLXFBConfig structure with the desired attributes for the
698context.
699
700@item @var{render_type}
c7b31271 701Specifies the type of the context to be created. Must be one of
8925f36f
AW
702@code{GLX_RGBA_TYPE} or @code{GLX_COLOR_INDEX_TYPE}.
703
704@item @var{share_list}
c7b31271 705Specifies the context with which to share display lists. @code{NULL}
8925f36f
AW
706indicates that no sharing is to take place.
707
708@item @var{share_list}
709Specifies whether rendering is to be done with a direct connection to
710the graphics system if possible (@code{True}) or through the X server
711(@code{False}).
712
713@end table
714
8925f36f 715@code{glXCreateNewContext} creates a GLX rendering context and returns
c7b31271
DH
716its handle. This context can be used to render into GLX windows,
717pixmaps, or pixel buffers. If @code{glXCreateNewContext} fails to
718create a rendering context, @code{NULL} is returned.
8925f36f
AW
719
720If @var{render_type} is @code{GLX_RGBA_TYPE}, then a context that
c7b31271 721supports RGBA rendering is created. If @var{config} is
8925f36f
AW
722@code{GLX_COLOR_INDEX_TYPE}, then context supporting color-index
723rendering is created.
724
725If @var{render_type} is not @code{NULL}, then all display-list indexes
726and definitions are shared by context @var{render_type} and by the newly
c7b31271
DH
727created context. An arbitrary number of contexts can share a single
728display-list space. However, all rendering contexts that share a single
729display-list space must themselves exist in the same address space. Two
8925f36f
AW
730rendering contexts share an address space if both are nondirect using
731the same server, or if both are direct and owned by a single process.
732Note that in the nondirect case, it is not necessary for the calling
733threads to share an address space, only for their related rendering
734contexts to share an address space.
735
736If @var{share_list} is @code{True}, then a direct-rendering context is
737created if the implementation supports direct rendering, if the
738connection is to an X server that is local, and if a direct-rendering
c7b31271 739context is available. (An implementation may return an indirect context
8925f36f
AW
740when @var{share_list} is @code{True}.) If @var{share_list} is
741@code{False}, then a rendering context that renders through the X server
c7b31271
DH
742is always created. Direct rendering provides a performance advantage in
743some implementations. However, direct-rendering contexts cannot be
8925f36f
AW
744shared outside a single process, and they may be unable to render to GLX
745pixmaps.
746
8925f36f
AW
747@code{NULL} is returned if execution fails on the client side.
748
749@code{GLXBadContext} is generated if @var{render_type} is not a GLX
750context and is not @code{NULL}.
751
752@code{GLXBadFBConfig} is generated if @var{config} is not a valid
753GLXFBConfig.
754
755@code{BadMatch} is generated if the context to be created would not
756share the address space or the screen of the context specified by
757@var{render_type}.
758
759@code{BadAlloc} is generated if the server does not have enough
760resources to allocate the new context.
761
762@code{BadValue} is generated if @var{config} is not a valid visual (for
763example, if a particular GLX implementation does not support it).
764
bb894c9d 765@end deftypefun
8925f36f 766
bb894c9d 767@deftypefun GLXPbuffer glXCreatePbuffer dpy config attrib_list
3c9b6116
AW
768Create an off-screen rendering area.
769
8925f36f
AW
770@table @asis
771@item @var{dpy}
772Specifies the connection to the X server.
773
774@item @var{config}
775Specifies a GLXFBConfig structure with the desired attributes for the
776window.
777
778@item @var{attrib_list}
779Specifies a list of attribute value pairs, which must be terminated with
c7b31271 780@code{None} or @code{NULL}. Accepted attributes are
8925f36f
AW
781@code{GLX_PBUFFER_WIDTH}, @code{GLX_PBUFFER_HEIGHT},
782@code{GLX_PRESERVED_CONTENTS}, and @code{GLX_LARGEST_PBUFFER}.
783
784@end table
785
8925f36f 786@code{glXCreatePbuffer} creates an off-screen rendering area and returns
c7b31271
DH
787its XID. Any GLX rendering context that was created with respect to
788@var{config} can be used to render into this window. Use
8925f36f
AW
789@code{glXMakeContextCurrent} to associate the rendering area with a GLX
790rendering context.
791
792The accepted attributes for a GLXPbuffer are:
793
794@table @asis
795@item @code{GLX_PBUFFER_WIDTH}
c7b31271 796Specify the pixel width of the requested GLXPbuffer. The default value
8925f36f
AW
797is 0.
798
799@item @code{GLX_PBUFFER_HEIGHT}
c7b31271 800Specify the pixel height of the requested GLXPbuffer. The default value
8925f36f
AW
801is 0.
802
803@item @code{GLX_LARGEST_PBUFFER}
804Specify to obtain the largest available pixel buffer, if the requested
c7b31271 805allocation would have failed. The width and height of the allocated
8925f36f 806pixel buffer will never exceed the specified @code{GLX_PBUFFER_WIDTH} or
c7b31271
DH
807@code{GLX_PBUFFER_HEIGHT}, respectively. Use @code{glXQueryDrawable} to
808retrieve the dimensions of the allocated pixel buffer. The default
809value is @code{False}.
8925f36f
AW
810
811@item @code{GLX_PRESERVED_CONTENTS}
812Specify if the contents of the pixel buffer should be preserved when a
c7b31271
DH
813resource conflict occurs. If set to @code{False}, the contents of the
814pixel buffer may be lost at any time. If set to @code{True}, or not
8925f36f
AW
815specified in @var{attrib_list}, then the contents of the pixel buffer
816will be preserved (most likely by copying the contents into main system
c7b31271 817memory from the frame buffer). In either case, the client can register
8925f36f
AW
818(using @code{glXSelectEvent}, to receive pixel buffer clobber events
819that are generated when the pbuffer contents have been preserved or
820damaged.
821
822@end table
823
824GLXPbuffers contain the color and ancillary buffers specified by
c7b31271 825@var{config}. It is possible to create a pixel buffer with back buffers
8925f36f
AW
826and to swap those buffers using @code{glXSwapBuffers}.
827
8925f36f
AW
828@code{BadAlloc} is generated if there are insufficient resources to
829allocate the requested GLXPbuffer.
830
831@code{GLXBadFBConfig} is generated if @var{config} is not a valid
832GLXFBConfig.
833
834@code{BadMatch} is generated if @var{config} does not support rendering
835to pixel buffers (e.g., @code{GLX_DRAWABLE_TYPE} does not contain
836@code{GLX_PBUFFER_BIT}).
837
bb894c9d 838@end deftypefun
8925f36f 839
bb894c9d 840@deftypefun GLXPixmap glXCreatePixmap dpy config pixmap attrib_list
3c9b6116
AW
841Create an off-screen rendering area.
842
8925f36f
AW
843@table @asis
844@item @var{dpy}
845Specifies the connection to the X server.
846
847@item @var{config}
848Specifies a GLXFBConfig structure with the desired attributes for the
849window.
850
851@item @var{pixmap}
852Specifies the X pixmap to be used as the rendering area.
853
854@item @var{attrib_list}
c7b31271 855Currently unused. This must be set to @code{NULL} or be an empty list
8925f36f
AW
856(i.e., one in which the first element is @code{None}).
857
858@end table
859
8925f36f 860@code{glXCreatePixmap} creates an off-screen rendering area and returns
c7b31271
DH
861its XID. Any GLX rendering context that was created with respect to
862@var{config} can be used to render into this window. Use
8925f36f
AW
863@code{glXMakeCurrent} to associate the rendering area with a GLX
864rendering context.
865
8925f36f
AW
866@code{BadMatch} is generated if @var{pixmap} was not created with a
867visual that corresponds to @var{config}.
868
869@code{BadMatch} is generated if @var{config} does not support rendering
870to windows (e.g., @code{GLX_DRAWABLE_TYPE} does not contain
871@code{GLX_WINDOW_BIT}).
872
873@code{BadWindow} is generated if @var{pixmap} is not a valid window XID.
874@code{BadAlloc} is generated if there is already a GLXFBConfig
875associated with @var{pixmap}.
876
877@code{BadAlloc} is generated if the X server cannot allocate a new GLX
878window.
879
880@code{GLXBadFBConfig} is generated if @var{config} is not a valid
881GLXFBConfig.
882
883
884
bb894c9d 885@end deftypefun
8925f36f 886
bb894c9d 887@deftypefun GLXWindow glXCreateWindow dpy config win attrib_list
3c9b6116
AW
888Create an on-screen rendering area.
889
8925f36f
AW
890@table @asis
891@item @var{dpy}
892Specifies the connection to the X server.
893
894@item @var{config}
895Specifies a GLXFBConfig structure with the desired attributes for the
896window.
897
898@item @var{win}
899Specifies the X window to be used as the rendering area.
900
901@item @var{attrib_list}
c7b31271 902Currently unused. This must be set to @code{NULL} or be an empty list
8925f36f
AW
903(i.e., one in which the first element is @code{None}).
904
905@end table
906
8925f36f
AW
907@code{glXCreateWindow} creates an on-screen rendering area from an
908existing X window that was created with a visual matching @var{config}.
c7b31271
DH
909The XID of the GLXWindow is returned. Any GLX rendering context that
910was created with respect to @var{config} can be used to render into this
911window. Use @code{glXMakeContextCurrent} to associate the rendering
912area with a GLX rendering context.
8925f36f 913
8925f36f
AW
914@code{BadMatch} is generated if @var{win} was not created with a visual
915that corresponds to @var{config}.
916
917@code{BadMatch} is generated if @var{config} does not support rendering
918to windows (i.e., @code{GLX_DRAWABLE_TYPE} does not contain
919@code{GLX_WINDOW_BIT}).
920
921@code{BadWindow} is generated if @var{win} is not a valid pixmap XID.
922
923@code{BadAlloc} is generated if there is already a GLXFBConfig
924associated with @var{win}.
925
926@code{BadAlloc} is generated if the X server cannot allocate a new GLX
927window.
928
929@code{GLXBadFBConfig} is generated if @var{config} is not a valid
930GLXFBConfig.
931
932
933
bb894c9d 934@end deftypefun
8925f36f 935
bb894c9d 936@deftypefun void glXDestroyContext dpy ctx
3c9b6116
AW
937Destroy a GLX context.
938
8925f36f
AW
939@table @asis
940@item @var{dpy}
941Specifies the connection to the X server.
942
943@item @var{ctx}
944Specifies the GLX context to be destroyed.
945
946@end table
947
8925f36f 948If the GLX rendering context @var{ctx} is not current to any thread,
c7b31271
DH
949@code{glXDestroyContext} destroys it immediately. Otherwise, @var{ctx}
950is destroyed when it becomes not current to any thread. In either case,
8925f36f
AW
951the resource ID referenced by @var{ctx} is freed immediately.
952
8925f36f
AW
953@code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
954context.
955
bb894c9d 956@end deftypefun
8925f36f 957
bb894c9d 958@deftypefun void glXDestroyGLXPixmap dpy pix
3c9b6116
AW
959Destroy a GLX pixmap.
960
8925f36f
AW
961@table @asis
962@item @var{dpy}
963Specifies the connection to the X server.
964
965@item @var{pix}
966Specifies the GLX pixmap to be destroyed.
967
968@end table
969
8925f36f 970If the GLX pixmap @var{pix} is not current to any client,
c7b31271
DH
971@code{glXDestroyGLXPixmap} destroys it immediately. Otherwise,
972@var{pix} is destroyed when it becomes not current to any client. In
973either case, the resource ID is freed immediately.
8925f36f 974
8925f36f
AW
975@code{GLXBadPixmap} is generated if @var{pix} is not a valid GLX pixmap.
976
bb894c9d 977@end deftypefun
8925f36f 978
bb894c9d 979@deftypefun void glXDestroyPbuffer dpy pbuf
3c9b6116
AW
980Destroy an off-screen rendering area.
981
8925f36f
AW
982@table @asis
983@item @var{dpy}
984Specifies the connection to the X server.
985
986@item @var{pbuf}
987Specifies the GLXPbuffer to be destroyed.
988
989@end table
990
8925f36f
AW
991@code{glXDestroyPbuffer} destroys a GLXPbuffer created by
992@code{glXCreatePbuffer}.
993
8925f36f
AW
994@code{GLXBadPbuffer} is generated if @var{pbuf} is not a valid
995GLXPbuffer.
996
bb894c9d 997@end deftypefun
8925f36f 998
bb894c9d 999@deftypefun void glXDestroyPixmap dpy pixmap
3c9b6116
AW
1000Destroy an off-screen rendering area.
1001
8925f36f
AW
1002@table @asis
1003@item @var{dpy}
1004Specifies the connection to the X server.
1005
1006@item @var{pixmap}
1007Specifies the GLXPixmap to be destroyed.
1008
1009@end table
1010
8925f36f
AW
1011@code{glXDestroyPixmap} destroys a GLXPixmap created by
1012@code{glXCreatePixmap}.
1013
8925f36f
AW
1014@code{GLXBadPixmap} is generated if @var{pixmap} is not a valid
1015GLXPixmap.
1016
bb894c9d 1017@end deftypefun
8925f36f 1018
bb894c9d 1019@deftypefun void glXDestroyWindow dpy win
3c9b6116
AW
1020Destroy an on-screen rendering area.
1021
8925f36f
AW
1022@table @asis
1023@item @var{dpy}
1024Specifies the connection to the X server.
1025
1026@item @var{win}
1027Specifies the GLXWindow to be destroyed.
1028
1029@end table
1030
8925f36f
AW
1031@code{glXDestroyWindow} destroys a GLXWindow created by
1032@code{glXCreateWindow}.
1033
8925f36f
AW
1034@code{GLXBadWindow} is generated if @var{win} is not a valid GLXPixmap.
1035
bb894c9d 1036@end deftypefun
8925f36f 1037
bb894c9d 1038@deftypefun void glXFreeContextEXT dpy ctx
3c9b6116
AW
1039Free client-side memory for imported context.
1040
8925f36f
AW
1041@table @asis
1042@item @var{dpy}
1043Specifies the connection to the X server.
1044
1045@item @var{ctx}
1046Specifies a GLX rendering context.
1047
1048@end table
1049
8925f36f 1050@code{glXFreeContextEXT} frees the client-side part of a GLXContext that
c7b31271 1051was created with @code{glXImportContextEXT}. @code{glXFreeContextEXT}
8925f36f
AW
1052does not free the server-side context information or the XID associated
1053with the server-side context.
1054
1055@code{glXFreeContextEXT} is part of the @code{EXT_import_context}
c7b31271 1056extension, not part of the core GLX command set. If
8925f36f
AW
1057_glxextstring(EXT_import_context) is included in the string returned by
1058@code{glXQueryExtensionsString}, when called with argument
1059@code{GLX_EXTENSIONS}, extension @code{EXT_vertex_array} is supported.
1060
8925f36f
AW
1061@code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1062context.
1063
bb894c9d 1064@end deftypefun
8925f36f 1065
00239761 1066@deftypefun const-char-* glXGetClientString dpy name
3c9b6116
AW
1067Return a string describing the client.
1068
8925f36f
AW
1069@table @asis
1070@item @var{dpy}
1071Specifies the connection to the X server.
1072
1073@item @var{name}
c7b31271 1074Specifies which string is returned. The symbolic constants
8925f36f
AW
1075@code{GLX_VENDOR}, @code{GLX_VERSION}, and @code{GLX_EXTENSIONS} are
1076accepted.
1077
1078@end table
1079
8925f36f 1080@code{glXGetClientString} returns a string describing some aspect of the
c7b31271
DH
1081client library. The possible values for @var{name} are
1082@code{GLX_VENDOR}, @code{GLX_VERSION}, and @code{GLX_EXTENSIONS}. If
8925f36f 1083@var{name} is not set to one of these values, @code{glXGetClientString}
c7b31271 1084returns @code{NULL}. The format and contents of the vendor string is
8925f36f
AW
1085implementation dependent.
1086
1087The extensions string is null-terminated and contains a space-separated
c7b31271 1088list of extension names. (The extension names never contain spaces.) If
8925f36f
AW
1089there are no extensions to GLX, then the empty string is returned.
1090
1091The version string is laid out as follows:
1092
1093<major_version.minor_version><space><vendor-specific info>
1094
1095Both the major and minor portions of the version number are of arbitrary
c7b31271 1096length. The vendor-specific information is optional. However, if it is
8925f36f
AW
1097present, the format and contents are implementation specific.
1098
bb894c9d 1099@end deftypefun
8925f36f 1100
bb894c9d 1101@deftypefun int glXGetConfig dpy vis attrib value
3c9b6116
AW
1102Return information about GLX visuals.
1103
8925f36f
AW
1104@table @asis
1105@item @var{dpy}
1106Specifies the connection to the X server.
1107
1108@item @var{vis}
c7b31271 1109Specifies the visual to be queried. It is a pointer to an
8925f36f
AW
1110@code{XVisualInfo} structure, not a visual ID or a pointer to a
1111@code{Visual}.
1112
1113@item @var{attrib}
1114Specifies the visual attribute to be returned.
1115
1116@item @var{value}
1117Returns the requested value.
1118
1119@end table
1120
8925f36f
AW
1121@code{glXGetConfig} sets @var{value} to the @var{attrib} value of
1122windows or GLX pixmaps created with respect to @var{vis}.
1123@code{glXGetConfig} returns an error code if it fails for any reason.
1124Otherwise, zero is returned.
1125
1126@var{attrib} is one of the following:
1127
1128
1129
1130@table @asis
1131@item @code{GLX_USE_GL}
1132@code{True} if OpenGL rendering is supported by this visual,
1133@code{False} otherwise.
1134
1135@item @code{GLX_BUFFER_SIZE}
c7b31271 1136Number of bits per color buffer. For RGBA visuals,
8925f36f
AW
1137@code{GLX_BUFFER_SIZE} is the sum of @code{GLX_RED_SIZE},
1138@code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and @code{GLX_ALPHA_SIZE}.
1139For color index visuals, @code{GLX_BUFFER_SIZE} is the size of the color
1140indexes.
1141
1142@item @code{GLX_LEVEL}
c7b31271
DH
1143Frame buffer level of the visual. Level zero is the default frame
1144buffer. Positive levels correspond to frame buffers that overlay the
8925f36f
AW
1145default buffer, and negative levels correspond to frame buffers that
1146underlay the default buffer.
1147
1148@item @code{GLX_RGBA}
1149@code{True} if color buffers store red, green, blue, and alpha values.
1150@code{False} if they store color indexes.
1151
1152@item @code{GLX_DOUBLEBUFFER}
1153@code{True} if color buffers exist in front/back pairs that can be
1154swapped, @code{False} otherwise.
1155
1156@item @code{GLX_STEREO}
1157@code{True} if color buffers exist in left/right pairs, @code{False}
1158otherwise.
1159
1160@item @code{GLX_AUX_BUFFERS}
c7b31271 1161Number of auxiliary color buffers that are available. Zero indicates
8925f36f
AW
1162that no auxiliary color buffers exist.
1163
1164@item @code{GLX_RED_SIZE}
c7b31271 1165Number of bits of red stored in each color buffer. Undefined if
8925f36f
AW
1166@code{GLX_RGBA} is @code{False}.
1167
1168@item @code{GLX_GREEN_SIZE}
c7b31271 1169Number of bits of green stored in each color buffer. Undefined if
8925f36f
AW
1170@code{GLX_RGBA} is @code{False}.
1171
1172@item @code{GLX_BLUE_SIZE}
c7b31271 1173Number of bits of blue stored in each color buffer. Undefined if
8925f36f
AW
1174@code{GLX_RGBA} is @code{False}.
1175
1176@item @code{GLX_ALPHA_SIZE}
c7b31271 1177Number of bits of alpha stored in each color buffer. Undefined if
8925f36f
AW
1178@code{GLX_RGBA} is @code{False}.
1179
1180@item @code{GLX_DEPTH_SIZE}
1181Number of bits in the depth buffer.
1182
1183@item @code{GLX_STENCIL_SIZE}
1184Number of bits in the stencil buffer.
1185
1186@item @code{GLX_ACCUM_RED_SIZE}
1187Number of bits of red stored in the accumulation buffer.
1188
1189@item @code{GLX_ACCUM_GREEN_SIZE}
1190Number of bits of green stored in the accumulation buffer.
1191
1192@item @code{GLX_ACCUM_BLUE_SIZE}
1193Number of bits of blue stored in the accumulation buffer.
1194
1195@item @code{GLX_ACCUM_ALPHA_SIZE}
1196Number of bits of alpha stored in the accumulation buffer.
1197
1198@end table
1199
1200The X protocol allows a single visual ID to be instantiated with
c7b31271
DH
1201different numbers of bits per pixel. Windows or GLX pixmaps that will
1202be rendered with OpenGL, however, must be instantiated with a color
1203buffer depth of @code{GLX_BUFFER_SIZE}.
8925f36f
AW
1204
1205Although a GLX implementation can export many visuals that support GL
c7b31271 1206rendering, it must support at least one RGBA visual. This visual must
8925f36f 1207have at least one color buffer, a stencil buffer of at least 1 bit, a
c7b31271
DH
1208depth buffer of at least 12 bits, and an accumulation buffer. Alpha
1209bitplanes are optional in this visual. However, its color buffer size
8925f36f
AW
1210must be as great as that of the deepest @code{TrueColor},
1211@code{DirectColor}, @code{PseudoColor}, or @code{StaticColor} visual
1212supported on level zero, and it must itself be made available on level
1213zero.
1214
1215In addition, if the X server exports a @code{PseudoColor} or
1216@code{StaticColor} visual on framebuffer level 0, a color index visual
c7b31271 1217is also required on that level. It must have at least one color buffer,
8925f36f 1218a stencil buffer of at least 1 bit, and a depth buffer of at least 12
c7b31271 1219bits. This visual must have as many color bitplanes as the deepest
8925f36f
AW
1220@code{PseudoColor} or @code{StaticColor} visual supported on level 0.
1221
1222Applications are best written to select the visual that most closely
c7b31271 1223meets their requirements. Creating windows or GLX pixmaps with
8925f36f
AW
1224unnecessary buffers can result in reduced rendering performance as well
1225as poor resource allocation.
1226
8925f36f
AW
1227@code{GLX_NO_EXTENSION} is returned if @var{dpy} does not support the
1228GLX extension.
1229
1230@code{GLX_BAD_SCREEN} is returned if the screen of @var{vis} does not
1231correspond to a screen.
1232
1233@code{GLX_BAD_ATTRIBUTE} is returned if @var{attrib} is not a valid GLX
1234attribute.
1235
1236@code{GLX_BAD_VISUAL} is returned if @var{vis} doesn't support GLX and
1237an attribute other than @code{GLX_USE_GL} is requested.
1238
bb894c9d 1239@end deftypefun
8925f36f 1240
bb894c9d 1241@deftypefun GLXContextID glXGetContextIDEXT ctx
3c9b6116
AW
1242Get the XID for a context..
1243
8925f36f
AW
1244@table @asis
1245@item @var{ctx}
1246Specifies a GLX rendering context.
1247
1248@end table
1249
8925f36f
AW
1250@code{glXGetContextIDEXT} returns the XID associated with a GLXContext.
1251
1252No round trip is forced to the server; unlike most X calls that return a
1253value, @code{glXGetContextIDEXT} does not flush any pending events.
1254
1255@code{glXGetContextIDEXT} is part of the @code{EXT_import_context}
c7b31271 1256extension, not part of the core GLX command set. If
8925f36f
AW
1257_glxextstring(EXT_import_context) is included in the string returned by
1258@code{glXQueryExtensionsString}, when called with argument
1259@code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1260
8925f36f
AW
1261@code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1262context.
1263
bb894c9d 1264@end deftypefun
8925f36f 1265
bb894c9d 1266@deftypefun GLXContext glXGetCurrentContext
3c9b6116
AW
1267Return the current context.
1268
8925f36f 1269@code{glXGetCurrentContext} returns the current context, as specified by
c7b31271 1270@code{glXMakeCurrent}. If there is no current context, @code{NULL} is
8925f36f
AW
1271returned.
1272
c7b31271
DH
1273@code{glXGetCurrentContext} returns client-side information. It does
1274not make a round trip to the server.
8925f36f
AW
1275
1276
1277
bb894c9d 1278@end deftypefun
8925f36f 1279
00239761 1280@deftypefun Display-* glXGetCurrentDisplay
3c9b6116
AW
1281Get display for current context.
1282
8925f36f
AW
1283@code{glXGetCurrentDisplay} returns the display for the current context.
1284If no context is current, @code{NULL} is returned.
1285
c7b31271
DH
1286@code{glXGetCurrentDisplay} returns client-side information. It does
1287not make a round-trip to the server, and therefore does not flush any
8925f36f
AW
1288pending events.
1289
bb894c9d 1290@end deftypefun
8925f36f 1291
bb894c9d 1292@deftypefun GLXDrawable glXGetCurrentDrawable
3c9b6116
AW
1293Return the current drawable.
1294
8925f36f 1295@code{glXGetCurrentDrawable} returns the current drawable, as specified
c7b31271 1296by @code{glXMakeCurrent}. If there is no current drawable, @code{None}
8925f36f
AW
1297is returned.
1298
c7b31271 1299@code{glXGetCurrentDrawable} returns client-side information. It does
8925f36f
AW
1300not make a round trip to the server.
1301
bb894c9d 1302@end deftypefun
8925f36f 1303
bb894c9d 1304@deftypefun GLXDrawable glXGetCurrentReadDrawable
3c9b6116
AW
1305Return the current drawable.
1306
8925f36f 1307@code{glXGetCurrentReadDrawable} returns the current read drawable, as
c7b31271 1308specified by @code{read} parameter of @code{glXMakeContextCurrent}. If
8925f36f
AW
1309there is no current drawable, @code{None} is returned.
1310
c7b31271 1311@code{glXGetCurrentReadDrawable} returns client-side information. It
8925f36f
AW
1312does not make a round-trip to the server.
1313
bb894c9d 1314@end deftypefun
8925f36f 1315
bb894c9d 1316@deftypefun int glXGetFBConfigAttrib dpy config attribute value
3c9b6116
AW
1317Return information about a GLX frame buffer configuration.
1318
8925f36f
AW
1319@table @asis
1320@item @var{dpy}
1321Specifies the connection to the X server.
1322
1323@item @var{config}
1324Specifies the GLX frame buffer configuration to be queried.
1325
1326@item @var{attribute}
1327Specifies the attribute to be returned.
1328
1329@item @var{value}
1330Returns the requested value.
1331
1332@end table
1333
8925f36f
AW
1334@code{glXGetFBConfigAttrib} sets @var{value} to the @var{attribute}
1335value of GLX drawables created with respect to @var{config}.
1336@code{glXGetFBConfigAttrib} returns an error code if it fails for any
c7b31271 1337reason. Otherwise, @code{Success} is returned.
8925f36f
AW
1338
1339@var{attribute} is one of the following:
1340
1341
1342
1343@table @asis
1344@item @code{GLX_FBCONFIG_ID}
1345XID of the given GLXFBConfig.
1346
1347@item @code{GLX_BUFFER_SIZE}
1348
1349
c7b31271 1350Number of bits per color buffer. If the frame buffer configuration
8925f36f
AW
1351supports RGBA contexts, then @code{GLX_BUFFER_SIZE} is the sum of
1352@code{GLX_RED_SIZE}, @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and
c7b31271 1353@code{GLX_ALPHA_SIZE}. If the frame buffer configuration supports only
8925f36f
AW
1354color index contexts, @code{GLX_BUFFER_SIZE} is the size of the color
1355indexes.
1356
1357@item @code{GLX_LEVEL}
1358
1359
c7b31271
DH
1360Frame buffer level of the configuration. Level zero is the default
1361frame buffer. Positive levels correspond to frame buffers that overlay
1362the default buffer, and negative levels correspond to frame buffers that
8925f36f
AW
1363underlie the default buffer.
1364
1365@item @code{GLX_DOUBLEBUFFER}
1366
1367
1368@code{True} if color buffers exist in front/back pairs that can be
1369swapped, @code{False} otherwise.
1370
1371@item @code{GLX_STEREO}
1372
1373
1374@code{True} if color buffers exist in left/right pairs, @code{False}
1375otherwise.
1376
1377@item @code{GLX_AUX_BUFFERS}
1378
1379
c7b31271 1380Number of auxiliary color buffers that are available. Zero indicates
8925f36f
AW
1381that no auxiliary color buffers exist.
1382
1383@item @code{GLX_RED_SIZE}
1384
1385
c7b31271 1386Number of bits of red stored in each color buffer. Undefined if RGBA
8925f36f
AW
1387contexts are not supported by the frame buffer configuration.
1388
1389@item @code{GLX_GREEN_SIZE}
1390
1391
c7b31271 1392Number of bits of green stored in each color buffer. Undefined if RGBA
8925f36f
AW
1393contexts are not supported by the frame buffer configuration.
1394
1395@item @code{GLX_BLUE_SIZE}
1396
1397
c7b31271 1398Number of bits of blue stored in each color buffer. Undefined if RGBA
8925f36f
AW
1399contexts are not supported by the frame buffer configuration.
1400
1401@item @code{GLX_ALPHA_SIZE}
1402
1403
c7b31271 1404Number of bits of alpha stored in each color buffer. Undefined if RGBA
8925f36f
AW
1405contexts are not supported by the frame buffer configuration.
1406
1407@item @code{GLX_DEPTH_SIZE}
1408
1409
1410Number of bits in the depth buffer.
1411
1412@item @code{GLX_STENCIL_SIZE}
1413
1414
1415Number of bits in the stencil buffer.
1416
1417@item @code{GLX_ACCUM_RED_SIZE}
1418
1419
1420Number of bits of red stored in the accumulation buffer.
1421
1422@item @code{GLX_ACCUM_GREEN_SIZE}
1423
1424
1425Number of bits of green stored in the accumulation buffer.
1426
1427@item @code{GLX_ACCUM_BLUE_SIZE}
1428
1429
1430Number of bits of blue stored in the accumulation buffer.
1431
1432@item @code{GLX_ACCUM_ALPHA_SIZE}
1433
1434
1435Number of bits of alpha stored in the accumulation buffer.
1436
1437@item @code{GLX_RENDER_TYPE}
1438
1439
1440Mask indicating what type of GLX contexts can be made current to the
c7b31271 1441frame buffer configuration. Valid bits are @code{GLX_RGBA_BIT} and
8925f36f
AW
1442@code{GLX_COLOR_INDEX_BIT}.
1443
1444@item @code{GLX_DRAWABLE_TYPE}
1445
1446
1447Mask indicating what drawable types the frame buffer configuration
c7b31271 1448supports. Valid bits are @code{GLX_WINDOW_BIT}, @code{GLX_PIXMAP_BIT},
8925f36f
AW
1449and @code{GLX_PBUFFER_BIT}.
1450
1451@item @code{GLX_X_RENDERABLE}
1452
1453
1454@code{True} if drawables created with the frame buffer configuration can
1455be rendered to by X.
1456
1457@item @code{GLX_VISUAL_ID}
1458
1459
1460XID of the corresponding visual, or zero if there is no associated
1461visual (i.e., if @code{GLX_X_RENDERABLE} is @code{False} or
1462@code{GLX_DRAWABLE_TYPE} does not have the @code{GLX_WINDOW_BIT} bit
1463set).
1464
1465@item @code{GLX_X_VISUAL_TYPE}
1466
1467
c7b31271 1468Visual type of associated visual. The returned value will be one of:
8925f36f
AW
1469@code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
1470@code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, @code{GLX_STATIC_GRAY},
1471or @code{GLX_NONE}, if there is no associated visual (i.e., if
1472@code{GLX_X_RENDERABLE} is @code{False} or @code{GLX_DRAWABLE_TYPE} does
1473not have the @code{GLX_WINDOW_BIT} bit set).
1474
1475@item @code{GLX_CONFIG_CAVEAT}
1476
1477
1478One of @code{GLX_NONE}, @code{GLX_SLOW_CONFIG}, or
1479@code{GLX_NON_CONFORMANT_CONFIG}, indicating that the frame buffer
1480configuration has no caveats, some aspect of the frame buffer
1481configuration runs slower than other frame buffer configurations, or
1482some aspect of the frame buffer configuration is nonconformant,
1483respectively.
1484
1485@item @code{GLX_TRANSPARENT_TYPE}
1486
1487
1488One of @code{GLX_NONE}, @code{GLX_TRANSPARENT_RGB},
1489@code{GLX_TRANSPARENT_INDEX}, indicating that the frame buffer
1490configuration is opaque, is transparent for particular values of red,
1491green, and blue, or is transparent for particular index values,
1492respectively.
1493
1494@item @code{GLX_TRANSPARENT_INDEX_VALUE}
1495
1496
1497Integer value between 0 and the maximum frame buffer value for indices,
1498indicating the transparent index value for the frame buffer
c7b31271 1499configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
8925f36f
AW
1500@code{GLX_TRANSPARENT_INDEX}.
1501
1502@item @code{GLX_TRANSPARENT_RED_VALUE}
1503
1504
1505Integer value between 0 and the maximum frame buffer value for red,
1506indicating the transparent red value for the frame buffer configuration.
1507Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1508@code{GLX_TRANSPARENT_RGB}.
1509
1510@item @code{GLX_TRANSPARENT_GREEN_VALUE}
1511
1512
1513Integer value between 0 and the maximum frame buffer value for green,
1514indicating the transparent green value for the frame buffer
c7b31271 1515configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
8925f36f
AW
1516@code{GLX_TRANSPARENT_RGB}.
1517
1518@item @code{GLX_TRANSPARENT_BLUE_VALUE}
1519
1520
1521Integer value between 0 and the maximum frame buffer value for blue,
1522indicating the transparent blue value for the frame buffer
c7b31271 1523configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
8925f36f
AW
1524@code{GLX_TRANSPARENT_RGB}.
1525
1526@item @code{GLX_TRANSPARENT_ALPHA_VALUE}
1527
1528
1529Integer value between 0 and the maximum frame buffer value for alpha,
1530indicating the transparent blue value for the frame buffer
c7b31271 1531configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
8925f36f
AW
1532@code{GLX_TRANSPARENT_RGB}.
1533
1534@item @code{GLX_MAX_PBUFFER_WIDTH}
1535
1536
1537The maximum width that can be specified to @code{glXCreatePbuffer}.
1538
1539@item @code{GLX_MAX_PBUFFER_HEIGHT}
1540
1541
1542The maximum height that can be specified to @code{glXCreatePbuffer}.
1543
1544@item @code{GLX_MAX_PBUFFER_PIXELS}
1545
1546
1547The maximum number of pixels (width times height) for a pixel buffer.
1548Note that this value may be less than @code{GLX_MAX_PBUFFER_WIDTH} times
c7b31271 1549@code{GLX_MAX_PBUFFER_HEIGHT}. Also, this value is static and assumes
8925f36f 1550that no other pixel buffers or X resources are contending for the frame
c7b31271 1551buffer memory. As a result, it may not be possible to allocate a pixel
8925f36f
AW
1552buffer of the size given by @code{GLX_MAX_PBUFFER_PIXELS}.
1553
1554@end table
1555
1556Applications should choose the frame buffer configuration that most
c7b31271 1557closely meets their requirements. Creating windows, GLX pixmaps, or GLX
8925f36f
AW
1558pixel buffers with unnecessary buffers can result in reduced rendering
1559performance as well as poor resource allocation.
1560
8925f36f 1561@code{GLX_NO_EXTENSION} is returned if @var{dpy} does not support the
c7b31271 1562GLX extension. @code{GLX_BAD_ATTRIBUTE} is returned if @var{attribute}
8925f36f
AW
1563is not a valid GLX attribute.
1564
bb894c9d 1565@end deftypefun
8925f36f 1566
00239761 1567@deftypefun GLXFBConfig-* glXGetFBConfigs dpy screen nelements
3c9b6116
AW
1568List all GLX frame buffer configurations for a given screen.
1569
8925f36f
AW
1570@table @asis
1571@item @var{dpy}
1572Specifies the connection to the X server.
1573
1574@item @var{screen}
1575Specifies the screen number.
1576
1577@item @var{nelements}
1578Returns the number of GLXFBConfigs returned.
1579
1580@end table
1581
8925f36f 1582@code{glXGetFBConfigs} returns a list of all GLXFBConfigs available on
c7b31271
DH
1583the screen specified by @var{screen}. Use @code{glXGetFBConfigAttrib}
1584to obtain attribute values from a specific GLXFBConfig.
8925f36f 1585
bb894c9d 1586@end deftypefun
8925f36f 1587
bb894c9d 1588@deftypefun void(*)() glXGetProcAddress procName
3c9b6116
AW
1589Obtain a pointer to an OpenGL or GLX function.
1590
8925f36f
AW
1591@table @asis
1592@item @var{procName}
1593Specifies the name of the OpenGL or GLX function whose address is to be
1594returned.
1595
1596@end table
1597
8925f36f 1598@code{glXGetProcAddress} returns the address of the function specified
c7b31271 1599in @var{procName}. This is necessary in environments where the OpenGL
8925f36f
AW
1600link library exports a different set of functions than the runtime
1601library.
1602
bb894c9d 1603@end deftypefun
8925f36f 1604
bb894c9d 1605@deftypefun void glXGetSelectedEvent dpy draw event_mask
3c9b6116
AW
1606Returns GLX events that are selected for a window or a GLX pixel buffer.
1607
8925f36f
AW
1608@table @asis
1609@item @var{dpy}
1610Specifies the connection to the X server.
1611
1612@item @var{draw}
c7b31271 1613Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
8925f36f
AW
1614
1615@item @var{event_mask}
1616Returns the events that are selected for @var{draw}.
1617
1618@end table
1619
8925f36f
AW
1620@code{glXGetSelectedEvent} returns in @var{event_mask} the events
1621selected for @var{draw}.
1622
8925f36f
AW
1623@code{GLXBadDrawable} is generated if @var{draw} is not a valid window
1624or a valid GLX pixel buffer.
1625
bb894c9d 1626@end deftypefun
8925f36f 1627
00239761 1628@deftypefun XVisualInfo-* glXGetVisualFromFBConfig dpy config
3c9b6116
AW
1629Return visual that is associated with the frame buffer configuration.
1630
8925f36f
AW
1631@table @asis
1632@item @var{dpy}
1633Specifies the connection to the X server.
1634
1635@item @var{config}
1636Specifies the GLX frame buffer configuration.
1637
1638@end table
1639
8925f36f
AW
1640If @var{config} is a valid GLX frame buffer configuration and it has an
1641associated X Visual, then information describing that visual is
c7b31271 1642returned; otherwise @code{NULL} is returned. Use @code{XFree} to free
8925f36f
AW
1643the data returned.
1644
8925f36f
AW
1645Returns @code{NULL} if @var{config} is not a valid GLXFBConfig.
1646
bb894c9d 1647@end deftypefun
8925f36f 1648
bb894c9d 1649@deftypefun GLXContext glXImportContextEXT dpy contextID
3c9b6116
AW
1650Import another process's indirect rendering context..
1651
8925f36f
AW
1652@table @asis
1653@item @var{dpy}
1654Specifies the connection to the X server.
1655
1656@item @var{contextID}
1657Specifies a GLX rendering context.
1658
1659@end table
1660
8925f36f 1661@code{glXImportContextEXT} creates a GLXContext given the XID of an
c7b31271
DH
1662existing GLXContext. It may be used in place of
1663@code{glXCreateContext}, to share another process's indirect rendering
1664context.
8925f36f
AW
1665
1666Only the server-side context information can be shared between X
1667clients; client-side state, such as pixel storage modes, cannot be
c7b31271
DH
1668shared. Thus, @code{glXImportContextEXT} must allocate memory to store
1669client-side information. This memory is freed by calling
8925f36f
AW
1670@code{glXFreeContextEXT}.
1671
c7b31271
DH
1672This call does not create a new XID. It merely makes an existing object
1673available to the importing client (Display *). Like any XID, it goes
8925f36f 1674away when the creating client drops its connection or the ID is
c7b31271
DH
1675explicitly deleted. Note that this is when the XID goes away. The
1676object goes away when the XID goes away AND the context is not current
1677to any thread.
8925f36f
AW
1678
1679If @var{contextID} refers to a direct rendering context then no error is
1680generated but @code{glXImportContextEXT} returns NULL.
1681
1682@code{glXImportContextEXT} is part of the @code{EXT_import_context}
c7b31271 1683extension, not part of the core GLX command set. If
8925f36f
AW
1684_glxextstring(EXT_import_context) is included in the string returned by
1685@code{glXQueryExtensionsString}, when called with argument
1686@code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1687
8925f36f
AW
1688@code{GLXBadContext} is generated if @var{contextID} does not refer to a
1689valid context.
1690
bb894c9d 1691@end deftypefun
8925f36f 1692
bb894c9d 1693@deftypefun Bool glXIsDirect dpy ctx
3c9b6116
AW
1694Indicate whether direct rendering is enabled.
1695
8925f36f
AW
1696@table @asis
1697@item @var{dpy}
1698Specifies the connection to the X server.
1699
1700@item @var{ctx}
1701Specifies the GLX context that is being queried.
1702
1703@end table
1704
8925f36f 1705@code{glXIsDirect} returns @code{True} if @var{ctx} is a direct
c7b31271 1706rendering context, @code{False} otherwise. Direct rendering contexts
8925f36f 1707pass rendering commands directly from the calling process's address
c7b31271 1708space to the rendering system, bypassing the X server. Nondirect
8925f36f
AW
1709rendering contexts pass all rendering commands to the X server.
1710
8925f36f
AW
1711@code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1712context.
1713
bb894c9d 1714@end deftypefun
8925f36f 1715
bb894c9d 1716@deftypefun Bool glXMakeContextCurrent display draw read ctx
3c9b6116
AW
1717Attach a GLX context to a GLX drawable.
1718
8925f36f
AW
1719@table @asis
1720@item @var{display}
1721Specifies the connection to the X server.
1722
1723@item @var{draw}
c7b31271 1724Specifies a GLX drawable to render into. Must be an XID representing a
8925f36f
AW
1725GLXWindow, GLXPixmap, or GLXPbuffer.
1726
1727@item @var{read}
c7b31271 1728Specifies a GLX drawable to read from. Must be an XID representing a
8925f36f
AW
1729GLXWindow, GLXPixmap, or GLXPbuffer.
1730
1731@item @var{ctx}
1732Specifies the GLX context to be bound to @var{read} and @var{ctx}.
1733
1734@end table
1735
8925f36f 1736@code{glXMakeContextCurrent} binds @var{ctx} to the current rendering
c7b31271 1737thread and to the @var{draw} and @var{read} GLX drawables. @var{draw}
8925f36f
AW
1738and @var{read} may be the same.
1739
1740@var{draw} is used for all OpenGL operations except:
1741
1742Any pixel data that are read based on the value of
c7b31271 1743@code{GLX_READ_BUFFER}. Note that accumulation operations use the value
8925f36f
AW
1744of @code{GLX_READ_BUFFER}, but are not allowed unless @var{draw} is
1745identical to @var{read}.
1746
1747Any depth values that are retrieved by @code{glReadPixels} or
1748@code{glCopyPixels}.
1749
1750Any stencil values that are retrieved by @code{glReadPixels} or
1751@code{glCopyPixels}.
1752
1753Frame buffer values are taken from @var{draw}.
1754
1755If the current rendering thread has a current rendering context, that
1756context is flushed and replaced by @var{ctx}.
1757
1758The first time that @var{ctx} is made current, the viewport and scissor
c7b31271 1759dimensions are set to the size of the @var{draw} drawable. The viewport
8925f36f
AW
1760and scissor are not modified when @var{ctx} is subsequently made
1761current.
1762
1763To release the current context without assigning a new one, call
1764@code{glXMakeContextCurrent} with @var{draw} and @var{read} set to
1765@code{None} and @var{ctx} set to @code{NULL}.
1766
1767@code{glXMakeContextCurrent} returns @code{True} if it is successful,
c7b31271 1768@code{False} otherwise. If @code{False} is returned, the previously
8925f36f
AW
1769current rendering context and drawable (if any) remain unchanged.
1770
8925f36f
AW
1771@code{BadMatch} is generated if @var{draw} and @var{read} are not
1772compatible.
1773
1774@code{BadAccess} is generated if @var{ctx} is current to some other
1775thread.
1776
1777@code{GLXContextState} is generated if there is a current rendering
1778context and its render mode is either @code{GLX_FEEDBACK} or
1779@code{GLX_SELECT}.
1780
1781@code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1782rendering context.
1783
1784@code{GLXBadDrawable} is generated if @var{draw} or @var{read} is not a
1785valid GLX drawable.
1786
1787@code{GLXBadWindow} is generated if the underlying X window for either
1788@var{draw} or @var{read} is no longer valid.
1789
1790@code{GLXBadCurrentDrawable} is generated if the previous context of the
1791calling thread has unflushed commands and the previous drawable is no
1792longer valid.
1793
1794@code{BadAlloc} is generated if the X server does not have enough
1795resources to allocate the buffers.
1796
1797@code{BadMatch} is generated if:
1798
1799@var{draw} and @var{read} cannot fit into frame buffer memory
1800simultaneously.
1801
1802@var{draw} or @var{read} is a GLXPixmap and @var{ctx} is a
1803direct-rendering context.
1804
1805@var{draw} or @var{read} is a GLXPixmap and @var{ctx} was previously
1806bound to a GLXWindow or GLXPbuffer.
1807
1808@var{draw} or @var{read} is a GLXWindow or GLXPbuffer and @var{ctx} was
1809previously bound to a GLXPixmap.
1810
bb894c9d 1811@end deftypefun
8925f36f 1812
bb894c9d 1813@deftypefun Bool glXMakeCurrent dpy drawable ctx
3c9b6116
AW
1814Attach a GLX context to a window or a GLX pixmap.
1815
8925f36f
AW
1816@table @asis
1817@item @var{dpy}
1818Specifies the connection to the X server.
1819
1820@item @var{drawable}
c7b31271 1821Specifies a GLX drawable. Must be either an X window ID or a GLX pixmap
8925f36f
AW
1822ID.
1823
1824@item @var{ctx}
1825Specifies a GLX rendering context that is to be attached to
1826@var{drawable}.
1827
1828@end table
1829
8925f36f
AW
1830@code{glXMakeCurrent} does two things: It makes @var{ctx} the current
1831GLX rendering context of the calling thread, replacing the previously
1832current context if there was one, and it attaches @var{ctx} to a GLX
c7b31271 1833drawable, either a window or a GLX pixmap. As a result of these two
8925f36f 1834actions, subsequent GL rendering calls use rendering context @var{ctx}
c7b31271 1835to modify GLX drawable @var{drawable} (for reading and writing). Because
8925f36f
AW
1836@code{glXMakeCurrent} always replaces the current rendering context with
1837@var{ctx}, there can be only one current context per thread.
1838
1839Pending commands to the previous context, if any, are flushed before it
1840is released.
1841
1842The first time @var{ctx} is made current to any thread, its viewport is
c7b31271 1843set to the full size of @var{drawable}. Subsequent calls by any thread
8925f36f
AW
1844to @code{glXMakeCurrent} with @var{ctx} have no effect on its viewport.
1845
1846To release the current context without assigning a new one, call
1847@code{glXMakeCurrent} with @var{drawable} set to @code{None} and
1848@var{ctx} set to @code{NULL}.
1849
1850@code{glXMakeCurrent} returns @code{True} if it is successful,
c7b31271 1851@code{False} otherwise. If @code{False} is returned, the previously
8925f36f
AW
1852current rendering context and drawable (if any) remain unchanged.
1853
8925f36f 1854@code{BadMatch} is generated if @var{drawable} was not created with the
c7b31271 1855same X screen and visual as @var{ctx}. It is also generated if
8925f36f
AW
1856@var{drawable} is @code{None} and @var{ctx} is not @code{NULL}.
1857
1858@code{BadAccess} is generated if @var{ctx} was current to another thread
1859at the time @code{glXMakeCurrent} was called.
1860
1861@code{GLXBadDrawable} is generated if @var{drawable} is not a valid GLX
1862drawable.
1863
1864@code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1865context.
1866
1867@code{GLXBadContextState} is generated if @code{glXMakeCurrent} is
1868executed between the execution of @code{glBegin} and the corresponding
1869execution of @code{glEnd}.
1870
1871@code{GLXBadContextState} is also generated if the rendering context
1872current to the calling thread has GL renderer state @code{GLX_FEEDBACK}
1873or @code{GLX_SELECT}.
1874
1875@code{GLXBadCurrentWindow} is generated if there are pending GL commands
1876for the previous context and the current drawable is a window that is no
1877longer valid.
1878
1879@code{BadAlloc} may be generated if the server has delayed allocation of
1880ancillary buffers until @code{glXMakeCurrent} is called, only to find
1881that it has insufficient resources to complete the allocation.
1882
bb894c9d 1883@end deftypefun
8925f36f 1884
bb894c9d 1885@deftypefun int glXQueryContextInfoEXT dpy ctx attribute value
3c9b6116
AW
1886Query context information.
1887
8925f36f
AW
1888@table @asis
1889@item @var{dpy}
1890Specifies the connection to the X server.
1891
1892@item @var{ctx}
1893Specifies a GLX rendering context.
1894
1895@item @var{attribute}
c7b31271 1896Specifies that a context parameter should be retrieved. Must be one of
8925f36f
AW
1897@code{GLX_SHARED_CONTEXT_EXT}, @code{GLX_VISUAL_ID_EXT}, or
1898@code{GLX_SCREEN_EXT}.
1899
1900@item @var{value}
1901Contains the return value for @var{attribute}.
1902
1903@end table
1904
8925f36f 1905@code{glXQueryContextInfoEXT} sets @var{value} to the value of
c7b31271
DH
1906@var{attribute} with respect to @var{ctx}. @code{glXQueryContextInfoEXT}
1907returns an error code if it fails for any reason. Otherwise,
8925f36f
AW
1908@code{Success} is returned.
1909
1910@var{attribute} may be one of the following:
1911
1912@table @asis
1913@item @code{GLX_SHARED_CONTEXT_EXT}
1914Returns the XID of the share list context associated with @var{ctx} at
1915its creation.
1916
1917@item @code{GLX_VISUAL_ID_EXT}
1918Returns the XID of the GLX Visual associated with @var{ctx}.
1919
1920@item @code{GLX_SCREEN_EXT}
1921Returns the screen number associated with @var{ctx}.
1922
1923@end table
1924
1925This call may cause a round-trip to the server.
1926
1927@code{glXQueryContextInfoEXT} is part of the @code{EXT_import_context}
c7b31271 1928extension, not part of the core GLX command set. If
8925f36f
AW
1929_glxextstring(EXT_import_context) is included in the string returned by
1930@code{glXQueryExtensionsString}, when called with argument
1931@code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1932
8925f36f
AW
1933@code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1934context.
1935
1936@code{GLX_BAD_ATTRIBUTE} is returned if @var{attribute} is not a valid
1937GLX context attribute.
1938
1939fred @code{GLX_BAD_CONTEXT} is returned if @var{attribute} is not a
1940valid context.
1941
bb894c9d 1942@end deftypefun
8925f36f 1943
bb894c9d 1944@deftypefun int glXQueryContext dpy ctx attribute value
3c9b6116
AW
1945Query context information.
1946
8925f36f
AW
1947@table @asis
1948@item @var{dpy}
1949Specifies the connection to the X server.
1950
1951@item @var{ctx}
1952Specifies a GLX rendering context.
1953
1954@item @var{attribute}
c7b31271 1955Specifies that a context parameter should be retrieved. Must be one of
8925f36f
AW
1956@code{GLX_FBCONFIG_ID}, @code{GLX_RENDER_TYPE}, or @code{GLX_SCREEN}.
1957
1958@item @var{value}
1959Contains the return value for @var{attribute}.
1960
1961@end table
1962
8925f36f 1963@code{glXQueryContext} sets @var{value} to the value of @var{attribute}
c7b31271 1964with respect to @var{ctx}. @var{attribute} may be one of the following:
8925f36f
AW
1965
1966@table @asis
1967@item @code{GLX_FBCONFIG_ID}
1968Returns the XID of the GLXFBConfig associated with @var{ctx}.
1969
1970@item @code{GLX_RENDER_TYPE}
1971Returns the rendering type supported by @var{ctx}.
1972
1973@item @code{GLX_SCREEN}
1974Returns the screen number associated with @var{ctx}.
1975
1976@end table
1977
1978@code{Success} is returned unless @var{attribute} is not a valid GLX
1979context attribute, in which case @code{GLX_BAD_ATTRIBUTE} is returned.
1980
1981This call may cause a round-trip to the server.
1982
8925f36f
AW
1983@code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1984context.
1985
bb894c9d 1986@end deftypefun
8925f36f 1987
bb894c9d 1988@deftypefun int glXQueryDrawable dpy draw attribute value
3c9b6116
AW
1989Returns an attribute assoicated with a GLX drawable.
1990
8925f36f
AW
1991@table @asis
1992@item @var{dpy}
1993Specifies the connection to the X server.
1994
1995@item @var{draw}
1996Specifies the GLX drawable to be queried.
1997
1998@item @var{attribute}
c7b31271
DH
1999Specifies the attribute to be returned. Must be one of
2000@code{GLX_WIDTH}, @code{GLX_HEIGHT}, @code{GLX_PRESERVED_CONTENTS},
8925f36f
AW
2001@code{GLX_LARGEST_PBUFFER}, or @code{GLX_FBCONFIG_ID}.
2002
2003@item @var{value}
2004Contains the return value for @var{attribute}.
2005
2006@end table
2007
8925f36f
AW
2008@code{glXQueryDrawable} sets @var{value} to the value of @var{attribute}
2009with respect to the GLXDrawable @var{draw}.
2010
2011@var{attribute} may be one of the following:
2012
2013@table @asis
2014@item @code{GLX_WIDTH}
2015Returns the width of @var{ctx}.
2016
2017@item @code{GLX_HEIGHT}
2018Returns the height of @var{ctx}.
2019
2020@item @code{GLX_PRESERVED_CONTENTS}
2021Returns @code{True} if the contents of a GLXPbuffer are preserved when a
2022resource conflict occurs; @code{False} otherwise.
2023
2024@item @code{GLX_LARGEST_PBUFFER}
2025Returns the value set when @code{glXCreatePbuffer} was called to create
c7b31271 2026the GLXPbuffer. If @code{False} is returned, then the call to
8925f36f
AW
2027@code{glXCreatePbuffer} will fail to create a GLXPbuffer if the
2028requested size is larger than the implementation maximum or available
c7b31271 2029resources. If @code{True} is returned, a GLXPbuffer of the maximum
8925f36f
AW
2030availble size (if less than the requested width and height) is created.
2031
2032@item @code{GLX_FBCONFIG_ID}
2033Returns the XID for @var{draw}.
2034
2035@end table
2036
2037If @var{draw} is a GLXWindow or GLXPixmap and @var{attribute} is set to
2038@code{GLX_PRESERVED_CONTENTS} or @code{GLX_LARGETST_PBUFFER}, the
c7b31271 2039contents of @var{value} are undefined. If @var{attribute} is not one of
8925f36f
AW
2040the attributes listed above, the contents of @var{value} are unedfined.
2041
8925f36f
AW
2042A @code{GLXBadDrawable} is generated if @var{draw} is not a valid
2043GLXDrawable.
2044
bb894c9d 2045@end deftypefun
8925f36f 2046
00239761 2047@deftypefun const-char-* glXQueryExtensionsString dpy screen
3c9b6116
AW
2048Return list of supported extensions.
2049
8925f36f
AW
2050@table @asis
2051@item @var{dpy}
2052Specifies the connection to the X server.
2053
2054@item @var{screen}
2055Specifies the screen number.
2056
2057@end table
2058
8925f36f 2059@code{glXQueryExtensionsString} returns a pointer to a string describing
c7b31271 2060which GLX extensions are supported on the connection. The string is
8925f36f
AW
2061null-terminated and contains a space-separated list of extension names.
2062(The extension names themselves never contain spaces.) If there are no
2063extensions to GLX, then the empty string is returned.
2064
bb894c9d 2065@end deftypefun
8925f36f 2066
bb894c9d 2067@deftypefun Bool glXQueryExtension dpy errorBase eventBase
3c9b6116
AW
2068Indicate whether the GLX extension is supported.
2069
8925f36f
AW
2070@table @asis
2071@item @var{dpy}
2072Specifies the connection to the X server.
2073
2074@item @var{errorBase}
2075Returns the base error code of the GLX server extension.
2076
2077@item @var{eventBase}
2078Returns the base event code of the GLX server extension.
2079
2080@end table
2081
8925f36f
AW
2082@code{glXQueryExtension} returns @code{True} if the X server of
2083connection @var{dpy} supports the GLX extension, @code{False} otherwise.
2084If @code{True} is returned, then @var{errorBase} and @var{eventBase}
c7b31271 2085return the error base and event base of the GLX extension. These values
8925f36f 2086should be added to the constant error and event values to determine the
c7b31271 2087actual event or error values. Otherwise, @var{errorBase} and
8925f36f
AW
2088@var{eventBase} are unchanged.
2089
2090@var{errorBase} and @var{eventBase} do not return values if they are
2091specified as @code{NULL}.
2092
bb894c9d 2093@end deftypefun
8925f36f 2094
00239761 2095@deftypefun const-char-* glXQueryServerString dpy screen name
3c9b6116
AW
2096Return string describing the server.
2097
8925f36f
AW
2098@table @asis
2099@item @var{dpy}
2100Specifies the connection to the X server.
2101
2102@item @var{screen}
2103Specifies the screen number.
2104
2105@item @var{name}
2106Specifies which string is returned: one of @code{GLX_VENDOR},
2107@code{GLX_VERSION}, or @code{GLX_EXTENSIONS}.
2108
2109@end table
2110
8925f36f
AW
2111@code{glXQueryServerString} returns a pointer to a static,
2112null-terminated string describing some aspect of the server's GLX
c7b31271
DH
2113extension. The possible values for @var{name} and the format of the
2114strings is the same as for @code{glXGetClientString}. If @var{name} is
8925f36f
AW
2115not set to a recognized value, @code{NULL} is returned.
2116
bb894c9d 2117@end deftypefun
8925f36f 2118
bb894c9d 2119@deftypefun Bool glXQueryVersion dpy major minor
3c9b6116
AW
2120Return the version numbers of the GLX extension.
2121
8925f36f
AW
2122@table @asis
2123@item @var{dpy}
2124Specifies the connection to the X server.
2125
2126@item @var{major}
2127Returns the major version number of the GLX server extension.
2128
2129@item @var{minor}
2130Returns the minor version number of the GLX server extension.
2131
2132@end table
2133
8925f36f
AW
2134@code{glXQueryVersion} returns the major and minor version numbers of
2135the GLX extension implemented by the server associated with connection
c7b31271
DH
2136@var{dpy}. Implementations with the same major version number are
2137upward compatible, meaning that the implementation with the higher minor
2138number is a superset of the version with the lower minor number.
8925f36f
AW
2139
2140@var{major} and @var{minor} do not return values if they are specified
2141as @code{NULL}.
2142
8925f36f
AW
2143@code{glXQueryVersion} returns @code{False} if it fails, @code{True}
2144otherwise.
2145
2146@var{major} and @var{minor} are not updated when @code{False} is
2147returned.
2148
bb894c9d 2149@end deftypefun
8925f36f 2150
bb894c9d 2151@deftypefun void glXSelectEvent dpy draw event_mask
3c9b6116
AW
2152Select GLX events for a window or a GLX pixel buffer.
2153
8925f36f
AW
2154@table @asis
2155@item @var{dpy}
2156Specifies the connection to the X server.
2157
2158@item @var{draw}
c7b31271 2159Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
8925f36f
AW
2160
2161@item @var{event_mask}
2162Specifies the events to be returned for @var{draw}.
2163
2164@end table
2165
8925f36f 2166@code{glXSelectEvent} sets the GLX event mask for a GLX pixel buffer or
c7b31271
DH
2167a window. Calling @code{glXSelectEvent} overrides any previous event
2168mask that was set by the client for @var{draw}. Note that it does not
8925f36f
AW
2169affect the event masks that other clients may have specified for
2170@var{draw} since each client rendering to @var{draw} has a separate
2171event mask for it.
2172
2173Currently, only one GLX event, @code{GLX_PBUFFER_CLOBBER_MASK}, can be
c7b31271 2174selected. The following data is returned to the client when a
8925f36f
AW
2175@code{GLX_PBUFFER_CLOBBER_MASK} event occurs:
2176
2177typedef struct @{
2178
2179@table @asis
2180@item
2181int @var{event_type};
2182/* GLX_DAMAGED or GLX_SAVED */
2183
2184@item
2185int @var{draw_type};
2186/* GLX_WINDOW or GLX_PBUFFER */
2187
2188@item
2189unsigned long @var{serial};
2190/* # of last request processed by server */
2191
2192@item
2193Bool @var{send_event};
2194/* true if this came for SendEvent request */
2195
2196@item
2197Display @var{*display};
2198/* display the event was read from */
2199
2200@item
2201GLXDrawable @var{drawable};
c7b31271 2202/* i.d. of Drawable */
8925f36f
AW
2203
2204@item
2205unsigned int @var{buffer_mask};
2206/* mask indicating affected buffers */
2207
2208@item
2209int @var{x, y};
2210
2211
2212@item
2213int @var{width, height};
2214
2215
2216@item
2217int @var{count};
2218/* if nonzero, at least this many more */
2219
2220@end table
2221
2222@} GLXPbufferClobberEvent; The valid bit masks used in @var{buffer_mask}
2223are:
2224
2225
2226
2227@table @asis
2228@item @strong{Bitmask}
2229@strong{Corresponding Buffer}
2230
2231@item @code{GLX_FRONT_LEFT_BUFFER_BIT}
2232Front left color buffer
2233
2234@item @code{GLX_FRONT_RIGHT_BUFFER_BIT}
2235Front right color buffer
2236
2237@item @code{GLX_BACK_LEFT_BUFFER_BIT}
2238Back left color buffer
2239
2240@item @code{GLX_BACK_RIGHT_BUFFER_BIT}
2241Back right color buffer
2242
2243@item @code{GLX_AUX_BUFFERS_BIT}
2244Auxiliary buffer
2245
2246@item @code{GLX_DEPTH_BUFFER_BIT}
2247Depth buffer
2248
2249@item @code{GLX_STENCIL_BUFFER_BIT}
2250Stencil buffer
2251
2252@item @code{GLX_ACCUM_BUFFER_BIT}
2253Accumulation buffer
2254
2255@end table
2256
2257A single X server operation can cause several buffer clobber events to
c7b31271
DH
2258be sent. (e.g., a single GLX pixel buffer may be damaged and cause
2259multiple buffer clobber events to be generated). Each event specifies
8925f36f 2260one region of the GLX drawable that was affected by the X Server
c7b31271
DH
2261operation. The @var{buffer_mask} field indicates which color buffers
2262and ancillary buffers were affected. All the buffer clobber events
2263generated by a single X server action are guaranteed to be contiguous in
2264the event queue. The conditions under which this event is generated and
2265the @var{event_type} varies, depending on the type of the GLX drawable.
8925f36f
AW
2266
2267When the @code{GLX_AUX_BUFFERS_BIT} is set in @var{buffer_mask}, then
c7b31271 2268@var{aux_buffer} is set to indicate which buffer was affected. If more
8925f36f 2269than one aux buffer was affected, then additional events are generated
c7b31271 2270as part of the same contiguous event group. Each additional event will
8925f36f 2271have only the @code{GLX_AUX_BUFFERS_BIT} set in @var{buffer_mask}, and
c7b31271 2272the @var{aux_buffer} field will be set appropriately. For nonstereo
8925f36f
AW
2273drawables, @code{GLX_FRONT_LEFT_BUFFER_BIT} and
2274@code{GLX_BACK_LEFT_BUFFER_BIT} are used to specify the front and back
2275color buffers.
2276
2277For preserved GLX pixel buffers, a buffer clobber event with type
2278@code{GLX_SAVED} is generated whenever the contents of the GLX pixel
c7b31271
DH
2279buffer is moved out of offscreen memory. The event(s) describes which
2280portions of the GLX pixel buffer were affected. Clients who receive
2281many buffer clobber events, referring to different save actions, should
8925f36f
AW
2282consider freeing the GLX pixel buffer resource in order to prevent the
2283system from thrashing due to insufficient resources.
2284
2285For an unpreserved GLXPbuffer, a buffer clobber event, with type
2286@code{GLX_DAMAGED}, is generated whenever a portion of the GLX pixel
c7b31271 2287buffer becomes invalid. The client may wish to regenerate the invalid
8925f36f
AW
2288portions of the GLX pixel buffer.
2289
2290For Windows, buffer clobber events, with type @code{GLX_SAVED}, occur
2291whenever an ancillary buffer, associated with the window, gets clobbered
c7b31271 2292or moved out of off-screen memory. The event contains information
8925f36f
AW
2293indicating which color buffers and ancillary buffers\(emand which
2294portions of those buffers\(emwere affected.
2295
8925f36f
AW
2296@code{GLXBadDrawable} is generated if @var{draw} is not a valid window
2297or a valid GLX pixel buffer.
2298
bb894c9d 2299@end deftypefun
8925f36f 2300
bb894c9d 2301@deftypefun void glXSwapBuffers dpy drawable
3c9b6116
AW
2302Exchange front and back buffers.
2303
8925f36f
AW
2304@table @asis
2305@item @var{dpy}
2306Specifies the connection to the X server.
2307
2308@item @var{drawable}
2309Specifies the drawable whose buffers are to be swapped.
2310
2311@end table
2312
8925f36f
AW
2313@code{glXSwapBuffers} promotes the contents of the back buffer of
2314@var{drawable} to become the contents of the front buffer of
c7b31271 2315@var{drawable}. The contents of the back buffer then become undefined.
8925f36f
AW
2316The update typically takes place during the vertical retrace of the
2317monitor, rather than immediately after @code{glXSwapBuffers} is called.
2318
2319@code{glXSwapBuffers} performs an implicit @code{glFlush} before it
c7b31271 2320returns. Subsequent OpenGL commands may be issued immediately after
8925f36f
AW
2321calling @code{glXSwapBuffers}, but are not executed until the buffer
2322exchange is completed.
2323
2324If @var{drawable} was not created with respect to a double-buffered
2325visual, @code{glXSwapBuffers} has no effect, and no error is generated.
2326
8925f36f
AW
2327@code{GLXBadDrawable} is generated if @var{drawable} is not a valid GLX
2328drawable.
2329
2330@code{GLXBadCurrentWindow} is generated if @var{dpy} and @var{drawable}
2331are respectively the display and drawable associated with the current
2332context of the calling thread, and @var{drawable} identifies a window
2333that is no longer valid.
2334
bb894c9d 2335@end deftypefun
8925f36f 2336
bb894c9d 2337@deftypefun void glXUseXFont font first count listBase
3c9b6116
AW
2338Create bitmap display lists from an X font.
2339
8925f36f
AW
2340@table @asis
2341@item @var{font}
2342Specifies the font from which character glyphs are to be taken.
2343
2344@item @var{first}
2345Specifies the index of the first glyph to be taken.
2346
2347@item @var{count}
2348Specifies the number of glyphs to be taken.
2349
2350@item @var{listBase}
2351Specifies the index of the first display list to be generated.
2352
2353@end table
2354
8925f36f 2355@code{glXUseXFont} generates @var{count} display lists, named
3c9b6116 2356@var{listBase} through @r{@var{listBase}+@var{count}-1}, each containing
c7b31271 2357a single @code{glBitmap} command. The parameters of the @code{glBitmap}
3c9b6116 2358command of display list @r{@var{listBase}+@var{i}} are derived from
c7b31271 2359glyph @r{@var{first}+@var{i}}. Bitmap parameters @r{@var{xorig}},
3c9b6116
AW
2360@r{@var{yorig}}, @r{@var{width}}, and @r{@var{height}} are computed from
2361font metrics as @r{@var{descent}-1}, @r{-@var{lbearing}},
2362@r{@var{rbearing}-@var{lbearing}}, and @r{@var{ascent}+@var{descent}},
c7b31271
DH
2363respectively. @r{@var{xmove}} is taken from the glyph's @r{@var{width}}
2364metric, and @r{@var{ymove}} is set to zero. Finally, the glyph's image
3c9b6116 2365is converted to the appropriate format for @code{glBitmap}.
8925f36f
AW
2366
2367Using @code{glXUseXFont} may be more efficient than accessing the X font
2368and generating the display lists explicitly, both because the display
2369lists are created on the server without requiring a round trip of the
2370glyph data, and because the server may choose to delay the creation of
2371each bitmap until it is accessed.
2372
2373Empty display lists are created for all glyphs that are requested and
c7b31271
DH
2374are not defined in @var{font}. @code{glXUseXFont} is ignored if there
2375is no current GLX context.
8925f36f 2376
8925f36f
AW
2377@code{BadFont} is generated if @var{font} is not a valid font.
2378
2379@code{GLXBadContextState} is generated if the current GLX context is in
2380display-list construction mode.
2381
2382@code{GLXBadCurrentWindow} is generated if the drawable associated with
2383the current context of the calling thread is a window, and that window
2384is no longer valid.
2385
bb894c9d 2386@end deftypefun
8925f36f 2387
bb894c9d 2388@deftypefun void glXWaitGL
3c9b6116
AW
2389Complete GL execution prior to subsequent X calls.
2390
8925f36f 2391GL rendering calls made prior to @code{glXWaitGL} are guaranteed to be
c7b31271 2392executed before X rendering calls made after @code{glXWaitGL}. Although
8925f36f
AW
2393this same result can be achieved using @code{glFinish}, @code{glXWaitGL}
2394does not require a round trip to the server, and it is therefore more
2395efficient in cases where client and server are on separate machines.
2396
2397@code{glXWaitGL} is ignored if there is no current GLX context.
2398
8925f36f
AW
2399@code{GLXBadCurrentWindow} is generated if the drawable associated with
2400the current context of the calling thread is a window, and that window
2401is no longer valid.
2402
bb894c9d 2403@end deftypefun
8925f36f 2404
bb894c9d 2405@deftypefun void glXWaitX
3c9b6116
AW
2406Complete X execution prior to subsequent GL calls.
2407
8925f36f 2408X rendering calls made prior to @code{glXWaitX} are guaranteed to be
c7b31271 2409executed before GL rendering calls made after @code{glXWaitX}. Although
8925f36f
AW
2410the same result can be achieved using @code{XSync}, @code{glXWaitX} does
2411not require a round trip to the server, and it is therefore more
2412efficient in cases where client and server are on separate machines.
2413
2414@code{glXWaitX} is ignored if there is no current GLX context.
2415
8925f36f
AW
2416@code{GLXBadCurrentWindow} is generated if the drawable associated with
2417the current context of the calling thread is a window, and that window
2418is no longer valid.
2419
bb894c9d 2420@end deftypefun
8925f36f
AW
2421
2422
2423@c %end of fragment