4 The functions from this section may be had by loading the module:
7 (use-modules (figl glx low-level)
11 This section of the manual was derived from the upstream OpenGL
12 documentation. Each function's documentation has its own copyright
13 statement; for full details, see the upstream documentation. The
14 copyright notices and licenses present in this section are as follows.
16 Copyright @copyright{} 1991-2006 Silicon Graphics, Inc. This document is
17 licensed under the SGI Free Software B License. For details, see
18 @uref{http://oss.sgi.com/projects/FreeB/,http://oss.sgi.com/projects/FreeB/}.
22 @deftypefun GLXFBConfig-* glXChooseFBConfig dpy screen attrib_list nelements
23 Return a list of GLX frame buffer configurations that match the
28 Specifies the connection to the X server.
31 Specifies the screen number.
33 @item @var{attrib_list}
34 Specifies a list of attribute/value pairs. The last attribute must be
38 Returns the number of elements in the list returned by
39 @code{glXChooseFBConfig}.
43 @code{glXChooseFBConfig} returns GLX frame buffer configurations that
44 match the attributes specified in @var{attrib_list}, or @code{NULL} if
45 no matches are found. If @var{attrib_list} is @code{NULL}, then
46 @code{glXChooseFBConfig} returns an array of GLX frame buffer
47 configurations that are available on the specified screen. If an error
48 occurs, no frame buffer configurations exist on the specified screen, or
49 if no frame buffer configurations match the specified attributes, then
50 @code{NULL} is returned. Use @code{XFree} to free the memory returned by
51 @code{glXChooseFBConfig}.
53 All attributes in @var{attrib_list}, including boolean attributes, are
54 immediately followed by the corresponding desired value. The list is
55 terminated with @code{None}. If an attribute is not specified in
56 @var{attrib_list}, then the default value (see below) is used (and the
57 attribute is said to be specified implicitly). For example, if
58 @code{GLX_STEREO} is not specified, then it is assumed to be
59 @code{False}. For some attributes, the default is @code{GLX_DONT_CARE},
60 meaning that any value is OK for this attribute, so the attribute will
63 Attributes are matched in an attribute-specific manner. Some of the
64 attributes, such as @code{GLX_LEVEL}, must match the specified value
65 exactly; others, such as, @code{GLX_RED_SIZE} must meet or exceed the
66 specified minimum values. If more than one GLX frame buffer
67 configuration is found, then a list of configurations, sorted according
68 to the ``best'' match criteria, is returned. The match criteria for each
69 attribute and the exact sorting order is defined below.
71 The interpretations of the various GLX visual attributes are as follows:
74 @item @code{GLX_FBCONFIG_ID}
77 Must be followed by a valid XID that indicates the desired GLX frame
78 buffer configuration. When a @code{GLX_FBCONFIG_ID} is specified, all
79 attributes are ignored. The default value is @code{GLX_DONT_CARE}.
81 @item @code{GLX_BUFFER_SIZE}
84 Must be followed by a nonnegative integer that indicates the desired
85 color index buffer size. The smallest index buffer of at least the
86 specified size is preferred. This attribute is ignored if
87 @code{GLX_COLOR_INDEX_BIT} is not set in @code{GLX_RENDER_TYPE}. The
90 @item @code{GLX_LEVEL}
93 Must be followed by an integer buffer-level specification. This
94 specification is honored exactly. Buffer level 0 corresponds to the
95 default frame buffer of the display. Buffer level 1 is the first overlay
96 frame buffer, level two the second overlay frame buffer, and so on.
97 Negative buffer levels correspond to underlay frame buffers. The default
100 @item @code{GLX_DOUBLEBUFFER}
103 Must be followed by @code{True} or @code{False}. If @code{True} is
104 specified, then only double-buffered frame buffer configurations are
105 considered; if @code{False} is specified, then only single-buffered
106 frame buffer configurations are considered. The default value is
107 @code{GLX_DONT_CARE}.
109 @item @code{GLX_STEREO}
112 Must be followed by @code{True} or @code{False}. If @code{True} is
113 specified, then only stereo frame buffer configurations are considered;
114 if @code{False} is specified, then only monoscopic frame buffer
115 configurations are considered. The default value is @code{False}.
117 @item @code{GLX_AUX_BUFFERS}
120 Must be followed by a nonnegative integer that indicates the desired
121 number of auxiliary buffers. Configurations with the smallest number of
122 auxiliary buffers that meet or exceed the specified number are
123 preferred. The default value is 0.
125 @item @code{GLX_RED_SIZE}, @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, @code{GLX_ALPHA_SIZE}
128 Each attribute, if present, must be followed by a nonnegative minimum
129 size specification or @code{GLX_DONT_CARE}. The largest available total
130 RGBA color buffer size (sum of @code{GLX_RED_SIZE},
131 @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and @code{GLX_ALPHA_SIZE})
132 of at least the minimum size specified for each color component is
133 preferred. If the requested number of bits for a color component is 0 or
134 @code{GLX_DONT_CARE}, it is not considered. The default value for each
135 color component is 0.
137 @item @code{GLX_DEPTH_SIZE}
140 Must be followed by a nonnegative minimum size specification. If this
141 value is zero, frame buffer configurations with no depth buffer are
142 preferred. Otherwise, the largest available depth buffer of at least the
143 minimum size is preferred. The default value is 0.
145 @item @code{GLX_STENCIL_SIZE}
148 Must be followed by a nonnegative integer that indicates the desired
149 number of stencil bitplanes. The smallest stencil buffer of at least the
150 specified size is preferred. If the desired value is zero, frame buffer
151 configurations with no stencil buffer are preferred. The default value
154 @item @code{GLX_ACCUM_RED_SIZE}
157 Must be followed by a nonnegative minimum size specification. If this
158 value is zero, frame buffer configurations with no red accumulation
159 buffer are preferred. Otherwise, the largest possible red accumulation
160 buffer of at least the minimum size is preferred. The default value is
163 @item @code{GLX_ACCUM_GREEN_SIZE}
166 Must be followed by a nonnegative minimum size specification. If this
167 value is zero, frame buffer configurations with no green accumulation
168 buffer are preferred. Otherwise, the largest possible green accumulation
169 buffer of at least the minimum size is preferred. The default value is
172 @item @code{GLX_ACCUM_BLUE_SIZE}
175 Must be followed by a nonnegative minimum size specification. If this
176 value is zero, frame buffer configurations with no blue accumulation
177 buffer are preferred. Otherwise, the largest possible blue accumulation
178 buffer of at least the minimum size is preferred. The default value is
181 @item @code{GLX_ACCUM_ALPHA_SIZE}
184 Must be followed by a nonnegative minimum size specification. If this
185 value is zero, frame buffer configurations with no alpha accumulation
186 buffer are preferred. Otherwise, the largest possible alpha accumulation
187 buffer of at least the minimum size is preferred. The default value is
190 @item @code{GLX_RENDER_TYPE}
193 Must be followed by a mask indicating which OpenGL rendering modes the
194 frame buffer configuration must support. Valid bits are
195 @code{GLX_RGBA_BIT} and @code{GLX_COLOR_INDEX_BIT}. If the mask is set
196 to @code{GLX_RGBA_BIT} | @code{GLX_COLOR_INDEX_BIT}, then only frame
197 buffer configurations that can be bound to both RGBA contexts and color
198 index contexts will be considered. The default value is
201 @item @code{GLX_DRAWABLE_TYPE}
204 Must be followed by a mask indicating which GLX drawable types the frame
205 buffer configuration must support. Valid bits are @code{GLX_WINDOW_BIT},
206 @code{GLX_PIXMAP_BIT}, and @code{GLX_PBUFFER_BIT}. For example, if mask
207 is set to @code{GLX_WINDOW_BIT} | @code{GLX_PIXMAP_BIT}, only frame
208 buffer configurations that support both windows and GLX pixmaps will be
209 considered. The default value is @code{GLX_WINDOW_BIT}.
211 @item @code{GLX_X_RENDERABLE}
214 Must be followed by @code{True} or @code{False}. If @code{True} is
215 specified, then only frame buffer configurations that have associated X
216 visuals (and can be used to render to Windows and/or GLX pixmaps) will
217 be considered. The default value is @code{GLX_DONT_CARE}.
219 @item @code{GLX_X_VISUAL_TYPE}
222 Must be followed by one of @code{GLX_TRUE_COLOR},
223 @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
224 @code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, or
225 @code{GLX_STATIC_GRAY}, indicating the desired X visual type. Not all
226 frame buffer configurations have an associated X visual. If
227 @code{GLX_DRAWABLE_TYPE} is specified in @var{attrib_list} and the mask
228 that follows does not have @code{GLX_WINDOW_BIT} set, then this value is
229 ignored. It is also ignored if @code{GLX_X_RENDERABLE} is specified as
230 @code{False}. RGBA rendering may be supported for visuals of type
231 @code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
232 or @code{GLX_STATIC_COLOR}, but color index rendering is only supported
233 for visuals of type @code{GLX_PSEUDO_COLOR} or @code{GLX_STATIC_COLOR}
234 (i.e., single-channel visuals). The tokens @code{GLX_GRAY_SCALE} and
235 @code{GLX_STATIC_GRAY} will not match current OpenGL enabled visuals,
236 but are included for future use. The default value for
237 @code{GLX_X_VISUAL_TYPE} is @code{GLX_DONT_CARE}.
239 @item @code{GLX_CONFIG_CAVEAT}
242 Must be followed by one of @code{GLX_NONE}, @code{GLX_SLOW_CONFIG},
243 @code{GLX_NON_CONFORMANT_CONFIG}. If @code{GLX_NONE} is specified, then
244 only frame buffer configurations with no caveats will be considered; if
245 @code{GLX_SLOW_CONFIG} is specified, then only slow frame buffer
246 configurations will be considered; if @code{GLX_NON_CONFORMANT_CONFIG}
247 is specified, then only nonconformant frame buffer configurations will
248 be considered. The default value is @code{GLX_DONT_CARE}.
250 @item @code{GLX_TRANSPARENT_TYPE}
253 Must be followed by one of @code{GLX_NONE}, @code{GLX_TRANSPARENT_RGB},
254 @code{GLX_TRANSPARENT_INDEX}. If @code{GLX_NONE} is specified, then only
255 opaque frame buffer configurations will be considered; if
256 @code{GLX_TRANSPARENT_RGB} is specified, then only transparent frame
257 buffer configurations that support RGBA rendering will be considered; if
258 @code{GLX_TRANSPARENT_INDEX} is specified, then only transparent frame
259 buffer configurations that support color index rendering will be
260 considered. The default value is @code{GLX_NONE}.
262 @item @code{GLX_TRANSPARENT_INDEX_VALUE}
265 Must be followed by an integer value indicating the transparent index
266 value; the value must be between 0 and the maximum frame buffer value
267 for indices. Only frame buffer configurations that use the specified
268 transparent index value will be considered. The default value is
269 @code{GLX_DONT_CARE}. This attribute is ignored unless
270 @code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
271 specified as @code{GLX_TRANSPARENT_INDEX}.
273 @item @code{GLX_TRANSPARENT_RED_VALUE}
276 Must be followed by an integer value indicating the transparent red
277 value; the value must be between 0 and the maximum frame buffer value
278 for red. Only frame buffer configurations that use the specified
279 transparent red value will be considered. The default value is
280 @code{GLX_DONT_CARE}. This attribute is ignored unless
281 @code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
282 specified as @code{GLX_TRANSPARENT_RGB}.
284 @item @code{GLX_TRANSPARENT_GREEN_VALUE}
287 Must be followed by an integer value indicating the transparent green
288 value; the value must be between 0 and the maximum frame buffer value
289 for green. Only frame buffer configurations that use the specified
290 transparent green value will be considered. The default value is
291 @code{GLX_DONT_CARE}. This attribute is ignored unless
292 @code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
293 specified as @code{GLX_TRANSPARENT_RGB}.
295 @item @code{GLX_TRANSPARENT_BLUE_VALUE}
298 Must be followed by an integer value indicating the transparent blue
299 value; the value must be between 0 and the maximum frame buffer value
300 for blue. Only frame buffer configurations that use the specified
301 transparent blue value will be considered. The default value is
302 @code{GLX_DONT_CARE}. This attribute is ignored unless
303 @code{GLX_TRANSPARENT_TYPE} is included in @var{attrib_list} and
304 specified as @code{GLX_TRANSPARENT_RGB}.
306 @item @code{GLX_TRANSPARENT_ALPHA_VALUE}
309 Must be followed by an integer value indicating the transparent alpha
310 value; the value must be between 0 and the maximum frame buffer value
311 for alpha. Only frame buffer configurations that use the specified
312 transparent alpha value will be considered. The default value is
313 @code{GLX_DONT_CARE}.
317 When more than one GLX frame buffer configuration matches the specified
318 attributes, a list of matching configurations is returned. The list is
319 sorted according to the following precedence rules, which are applied in
320 ascending order (i.e., configurations that are considered equal by a
321 lower numbered rule are sorted by the higher numbered rule):
325 By @code{GLX_CONFIG_CAVEAT} where the precedence is @code{GLX_NONE},
326 @code{GLX_SLOW_CONFIG}, and @code{GLX_NON_CONFORMANT_CONFIG}.
329 Larger total number of RGBA color components (@code{GLX_RED_SIZE},
330 @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, plus @code{GLX_ALPHA_SIZE})
331 that have higher number of bits. If the requested number of bits in
332 @var{attrib_list} is zero or @code{GLX_DONT_CARE} for a particular color
333 component, then the number of bits for that component is not considered.
336 Smaller @code{GLX_BUFFER_SIZE}.
339 Single buffered configuration (@code{GLX_DOUBLEBUFFER} being
340 @code{False} precedes a double buffered one.
343 Smaller @code{GLX_AUX_BUFFERS}.
346 Larger @code{GLX_DEPTH_SIZE}.
349 Smaller @code{GLX_STENCIL_SIZE}.
352 Larger total number of accumulation buffer color components
353 (@code{GLX_ACCUM_RED_SIZE}, @code{GLX_ACCUM_GREEN_SIZE},
354 @code{GLX_ACCUM_BLUE_SIZE}, plus @code{GLX_ACCUM_ALPHA_SIZE}) that have
355 higher number of bits. If the requested number of bits in
356 @var{attrib_list} is zero or @code{GLX_DONT_CARE} for a particular color
357 component, then the number of bits for that component is not considered.
360 By @code{GLX_X_VISUAL_TYPE} where the precedence order is
361 @code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
362 @code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, @code{GLX_STATIC_GRAY}.
366 @code{NULL} is returned if an undefined GLX attribute is encountered in
367 @var{attrib_list}, if @var{screen} is invalid, or if @var{dpy} does not
368 support the GLX extension.
372 @deftypefun XVisualInfo* glXChooseVisual dpy screen attribList
373 Return a visual that matches specified attributes.
377 Specifies the connection to the X server.
380 Specifies the screen number.
382 @item @var{attribList}
383 Specifies a list of boolean attributes and integer attribute/value
384 pairs. The last attribute must be @code{None}.
388 @code{glXChooseVisual} returns a pointer to an XVisualInfo structure
389 describing the visual that best meets a minimum specification. The
390 boolean GLX attributes of the visual that is returned will match the
391 specified values, and the integer GLX attributes will meet or exceed the
392 specified minimum values. If all other attributes are equivalent, then
393 TrueColor and PseudoColor visuals have priority over DirectColor and
394 StaticColor visuals, respectively. If no conforming visual exists,
395 @code{NULL} is returned. To free the data returned by this function, use
398 All boolean GLX attributes default to @code{False} except
399 @code{GLX_USE_GL}, which defaults to @code{True}. All integer GLX
400 attributes default to zero. Default specifications are superseded by
401 attributes included in @var{attribList}. Boolean attributes included in
402 @var{attribList} are understood to be @code{True}. Integer attributes
403 and enumerated type attributes are followed immediately by the
404 corresponding desired or minimum value. The list must be terminated with
407 The interpretations of the various GLX visual attributes are as follows:
410 @item @code{GLX_USE_GL}
411 Ignored. Only visuals that can be rendered with GLX are considered.
413 @item @code{GLX_BUFFER_SIZE}
414 Must be followed by a nonnegative integer that indicates the desired
415 color index buffer size. The smallest index buffer of at least the
416 specified size is preferred. Ignored if @code{GLX_RGBA} is asserted.
418 @item @code{GLX_LEVEL}
419 Must be followed by an integer buffer-level specification. This
420 specification is honored exactly. Buffer level zero corresponds to the
421 main frame buffer of the display. Buffer level one is the first overlay
422 frame buffer, level two the second overlay frame buffer, and so on.
423 Negative buffer levels correspond to underlay frame buffers.
425 @item @code{GLX_RGBA}
426 If present, only TrueColor and DirectColor visuals are considered.
427 Otherwise, only PseudoColor and StaticColor visuals are considered.
429 @item @code{GLX_DOUBLEBUFFER}
430 If present, only double-buffered visuals are considered. Otherwise, only
431 single-buffered visuals are considered.
433 @item @code{GLX_STEREO}
434 If present, only stereo visuals are considered. Otherwise, only
435 monoscopic visuals are considered.
437 @item @code{GLX_AUX_BUFFERS}
438 Must be followed by a nonnegative integer that indicates the desired
439 number of auxiliary buffers. Visuals with the smallest number of
440 auxiliary buffers that meets or exceeds the specified number are
443 @item @code{GLX_RED_SIZE}
444 Must be followed by a nonnegative minimum size specification. If this
445 value is zero, the smallest available red buffer is preferred.
446 Otherwise, the largest available red buffer of at least the minimum size
449 @item @code{GLX_GREEN_SIZE}
450 Must be followed by a nonnegative minimum size specification. If this
451 value is zero, the smallest available green buffer is preferred.
452 Otherwise, the largest available green buffer of at least the minimum
455 @item @code{GLX_BLUE_SIZE}
456 Must be followed by a nonnegative minimum size specification. If this
457 value is zero, the smallest available blue buffer is preferred.
458 Otherwise, the largest available blue buffer of at least the minimum
461 @item @code{GLX_ALPHA_SIZE}
462 Must be followed by a nonnegative minimum size specification. If this
463 value is zero, the smallest available alpha buffer is preferred.
464 Otherwise, the largest available alpha buffer of at least the minimum
467 @item @code{GLX_DEPTH_SIZE}
468 Must be followed by a nonnegative minimum size specification. If this
469 value is zero, visuals with no depth buffer are preferred. Otherwise,
470 the largest available depth buffer of at least the minimum size is
473 @item @code{GLX_STENCIL_SIZE}
474 Must be followed by a nonnegative integer that indicates the desired
475 number of stencil bitplanes. The smallest stencil buffer of at least the
476 specified size is preferred. If the desired value is zero, visuals with
477 no stencil buffer are preferred.
479 @item @code{GLX_ACCUM_RED_SIZE}
480 Must be followed by a nonnegative minimum size specification. If this
481 value is zero, visuals with no red accumulation buffer are preferred.
482 Otherwise, the largest possible red accumulation buffer of at least the
483 minimum size is preferred.
485 @item @code{GLX_ACCUM_GREEN_SIZE}
486 Must be followed by a nonnegative minimum size specification. If this
487 value is zero, visuals with no green accumulation buffer are preferred.
488 Otherwise, the largest possible green accumulation buffer of at least
489 the minimum size is preferred.
491 @item @code{GLX_ACCUM_BLUE_SIZE}
492 Must be followed by a nonnegative minimum size specification. If this
493 value is zero, visuals with no blue accumulation buffer are preferred.
494 Otherwise, the largest possible blue accumulation buffer of at least the
495 minimum size is preferred.
497 @item @code{GLX_ACCUM_ALPHA_SIZE}
498 Must be followed by a nonnegative minimum size specification. If this
499 value is zero, visuals with no alpha accumulation buffer are preferred.
500 Otherwise, the largest possible alpha accumulation buffer of at least
501 the minimum size is preferred.
505 @code{NULL} is returned if an undefined GLX attribute is encountered in
510 @deftypefun void glXCopyContext dpy src dst mask
511 Copy state from one rendering context to another.
515 Specifies the connection to the X server.
518 Specifies the source context.
521 Specifies the destination context.
524 Specifies which portions of @var{src} state are to be copied to
529 @code{glXCopyContext} copies selected groups of state variables from
530 @var{src} to @var{dst}. @var{mask} indicates which groups of state
531 variables are to be copied. @var{mask} contains the bitwise OR of the
532 same symbolic names that are passed to the GL command
533 @code{glPushAttrib}. The single symbolic constant
534 @code{GLX_ALL_ATTRIB_BITS} can be used to copy the maximum possible
535 portion of rendering state.
537 The copy can be done only if the renderers named by @var{src} and
538 @var{dst} share an address space. Two rendering contexts share an
539 address space if both are nondirect using the same server, or if both
540 are direct and owned by a single process. Note that in the nondirect
541 case it is not necessary for the calling threads to share an address
542 space, only for their related rendering contexts to share an address
545 Not all values for GL state can be copied. For example, pixel pack and
546 unpack state, render mode state, and select and feedback state are not
547 copied. The state that can be copied is exactly the state that is
548 manipulated by the GL command @code{glPushAttrib}.
550 An implicit @code{glFlush} is done by @code{glXCopyContext} if @var{src}
551 is the current context for the calling thread.
553 @code{BadMatch} is generated if rendering contexts @var{src} and
554 @var{dst} do not share an address space or were not created with respect
557 @code{BadAccess} is generated if @var{dst} is current to any thread
558 (including the calling thread) at the time @code{glXCopyContext} is
561 @code{GLXBadCurrentWindow} is generated if @var{src} is the current
562 context and the current drawable is a window that is no longer valid.
564 @code{GLXBadContext} is generated if either @var{src} or @var{dst} is
565 not a valid GLX context.
569 @deftypefun GLXContext glXCreateContext dpy vis shareList direct
570 Create a new GLX rendering context.
574 Specifies the connection to the X server.
577 Specifies the visual that defines the frame buffer resources available
578 to the rendering context. It is a pointer to an @code{XVisualInfo}
579 structure, not a visual ID or a pointer to a @code{Visual}.
581 @item @var{shareList}
582 Specifies the context with which to share display lists. @code{NULL}
583 indicates that no sharing is to take place.
586 Specifies whether rendering is to be done with a direct connection to
587 the graphics system if possible (@code{True}) or through the X server
592 @code{glXCreateContext} creates a GLX rendering context and returns its
593 handle. This context can be used to render into both windows and GLX
594 pixmaps. If @code{glXCreateContext} fails to create a rendering context,
595 @code{NULL} is returned.
597 If @var{direct} is @code{True}, then a direct rendering context is
598 created if the implementation supports direct rendering, if the
599 connection is to an X server that is local, and if a direct rendering
600 context is available. (An implementation may return an indirect context
601 when @var{direct} is @code{True}.) If @var{direct} is @code{False}, then
602 a rendering context that renders through the X server is always created.
603 Direct rendering provides a performance advantage in some
604 implementations. However, direct rendering contexts cannot be shared
605 outside a single process, and they may be unable to render to GLX
608 If @var{shareList} is not @code{NULL}, then all display-list indexes and
609 definitions are shared by context @var{shareList} and by the newly
610 created context. An arbitrary number of contexts can share a single
611 display-list space. However, all rendering contexts that share a single
612 display-list space must themselves exist in the same address space. Two
613 rendering contexts share an address space if both are nondirect using
614 the same server, or if both are direct and owned by a single process.
615 Note that in the nondirect case, it is not necessary for the calling
616 threads to share an address space, only for their related rendering
617 contexts to share an address space.
619 If the GL version is 1.1 or greater, then all texture objects except
620 object 0 are shared by any contexts that share display lists.
622 @code{NULL} is returned if execution fails on the client side.
624 @code{BadMatch} is generated if the context to be created would not
625 share the address space or the screen of the context specified by
628 @code{BadValue} is generated if @var{vis} is not a valid visual (for
629 example, if a particular GLX implementation does not support it).
631 @code{GLXBadContext} is generated if @var{shareList} is not a GLX
632 context and is not @code{NULL}.
634 @code{BadAlloc} is generated if the server does not have enough
635 resources to allocate the new context.
639 @deftypefun GLXPixmap glXCreateGLXPixmap dpy vis pixmap
640 Create an off-screen GLX rendering area.
644 Specifies the connection to the X server.
647 Specifies the visual that defines the structure of the rendering area.
648 It is a pointer to an @code{XVisualInfo} structure, not a visual ID or a
649 pointer to a @code{Visual}.
652 Specifies the X pixmap that will be used as the front left color buffer
653 of the off-screen rendering area.
657 @code{glXCreateGLXPixmap} creates an off-screen rendering area and
658 returns its XID. Any GLX rendering context that was created with respect
659 to @var{vis} can be used to render into this off-screen area. Use
660 @code{glXMakeCurrent} to associate the rendering area with a GLX
663 The X pixmap identified by @var{pixmap} is used as the front left buffer
664 of the resulting off-screen rendering area. All other buffers specified
665 by @var{vis}, including color buffers other than the front left buffer,
666 are created without externally visible names. GLX pixmaps with
667 double-buffering are supported. However, @code{glXSwapBuffers} is
668 ignored by these pixmaps.
670 Some implementations may not support GLX pixmaps with direct rendering
673 @code{BadMatch} is generated if the depth of @var{pixmap} does not match
674 the depth value reported by core X11 for @var{vis}, or if @var{pixmap}
675 was not created with respect to the same screen as @var{vis}.
677 @code{BadValue} is generated if @var{vis} is not a valid XVisualInfo
678 pointer (for example, if a particular GLX implementation does not
679 support this visual).
681 @code{BadPixmap} is generated if @var{pixmap} is not a valid pixmap.
683 @code{BadAlloc} is generated if the server cannot allocate the GLX
688 @deftypefun GLXContext glXCreateNewContext dpy config render_type share_list direct
689 Create a new GLX rendering context.
693 Specifies the connection to the X server.
696 Specifies the GLXFBConfig structure with the desired attributes for the
699 @item @var{render_type}
700 Specifies the type of the context to be created. Must be one of
701 @code{GLX_RGBA_TYPE} or @code{GLX_COLOR_INDEX_TYPE}.
703 @item @var{share_list}
704 Specifies the context with which to share display lists. @code{NULL}
705 indicates that no sharing is to take place.
707 @item @var{share_list}
708 Specifies whether rendering is to be done with a direct connection to
709 the graphics system if possible (@code{True}) or through the X server
714 @code{glXCreateNewContext} creates a GLX rendering context and returns
715 its handle. This context can be used to render into GLX windows,
716 pixmaps, or pixel buffers. If @code{glXCreateNewContext} fails to create
717 a rendering context, @code{NULL} is returned.
719 If @var{render_type} is @code{GLX_RGBA_TYPE}, then a context that
720 supports RGBA rendering is created. If @var{config} is
721 @code{GLX_COLOR_INDEX_TYPE}, then context supporting color-index
722 rendering is created.
724 If @var{render_type} is not @code{NULL}, then all display-list indexes
725 and definitions are shared by context @var{render_type} and by the newly
726 created context. An arbitrary number of contexts can share a single
727 display-list space. However, all rendering contexts that share a single
728 display-list space must themselves exist in the same address space. Two
729 rendering contexts share an address space if both are nondirect using
730 the same server, or if both are direct and owned by a single process.
731 Note that in the nondirect case, it is not necessary for the calling
732 threads to share an address space, only for their related rendering
733 contexts to share an address space.
735 If @var{share_list} is @code{True}, then a direct-rendering context is
736 created if the implementation supports direct rendering, if the
737 connection is to an X server that is local, and if a direct-rendering
738 context is available. (An implementation may return an indirect context
739 when @var{share_list} is @code{True}.) If @var{share_list} is
740 @code{False}, then a rendering context that renders through the X server
741 is always created. Direct rendering provides a performance advantage in
742 some implementations. However, direct-rendering contexts cannot be
743 shared outside a single process, and they may be unable to render to GLX
746 @code{NULL} is returned if execution fails on the client side.
748 @code{GLXBadContext} is generated if @var{render_type} is not a GLX
749 context and is not @code{NULL}.
751 @code{GLXBadFBConfig} is generated if @var{config} is not a valid
754 @code{BadMatch} is generated if the context to be created would not
755 share the address space or the screen of the context specified by
758 @code{BadAlloc} is generated if the server does not have enough
759 resources to allocate the new context.
761 @code{BadValue} is generated if @var{config} is not a valid visual (for
762 example, if a particular GLX implementation does not support it).
766 @deftypefun GLXPbuffer glXCreatePbuffer dpy config attrib_list
767 Create an off-screen rendering area.
771 Specifies the connection to the X server.
774 Specifies a GLXFBConfig structure with the desired attributes for the
777 @item @var{attrib_list}
778 Specifies a list of attribute value pairs, which must be terminated with
779 @code{None} or @code{NULL}. Accepted attributes are
780 @code{GLX_PBUFFER_WIDTH}, @code{GLX_PBUFFER_HEIGHT},
781 @code{GLX_PRESERVED_CONTENTS}, and @code{GLX_LARGEST_PBUFFER}.
785 @code{glXCreatePbuffer} creates an off-screen rendering area and returns
786 its XID. Any GLX rendering context that was created with respect to
787 @var{config} can be used to render into this window. Use
788 @code{glXMakeContextCurrent} to associate the rendering area with a GLX
791 The accepted attributes for a GLXPbuffer are:
794 @item @code{GLX_PBUFFER_WIDTH}
795 Specify the pixel width of the requested GLXPbuffer. The default value
798 @item @code{GLX_PBUFFER_HEIGHT}
799 Specify the pixel height of the requested GLXPbuffer. The default value
802 @item @code{GLX_LARGEST_PBUFFER}
803 Specify to obtain the largest available pixel buffer, if the requested
804 allocation would have failed. The width and height of the allocated
805 pixel buffer will never exceed the specified @code{GLX_PBUFFER_WIDTH} or
806 @code{GLX_PBUFFER_HEIGHT}, respectively. Use @code{glXQueryDrawable} to
807 retrieve the dimensions of the allocated pixel buffer. The default value
810 @item @code{GLX_PRESERVED_CONTENTS}
811 Specify if the contents of the pixel buffer should be preserved when a
812 resource conflict occurs. If set to @code{False}, the contents of the
813 pixel buffer may be lost at any time. If set to @code{True}, or not
814 specified in @var{attrib_list}, then the contents of the pixel buffer
815 will be preserved (most likely by copying the contents into main system
816 memory from the frame buffer). In either case, the client can register
817 (using @code{glXSelectEvent}, to receive pixel buffer clobber events
818 that are generated when the pbuffer contents have been preserved or
823 GLXPbuffers contain the color and ancillary buffers specified by
824 @var{config}. It is possible to create a pixel buffer with back buffers
825 and to swap those buffers using @code{glXSwapBuffers}.
827 @code{BadAlloc} is generated if there are insufficient resources to
828 allocate the requested GLXPbuffer.
830 @code{GLXBadFBConfig} is generated if @var{config} is not a valid
833 @code{BadMatch} is generated if @var{config} does not support rendering
834 to pixel buffers (e.g., @code{GLX_DRAWABLE_TYPE} does not contain
835 @code{GLX_PBUFFER_BIT}).
839 @deftypefun GLXPixmap glXCreatePixmap dpy config pixmap attrib_list
840 Create an off-screen rendering area.
844 Specifies the connection to the X server.
847 Specifies a GLXFBConfig structure with the desired attributes for the
851 Specifies the X pixmap to be used as the rendering area.
853 @item @var{attrib_list}
854 Currently unused. This must be set to @code{NULL} or be an empty list
855 (i.e., one in which the first element is @code{None}).
859 @code{glXCreatePixmap} creates an off-screen rendering area and returns
860 its XID. Any GLX rendering context that was created with respect to
861 @var{config} can be used to render into this window. Use
862 @code{glXMakeCurrent} to associate the rendering area with a GLX
865 @code{BadMatch} is generated if @var{pixmap} was not created with a
866 visual that corresponds to @var{config}.
868 @code{BadMatch} is generated if @var{config} does not support rendering
869 to windows (e.g., @code{GLX_DRAWABLE_TYPE} does not contain
870 @code{GLX_WINDOW_BIT}).
872 @code{BadWindow} is generated if @var{pixmap} is not a valid window XID.
873 @code{BadAlloc} is generated if there is already a GLXFBConfig
874 associated with @var{pixmap}.
876 @code{BadAlloc} is generated if the X server cannot allocate a new GLX
879 @code{GLXBadFBConfig} is generated if @var{config} is not a valid
886 @deftypefun GLXWindow glXCreateWindow dpy config win attrib_list
887 Create an on-screen rendering area.
891 Specifies the connection to the X server.
894 Specifies a GLXFBConfig structure with the desired attributes for the
898 Specifies the X window to be used as the rendering area.
900 @item @var{attrib_list}
901 Currently unused. This must be set to @code{NULL} or be an empty list
902 (i.e., one in which the first element is @code{None}).
906 @code{glXCreateWindow} creates an on-screen rendering area from an
907 existing X window that was created with a visual matching @var{config}.
908 The XID of the GLXWindow is returned. Any GLX rendering context that was
909 created with respect to @var{config} can be used to render into this
910 window. Use @code{glXMakeContextCurrent} to associate the rendering area
911 with a GLX rendering context.
913 @code{BadMatch} is generated if @var{win} was not created with a visual
914 that corresponds to @var{config}.
916 @code{BadMatch} is generated if @var{config} does not support rendering
917 to windows (i.e., @code{GLX_DRAWABLE_TYPE} does not contain
918 @code{GLX_WINDOW_BIT}).
920 @code{BadWindow} is generated if @var{win} is not a valid pixmap XID.
922 @code{BadAlloc} is generated if there is already a GLXFBConfig
923 associated with @var{win}.
925 @code{BadAlloc} is generated if the X server cannot allocate a new GLX
928 @code{GLXBadFBConfig} is generated if @var{config} is not a valid
935 @deftypefun void glXDestroyContext dpy ctx
936 Destroy a GLX context.
940 Specifies the connection to the X server.
943 Specifies the GLX context to be destroyed.
947 If the GLX rendering context @var{ctx} is not current to any thread,
948 @code{glXDestroyContext} destroys it immediately. Otherwise, @var{ctx}
949 is destroyed when it becomes not current to any thread. In either case,
950 the resource ID referenced by @var{ctx} is freed immediately.
952 @code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
957 @deftypefun void glXDestroyGLXPixmap dpy pix
958 Destroy a GLX pixmap.
962 Specifies the connection to the X server.
965 Specifies the GLX pixmap to be destroyed.
969 If the GLX pixmap @var{pix} is not current to any client,
970 @code{glXDestroyGLXPixmap} destroys it immediately. Otherwise, @var{pix}
971 is destroyed when it becomes not current to any client. In either case,
972 the resource ID is freed immediately.
974 @code{GLXBadPixmap} is generated if @var{pix} is not a valid GLX pixmap.
978 @deftypefun void glXDestroyPbuffer dpy pbuf
979 Destroy an off-screen rendering area.
983 Specifies the connection to the X server.
986 Specifies the GLXPbuffer to be destroyed.
990 @code{glXDestroyPbuffer} destroys a GLXPbuffer created by
991 @code{glXCreatePbuffer}.
993 @code{GLXBadPbuffer} is generated if @var{pbuf} is not a valid
998 @deftypefun void glXDestroyPixmap dpy pixmap
999 Destroy an off-screen rendering area.
1003 Specifies the connection to the X server.
1006 Specifies the GLXPixmap to be destroyed.
1010 @code{glXDestroyPixmap} destroys a GLXPixmap created by
1011 @code{glXCreatePixmap}.
1013 @code{GLXBadPixmap} is generated if @var{pixmap} is not a valid
1018 @deftypefun void glXDestroyWindow dpy win
1019 Destroy an on-screen rendering area.
1023 Specifies the connection to the X server.
1026 Specifies the GLXWindow to be destroyed.
1030 @code{glXDestroyWindow} destroys a GLXWindow created by
1031 @code{glXCreateWindow}.
1033 @code{GLXBadWindow} is generated if @var{win} is not a valid GLXPixmap.
1037 @deftypefun void glXFreeContextEXT dpy ctx
1038 Free client-side memory for imported context.
1042 Specifies the connection to the X server.
1045 Specifies a GLX rendering context.
1049 @code{glXFreeContextEXT} frees the client-side part of a GLXContext that
1050 was created with @code{glXImportContextEXT}. @code{glXFreeContextEXT}
1051 does not free the server-side context information or the XID associated
1052 with the server-side context.
1054 @code{glXFreeContextEXT} is part of the @code{EXT_import_context}
1055 extension, not part of the core GLX command set. If
1056 _glxextstring(EXT_import_context) is included in the string returned by
1057 @code{glXQueryExtensionsString}, when called with argument
1058 @code{GLX_EXTENSIONS}, extension @code{EXT_vertex_array} is supported.
1060 @code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1065 @deftypefun const-char-* glXGetClientString dpy name
1066 Return a string describing the client.
1070 Specifies the connection to the X server.
1073 Specifies which string is returned. The symbolic constants
1074 @code{GLX_VENDOR}, @code{GLX_VERSION}, and @code{GLX_EXTENSIONS} are
1079 @code{glXGetClientString} returns a string describing some aspect of the
1080 client library. The possible values for @var{name} are
1081 @code{GLX_VENDOR}, @code{GLX_VERSION}, and @code{GLX_EXTENSIONS}. If
1082 @var{name} is not set to one of these values, @code{glXGetClientString}
1083 returns @code{NULL}. The format and contents of the vendor string is
1084 implementation dependent.
1086 The extensions string is null-terminated and contains a space-separated
1087 list of extension names. (The extension names never contain spaces.) If
1088 there are no extensions to GLX, then the empty string is returned.
1090 The version string is laid out as follows:
1092 <major_version.minor_version><space><vendor-specific info>
1094 Both the major and minor portions of the version number are of arbitrary
1095 length. The vendor-specific information is optional. However, if it is
1096 present, the format and contents are implementation specific.
1100 @deftypefun int glXGetConfig dpy vis attrib value
1101 Return information about GLX visuals.
1105 Specifies the connection to the X server.
1108 Specifies the visual to be queried. It is a pointer to an
1109 @code{XVisualInfo} structure, not a visual ID or a pointer to a
1113 Specifies the visual attribute to be returned.
1116 Returns the requested value.
1120 @code{glXGetConfig} sets @var{value} to the @var{attrib} value of
1121 windows or GLX pixmaps created with respect to @var{vis}.
1122 @code{glXGetConfig} returns an error code if it fails for any reason.
1123 Otherwise, zero is returned.
1125 @var{attrib} is one of the following:
1130 @item @code{GLX_USE_GL}
1131 @code{True} if OpenGL rendering is supported by this visual,
1132 @code{False} otherwise.
1134 @item @code{GLX_BUFFER_SIZE}
1135 Number of bits per color buffer. For RGBA visuals,
1136 @code{GLX_BUFFER_SIZE} is the sum of @code{GLX_RED_SIZE},
1137 @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and @code{GLX_ALPHA_SIZE}.
1138 For color index visuals, @code{GLX_BUFFER_SIZE} is the size of the color
1141 @item @code{GLX_LEVEL}
1142 Frame buffer level of the visual. Level zero is the default frame
1143 buffer. Positive levels correspond to frame buffers that overlay the
1144 default buffer, and negative levels correspond to frame buffers that
1145 underlay the default buffer.
1147 @item @code{GLX_RGBA}
1148 @code{True} if color buffers store red, green, blue, and alpha values.
1149 @code{False} if they store color indexes.
1151 @item @code{GLX_DOUBLEBUFFER}
1152 @code{True} if color buffers exist in front/back pairs that can be
1153 swapped, @code{False} otherwise.
1155 @item @code{GLX_STEREO}
1156 @code{True} if color buffers exist in left/right pairs, @code{False}
1159 @item @code{GLX_AUX_BUFFERS}
1160 Number of auxiliary color buffers that are available. Zero indicates
1161 that no auxiliary color buffers exist.
1163 @item @code{GLX_RED_SIZE}
1164 Number of bits of red stored in each color buffer. Undefined if
1165 @code{GLX_RGBA} is @code{False}.
1167 @item @code{GLX_GREEN_SIZE}
1168 Number of bits of green stored in each color buffer. Undefined if
1169 @code{GLX_RGBA} is @code{False}.
1171 @item @code{GLX_BLUE_SIZE}
1172 Number of bits of blue stored in each color buffer. Undefined if
1173 @code{GLX_RGBA} is @code{False}.
1175 @item @code{GLX_ALPHA_SIZE}
1176 Number of bits of alpha stored in each color buffer. Undefined if
1177 @code{GLX_RGBA} is @code{False}.
1179 @item @code{GLX_DEPTH_SIZE}
1180 Number of bits in the depth buffer.
1182 @item @code{GLX_STENCIL_SIZE}
1183 Number of bits in the stencil buffer.
1185 @item @code{GLX_ACCUM_RED_SIZE}
1186 Number of bits of red stored in the accumulation buffer.
1188 @item @code{GLX_ACCUM_GREEN_SIZE}
1189 Number of bits of green stored in the accumulation buffer.
1191 @item @code{GLX_ACCUM_BLUE_SIZE}
1192 Number of bits of blue stored in the accumulation buffer.
1194 @item @code{GLX_ACCUM_ALPHA_SIZE}
1195 Number of bits of alpha stored in the accumulation buffer.
1199 The X protocol allows a single visual ID to be instantiated with
1200 different numbers of bits per pixel. Windows or GLX pixmaps that will be
1201 rendered with OpenGL, however, must be instantiated with a color buffer
1202 depth of @code{GLX_BUFFER_SIZE}.
1204 Although a GLX implementation can export many visuals that support GL
1205 rendering, it must support at least one RGBA visual. This visual must
1206 have at least one color buffer, a stencil buffer of at least 1 bit, a
1207 depth buffer of at least 12 bits, and an accumulation buffer. Alpha
1208 bitplanes are optional in this visual. However, its color buffer size
1209 must be as great as that of the deepest @code{TrueColor},
1210 @code{DirectColor}, @code{PseudoColor}, or @code{StaticColor} visual
1211 supported on level zero, and it must itself be made available on level
1214 In addition, if the X server exports a @code{PseudoColor} or
1215 @code{StaticColor} visual on framebuffer level 0, a color index visual
1216 is also required on that level. It must have at least one color buffer,
1217 a stencil buffer of at least 1 bit, and a depth buffer of at least 12
1218 bits. This visual must have as many color bitplanes as the deepest
1219 @code{PseudoColor} or @code{StaticColor} visual supported on level 0.
1221 Applications are best written to select the visual that most closely
1222 meets their requirements. Creating windows or GLX pixmaps with
1223 unnecessary buffers can result in reduced rendering performance as well
1224 as poor resource allocation.
1226 @code{GLX_NO_EXTENSION} is returned if @var{dpy} does not support the
1229 @code{GLX_BAD_SCREEN} is returned if the screen of @var{vis} does not
1230 correspond to a screen.
1232 @code{GLX_BAD_ATTRIBUTE} is returned if @var{attrib} is not a valid GLX
1235 @code{GLX_BAD_VISUAL} is returned if @var{vis} doesn't support GLX and
1236 an attribute other than @code{GLX_USE_GL} is requested.
1240 @deftypefun GLXContextID glXGetContextIDEXT ctx
1241 Get the XID for a context..
1245 Specifies a GLX rendering context.
1249 @code{glXGetContextIDEXT} returns the XID associated with a GLXContext.
1251 No round trip is forced to the server; unlike most X calls that return a
1252 value, @code{glXGetContextIDEXT} does not flush any pending events.
1254 @code{glXGetContextIDEXT} is part of the @code{EXT_import_context}
1255 extension, not part of the core GLX command set. If
1256 _glxextstring(EXT_import_context) is included in the string returned by
1257 @code{glXQueryExtensionsString}, when called with argument
1258 @code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1260 @code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1265 @deftypefun GLXContext glXGetCurrentContext
1266 Return the current context.
1268 @code{glXGetCurrentContext} returns the current context, as specified by
1269 @code{glXMakeCurrent}. If there is no current context, @code{NULL} is
1272 @code{glXGetCurrentContext} returns client-side information. It does not
1273 make a round trip to the server.
1279 @deftypefun Display-* glXGetCurrentDisplay
1280 Get display for current context.
1282 @code{glXGetCurrentDisplay} returns the display for the current context.
1283 If no context is current, @code{NULL} is returned.
1285 @code{glXGetCurrentDisplay} returns client-side information. It does not
1286 make a round-trip to the server, and therefore does not flush any
1291 @deftypefun GLXDrawable glXGetCurrentDrawable
1292 Return the current drawable.
1294 @code{glXGetCurrentDrawable} returns the current drawable, as specified
1295 by @code{glXMakeCurrent}. If there is no current drawable, @code{None}
1298 @code{glXGetCurrentDrawable} returns client-side information. It does
1299 not make a round trip to the server.
1303 @deftypefun GLXDrawable glXGetCurrentReadDrawable
1304 Return the current drawable.
1306 @code{glXGetCurrentReadDrawable} returns the current read drawable, as
1307 specified by @code{read} parameter of @code{glXMakeContextCurrent}. If
1308 there is no current drawable, @code{None} is returned.
1310 @code{glXGetCurrentReadDrawable} returns client-side information. It
1311 does not make a round-trip to the server.
1315 @deftypefun int glXGetFBConfigAttrib dpy config attribute value
1316 Return information about a GLX frame buffer configuration.
1320 Specifies the connection to the X server.
1323 Specifies the GLX frame buffer configuration to be queried.
1325 @item @var{attribute}
1326 Specifies the attribute to be returned.
1329 Returns the requested value.
1333 @code{glXGetFBConfigAttrib} sets @var{value} to the @var{attribute}
1334 value of GLX drawables created with respect to @var{config}.
1335 @code{glXGetFBConfigAttrib} returns an error code if it fails for any
1336 reason. Otherwise, @code{Success} is returned.
1338 @var{attribute} is one of the following:
1343 @item @code{GLX_FBCONFIG_ID}
1344 XID of the given GLXFBConfig.
1346 @item @code{GLX_BUFFER_SIZE}
1349 Number of bits per color buffer. If the frame buffer configuration
1350 supports RGBA contexts, then @code{GLX_BUFFER_SIZE} is the sum of
1351 @code{GLX_RED_SIZE}, @code{GLX_GREEN_SIZE}, @code{GLX_BLUE_SIZE}, and
1352 @code{GLX_ALPHA_SIZE}. If the frame buffer configuration supports only
1353 color index contexts, @code{GLX_BUFFER_SIZE} is the size of the color
1356 @item @code{GLX_LEVEL}
1359 Frame buffer level of the configuration. Level zero is the default frame
1360 buffer. Positive levels correspond to frame buffers that overlay the
1361 default buffer, and negative levels correspond to frame buffers that
1362 underlie the default buffer.
1364 @item @code{GLX_DOUBLEBUFFER}
1367 @code{True} if color buffers exist in front/back pairs that can be
1368 swapped, @code{False} otherwise.
1370 @item @code{GLX_STEREO}
1373 @code{True} if color buffers exist in left/right pairs, @code{False}
1376 @item @code{GLX_AUX_BUFFERS}
1379 Number of auxiliary color buffers that are available. Zero indicates
1380 that no auxiliary color buffers exist.
1382 @item @code{GLX_RED_SIZE}
1385 Number of bits of red stored in each color buffer. Undefined if RGBA
1386 contexts are not supported by the frame buffer configuration.
1388 @item @code{GLX_GREEN_SIZE}
1391 Number of bits of green stored in each color buffer. Undefined if RGBA
1392 contexts are not supported by the frame buffer configuration.
1394 @item @code{GLX_BLUE_SIZE}
1397 Number of bits of blue stored in each color buffer. Undefined if RGBA
1398 contexts are not supported by the frame buffer configuration.
1400 @item @code{GLX_ALPHA_SIZE}
1403 Number of bits of alpha stored in each color buffer. Undefined if RGBA
1404 contexts are not supported by the frame buffer configuration.
1406 @item @code{GLX_DEPTH_SIZE}
1409 Number of bits in the depth buffer.
1411 @item @code{GLX_STENCIL_SIZE}
1414 Number of bits in the stencil buffer.
1416 @item @code{GLX_ACCUM_RED_SIZE}
1419 Number of bits of red stored in the accumulation buffer.
1421 @item @code{GLX_ACCUM_GREEN_SIZE}
1424 Number of bits of green stored in the accumulation buffer.
1426 @item @code{GLX_ACCUM_BLUE_SIZE}
1429 Number of bits of blue stored in the accumulation buffer.
1431 @item @code{GLX_ACCUM_ALPHA_SIZE}
1434 Number of bits of alpha stored in the accumulation buffer.
1436 @item @code{GLX_RENDER_TYPE}
1439 Mask indicating what type of GLX contexts can be made current to the
1440 frame buffer configuration. Valid bits are @code{GLX_RGBA_BIT} and
1441 @code{GLX_COLOR_INDEX_BIT}.
1443 @item @code{GLX_DRAWABLE_TYPE}
1446 Mask indicating what drawable types the frame buffer configuration
1447 supports. Valid bits are @code{GLX_WINDOW_BIT}, @code{GLX_PIXMAP_BIT},
1448 and @code{GLX_PBUFFER_BIT}.
1450 @item @code{GLX_X_RENDERABLE}
1453 @code{True} if drawables created with the frame buffer configuration can
1454 be rendered to by X.
1456 @item @code{GLX_VISUAL_ID}
1459 XID of the corresponding visual, or zero if there is no associated
1460 visual (i.e., if @code{GLX_X_RENDERABLE} is @code{False} or
1461 @code{GLX_DRAWABLE_TYPE} does not have the @code{GLX_WINDOW_BIT} bit
1464 @item @code{GLX_X_VISUAL_TYPE}
1467 Visual type of associated visual. The returned value will be one of:
1468 @code{GLX_TRUE_COLOR}, @code{GLX_DIRECT_COLOR}, @code{GLX_PSEUDO_COLOR},
1469 @code{GLX_STATIC_COLOR}, @code{GLX_GRAY_SCALE}, @code{GLX_STATIC_GRAY},
1470 or @code{GLX_NONE}, if there is no associated visual (i.e., if
1471 @code{GLX_X_RENDERABLE} is @code{False} or @code{GLX_DRAWABLE_TYPE} does
1472 not have the @code{GLX_WINDOW_BIT} bit set).
1474 @item @code{GLX_CONFIG_CAVEAT}
1477 One of @code{GLX_NONE}, @code{GLX_SLOW_CONFIG}, or
1478 @code{GLX_NON_CONFORMANT_CONFIG}, indicating that the frame buffer
1479 configuration has no caveats, some aspect of the frame buffer
1480 configuration runs slower than other frame buffer configurations, or
1481 some aspect of the frame buffer configuration is nonconformant,
1484 @item @code{GLX_TRANSPARENT_TYPE}
1487 One of @code{GLX_NONE}, @code{GLX_TRANSPARENT_RGB},
1488 @code{GLX_TRANSPARENT_INDEX}, indicating that the frame buffer
1489 configuration is opaque, is transparent for particular values of red,
1490 green, and blue, or is transparent for particular index values,
1493 @item @code{GLX_TRANSPARENT_INDEX_VALUE}
1496 Integer value between 0 and the maximum frame buffer value for indices,
1497 indicating the transparent index value for the frame buffer
1498 configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1499 @code{GLX_TRANSPARENT_INDEX}.
1501 @item @code{GLX_TRANSPARENT_RED_VALUE}
1504 Integer value between 0 and the maximum frame buffer value for red,
1505 indicating the transparent red value for the frame buffer configuration.
1506 Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1507 @code{GLX_TRANSPARENT_RGB}.
1509 @item @code{GLX_TRANSPARENT_GREEN_VALUE}
1512 Integer value between 0 and the maximum frame buffer value for green,
1513 indicating the transparent green value for the frame buffer
1514 configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1515 @code{GLX_TRANSPARENT_RGB}.
1517 @item @code{GLX_TRANSPARENT_BLUE_VALUE}
1520 Integer value between 0 and the maximum frame buffer value for blue,
1521 indicating the transparent blue value for the frame buffer
1522 configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1523 @code{GLX_TRANSPARENT_RGB}.
1525 @item @code{GLX_TRANSPARENT_ALPHA_VALUE}
1528 Integer value between 0 and the maximum frame buffer value for alpha,
1529 indicating the transparent blue value for the frame buffer
1530 configuration. Undefined if @code{GLX_TRANSPARENT_TYPE} is not
1531 @code{GLX_TRANSPARENT_RGB}.
1533 @item @code{GLX_MAX_PBUFFER_WIDTH}
1536 The maximum width that can be specified to @code{glXCreatePbuffer}.
1538 @item @code{GLX_MAX_PBUFFER_HEIGHT}
1541 The maximum height that can be specified to @code{glXCreatePbuffer}.
1543 @item @code{GLX_MAX_PBUFFER_PIXELS}
1546 The maximum number of pixels (width times height) for a pixel buffer.
1547 Note that this value may be less than @code{GLX_MAX_PBUFFER_WIDTH} times
1548 @code{GLX_MAX_PBUFFER_HEIGHT}. Also, this value is static and assumes
1549 that no other pixel buffers or X resources are contending for the frame
1550 buffer memory. As a result, it may not be possible to allocate a pixel
1551 buffer of the size given by @code{GLX_MAX_PBUFFER_PIXELS}.
1555 Applications should choose the frame buffer configuration that most
1556 closely meets their requirements. Creating windows, GLX pixmaps, or GLX
1557 pixel buffers with unnecessary buffers can result in reduced rendering
1558 performance as well as poor resource allocation.
1560 @code{GLX_NO_EXTENSION} is returned if @var{dpy} does not support the
1561 GLX extension. @code{GLX_BAD_ATTRIBUTE} is returned if @var{attribute}
1562 is not a valid GLX attribute.
1566 @deftypefun GLXFBConfig-* glXGetFBConfigs dpy screen nelements
1567 List all GLX frame buffer configurations for a given screen.
1571 Specifies the connection to the X server.
1574 Specifies the screen number.
1576 @item @var{nelements}
1577 Returns the number of GLXFBConfigs returned.
1581 @code{glXGetFBConfigs} returns a list of all GLXFBConfigs available on
1582 the screen specified by @var{screen}. Use @code{glXGetFBConfigAttrib} to
1583 obtain attribute values from a specific GLXFBConfig.
1587 @deftypefun void(*)() glXGetProcAddress procName
1588 Obtain a pointer to an OpenGL or GLX function.
1591 @item @var{procName}
1592 Specifies the name of the OpenGL or GLX function whose address is to be
1597 @code{glXGetProcAddress} returns the address of the function specified
1598 in @var{procName}. This is necessary in environments where the OpenGL
1599 link library exports a different set of functions than the runtime
1604 @deftypefun void glXGetSelectedEvent dpy draw event_mask
1605 Returns GLX events that are selected for a window or a GLX pixel buffer.
1609 Specifies the connection to the X server.
1612 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
1614 @item @var{event_mask}
1615 Returns the events that are selected for @var{draw}.
1619 @code{glXGetSelectedEvent} returns in @var{event_mask} the events
1620 selected for @var{draw}.
1622 @code{GLXBadDrawable} is generated if @var{draw} is not a valid window
1623 or a valid GLX pixel buffer.
1627 @deftypefun XVisualInfo-* glXGetVisualFromFBConfig dpy config
1628 Return visual that is associated with the frame buffer configuration.
1632 Specifies the connection to the X server.
1635 Specifies the GLX frame buffer configuration.
1639 If @var{config} is a valid GLX frame buffer configuration and it has an
1640 associated X Visual, then information describing that visual is
1641 returned; otherwise @code{NULL} is returned. Use @code{XFree} to free
1644 Returns @code{NULL} if @var{config} is not a valid GLXFBConfig.
1648 @deftypefun GLXContext glXImportContextEXT dpy contextID
1649 Import another process's indirect rendering context..
1653 Specifies the connection to the X server.
1655 @item @var{contextID}
1656 Specifies a GLX rendering context.
1660 @code{glXImportContextEXT} creates a GLXContext given the XID of an
1661 existing GLXContext. It may be used in place of @code{glXCreateContext},
1662 to share another process's indirect rendering context.
1664 Only the server-side context information can be shared between X
1665 clients; client-side state, such as pixel storage modes, cannot be
1666 shared. Thus, @code{glXImportContextEXT} must allocate memory to store
1667 client-side information. This memory is freed by calling
1668 @code{glXFreeContextEXT}.
1670 This call does not create a new XID. It merely makes an existing object
1671 available to the importing client (Display *). Like any XID, it goes
1672 away when the creating client drops its connection or the ID is
1673 explicitly deleted. Note that this is when the XID goes away. The object
1674 goes away when the XID goes away AND the context is not current to any
1677 If @var{contextID} refers to a direct rendering context then no error is
1678 generated but @code{glXImportContextEXT} returns NULL.
1680 @code{glXImportContextEXT} is part of the @code{EXT_import_context}
1681 extension, not part of the core GLX command set. If
1682 _glxextstring(EXT_import_context) is included in the string returned by
1683 @code{glXQueryExtensionsString}, when called with argument
1684 @code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1686 @code{GLXBadContext} is generated if @var{contextID} does not refer to a
1691 @deftypefun Bool glXIsDirect dpy ctx
1692 Indicate whether direct rendering is enabled.
1696 Specifies the connection to the X server.
1699 Specifies the GLX context that is being queried.
1703 @code{glXIsDirect} returns @code{True} if @var{ctx} is a direct
1704 rendering context, @code{False} otherwise. Direct rendering contexts
1705 pass rendering commands directly from the calling process's address
1706 space to the rendering system, bypassing the X server. Nondirect
1707 rendering contexts pass all rendering commands to the X server.
1709 @code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1714 @deftypefun Bool glXMakeContextCurrent display draw read ctx
1715 Attach a GLX context to a GLX drawable.
1719 Specifies the connection to the X server.
1722 Specifies a GLX drawable to render into. Must be an XID representing a
1723 GLXWindow, GLXPixmap, or GLXPbuffer.
1726 Specifies a GLX drawable to read from. Must be an XID representing a
1727 GLXWindow, GLXPixmap, or GLXPbuffer.
1730 Specifies the GLX context to be bound to @var{read} and @var{ctx}.
1734 @code{glXMakeContextCurrent} binds @var{ctx} to the current rendering
1735 thread and to the @var{draw} and @var{read} GLX drawables. @var{draw}
1736 and @var{read} may be the same.
1738 @var{draw} is used for all OpenGL operations except:
1740 Any pixel data that are read based on the value of
1741 @code{GLX_READ_BUFFER}. Note that accumulation operations use the value
1742 of @code{GLX_READ_BUFFER}, but are not allowed unless @var{draw} is
1743 identical to @var{read}.
1745 Any depth values that are retrieved by @code{glReadPixels} or
1746 @code{glCopyPixels}.
1748 Any stencil values that are retrieved by @code{glReadPixels} or
1749 @code{glCopyPixels}.
1751 Frame buffer values are taken from @var{draw}.
1753 If the current rendering thread has a current rendering context, that
1754 context is flushed and replaced by @var{ctx}.
1756 The first time that @var{ctx} is made current, the viewport and scissor
1757 dimensions are set to the size of the @var{draw} drawable. The viewport
1758 and scissor are not modified when @var{ctx} is subsequently made
1761 To release the current context without assigning a new one, call
1762 @code{glXMakeContextCurrent} with @var{draw} and @var{read} set to
1763 @code{None} and @var{ctx} set to @code{NULL}.
1765 @code{glXMakeContextCurrent} returns @code{True} if it is successful,
1766 @code{False} otherwise. If @code{False} is returned, the previously
1767 current rendering context and drawable (if any) remain unchanged.
1769 @code{BadMatch} is generated if @var{draw} and @var{read} are not
1772 @code{BadAccess} is generated if @var{ctx} is current to some other
1775 @code{GLXContextState} is generated if there is a current rendering
1776 context and its render mode is either @code{GLX_FEEDBACK} or
1779 @code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1782 @code{GLXBadDrawable} is generated if @var{draw} or @var{read} is not a
1785 @code{GLXBadWindow} is generated if the underlying X window for either
1786 @var{draw} or @var{read} is no longer valid.
1788 @code{GLXBadCurrentDrawable} is generated if the previous context of the
1789 calling thread has unflushed commands and the previous drawable is no
1792 @code{BadAlloc} is generated if the X server does not have enough
1793 resources to allocate the buffers.
1795 @code{BadMatch} is generated if:
1797 @var{draw} and @var{read} cannot fit into frame buffer memory
1800 @var{draw} or @var{read} is a GLXPixmap and @var{ctx} is a
1801 direct-rendering context.
1803 @var{draw} or @var{read} is a GLXPixmap and @var{ctx} was previously
1804 bound to a GLXWindow or GLXPbuffer.
1806 @var{draw} or @var{read} is a GLXWindow or GLXPbuffer and @var{ctx} was
1807 previously bound to a GLXPixmap.
1811 @deftypefun Bool glXMakeCurrent dpy drawable ctx
1812 Attach a GLX context to a window or a GLX pixmap.
1816 Specifies the connection to the X server.
1818 @item @var{drawable}
1819 Specifies a GLX drawable. Must be either an X window ID or a GLX pixmap
1823 Specifies a GLX rendering context that is to be attached to
1828 @code{glXMakeCurrent} does two things: It makes @var{ctx} the current
1829 GLX rendering context of the calling thread, replacing the previously
1830 current context if there was one, and it attaches @var{ctx} to a GLX
1831 drawable, either a window or a GLX pixmap. As a result of these two
1832 actions, subsequent GL rendering calls use rendering context @var{ctx}
1833 to modify GLX drawable @var{drawable} (for reading and writing). Because
1834 @code{glXMakeCurrent} always replaces the current rendering context with
1835 @var{ctx}, there can be only one current context per thread.
1837 Pending commands to the previous context, if any, are flushed before it
1840 The first time @var{ctx} is made current to any thread, its viewport is
1841 set to the full size of @var{drawable}. Subsequent calls by any thread
1842 to @code{glXMakeCurrent} with @var{ctx} have no effect on its viewport.
1844 To release the current context without assigning a new one, call
1845 @code{glXMakeCurrent} with @var{drawable} set to @code{None} and
1846 @var{ctx} set to @code{NULL}.
1848 @code{glXMakeCurrent} returns @code{True} if it is successful,
1849 @code{False} otherwise. If @code{False} is returned, the previously
1850 current rendering context and drawable (if any) remain unchanged.
1852 @code{BadMatch} is generated if @var{drawable} was not created with the
1853 same X screen and visual as @var{ctx}. It is also generated if
1854 @var{drawable} is @code{None} and @var{ctx} is not @code{NULL}.
1856 @code{BadAccess} is generated if @var{ctx} was current to another thread
1857 at the time @code{glXMakeCurrent} was called.
1859 @code{GLXBadDrawable} is generated if @var{drawable} is not a valid GLX
1862 @code{GLXBadContext} is generated if @var{ctx} is not a valid GLX
1865 @code{GLXBadContextState} is generated if @code{glXMakeCurrent} is
1866 executed between the execution of @code{glBegin} and the corresponding
1867 execution of @code{glEnd}.
1869 @code{GLXBadContextState} is also generated if the rendering context
1870 current to the calling thread has GL renderer state @code{GLX_FEEDBACK}
1871 or @code{GLX_SELECT}.
1873 @code{GLXBadCurrentWindow} is generated if there are pending GL commands
1874 for the previous context and the current drawable is a window that is no
1877 @code{BadAlloc} may be generated if the server has delayed allocation of
1878 ancillary buffers until @code{glXMakeCurrent} is called, only to find
1879 that it has insufficient resources to complete the allocation.
1883 @deftypefun int glXQueryContextInfoEXT dpy ctx attribute value
1884 Query context information.
1888 Specifies the connection to the X server.
1891 Specifies a GLX rendering context.
1893 @item @var{attribute}
1894 Specifies that a context parameter should be retrieved. Must be one of
1895 @code{GLX_SHARED_CONTEXT_EXT}, @code{GLX_VISUAL_ID_EXT}, or
1896 @code{GLX_SCREEN_EXT}.
1899 Contains the return value for @var{attribute}.
1903 @code{glXQueryContextInfoEXT} sets @var{value} to the value of
1904 @var{attribute} with respect to @var{ctx}. @code{glXQueryContextInfoEXT}
1905 returns an error code if it fails for any reason. Otherwise,
1906 @code{Success} is returned.
1908 @var{attribute} may be one of the following:
1911 @item @code{GLX_SHARED_CONTEXT_EXT}
1912 Returns the XID of the share list context associated with @var{ctx} at
1915 @item @code{GLX_VISUAL_ID_EXT}
1916 Returns the XID of the GLX Visual associated with @var{ctx}.
1918 @item @code{GLX_SCREEN_EXT}
1919 Returns the screen number associated with @var{ctx}.
1923 This call may cause a round-trip to the server.
1925 @code{glXQueryContextInfoEXT} is part of the @code{EXT_import_context}
1926 extension, not part of the core GLX command set. If
1927 _glxextstring(EXT_import_context) is included in the string returned by
1928 @code{glXQueryExtensionsString}, when called with argument
1929 @code{GLX_EXTENSIONS}, extension @code{EXT_import_context} is supported.
1931 @code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1934 @code{GLX_BAD_ATTRIBUTE} is returned if @var{attribute} is not a valid
1935 GLX context attribute.
1937 fred @code{GLX_BAD_CONTEXT} is returned if @var{attribute} is not a
1942 @deftypefun int glXQueryContext dpy ctx attribute value
1943 Query context information.
1947 Specifies the connection to the X server.
1950 Specifies a GLX rendering context.
1952 @item @var{attribute}
1953 Specifies that a context parameter should be retrieved. Must be one of
1954 @code{GLX_FBCONFIG_ID}, @code{GLX_RENDER_TYPE}, or @code{GLX_SCREEN}.
1957 Contains the return value for @var{attribute}.
1961 @code{glXQueryContext} sets @var{value} to the value of @var{attribute}
1962 with respect to @var{ctx}. @var{attribute} may be one of the following:
1965 @item @code{GLX_FBCONFIG_ID}
1966 Returns the XID of the GLXFBConfig associated with @var{ctx}.
1968 @item @code{GLX_RENDER_TYPE}
1969 Returns the rendering type supported by @var{ctx}.
1971 @item @code{GLX_SCREEN}
1972 Returns the screen number associated with @var{ctx}.
1976 @code{Success} is returned unless @var{attribute} is not a valid GLX
1977 context attribute, in which case @code{GLX_BAD_ATTRIBUTE} is returned.
1979 This call may cause a round-trip to the server.
1981 @code{GLXBadContext} is generated if @var{ctx} does not refer to a valid
1986 @deftypefun int glXQueryDrawable dpy draw attribute value
1987 Returns an attribute assoicated with a GLX drawable.
1991 Specifies the connection to the X server.
1994 Specifies the GLX drawable to be queried.
1996 @item @var{attribute}
1997 Specifies the attribute to be returned. Must be one of @code{GLX_WIDTH},
1998 @code{GLX_HEIGHT}, @code{GLX_PRESERVED_CONTENTS},
1999 @code{GLX_LARGEST_PBUFFER}, or @code{GLX_FBCONFIG_ID}.
2002 Contains the return value for @var{attribute}.
2006 @code{glXQueryDrawable} sets @var{value} to the value of @var{attribute}
2007 with respect to the GLXDrawable @var{draw}.
2009 @var{attribute} may be one of the following:
2012 @item @code{GLX_WIDTH}
2013 Returns the width of @var{ctx}.
2015 @item @code{GLX_HEIGHT}
2016 Returns the height of @var{ctx}.
2018 @item @code{GLX_PRESERVED_CONTENTS}
2019 Returns @code{True} if the contents of a GLXPbuffer are preserved when a
2020 resource conflict occurs; @code{False} otherwise.
2022 @item @code{GLX_LARGEST_PBUFFER}
2023 Returns the value set when @code{glXCreatePbuffer} was called to create
2024 the GLXPbuffer. If @code{False} is returned, then the call to
2025 @code{glXCreatePbuffer} will fail to create a GLXPbuffer if the
2026 requested size is larger than the implementation maximum or available
2027 resources. If @code{True} is returned, a GLXPbuffer of the maximum
2028 availble size (if less than the requested width and height) is created.
2030 @item @code{GLX_FBCONFIG_ID}
2031 Returns the XID for @var{draw}.
2035 If @var{draw} is a GLXWindow or GLXPixmap and @var{attribute} is set to
2036 @code{GLX_PRESERVED_CONTENTS} or @code{GLX_LARGETST_PBUFFER}, the
2037 contents of @var{value} are undefined. If @var{attribute} is not one of
2038 the attributes listed above, the contents of @var{value} are unedfined.
2040 A @code{GLXBadDrawable} is generated if @var{draw} is not a valid
2045 @deftypefun const-char-* glXQueryExtensionsString dpy screen
2046 Return list of supported extensions.
2050 Specifies the connection to the X server.
2053 Specifies the screen number.
2057 @code{glXQueryExtensionsString} returns a pointer to a string describing
2058 which GLX extensions are supported on the connection. The string is
2059 null-terminated and contains a space-separated list of extension names.
2060 (The extension names themselves never contain spaces.) If there are no
2061 extensions to GLX, then the empty string is returned.
2065 @deftypefun Bool glXQueryExtension dpy errorBase eventBase
2066 Indicate whether the GLX extension is supported.
2070 Specifies the connection to the X server.
2072 @item @var{errorBase}
2073 Returns the base error code of the GLX server extension.
2075 @item @var{eventBase}
2076 Returns the base event code of the GLX server extension.
2080 @code{glXQueryExtension} returns @code{True} if the X server of
2081 connection @var{dpy} supports the GLX extension, @code{False} otherwise.
2082 If @code{True} is returned, then @var{errorBase} and @var{eventBase}
2083 return the error base and event base of the GLX extension. These values
2084 should be added to the constant error and event values to determine the
2085 actual event or error values. Otherwise, @var{errorBase} and
2086 @var{eventBase} are unchanged.
2088 @var{errorBase} and @var{eventBase} do not return values if they are
2089 specified as @code{NULL}.
2093 @deftypefun const-char-* glXQueryServerString dpy screen name
2094 Return string describing the server.
2098 Specifies the connection to the X server.
2101 Specifies the screen number.
2104 Specifies which string is returned: one of @code{GLX_VENDOR},
2105 @code{GLX_VERSION}, or @code{GLX_EXTENSIONS}.
2109 @code{glXQueryServerString} returns a pointer to a static,
2110 null-terminated string describing some aspect of the server's GLX
2111 extension. The possible values for @var{name} and the format of the
2112 strings is the same as for @code{glXGetClientString}. If @var{name} is
2113 not set to a recognized value, @code{NULL} is returned.
2117 @deftypefun Bool glXQueryVersion dpy major minor
2118 Return the version numbers of the GLX extension.
2122 Specifies the connection to the X server.
2125 Returns the major version number of the GLX server extension.
2128 Returns the minor version number of the GLX server extension.
2132 @code{glXQueryVersion} returns the major and minor version numbers of
2133 the GLX extension implemented by the server associated with connection
2134 @var{dpy}. Implementations with the same major version number are upward
2135 compatible, meaning that the implementation with the higher minor number
2136 is a superset of the version with the lower minor number.
2138 @var{major} and @var{minor} do not return values if they are specified
2141 @code{glXQueryVersion} returns @code{False} if it fails, @code{True}
2144 @var{major} and @var{minor} are not updated when @code{False} is
2149 @deftypefun void glXSelectEvent dpy draw event_mask
2150 Select GLX events for a window or a GLX pixel buffer.
2154 Specifies the connection to the X server.
2157 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
2159 @item @var{event_mask}
2160 Specifies the events to be returned for @var{draw}.
2164 @code{glXSelectEvent} sets the GLX event mask for a GLX pixel buffer or
2165 a window. Calling @code{glXSelectEvent} overrides any previous event
2166 mask that was set by the client for @var{draw}. Note that it does not
2167 affect the event masks that other clients may have specified for
2168 @var{draw} since each client rendering to @var{draw} has a separate
2171 Currently, only one GLX event, @code{GLX_PBUFFER_CLOBBER_MASK}, can be
2172 selected. The following data is returned to the client when a
2173 @code{GLX_PBUFFER_CLOBBER_MASK} event occurs:
2179 int @var{event_type};
2180 /* GLX_DAMAGED or GLX_SAVED */
2183 int @var{draw_type};
2184 /* GLX_WINDOW or GLX_PBUFFER */
2187 unsigned long @var{serial};
2188 /* # of last request processed by server */
2191 Bool @var{send_event};
2192 /* true if this came for SendEvent request */
2195 Display @var{*display};
2196 /* display the event was read from */
2199 GLXDrawable @var{drawable};
2200 /* i.d. of Drawable */
2203 unsigned int @var{buffer_mask};
2204 /* mask indicating affected buffers */
2211 int @var{width, height};
2216 /* if nonzero, at least this many more */
2220 @} GLXPbufferClobberEvent; The valid bit masks used in @var{buffer_mask}
2226 @item @strong{Bitmask}
2227 @strong{Corresponding Buffer}
2229 @item @code{GLX_FRONT_LEFT_BUFFER_BIT}
2230 Front left color buffer
2232 @item @code{GLX_FRONT_RIGHT_BUFFER_BIT}
2233 Front right color buffer
2235 @item @code{GLX_BACK_LEFT_BUFFER_BIT}
2236 Back left color buffer
2238 @item @code{GLX_BACK_RIGHT_BUFFER_BIT}
2239 Back right color buffer
2241 @item @code{GLX_AUX_BUFFERS_BIT}
2244 @item @code{GLX_DEPTH_BUFFER_BIT}
2247 @item @code{GLX_STENCIL_BUFFER_BIT}
2250 @item @code{GLX_ACCUM_BUFFER_BIT}
2255 A single X server operation can cause several buffer clobber events to
2256 be sent. (e.g., a single GLX pixel buffer may be damaged and cause
2257 multiple buffer clobber events to be generated). Each event specifies
2258 one region of the GLX drawable that was affected by the X Server
2259 operation. The @var{buffer_mask} field indicates which color buffers and
2260 ancillary buffers were affected. All the buffer clobber events generated
2261 by a single X server action are guaranteed to be contiguous in the event
2262 queue. The conditions under which this event is generated and the
2263 @var{event_type} varies, depending on the type of the GLX drawable.
2265 When the @code{GLX_AUX_BUFFERS_BIT} is set in @var{buffer_mask}, then
2266 @var{aux_buffer} is set to indicate which buffer was affected. If more
2267 than one aux buffer was affected, then additional events are generated
2268 as part of the same contiguous event group. Each additional event will
2269 have only the @code{GLX_AUX_BUFFERS_BIT} set in @var{buffer_mask}, and
2270 the @var{aux_buffer} field will be set appropriately. For nonstereo
2271 drawables, @code{GLX_FRONT_LEFT_BUFFER_BIT} and
2272 @code{GLX_BACK_LEFT_BUFFER_BIT} are used to specify the front and back
2275 For preserved GLX pixel buffers, a buffer clobber event with type
2276 @code{GLX_SAVED} is generated whenever the contents of the GLX pixel
2277 buffer is moved out of offscreen memory. The event(s) describes which
2278 portions of the GLX pixel buffer were affected. Clients who receive many
2279 buffer clobber events, referring to different save actions, should
2280 consider freeing the GLX pixel buffer resource in order to prevent the
2281 system from thrashing due to insufficient resources.
2283 For an unpreserved GLXPbuffer, a buffer clobber event, with type
2284 @code{GLX_DAMAGED}, is generated whenever a portion of the GLX pixel
2285 buffer becomes invalid. The client may wish to regenerate the invalid
2286 portions of the GLX pixel buffer.
2288 For Windows, buffer clobber events, with type @code{GLX_SAVED}, occur
2289 whenever an ancillary buffer, associated with the window, gets clobbered
2290 or moved out of off-screen memory. The event contains information
2291 indicating which color buffers and ancillary buffers\(emand which
2292 portions of those buffers\(emwere affected.
2294 @code{GLXBadDrawable} is generated if @var{draw} is not a valid window
2295 or a valid GLX pixel buffer.
2299 @deftypefun void glXSwapBuffers dpy drawable
2300 Exchange front and back buffers.
2304 Specifies the connection to the X server.
2306 @item @var{drawable}
2307 Specifies the drawable whose buffers are to be swapped.
2311 @code{glXSwapBuffers} promotes the contents of the back buffer of
2312 @var{drawable} to become the contents of the front buffer of
2313 @var{drawable}. The contents of the back buffer then become undefined.
2314 The update typically takes place during the vertical retrace of the
2315 monitor, rather than immediately after @code{glXSwapBuffers} is called.
2317 @code{glXSwapBuffers} performs an implicit @code{glFlush} before it
2318 returns. Subsequent OpenGL commands may be issued immediately after
2319 calling @code{glXSwapBuffers}, but are not executed until the buffer
2320 exchange is completed.
2322 If @var{drawable} was not created with respect to a double-buffered
2323 visual, @code{glXSwapBuffers} has no effect, and no error is generated.
2325 @code{GLXBadDrawable} is generated if @var{drawable} is not a valid GLX
2328 @code{GLXBadCurrentWindow} is generated if @var{dpy} and @var{drawable}
2329 are respectively the display and drawable associated with the current
2330 context of the calling thread, and @var{drawable} identifies a window
2331 that is no longer valid.
2335 @deftypefun void glXUseXFont font first count listBase
2336 Create bitmap display lists from an X font.
2340 Specifies the font from which character glyphs are to be taken.
2343 Specifies the index of the first glyph to be taken.
2346 Specifies the number of glyphs to be taken.
2348 @item @var{listBase}
2349 Specifies the index of the first display list to be generated.
2353 @code{glXUseXFont} generates @var{count} display lists, named
2354 @var{listBase} through @r{@var{listBase}+@var{count}-1}, each containing
2355 a single @code{glBitmap} command. The parameters of the @code{glBitmap}
2356 command of display list @r{@var{listBase}+@var{i}} are derived from
2357 glyph @r{@var{first}+@var{i}}. Bitmap parameters @r{@var{xorig}},
2358 @r{@var{yorig}}, @r{@var{width}}, and @r{@var{height}} are computed from
2359 font metrics as @r{@var{descent}-1}, @r{-@var{lbearing}},
2360 @r{@var{rbearing}-@var{lbearing}}, and @r{@var{ascent}+@var{descent}},
2361 respectively. @r{@var{xmove}} is taken from the glyph's @r{@var{width}}
2362 metric, and @r{@var{ymove}} is set to zero. Finally, the glyph's image
2363 is converted to the appropriate format for @code{glBitmap}.
2365 Using @code{glXUseXFont} may be more efficient than accessing the X font
2366 and generating the display lists explicitly, both because the display
2367 lists are created on the server without requiring a round trip of the
2368 glyph data, and because the server may choose to delay the creation of
2369 each bitmap until it is accessed.
2371 Empty display lists are created for all glyphs that are requested and
2372 are not defined in @var{font}. @code{glXUseXFont} is ignored if there is
2373 no current GLX context.
2375 @code{BadFont} is generated if @var{font} is not a valid font.
2377 @code{GLXBadContextState} is generated if the current GLX context is in
2378 display-list construction mode.
2380 @code{GLXBadCurrentWindow} is generated if the drawable associated with
2381 the current context of the calling thread is a window, and that window
2386 @deftypefun void glXWaitGL
2387 Complete GL execution prior to subsequent X calls.
2389 GL rendering calls made prior to @code{glXWaitGL} are guaranteed to be
2390 executed before X rendering calls made after @code{glXWaitGL}. Although
2391 this same result can be achieved using @code{glFinish}, @code{glXWaitGL}
2392 does not require a round trip to the server, and it is therefore more
2393 efficient in cases where client and server are on separate machines.
2395 @code{glXWaitGL} is ignored if there is no current GLX context.
2397 @code{GLXBadCurrentWindow} is generated if the drawable associated with
2398 the current context of the calling thread is a window, and that window
2403 @deftypefun void glXWaitX
2404 Complete X execution prior to subsequent GL calls.
2406 X rendering calls made prior to @code{glXWaitX} are guaranteed to be
2407 executed before GL rendering calls made after @code{glXWaitX}. Although
2408 the same result can be achieved using @code{XSync}, @code{glXWaitX} does
2409 not require a round trip to the server, and it is therefore more
2410 efficient in cases where client and server are on separate machines.
2412 @code{glXWaitX} is ignored if there is no current GLX context.
2414 @code{GLXBadCurrentWindow} is generated if the drawable associated with
2415 the current context of the calling thread is a window, and that window