1 ;;; figl -*- mode: scheme; coding: utf-8 -*-
2 ;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
4 ;;; Figl is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Lesser General Public License as
6 ;;; published by the Free Software Foundation, either version 3 of the
7 ;;; License, or (at your option) any later version.
9 ;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12 ;;; Public License for more details.
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
18 ;;; Derived from upstream OpenGL documentation.
20 ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is
21 ;;; licensed under the SGI Free Software B License. For details, see
22 ;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
24 ;;; Automatically generated; you probably don't want to edit this. To
25 ;;; update, run "make update" in the top-level build tree.
56 glXGetCurrentReadDrawable
61 glXGetVisualFromFBConfig
66 glXQueryContextInfoEXT
69 glXQueryExtensionsString
79 (define-glx-procedures
83 (attrib_list const-int-*)
87 "Return a list of GLX frame buffer configurations that match the
91 Specifies the connection to the X server.
94 Specifies the screen number.
97 Specifies a list of attribute/value pairs. The last attribute must
101 Returns the number of elements in the list returned by
104 `glXChooseFBConfig' returns GLX frame buffer configurations that match
105 the attributes specified in ATTRIB_LIST, or `NULL' if no matches are
106 found. If ATTRIB_LIST is `NULL', then `glXChooseFBConfig' returns an
107 array of GLX frame buffer configurations that are available on the
108 specified screen. If an error occurs, no frame buffer configurations
109 exist on the specified screen, or if no frame buffer configurations
110 match the specified attributes, then `NULL' is returned. Use `XFree' to
111 free the memory returned by `glXChooseFBConfig'.
113 All attributes in ATTRIB_LIST, including boolean attributes, are
114 immediately followed by the corresponding desired value. The list is
115 terminated with `None'. If an attribute is not specified in
116 ATTRIB_LIST, then the default value (see below) is used (and the
117 attribute is said to be specified implicitly). For example, if
118 `GLX_STEREO' is not specified, then it is assumed to be `False'. For
119 some attributes, the default is `GLX_DONT_CARE', meaning that any value
120 is OK for this attribute, so the attribute will not be checked.
122 Attributes are matched in an attribute-specific manner. Some of the
123 attributes, such as `GLX_LEVEL', must match the specified value exactly;
124 others, such as, `GLX_RED_SIZE' must meet or exceed the specified
125 minimum values. If more than one GLX frame buffer configuration is
126 found, then a list of configurations, sorted according to the ``best''
127 match criteria, is returned. The match criteria for each attribute and
128 the exact sorting order is defined below.
130 The interpretations of the various GLX visual attributes are as follows:
135 Must be followed by a valid XID that indicates the desired GLX
136 frame buffer configuration. When a `GLX_FBCONFIG_ID' is specified,
137 all attributes are ignored. The default value is `GLX_DONT_CARE'.
142 Must be followed by a nonnegative integer that indicates the
143 desired color index buffer size. The smallest index buffer of at
144 least the specified size is preferred. This attribute is ignored
145 if `GLX_COLOR_INDEX_BIT' is not set in `GLX_RENDER_TYPE'. The
151 Must be followed by an integer buffer-level specification. This
152 specification is honored exactly. Buffer level 0 corresponds to
153 the default frame buffer of the display. Buffer level 1 is the
154 first overlay frame buffer, level two the second overlay frame
155 buffer, and so on. Negative buffer levels correspond to underlay
156 frame buffers. The default value is 0.
161 Must be followed by `True' or `False'. If `True' is specified,
162 then only double-buffered frame buffer configurations are
163 considered; if `False' is specified, then only single-buffered
164 frame buffer configurations are considered. The default value is
170 Must be followed by `True' or `False'. If `True' is specified,
171 then only stereo frame buffer configurations are considered; if
172 `False' is specified, then only monoscopic frame buffer
173 configurations are considered. The default value is `False'.
178 Must be followed by a nonnegative integer that indicates the
179 desired number of auxiliary buffers. Configurations with the
180 smallest number of auxiliary buffers that meet or exceed the
181 specified number are preferred. The default value is 0.
183 `GLX_RED_SIZE', `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', `GLX_ALPHA_SIZE'
186 Each attribute, if present, must be followed by a nonnegative
187 minimum size specification or `GLX_DONT_CARE'. The largest
188 available total RGBA color buffer size (sum of `GLX_RED_SIZE',
189 `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', and `GLX_ALPHA_SIZE') of at
190 least the minimum size specified for each color component is
191 preferred. If the requested number of bits for a color component
192 is 0 or `GLX_DONT_CARE', it is not considered. The default value
193 for each color component is 0.
198 Must be followed by a nonnegative minimum size specification. If
199 this value is zero, frame buffer configurations with no depth
200 buffer are preferred. Otherwise, the largest available depth
201 buffer of at least the minimum size is preferred. The default
207 Must be followed by a nonnegative integer that indicates the
208 desired number of stencil bitplanes. The smallest stencil buffer
209 of at least the specified size is preferred. If the desired value
210 is zero, frame buffer configurations with no stencil buffer are
211 preferred. The default value is 0.
216 Must be followed by a nonnegative minimum size specification. If
217 this value is zero, frame buffer configurations with no red
218 accumulation buffer are preferred. Otherwise, the largest possible
219 red accumulation buffer of at least the minimum size is preferred.
220 The default value is 0.
222 `GLX_ACCUM_GREEN_SIZE'
225 Must be followed by a nonnegative minimum size specification. If
226 this value is zero, frame buffer configurations with no green
227 accumulation buffer are preferred. Otherwise, the largest possible
228 green accumulation buffer of at least the minimum size is
229 preferred. The default value is 0.
231 `GLX_ACCUM_BLUE_SIZE'
234 Must be followed by a nonnegative minimum size specification. If
235 this value is zero, frame buffer configurations with no blue
236 accumulation buffer are preferred. Otherwise, the largest possible
237 blue accumulation buffer of at least the minimum size is preferred.
238 The default value is 0.
240 `GLX_ACCUM_ALPHA_SIZE'
243 Must be followed by a nonnegative minimum size specification. If
244 this value is zero, frame buffer configurations with no alpha
245 accumulation buffer are preferred. Otherwise, the largest possible
246 alpha accumulation buffer of at least the minimum size is
247 preferred. The default value is 0.
252 Must be followed by a mask indicating which OpenGL rendering modes
253 the frame buffer configuration must support. Valid bits are
254 `GLX_RGBA_BIT' and `GLX_COLOR_INDEX_BIT'. If the mask is set to
255 `GLX_RGBA_BIT' | `GLX_COLOR_INDEX_BIT', then only frame buffer
256 configurations that can be bound to both RGBA contexts and color
257 index contexts will be considered. The default value is
263 Must be followed by a mask indicating which GLX drawable types the
264 frame buffer configuration must support. Valid bits are
265 `GLX_WINDOW_BIT', `GLX_PIXMAP_BIT', and `GLX_PBUFFER_BIT'. For
266 example, if mask is set to `GLX_WINDOW_BIT' | `GLX_PIXMAP_BIT',
267 only frame buffer configurations that support both windows and GLX
268 pixmaps will be considered. The default value is `GLX_WINDOW_BIT'.
273 Must be followed by `True' or `False'. If `True' is specified,
274 then only frame buffer configurations that have associated X
275 visuals (and can be used to render to Windows and/or GLX pixmaps)
276 will be considered. The default value is `GLX_DONT_CARE'.
281 Must be followed by one of `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR',
282 `GLX_PSEUDO_COLOR', `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', or
283 `GLX_STATIC_GRAY', indicating the desired X visual type. Not all
284 frame buffer configurations have an associated X visual. If
285 `GLX_DRAWABLE_TYPE' is specified in ATTRIB_LIST and the mask that
286 follows does not have `GLX_WINDOW_BIT' set, then this value is
287 ignored. It is also ignored if `GLX_X_RENDERABLE' is specified as
288 `False'. RGBA rendering may be supported for visuals of type
289 `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR', or
290 `GLX_STATIC_COLOR', but color index rendering is only supported for
291 visuals of type `GLX_PSEUDO_COLOR' or `GLX_STATIC_COLOR' (i.e.,
292 single-channel visuals). The tokens `GLX_GRAY_SCALE' and
293 `GLX_STATIC_GRAY' will not match current OpenGL enabled visuals,
294 but are included for future use. The default value for
295 `GLX_X_VISUAL_TYPE' is `GLX_DONT_CARE'.
300 Must be followed by one of `GLX_NONE', `GLX_SLOW_CONFIG',
301 `GLX_NON_CONFORMANT_CONFIG'. If `GLX_NONE' is specified, then only
302 frame buffer configurations with no caveats will be considered; if
303 `GLX_SLOW_CONFIG' is specified, then only slow frame buffer
304 configurations will be considered; if `GLX_NON_CONFORMANT_CONFIG'
305 is specified, then only nonconformant frame buffer configurations
306 will be considered. The default value is `GLX_DONT_CARE'.
308 `GLX_TRANSPARENT_TYPE'
311 Must be followed by one of `GLX_NONE', `GLX_TRANSPARENT_RGB',
312 `GLX_TRANSPARENT_INDEX'. If `GLX_NONE' is specified, then only
313 opaque frame buffer configurations will be considered; if
314 `GLX_TRANSPARENT_RGB' is specified, then only transparent frame
315 buffer configurations that support RGBA rendering will be
316 considered; if `GLX_TRANSPARENT_INDEX' is specified, then only
317 transparent frame buffer configurations that support color index
318 rendering will be considered. The default value is `GLX_NONE'.
320 `GLX_TRANSPARENT_INDEX_VALUE'
323 Must be followed by an integer value indicating the transparent
324 index value; the value must be between 0 and the maximum frame
325 buffer value for indices. Only frame buffer configurations that
326 use the specified transparent index value will be considered. The
327 default value is `GLX_DONT_CARE'. This attribute is ignored unless
328 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
329 `GLX_TRANSPARENT_INDEX'.
331 `GLX_TRANSPARENT_RED_VALUE'
334 Must be followed by an integer value indicating the transparent red
335 value; the value must be between 0 and the maximum frame buffer
336 value for red. Only frame buffer configurations that use the
337 specified transparent red value will be considered. The default
338 value is `GLX_DONT_CARE'. This attribute is ignored unless
339 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
340 `GLX_TRANSPARENT_RGB'.
342 `GLX_TRANSPARENT_GREEN_VALUE'
345 Must be followed by an integer value indicating the transparent
346 green value; the value must be between 0 and the maximum frame
347 buffer value for green. Only frame buffer configurations that use
348 the specified transparent green value will be considered. The
349 default value is `GLX_DONT_CARE'. This attribute is ignored unless
350 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
351 `GLX_TRANSPARENT_RGB'.
353 `GLX_TRANSPARENT_BLUE_VALUE'
356 Must be followed by an integer value indicating the transparent
357 blue value; the value must be between 0 and the maximum frame
358 buffer value for blue. Only frame buffer configurations that use
359 the specified transparent blue value will be considered. The
360 default value is `GLX_DONT_CARE'. This attribute is ignored unless
361 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
362 `GLX_TRANSPARENT_RGB'.
364 `GLX_TRANSPARENT_ALPHA_VALUE'
367 Must be followed by an integer value indicating the transparent
368 alpha value; the value must be between 0 and the maximum frame
369 buffer value for alpha. Only frame buffer configurations that use
370 the specified transparent alpha value will be considered. The
371 default value is `GLX_DONT_CARE'.
373 When more than one GLX frame buffer configuration matches the specified
374 attributes, a list of matching configurations is returned. The list is
375 sorted according to the following precedence rules, which are applied in
376 ascending order (i.e., configurations that are considered equal by a
377 lower numbered rule are sorted by the higher numbered rule):
380 By `GLX_CONFIG_CAVEAT' where the precedence is `GLX_NONE',
381 `GLX_SLOW_CONFIG', and `GLX_NON_CONFORMANT_CONFIG'.
384 Larger total number of RGBA color components (`GLX_RED_SIZE',
385 `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', plus `GLX_ALPHA_SIZE') that have
386 higher number of bits. If the requested number of bits in
387 ATTRIB_LIST is zero or `GLX_DONT_CARE' for a particular color
388 component, then the number of bits for that component is not
392 Smaller `GLX_BUFFER_SIZE'.
395 Single buffered configuration (`GLX_DOUBLEBUFFER' being `False'
396 precedes a double buffered one.
399 Smaller `GLX_AUX_BUFFERS'.
402 Larger `GLX_DEPTH_SIZE'.
405 Smaller `GLX_STENCIL_SIZE'.
408 Larger total number of accumulation buffer color components
409 (`GLX_ACCUM_RED_SIZE', `GLX_ACCUM_GREEN_SIZE',
410 `GLX_ACCUM_BLUE_SIZE', plus `GLX_ACCUM_ALPHA_SIZE') that have
411 higher number of bits. If the requested number of bits in
412 ATTRIB_LIST is zero or `GLX_DONT_CARE' for a particular color
413 component, then the number of bits for that component is not
417 By `GLX_X_VISUAL_TYPE' where the precedence order is
418 `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR',
419 `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', `GLX_STATIC_GRAY'.
421 `NULL' is returned if an undefined GLX attribute is encountered in
422 ATTRIB_LIST, if SCREEN is invalid, or if DPY does not support the GLX
425 (define-glx-procedures
432 "Return a visual that matches specified attributes.
435 Specifies the connection to the X server.
438 Specifies the screen number.
441 Specifies a list of boolean attributes and integer attribute/value
442 pairs. The last attribute must be `None'.
444 `glXChooseVisual' returns a pointer to an XVisualInfo structure
445 describing the visual that best meets a minimum specification. The
446 boolean GLX attributes of the visual that is returned will match the
447 specified values, and the integer GLX attributes will meet or exceed the
448 specified minimum values. If all other attributes are equivalent, then
449 TrueColor and PseudoColor visuals have priority over DirectColor and
450 StaticColor visuals, respectively. If no conforming visual exists,
451 `NULL' is returned. To free the data returned by this function, use
454 All boolean GLX attributes default to `False' except `GLX_USE_GL', which
455 defaults to `True'. All integer GLX attributes default to zero. Default
456 specifications are superseded by attributes included in ATTRIBLIST.
457 Boolean attributes included in ATTRIBLIST are understood to be `True'.
458 Integer attributes and enumerated type attributes are followed
459 immediately by the corresponding desired or minimum value. The list
460 must be terminated with `None'.
462 The interpretations of the various GLX visual attributes are as follows:
465 Ignored. Only visuals that can be rendered with GLX are
469 Must be followed by a nonnegative integer that indicates the
470 desired color index buffer size. The smallest index buffer of at
471 least the specified size is preferred. Ignored if `GLX_RGBA' is
475 Must be followed by an integer buffer-level specification. This
476 specification is honored exactly. Buffer level zero corresponds to
477 the main frame buffer of the display. Buffer level one is the
478 first overlay frame buffer, level two the second overlay frame
479 buffer, and so on. Negative buffer levels correspond to underlay
483 If present, only TrueColor and DirectColor visuals are considered.
484 Otherwise, only PseudoColor and StaticColor visuals are considered.
487 If present, only double-buffered visuals are considered. Otherwise,
488 only single-buffered visuals are considered.
491 If present, only stereo visuals are considered. Otherwise, only
492 monoscopic visuals are considered.
495 Must be followed by a nonnegative integer that indicates the
496 desired number of auxiliary buffers. Visuals with the smallest
497 number of auxiliary buffers that meets or exceeds the specified
498 number are preferred.
501 Must be followed by a nonnegative minimum size specification. If
502 this value is zero, the smallest available red buffer is preferred.
503 Otherwise, the largest available red buffer of at least the minimum
507 Must be followed by a nonnegative minimum size specification. If
508 this value is zero, the smallest available green buffer is
509 preferred. Otherwise, the largest available green buffer of at
510 least the minimum size is preferred.
513 Must be followed by a nonnegative minimum size specification. If
514 this value is zero, the smallest available blue buffer is
515 preferred. Otherwise, the largest available blue buffer of at
516 least the minimum size is preferred.
519 Must be followed by a nonnegative minimum size specification. If
520 this value is zero, the smallest available alpha buffer is
521 preferred. Otherwise, the largest available alpha buffer of at
522 least the minimum size is preferred.
525 Must be followed by a nonnegative minimum size specification. If
526 this value is zero, visuals with no depth buffer are preferred.
527 Otherwise, the largest available depth buffer of at least the
528 minimum size is preferred.
531 Must be followed by a nonnegative integer that indicates the
532 desired number of stencil bitplanes. The smallest stencil buffer
533 of at least the specified size is preferred. If the desired value
534 is zero, visuals with no stencil buffer are preferred.
537 Must be followed by a nonnegative minimum size specification. If
538 this value is zero, visuals with no red accumulation buffer are
539 preferred. Otherwise, the largest possible red accumulation buffer
540 of at least the minimum size is preferred.
542 `GLX_ACCUM_GREEN_SIZE'
543 Must be followed by a nonnegative minimum size specification. If
544 this value is zero, visuals with no green accumulation buffer are
545 preferred. Otherwise, the largest possible green accumulation
546 buffer of at least the minimum size is preferred.
548 `GLX_ACCUM_BLUE_SIZE'
549 Must be followed by a nonnegative minimum size specification. If
550 this value is zero, visuals with no blue accumulation buffer are
551 preferred. Otherwise, the largest possible blue accumulation
552 buffer of at least the minimum size is preferred.
554 `GLX_ACCUM_ALPHA_SIZE'
555 Must be followed by a nonnegative minimum size specification. If
556 this value is zero, visuals with no alpha accumulation buffer are
557 preferred. Otherwise, the largest possible alpha accumulation
558 buffer of at least the minimum size is preferred.
560 `NULL' is returned if an undefined GLX attribute is encountered in
563 (define-glx-procedures
571 "Copy state from one rendering context to another.
574 Specifies the connection to the X server.
577 Specifies the source context.
580 Specifies the destination context.
583 Specifies which portions of SRC state are to be copied to DST.
585 `glXCopyContext' copies selected groups of state variables from SRC to
586 DST. MASK indicates which groups of state variables are to be copied.
587 MASK contains the bitwise OR of the same symbolic names that are passed
588 to the GL command `glPushAttrib'. The single symbolic constant
589 `GLX_ALL_ATTRIB_BITS' can be used to copy the maximum possible portion
592 The copy can be done only if the renderers named by SRC and DST share an
593 address space. Two rendering contexts share an address space if both
594 are nondirect using the same server, or if both are direct and owned by
595 a single process. Note that in the nondirect case it is not necessary
596 for the calling threads to share an address space, only for their
597 related rendering contexts to share an address space.
599 Not all values for GL state can be copied. For example, pixel pack and
600 unpack state, render mode state, and select and feedback state are not
601 copied. The state that can be copied is exactly the state that is
602 manipulated by the GL command `glPushAttrib'.
604 An implicit `glFlush' is done by `glXCopyContext' if SRC is the current
605 context for the calling thread.
607 `BadMatch' is generated if rendering contexts SRC and DST do not share
608 an address space or were not created with respect to the same screen.
610 `BadAccess' is generated if DST is current to any thread (including the
611 calling thread) at the time `glXCopyContext' is called.
613 `GLXBadCurrentWindow' is generated if SRC is the current context and the
614 current drawable is a window that is no longer valid.
616 `GLXBadContext' is generated if either SRC or DST is not a valid GLX
619 (define-glx-procedures
623 (shareList GLXContext)
627 "Create a new GLX rendering context.
630 Specifies the connection to the X server.
633 Specifies the visual that defines the frame buffer resources
634 available to the rendering context. It is a pointer to an
635 `XVisualInfo' structure, not a visual ID or a pointer to a
639 Specifies the context with which to share display lists. `NULL'
640 indicates that no sharing is to take place.
643 Specifies whether rendering is to be done with a direct connection
644 to the graphics system if possible (`True') or through the X server
647 `glXCreateContext' creates a GLX rendering context and returns its
648 handle. This context can be used to render into both windows and GLX
649 pixmaps. If `glXCreateContext' fails to create a rendering context,
652 If DIRECT is `True', then a direct rendering context is created if the
653 implementation supports direct rendering, if the connection is to an X
654 server that is local, and if a direct rendering context is available.
655 (An implementation may return an indirect context when DIRECT is
656 `True'.) If DIRECT is `False', then a rendering context that renders
657 through the X server is always created. Direct rendering provides a
658 performance advantage in some implementations. However, direct
659 rendering contexts cannot be shared outside a single process, and they
660 may be unable to render to GLX pixmaps.
662 If SHARELIST is not `NULL', then all display-list indexes and
663 definitions are shared by context SHARELIST and by the newly created
664 context. An arbitrary number of contexts can share a single
665 display-list space. However, all rendering contexts that share a single
666 display-list space must themselves exist in the same address space. Two
667 rendering contexts share an address space if both are nondirect using
668 the same server, or if both are direct and owned by a single process.
669 Note that in the nondirect case, it is not necessary for the calling
670 threads to share an address space, only for their related rendering
671 contexts to share an address space.
673 If the GL version is 1.1 or greater, then all texture objects except
674 object 0 are shared by any contexts that share display lists.
676 `NULL' is returned if execution fails on the client side.
678 `BadMatch' is generated if the context to be created would not share the
679 address space or the screen of the context specified by SHARELIST.
681 `BadValue' is generated if VIS is not a valid visual (for example, if a
682 particular GLX implementation does not support it).
684 `GLXBadContext' is generated if SHARELIST is not a GLX context and is
687 `BadAlloc' is generated if the server does not have enough resources to
688 allocate the new context.")
690 (define-glx-procedures
697 "Create an off-screen GLX rendering area.
700 Specifies the connection to the X server.
703 Specifies the visual that defines the structure of the rendering
704 area. It is a pointer to an `XVisualInfo' structure, not a visual
705 ID or a pointer to a `Visual'.
708 Specifies the X pixmap that will be used as the front left color
709 buffer of the off-screen rendering area.
711 `glXCreateGLXPixmap' creates an off-screen rendering area and returns
712 its XID. Any GLX rendering context that was created with respect to VIS
713 can be used to render into this off-screen area. Use `glXMakeCurrent'
714 to associate the rendering area with a GLX rendering context.
716 The X pixmap identified by PIXMAP is used as the front left buffer of
717 the resulting off-screen rendering area. All other buffers specified by
718 VIS, including color buffers other than the front left buffer, are
719 created without externally visible names. GLX pixmaps with
720 double-buffering are supported. However, `glXSwapBuffers' is ignored by
723 Some implementations may not support GLX pixmaps with direct rendering
726 `BadMatch' is generated if the depth of PIXMAP does not match the depth
727 value reported by core X11 for VIS, or if PIXMAP was not created with
728 respect to the same screen as VIS.
730 `BadValue' is generated if VIS is not a valid XVisualInfo pointer (for
731 example, if a particular GLX implementation does not support this
734 `BadPixmap' is generated if PIXMAP is not a valid pixmap.
736 `BadAlloc' is generated if the server cannot allocate the GLX pixmap.")
738 (define-glx-procedures
739 ((glXCreateNewContext
743 (share_list GLXContext)
747 "Create a new GLX rendering context.
750 Specifies the connection to the X server.
753 Specifies the GLXFBConfig structure with the desired attributes for
757 Specifies the type of the context to be created. Must be one of
758 `GLX_RGBA_TYPE' or `GLX_COLOR_INDEX_TYPE'.
761 Specifies the context with which to share display lists. `NULL'
762 indicates that no sharing is to take place.
765 Specifies whether rendering is to be done with a direct connection
766 to the graphics system if possible (`True') or through the X server
769 `glXCreateNewContext' creates a GLX rendering context and returns its
770 handle. This context can be used to render into GLX windows, pixmaps,
771 or pixel buffers. If `glXCreateNewContext' fails to create a rendering
772 context, `NULL' is returned.
774 If RENDER_TYPE is `GLX_RGBA_TYPE', then a context that supports RGBA
775 rendering is created. If CONFIG is `GLX_COLOR_INDEX_TYPE', then context
776 supporting color-index rendering is created.
778 If RENDER_TYPE is not `NULL', then all display-list indexes and
779 definitions are shared by context RENDER_TYPE and by the newly created
780 context. An arbitrary number of contexts can share a single
781 display-list space. However, all rendering contexts that share a single
782 display-list space must themselves exist in the same address space. Two
783 rendering contexts share an address space if both are nondirect using
784 the same server, or if both are direct and owned by a single process.
785 Note that in the nondirect case, it is not necessary for the calling
786 threads to share an address space, only for their related rendering
787 contexts to share an address space.
789 If SHARE_LIST is `True', then a direct-rendering context is created if
790 the implementation supports direct rendering, if the connection is to an
791 X server that is local, and if a direct-rendering context is available.
792 (An implementation may return an indirect context when SHARE_LIST is
793 `True'.) If SHARE_LIST is `False', then a rendering context that renders
794 through the X server is always created. Direct rendering provides a
795 performance advantage in some implementations. However,
796 direct-rendering contexts cannot be shared outside a single process, and
797 they may be unable to render to GLX pixmaps.
799 `NULL' is returned if execution fails on the client side.
801 `GLXBadContext' is generated if RENDER_TYPE is not a GLX context and is
804 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.
806 `BadMatch' is generated if the context to be created would not share the
807 address space or the screen of the context specified by RENDER_TYPE.
809 `BadAlloc' is generated if the server does not have enough resources to
810 allocate the new context.
812 `BadValue' is generated if CONFIG is not a valid visual (for example, if
813 a particular GLX implementation does not support it).")
815 (define-glx-procedures
819 (attrib_list const-int-*)
822 "Create an off-screen rendering area.
825 Specifies the connection to the X server.
828 Specifies a GLXFBConfig structure with the desired attributes for
832 Specifies a list of attribute value pairs, which must be terminated
833 with `None' or `NULL'. Accepted attributes are
834 `GLX_PBUFFER_WIDTH', `GLX_PBUFFER_HEIGHT',
835 `GLX_PRESERVED_CONTENTS', and `GLX_LARGEST_PBUFFER'.
837 `glXCreatePbuffer' creates an off-screen rendering area and returns its
838 XID. Any GLX rendering context that was created with respect to CONFIG
839 can be used to render into this window. Use `glXMakeContextCurrent' to
840 associate the rendering area with a GLX rendering context.
842 The accepted attributes for a GLXPbuffer are:
845 Specify the pixel width of the requested GLXPbuffer. The default
849 Specify the pixel height of the requested GLXPbuffer. The default
852 `GLX_LARGEST_PBUFFER'
853 Specify to obtain the largest available pixel buffer, if the
854 requested allocation would have failed. The width and height of
855 the allocated pixel buffer will never exceed the specified
856 `GLX_PBUFFER_WIDTH' or `GLX_PBUFFER_HEIGHT', respectively. Use
857 `glXQueryDrawable' to retrieve the dimensions of the allocated
858 pixel buffer. The default value is `False'.
860 `GLX_PRESERVED_CONTENTS'
861 Specify if the contents of the pixel buffer should be preserved
862 when a resource conflict occurs. If set to `False', the contents
863 of the pixel buffer may be lost at any time. If set to `True', or
864 not specified in ATTRIB_LIST, then the contents of the pixel buffer
865 will be preserved (most likely by copying the contents into main
866 system memory from the frame buffer). In either case, the client
867 can register (using `glXSelectEvent', to receive pixel buffer
868 clobber events that are generated when the pbuffer contents have
869 been preserved or damaged.
871 GLXPbuffers contain the color and ancillary buffers specified by CONFIG.
872 It is possible to create a pixel buffer with back buffers and to swap
873 those buffers using `glXSwapBuffers'.
875 `BadAlloc' is generated if there are insufficient resources to allocate
876 the requested GLXPbuffer.
878 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.
880 `BadMatch' is generated if CONFIG does not support rendering to pixel
881 buffers (e.g., `GLX_DRAWABLE_TYPE' does not contain `GLX_PBUFFER_BIT').")
883 (define-glx-procedures
888 (attrib_list const-int-*)
891 "Create an off-screen rendering area.
894 Specifies the connection to the X server.
897 Specifies a GLXFBConfig structure with the desired attributes for
901 Specifies the X pixmap to be used as the rendering area.
904 Currently unused. This must be set to `NULL' or be an empty list
905 (i.e., one in which the first element is `None').
907 `glXCreatePixmap' creates an off-screen rendering area and returns its
908 XID. Any GLX rendering context that was created with respect to CONFIG
909 can be used to render into this window. Use `glXMakeCurrent' to
910 associate the rendering area with a GLX rendering context.
912 `BadMatch' is generated if PIXMAP was not created with a visual that
913 corresponds to CONFIG.
915 `BadMatch' is generated if CONFIG does not support rendering to windows
916 (e.g., `GLX_DRAWABLE_TYPE' does not contain `GLX_WINDOW_BIT').
918 `BadWindow' is generated if PIXMAP is not a valid window XID. `BadAlloc'
919 is generated if there is already a GLXFBConfig associated with PIXMAP.
921 `BadAlloc' is generated if the X server cannot allocate a new GLX
924 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.")
926 (define-glx-procedures
931 (attrib_list const-int-*)
934 "Create an on-screen rendering area.
937 Specifies the connection to the X server.
940 Specifies a GLXFBConfig structure with the desired attributes for
944 Specifies the X window to be used as the rendering area.
947 Currently unused. This must be set to `NULL' or be an empty list
948 (i.e., one in which the first element is `None').
950 `glXCreateWindow' creates an on-screen rendering area from an existing X
951 window that was created with a visual matching CONFIG. The XID of the
952 GLXWindow is returned. Any GLX rendering context that was created with
953 respect to CONFIG can be used to render into this window. Use
954 `glXMakeContextCurrent' to associate the rendering area with a GLX
957 `BadMatch' is generated if WIN was not created with a visual that
958 corresponds to CONFIG.
960 `BadMatch' is generated if CONFIG does not support rendering to windows
961 (i.e., `GLX_DRAWABLE_TYPE' does not contain `GLX_WINDOW_BIT').
963 `BadWindow' is generated if WIN is not a valid pixmap XID.
965 `BadAlloc' is generated if there is already a GLXFBConfig associated
968 `BadAlloc' is generated if the X server cannot allocate a new GLX
971 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.")
973 (define-glx-procedures
979 "Destroy a GLX context.
982 Specifies the connection to the X server.
985 Specifies the GLX context to be destroyed.
987 If the GLX rendering context CTX is not current to any thread,
988 `glXDestroyContext' destroys it immediately. Otherwise, CTX is
989 destroyed when it becomes not current to any thread. In either case,
990 the resource ID referenced by CTX is freed immediately.
992 `GLXBadContext' is generated if CTX is not a valid GLX context.")
994 (define-glx-procedures
995 ((glXDestroyGLXPixmap
1000 "Destroy a GLX pixmap.
1003 Specifies the connection to the X server.
1006 Specifies the GLX pixmap to be destroyed.
1008 If the GLX pixmap PIX is not current to any client,
1009 `glXDestroyGLXPixmap' destroys it immediately. Otherwise, PIX is
1010 destroyed when it becomes not current to any client. In either case,
1011 the resource ID is freed immediately.
1013 `GLXBadPixmap' is generated if PIX is not a valid GLX pixmap.")
1015 (define-glx-procedures
1021 "Destroy an off-screen rendering area.
1024 Specifies the connection to the X server.
1027 Specifies the GLXPbuffer to be destroyed.
1029 `glXDestroyPbuffer' destroys a GLXPbuffer created by `glXCreatePbuffer'.
1031 `GLXBadPbuffer' is generated if PBUF is not a valid GLXPbuffer.")
1033 (define-glx-procedures
1039 "Destroy an off-screen rendering area.
1042 Specifies the connection to the X server.
1045 Specifies the GLXPixmap to be destroyed.
1047 `glXDestroyPixmap' destroys a GLXPixmap created by `glXCreatePixmap'.
1049 `GLXBadPixmap' is generated if PIXMAP is not a valid GLXPixmap.")
1051 (define-glx-procedures
1057 "Destroy an on-screen rendering area.
1060 Specifies the connection to the X server.
1063 Specifies the GLXWindow to be destroyed.
1065 `glXDestroyWindow' destroys a GLXWindow created by `glXCreateWindow'.
1067 `GLXBadWindow' is generated if WIN is not a valid GLXPixmap.")
1069 (define-glx-procedures
1075 "Free client-side memory for imported context.
1078 Specifies the connection to the X server.
1081 Specifies a GLX rendering context.
1083 `glXFreeContextEXT' frees the client-side part of a GLXContext that was
1084 created with `glXImportContextEXT'. `glXFreeContextEXT' does not free
1085 the server-side context information or the XID associated with the
1086 server-side context.
1088 `glXFreeContextEXT' is part of the `EXT_import_context' extension, not
1089 part of the core GLX command set. If _glxextstring(EXT_import_context)
1090 is included in the string returned by `glXQueryExtensionsString', when
1091 called with argument `GLX_EXTENSIONS', extension `EXT_vertex_array' is
1094 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1096 (define-glx-procedures
1097 ((glXGetClientString
1102 "Return a string describing the client.
1105 Specifies the connection to the X server.
1108 Specifies which string is returned. The symbolic constants
1109 `GLX_VENDOR', `GLX_VERSION', and `GLX_EXTENSIONS' are accepted.
1111 `glXGetClientString' returns a string describing some aspect of the
1112 client library. The possible values for NAME are `GLX_VENDOR',
1113 `GLX_VERSION', and `GLX_EXTENSIONS'. If NAME is not set to one of these
1114 values, `glXGetClientString' returns `NULL'. The format and contents of
1115 the vendor string is implementation dependent.
1117 The extensions string is null-terminated and contains a space-separated
1118 list of extension names. (The extension names never contain spaces.) If
1119 there are no extensions to GLX, then the empty string is returned.
1121 The version string is laid out as follows:
1123 <major_version.minor_version><space><vendor-specific info>
1125 Both the major and minor portions of the version number are of arbitrary
1126 length. The vendor-specific information is optional. However, if it is
1127 present, the format and contents are implementation specific.")
1129 (define-glx-procedures
1137 "Return information about GLX visuals.
1140 Specifies the connection to the X server.
1143 Specifies the visual to be queried. It is a pointer to an
1144 `XVisualInfo' structure, not a visual ID or a pointer to a
1148 Specifies the visual attribute to be returned.
1151 Returns the requested value.
1153 `glXGetConfig' sets VALUE to the ATTRIB value of windows or GLX pixmaps
1154 created with respect to VIS. `glXGetConfig' returns an error code if it
1155 fails for any reason. Otherwise, zero is returned.
1157 ATTRIB is one of the following:
1162 `True' if OpenGL rendering is supported by this visual, `False'
1166 Number of bits per color buffer. For RGBA visuals,
1167 `GLX_BUFFER_SIZE' is the sum of `GLX_RED_SIZE', `GLX_GREEN_SIZE',
1168 `GLX_BLUE_SIZE', and `GLX_ALPHA_SIZE'. For color index visuals,
1169 `GLX_BUFFER_SIZE' is the size of the color indexes.
1172 Frame buffer level of the visual. Level zero is the default frame
1173 buffer. Positive levels correspond to frame buffers that overlay
1174 the default buffer, and negative levels correspond to frame buffers
1175 that underlay the default buffer.
1178 `True' if color buffers store red, green, blue, and alpha values.
1179 `False' if they store color indexes.
1182 `True' if color buffers exist in front/back pairs that can be
1183 swapped, `False' otherwise.
1186 `True' if color buffers exist in left/right pairs, `False'
1190 Number of auxiliary color buffers that are available. Zero
1191 indicates that no auxiliary color buffers exist.
1194 Number of bits of red stored in each color buffer. Undefined if
1195 `GLX_RGBA' is `False'.
1198 Number of bits of green stored in each color buffer. Undefined if
1199 `GLX_RGBA' is `False'.
1202 Number of bits of blue stored in each color buffer. Undefined if
1203 `GLX_RGBA' is `False'.
1206 Number of bits of alpha stored in each color buffer. Undefined if
1207 `GLX_RGBA' is `False'.
1210 Number of bits in the depth buffer.
1213 Number of bits in the stencil buffer.
1215 `GLX_ACCUM_RED_SIZE'
1216 Number of bits of red stored in the accumulation buffer.
1218 `GLX_ACCUM_GREEN_SIZE'
1219 Number of bits of green stored in the accumulation buffer.
1221 `GLX_ACCUM_BLUE_SIZE'
1222 Number of bits of blue stored in the accumulation buffer.
1224 `GLX_ACCUM_ALPHA_SIZE'
1225 Number of bits of alpha stored in the accumulation buffer.
1227 The X protocol allows a single visual ID to be instantiated with
1228 different numbers of bits per pixel. Windows or GLX pixmaps that will
1229 be rendered with OpenGL, however, must be instantiated with a color
1230 buffer depth of `GLX_BUFFER_SIZE'.
1232 Although a GLX implementation can export many visuals that support GL
1233 rendering, it must support at least one RGBA visual. This visual must
1234 have at least one color buffer, a stencil buffer of at least 1 bit, a
1235 depth buffer of at least 12 bits, and an accumulation buffer. Alpha
1236 bitplanes are optional in this visual. However, its color buffer size
1237 must be as great as that of the deepest `TrueColor', `DirectColor',
1238 `PseudoColor', or `StaticColor' visual supported on level zero, and it
1239 must itself be made available on level zero.
1241 In addition, if the X server exports a `PseudoColor' or `StaticColor'
1242 visual on framebuffer level 0, a color index visual is also required on
1243 that level. It must have at least one color buffer, a stencil buffer of
1244 at least 1 bit, and a depth buffer of at least 12 bits. This visual
1245 must have as many color bitplanes as the deepest `PseudoColor' or
1246 `StaticColor' visual supported on level 0.
1248 Applications are best written to select the visual that most closely
1249 meets their requirements. Creating windows or GLX pixmaps with
1250 unnecessary buffers can result in reduced rendering performance as well
1251 as poor resource allocation.
1253 `GLX_NO_EXTENSION' is returned if DPY does not support the GLX
1256 `GLX_BAD_SCREEN' is returned if the screen of VIS does not correspond to
1259 `GLX_BAD_ATTRIBUTE' is returned if ATTRIB is not a valid GLX attribute.
1261 `GLX_BAD_VISUAL' is returned if VIS doesn't support GLX and an attribute
1262 other than `GLX_USE_GL' is requested.")
1264 (define-glx-procedures
1265 ((glXGetContextIDEXT
1266 (ctx const-GLXContext)
1269 "Get the XID for a context..
1272 Specifies a GLX rendering context.
1274 `glXGetContextIDEXT' returns the XID associated with a GLXContext.
1276 No round trip is forced to the server; unlike most X calls that return a
1277 value, `glXGetContextIDEXT' does not flush any pending events.
1279 `glXGetContextIDEXT' is part of the `EXT_import_context' extension, not
1280 part of the core GLX command set. If _glxextstring(EXT_import_context)
1281 is included in the string returned by `glXQueryExtensionsString', when
1282 called with argument `GLX_EXTENSIONS', extension `EXT_import_context' is
1285 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1287 (define-glx-procedures
1288 ((glXGetCurrentContext -> GLXContext))
1289 "Return the current context.
1291 `glXGetCurrentContext' returns the current context, as specified by
1292 `glXMakeCurrent'. If there is no current context, `NULL' is returned.
1294 `glXGetCurrentContext' returns client-side information. It does not
1295 make a round trip to the server.")
1297 (define-glx-procedures
1298 ((glXGetCurrentDisplay -> Display-*))
1299 "Get display for current context.
1301 `glXGetCurrentDisplay' returns the display for the current context. If
1302 no context is current, `NULL' is returned.
1304 `glXGetCurrentDisplay' returns client-side information. It does not
1305 make a round-trip to the server, and therefore does not flush any
1308 (define-glx-procedures
1309 ((glXGetCurrentDrawable -> GLXDrawable))
1310 "Return the current drawable.
1312 `glXGetCurrentDrawable' returns the current drawable, as specified by
1313 `glXMakeCurrent'. If there is no current drawable, `None' is returned.
1315 `glXGetCurrentDrawable' returns client-side information. It does not
1316 make a round trip to the server.")
1318 (define-glx-procedures
1319 ((glXGetCurrentReadDrawable -> GLXDrawable))
1320 "Return the current drawable.
1322 `glXGetCurrentReadDrawable' returns the current read drawable, as
1323 specified by `read' parameter of `glXMakeContextCurrent'. If there is
1324 no current drawable, `None' is returned.
1326 `glXGetCurrentReadDrawable' returns client-side information. It does
1327 not make a round-trip to the server.")
1329 (define-glx-procedures
1330 ((glXGetFBConfigAttrib
1332 (config GLXFBConfig)
1337 "Return information about a GLX frame buffer configuration.
1340 Specifies the connection to the X server.
1343 Specifies the GLX frame buffer configuration to be queried.
1346 Specifies the attribute to be returned.
1349 Returns the requested value.
1351 `glXGetFBConfigAttrib' sets VALUE to the ATTRIBUTE value of GLX
1352 drawables created with respect to CONFIG. `glXGetFBConfigAttrib'
1353 returns an error code if it fails for any reason. Otherwise, `Success'
1356 ATTRIBUTE is one of the following:
1361 XID of the given GLXFBConfig.
1366 Number of bits per color buffer. If the frame buffer configuration
1367 supports RGBA contexts, then `GLX_BUFFER_SIZE' is the sum of
1368 `GLX_RED_SIZE', `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', and
1369 `GLX_ALPHA_SIZE'. If the frame buffer configuration supports only
1370 color index contexts, `GLX_BUFFER_SIZE' is the size of the color
1376 Frame buffer level of the configuration. Level zero is the default
1377 frame buffer. Positive levels correspond to frame buffers that
1378 overlay the default buffer, and negative levels correspond to frame
1379 buffers that underlie the default buffer.
1384 `True' if color buffers exist in front/back pairs that can be
1385 swapped, `False' otherwise.
1390 `True' if color buffers exist in left/right pairs, `False'
1396 Number of auxiliary color buffers that are available. Zero
1397 indicates that no auxiliary color buffers exist.
1402 Number of bits of red stored in each color buffer. Undefined if
1403 RGBA contexts are not supported by the frame buffer configuration.
1408 Number of bits of green stored in each color buffer. Undefined if
1409 RGBA contexts are not supported by the frame buffer configuration.
1414 Number of bits of blue stored in each color buffer. Undefined if
1415 RGBA contexts are not supported by the frame buffer configuration.
1420 Number of bits of alpha stored in each color buffer. Undefined if
1421 RGBA contexts are not supported by the frame buffer configuration.
1426 Number of bits in the depth buffer.
1431 Number of bits in the stencil buffer.
1433 `GLX_ACCUM_RED_SIZE'
1436 Number of bits of red stored in the accumulation buffer.
1438 `GLX_ACCUM_GREEN_SIZE'
1441 Number of bits of green stored in the accumulation buffer.
1443 `GLX_ACCUM_BLUE_SIZE'
1446 Number of bits of blue stored in the accumulation buffer.
1448 `GLX_ACCUM_ALPHA_SIZE'
1451 Number of bits of alpha stored in the accumulation buffer.
1456 Mask indicating what type of GLX contexts can be made current to
1457 the frame buffer configuration. Valid bits are `GLX_RGBA_BIT' and
1458 `GLX_COLOR_INDEX_BIT'.
1463 Mask indicating what drawable types the frame buffer configuration
1464 supports. Valid bits are `GLX_WINDOW_BIT', `GLX_PIXMAP_BIT', and
1470 `True' if drawables created with the frame buffer configuration can
1471 be rendered to by X.
1476 XID of the corresponding visual, or zero if there is no associated
1477 visual (i.e., if `GLX_X_RENDERABLE' is `False' or
1478 `GLX_DRAWABLE_TYPE' does not have the `GLX_WINDOW_BIT' bit set).
1483 Visual type of associated visual. The returned value will be one
1484 of: `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR',
1485 `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', `GLX_STATIC_GRAY', or
1486 `GLX_NONE', if there is no associated visual (i.e., if
1487 `GLX_X_RENDERABLE' is `False' or `GLX_DRAWABLE_TYPE' does not have
1488 the `GLX_WINDOW_BIT' bit set).
1493 One of `GLX_NONE', `GLX_SLOW_CONFIG', or
1494 `GLX_NON_CONFORMANT_CONFIG', indicating that the frame buffer
1495 configuration has no caveats, some aspect of the frame buffer
1496 configuration runs slower than other frame buffer configurations,
1497 or some aspect of the frame buffer configuration is nonconformant,
1500 `GLX_TRANSPARENT_TYPE'
1503 One of `GLX_NONE', `GLX_TRANSPARENT_RGB', `GLX_TRANSPARENT_INDEX',
1504 indicating that the frame buffer configuration is opaque, is
1505 transparent for particular values of red, green, and blue, or is
1506 transparent for particular index values, respectively.
1508 `GLX_TRANSPARENT_INDEX_VALUE'
1511 Integer value between 0 and the maximum frame buffer value for
1512 indices, indicating the transparent index value for the frame
1513 buffer configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1514 `GLX_TRANSPARENT_INDEX'.
1516 `GLX_TRANSPARENT_RED_VALUE'
1519 Integer value between 0 and the maximum frame buffer value for red,
1520 indicating the transparent red value for the frame buffer
1521 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1522 `GLX_TRANSPARENT_RGB'.
1524 `GLX_TRANSPARENT_GREEN_VALUE'
1527 Integer value between 0 and the maximum frame buffer value for
1528 green, indicating the transparent green value for the frame buffer
1529 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1530 `GLX_TRANSPARENT_RGB'.
1532 `GLX_TRANSPARENT_BLUE_VALUE'
1535 Integer value between 0 and the maximum frame buffer value for
1536 blue, indicating the transparent blue value for the frame buffer
1537 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1538 `GLX_TRANSPARENT_RGB'.
1540 `GLX_TRANSPARENT_ALPHA_VALUE'
1543 Integer value between 0 and the maximum frame buffer value for
1544 alpha, indicating the transparent blue value for the frame buffer
1545 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1546 `GLX_TRANSPARENT_RGB'.
1548 `GLX_MAX_PBUFFER_WIDTH'
1551 The maximum width that can be specified to `glXCreatePbuffer'.
1553 `GLX_MAX_PBUFFER_HEIGHT'
1556 The maximum height that can be specified to `glXCreatePbuffer'.
1558 `GLX_MAX_PBUFFER_PIXELS'
1561 The maximum number of pixels (width times height) for a pixel
1562 buffer. Note that this value may be less than
1563 `GLX_MAX_PBUFFER_WIDTH' times `GLX_MAX_PBUFFER_HEIGHT'. Also, this
1564 value is static and assumes that no other pixel buffers or X
1565 resources are contending for the frame buffer memory. As a result,
1566 it may not be possible to allocate a pixel buffer of the size given
1567 by `GLX_MAX_PBUFFER_PIXELS'.
1569 Applications should choose the frame buffer configuration that most
1570 closely meets their requirements. Creating windows, GLX pixmaps, or GLX
1571 pixel buffers with unnecessary buffers can result in reduced rendering
1572 performance as well as poor resource allocation.
1574 `GLX_NO_EXTENSION' is returned if DPY does not support the GLX
1575 extension. `GLX_BAD_ATTRIBUTE' is returned if ATTRIBUTE is not a valid
1578 (define-glx-procedures
1585 "List all GLX frame buffer configurations for a given screen.
1588 Specifies the connection to the X server.
1591 Specifies the screen number.
1594 Returns the number of GLXFBConfigs returned.
1596 `glXGetFBConfigs' returns a list of all GLXFBConfigs available on the
1597 screen specified by SCREEN. Use `glXGetFBConfigAttrib' to obtain
1598 attribute values from a specific GLXFBConfig.")
1600 (define-glx-procedures
1602 (procName const-GLubyte-*)
1604 #{void\x28;*\x29;\x28;\x29;}#))
1605 "Obtain a pointer to an OpenGL or GLX function.
1608 Specifies the name of the OpenGL or GLX function whose address is
1611 `glXGetProcAddress' returns the address of the function specified in
1612 PROCNAME. This is necessary in environments where the OpenGL link
1613 library exports a different set of functions than the runtime library.")
1615 (define-glx-procedures
1616 ((glXGetSelectedEvent
1619 (event_mask unsigned-long-*)
1622 "Returns GLX events that are selected for a window or a GLX pixel buffer.
1625 Specifies the connection to the X server.
1628 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
1631 Returns the events that are selected for DRAW.
1633 `glXGetSelectedEvent' returns in EVENT_MASK the events selected for
1636 `GLXBadDrawable' is generated if DRAW is not a valid window or a valid
1639 (define-glx-procedures
1640 ((glXGetVisualFromFBConfig
1642 (config GLXFBConfig)
1645 "Return visual that is associated with the frame buffer configuration.
1648 Specifies the connection to the X server.
1651 Specifies the GLX frame buffer configuration.
1653 If CONFIG is a valid GLX frame buffer configuration and it has an
1654 associated X Visual, then information describing that visual is
1655 returned; otherwise `NULL' is returned. Use `XFree' to free the data
1658 Returns `NULL' if CONFIG is not a valid GLXFBConfig.")
1660 (define-glx-procedures
1661 ((glXImportContextEXT
1663 (contextID GLXContextID)
1666 "Import another process's indirect rendering context..
1669 Specifies the connection to the X server.
1672 Specifies a GLX rendering context.
1674 `glXImportContextEXT' creates a GLXContext given the XID of an existing
1675 GLXContext. It may be used in place of `glXCreateContext', to share
1676 another process's indirect rendering context.
1678 Only the server-side context information can be shared between X
1679 clients; client-side state, such as pixel storage modes, cannot be
1680 shared. Thus, `glXImportContextEXT' must allocate memory to store
1681 client-side information. This memory is freed by calling
1682 `glXFreeContextEXT'.
1684 This call does not create a new XID. It merely makes an existing object
1685 available to the importing client (Display *). Like any XID, it goes
1686 away when the creating client drops its connection or the ID is
1687 explicitly deleted. Note that this is when the XID goes away. The
1688 object goes away when the XID goes away AND the context is not current
1691 If CONTEXTID refers to a direct rendering context then no error is
1692 generated but `glXImportContextEXT' returns NULL.
1694 `glXImportContextEXT' is part of the `EXT_import_context' extension, not
1695 part of the core GLX command set. If _glxextstring(EXT_import_context)
1696 is included in the string returned by `glXQueryExtensionsString', when
1697 called with argument `GLX_EXTENSIONS', extension `EXT_import_context' is
1700 `GLXBadContext' is generated if CONTEXTID does not refer to a valid
1703 (define-glx-procedures
1709 "Indicate whether direct rendering is enabled.
1712 Specifies the connection to the X server.
1715 Specifies the GLX context that is being queried.
1717 `glXIsDirect' returns `True' if CTX is a direct rendering context,
1718 `False' otherwise. Direct rendering contexts pass rendering commands
1719 directly from the calling process's address space to the rendering
1720 system, bypassing the X server. Nondirect rendering contexts pass all
1721 rendering commands to the X server.
1723 `GLXBadContext' is generated if CTX is not a valid GLX context.")
1725 (define-glx-procedures
1726 ((glXMakeContextCurrent
1733 "Attach a GLX context to a GLX drawable.
1736 Specifies the connection to the X server.
1739 Specifies a GLX drawable to render into. Must be an XID
1740 representing a GLXWindow, GLXPixmap, or GLXPbuffer.
1743 Specifies a GLX drawable to read from. Must be an XID representing
1744 a GLXWindow, GLXPixmap, or GLXPbuffer.
1747 Specifies the GLX context to be bound to READ and CTX.
1749 `glXMakeContextCurrent' binds CTX to the current rendering thread and to
1750 the DRAW and READ GLX drawables. DRAW and READ may be the same.
1752 DRAW is used for all OpenGL operations except:
1754 Any pixel data that are read based on the value of `GLX_READ_BUFFER'.
1755 Note that accumulation operations use the value of `GLX_READ_BUFFER',
1756 but are not allowed unless DRAW is identical to READ.
1758 Any depth values that are retrieved by `glReadPixels' or `glCopyPixels'.
1760 Any stencil values that are retrieved by `glReadPixels' or
1763 Frame buffer values are taken from DRAW.
1765 If the current rendering thread has a current rendering context, that
1766 context is flushed and replaced by CTX.
1768 The first time that CTX is made current, the viewport and scissor
1769 dimensions are set to the size of the DRAW drawable. The viewport and
1770 scissor are not modified when CTX is subsequently made current.
1772 To release the current context without assigning a new one, call
1773 `glXMakeContextCurrent' with DRAW and READ set to `None' and CTX set to
1776 `glXMakeContextCurrent' returns `True' if it is successful, `False'
1777 otherwise. If `False' is returned, the previously current rendering
1778 context and drawable (if any) remain unchanged.
1780 `BadMatch' is generated if DRAW and READ are not compatible.
1782 `BadAccess' is generated if CTX is current to some other thread.
1784 `GLXContextState' is generated if there is a current rendering context
1785 and its render mode is either `GLX_FEEDBACK' or `GLX_SELECT'.
1787 `GLXBadContext' is generated if CTX is not a valid GLX rendering
1790 `GLXBadDrawable' is generated if DRAW or READ is not a valid GLX
1793 `GLXBadWindow' is generated if the underlying X window for either DRAW
1794 or READ is no longer valid.
1796 `GLXBadCurrentDrawable' is generated if the previous context of the
1797 calling thread has unflushed commands and the previous drawable is no
1800 `BadAlloc' is generated if the X server does not have enough resources
1801 to allocate the buffers.
1803 `BadMatch' is generated if:
1805 DRAW and READ cannot fit into frame buffer memory simultaneously.
1807 DRAW or READ is a GLXPixmap and CTX is a direct-rendering context.
1809 DRAW or READ is a GLXPixmap and CTX was previously bound to a GLXWindow
1812 DRAW or READ is a GLXWindow or GLXPbuffer and CTX was previously bound
1815 (define-glx-procedures
1818 (drawable GLXDrawable)
1822 "Attach a GLX context to a window or a GLX pixmap.
1825 Specifies the connection to the X server.
1828 Specifies a GLX drawable. Must be either an X window ID or a GLX
1832 Specifies a GLX rendering context that is to be attached to
1835 `glXMakeCurrent' does two things: It makes CTX the current GLX rendering
1836 context of the calling thread, replacing the previously current context
1837 if there was one, and it attaches CTX to a GLX drawable, either a window
1838 or a GLX pixmap. As a result of these two actions, subsequent GL
1839 rendering calls use rendering context CTX to modify GLX drawable
1840 DRAWABLE (for reading and writing). Because `glXMakeCurrent' always
1841 replaces the current rendering context with CTX, there can be only one
1842 current context per thread.
1844 Pending commands to the previous context, if any, are flushed before it
1847 The first time CTX is made current to any thread, its viewport is set to
1848 the full size of DRAWABLE. Subsequent calls by any thread to
1849 `glXMakeCurrent' with CTX have no effect on its viewport.
1851 To release the current context without assigning a new one, call
1852 `glXMakeCurrent' with DRAWABLE set to `None' and CTX set to `NULL'.
1854 `glXMakeCurrent' returns `True' if it is successful, `False' otherwise.
1855 If `False' is returned, the previously current rendering context and
1856 drawable (if any) remain unchanged.
1858 `BadMatch' is generated if DRAWABLE was not created with the same X
1859 screen and visual as CTX. It is also generated if DRAWABLE is `None'
1860 and CTX is not `NULL'.
1862 `BadAccess' is generated if CTX was current to another thread at the
1863 time `glXMakeCurrent' was called.
1865 `GLXBadDrawable' is generated if DRAWABLE is not a valid GLX drawable.
1867 `GLXBadContext' is generated if CTX is not a valid GLX context.
1869 `GLXBadContextState' is generated if `glXMakeCurrent' is executed
1870 between the execution of `glBegin' and the corresponding execution of
1873 `GLXBadContextState' is also generated if the rendering context current
1874 to the calling thread has GL renderer state `GLX_FEEDBACK' or
1877 `GLXBadCurrentWindow' is generated if there are pending GL commands for
1878 the previous context and the current drawable is a window that is no
1881 `BadAlloc' may be generated if the server has delayed allocation of
1882 ancillary buffers until `glXMakeCurrent' is called, only to find that it
1883 has insufficient resources to complete the allocation.")
1885 (define-glx-procedures
1886 ((glXQueryContextInfoEXT
1893 "Query context information.
1896 Specifies the connection to the X server.
1899 Specifies a GLX rendering context.
1902 Specifies that a context parameter should be retrieved. Must be
1903 one of `GLX_SHARED_CONTEXT_EXT', `GLX_VISUAL_ID_EXT', or
1907 Contains the return value for ATTRIBUTE.
1909 `glXQueryContextInfoEXT' sets VALUE to the value of ATTRIBUTE with
1910 respect to CTX. `glXQueryContextInfoEXT' returns an error code if it
1911 fails for any reason. Otherwise, `Success' is returned.
1913 ATTRIBUTE may be one of the following:
1915 `GLX_SHARED_CONTEXT_EXT'
1916 Returns the XID of the share list context associated with CTX at
1920 Returns the XID of the GLX Visual associated with CTX.
1923 Returns the screen number associated with CTX.
1925 This call may cause a round-trip to the server.
1927 `glXQueryContextInfoEXT' is part of the `EXT_import_context' extension,
1928 not part of the core GLX command set. If
1929 _glxextstring(EXT_import_context) is included in the string returned by
1930 `glXQueryExtensionsString', when called with argument `GLX_EXTENSIONS',
1931 extension `EXT_import_context' is supported.
1933 `GLXBadContext' is generated if CTX does not refer to a valid context.
1935 `GLX_BAD_ATTRIBUTE' is returned if ATTRIBUTE is not a valid GLX context
1938 fred `GLX_BAD_CONTEXT' is returned if ATTRIBUTE is not a valid context.")
1940 (define-glx-procedures
1948 "Query context information.
1951 Specifies the connection to the X server.
1954 Specifies a GLX rendering context.
1957 Specifies that a context parameter should be retrieved. Must be
1958 one of `GLX_FBCONFIG_ID', `GLX_RENDER_TYPE', or `GLX_SCREEN'.
1961 Contains the return value for ATTRIBUTE.
1963 `glXQueryContext' sets VALUE to the value of ATTRIBUTE with respect to
1964 CTX. ATTRIBUTE may be one of the following:
1967 Returns the XID of the GLXFBConfig associated with CTX.
1970 Returns the rendering type supported by CTX.
1973 Returns the screen number associated with CTX.
1975 `Success' is returned unless ATTRIBUTE is not a valid GLX context
1976 attribute, in which case `GLX_BAD_ATTRIBUTE' is returned.
1978 This call may cause a round-trip to the server.
1980 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1982 (define-glx-procedures
1987 (value unsigned-int-*)
1990 "Returns an attribute assoicated with a GLX drawable.
1993 Specifies the connection to the X server.
1996 Specifies the GLX drawable to be queried.
1999 Specifies the attribute to be returned. Must be one of
2000 `GLX_WIDTH', `GLX_HEIGHT', `GLX_PRESERVED_CONTENTS',
2001 `GLX_LARGEST_PBUFFER', or `GLX_FBCONFIG_ID'.
2004 Contains the return value for ATTRIBUTE.
2006 `glXQueryDrawable' sets VALUE to the value of ATTRIBUTE with respect to
2007 the GLXDrawable DRAW.
2009 ATTRIBUTE may be one of the following:
2012 Returns the width of CTX.
2015 Returns the height of CTX.
2017 `GLX_PRESERVED_CONTENTS'
2018 Returns `True' if the contents of a GLXPbuffer are preserved when a
2019 resource conflict occurs; `False' otherwise.
2021 `GLX_LARGEST_PBUFFER'
2022 Returns the value set when `glXCreatePbuffer' was called to create
2023 the GLXPbuffer. If `False' is returned, then the call to
2024 `glXCreatePbuffer' will fail to create a GLXPbuffer if the
2025 requested size is larger than the implementation maximum or
2026 available resources. If `True' is returned, a GLXPbuffer of the
2027 maximum availble size (if less than the requested width and height)
2031 Returns the XID for DRAW.
2033 If DRAW is a GLXWindow or GLXPixmap and ATTRIBUTE is set to
2034 `GLX_PRESERVED_CONTENTS' or `GLX_LARGETST_PBUFFER', the contents of
2035 VALUE are undefined. If ATTRIBUTE is not one of the attributes listed
2036 above, the contents of VALUE are unedfined.
2038 A `GLXBadDrawable' is generated if DRAW is not a valid GLXDrawable.")
2040 (define-glx-procedures
2041 ((glXQueryExtensionsString
2046 "Return list of supported extensions.
2049 Specifies the connection to the X server.
2052 Specifies the screen number.
2054 `glXQueryExtensionsString' returns a pointer to a string describing
2055 which GLX extensions are supported on the connection. The string is
2056 null-terminated and contains a space-separated list of extension names.
2057 (The extension names themselves never contain spaces.) If there are no
2058 extensions to GLX, then the empty string is returned.")
2060 (define-glx-procedures
2067 "Indicate whether the GLX extension is supported.
2070 Specifies the connection to the X server.
2073 Returns the base error code of the GLX server extension.
2076 Returns the base event code of the GLX server extension.
2078 `glXQueryExtension' returns `True' if the X server of connection DPY
2079 supports the GLX extension, `False' otherwise. If `True' is returned,
2080 then ERRORBASE and EVENTBASE return the error base and event base of the
2081 GLX extension. These values should be added to the constant error and
2082 event values to determine the actual event or error values. Otherwise,
2083 ERRORBASE and EVENTBASE are unchanged.
2085 ERRORBASE and EVENTBASE do not return values if they are specified as
2088 (define-glx-procedures
2089 ((glXQueryServerString
2095 "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 `GLX_VENDOR',
2105 `GLX_VERSION', or `GLX_EXTENSIONS'.
2107 `glXQueryServerString' returns a pointer to a static, null-terminated
2108 string describing some aspect of the server's GLX extension. The
2109 possible values for NAME and the format of the strings is the same as
2110 for `glXGetClientString'. If NAME is not set to a recognized value,
2111 `NULL' is returned.")
2113 (define-glx-procedures
2120 "Return the version numbers of the GLX extension.
2123 Specifies the connection to the X server.
2126 Returns the major version number of the GLX server extension.
2129 Returns the minor version number of the GLX server extension.
2131 `glXQueryVersion' returns the major and minor version numbers of the GLX
2132 extension implemented by the server associated with connection DPY.
2133 Implementations with the same major version number are upward
2134 compatible, meaning that the implementation with the higher minor number
2135 is a superset of the version with the lower minor number.
2137 MAJOR and MINOR do not return values if they are specified as `NULL'.
2139 `glXQueryVersion' returns `False' if it fails, `True' otherwise.
2141 MAJOR and MINOR are not updated when `False' is returned.")
2143 (define-glx-procedures
2147 (event_mask unsigned-long)
2150 "Select GLX events for a window or a GLX pixel buffer.
2153 Specifies the connection to the X server.
2156 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
2159 Specifies the events to be returned for DRAW.
2161 `glXSelectEvent' sets the GLX event mask for a GLX pixel buffer or a
2162 window. Calling `glXSelectEvent' overrides any previous event mask that
2163 was set by the client for DRAW. Note that it does not affect the event
2164 masks that other clients may have specified for DRAW since each client
2165 rendering to DRAW has a separate event mask for it.
2167 Currently, only one GLX event, `GLX_PBUFFER_CLOBBER_MASK', can be
2168 selected. The following data is returned to the client when a
2169 `GLX_PBUFFER_CLOBBER_MASK' event occurs:
2174 /* GLX_DAMAGED or GLX_SAVED */
2177 /* GLX_WINDOW or GLX_PBUFFER */
2179 unsigned long SERIAL;
2180 /* # of last request processed by server */
2183 /* true if this came for SendEvent request */
2186 /* display the event was read from */
2188 GLXDrawable DRAWABLE;
2189 /* i.d. of Drawable */
2191 unsigned int BUFFER_MASK;
2192 /* mask indicating affected buffers */
2201 /* if nonzero, at least this many more */
2203 } GLXPbufferClobberEvent; The valid bit masks used in BUFFER_MASK are:
2208 *Corresponding Buffer*
2210 `GLX_FRONT_LEFT_BUFFER_BIT'
2211 Front left color buffer
2213 `GLX_FRONT_RIGHT_BUFFER_BIT'
2214 Front right color buffer
2216 `GLX_BACK_LEFT_BUFFER_BIT'
2217 Back left color buffer
2219 `GLX_BACK_RIGHT_BUFFER_BIT'
2220 Back right color buffer
2222 `GLX_AUX_BUFFERS_BIT'
2225 `GLX_DEPTH_BUFFER_BIT'
2228 `GLX_STENCIL_BUFFER_BIT'
2231 `GLX_ACCUM_BUFFER_BIT'
2234 A single X server operation can cause several buffer clobber events to
2235 be sent. (e.g., a single GLX pixel buffer may be damaged and cause
2236 multiple buffer clobber events to be generated). Each event specifies
2237 one region of the GLX drawable that was affected by the X Server
2238 operation. The BUFFER_MASK field indicates which color buffers and
2239 ancillary buffers were affected. All the buffer clobber events
2240 generated by a single X server action are guaranteed to be contiguous in
2241 the event queue. The conditions under which this event is generated and
2242 the EVENT_TYPE varies, depending on the type of the GLX drawable.
2244 When the `GLX_AUX_BUFFERS_BIT' is set in BUFFER_MASK, then AUX_BUFFER is
2245 set to indicate which buffer was affected. If more than one aux buffer
2246 was affected, then additional events are generated as part of the same
2247 contiguous event group. Each additional event will have only the
2248 `GLX_AUX_BUFFERS_BIT' set in BUFFER_MASK, and the AUX_BUFFER field will
2249 be set appropriately. For nonstereo drawables,
2250 `GLX_FRONT_LEFT_BUFFER_BIT' and `GLX_BACK_LEFT_BUFFER_BIT' are used to
2251 specify the front and back color buffers.
2253 For preserved GLX pixel buffers, a buffer clobber event with type
2254 `GLX_SAVED' is generated whenever the contents of the GLX pixel buffer
2255 is moved out of offscreen memory. The event(s) describes which portions
2256 of the GLX pixel buffer were affected. Clients who receive many buffer
2257 clobber events, referring to different save actions, should consider
2258 freeing the GLX pixel buffer resource in order to prevent the system
2259 from thrashing due to insufficient resources.
2261 For an unpreserved GLXPbuffer, a buffer clobber event, with type
2262 `GLX_DAMAGED', is generated whenever a portion of the GLX pixel buffer
2263 becomes invalid. The client may wish to regenerate the invalid portions
2264 of the GLX pixel buffer.
2266 For Windows, buffer clobber events, with type `GLX_SAVED', occur
2267 whenever an ancillary buffer, associated with the window, gets clobbered
2268 or moved out of off-screen memory. The event contains information
2269 indicating which color buffers and ancillary buffers\\(emand which
2270 portions of those buffers\\(emwere affected.
2272 `GLXBadDrawable' is generated if DRAW is not a valid window or a valid
2275 (define-glx-procedures
2278 (drawable GLXDrawable)
2281 "Exchange front and back buffers.
2284 Specifies the connection to the X server.
2287 Specifies the drawable whose buffers are to be swapped.
2289 `glXSwapBuffers' promotes the contents of the back buffer of DRAWABLE to
2290 become the contents of the front buffer of DRAWABLE. The contents of
2291 the back buffer then become undefined. The update typically takes place
2292 during the vertical retrace of the monitor, rather than immediately
2293 after `glXSwapBuffers' is called.
2295 `glXSwapBuffers' performs an implicit `glFlush' before it returns.
2296 Subsequent OpenGL commands may be issued immediately after calling
2297 `glXSwapBuffers', but are not executed until the buffer exchange is
2300 If DRAWABLE was not created with respect to a double-buffered visual,
2301 `glXSwapBuffers' has no effect, and no error is generated.
2303 `GLXBadDrawable' is generated if DRAWABLE is not a valid GLX drawable.
2305 `GLXBadCurrentWindow' is generated if DPY and DRAWABLE are respectively
2306 the display and drawable associated with the current context of the
2307 calling thread, and DRAWABLE identifies a window that is no longer
2310 (define-glx-procedures
2318 "Create bitmap display lists from an X font.
2321 Specifies the font from which character glyphs are to be taken.
2324 Specifies the index of the first glyph to be taken.
2327 Specifies the number of glyphs to be taken.
2330 Specifies the index of the first display list to be generated.
2332 `glXUseXFont' generates COUNT display lists, named LISTBASE through
2333 LISTBASE+COUNT-1 , each containing a single `glBitmap' command. The
2334 parameters of the `glBitmap' command of display list LISTBASE+I are
2335 derived from glyph FIRST+I . Bitmap parameters XORIG , YORIG , WIDTH ,
2336 and HEIGHT are computed from font metrics as DESCENT-1 , -LBEARING ,
2337 RBEARING-LBEARING , and ASCENT+DESCENT , respectively. XMOVE is taken
2338 from the glyph's WIDTH metric, and YMOVE is set to zero. Finally, the
2339 glyph's image is converted to the appropriate format for `glBitmap'.
2341 Using `glXUseXFont' may be more efficient than accessing the X font and
2342 generating the display lists explicitly, both because the display lists
2343 are created on the server without requiring a round trip of the glyph
2344 data, and because the server may choose to delay the creation of each
2345 bitmap until it is accessed.
2347 Empty display lists are created for all glyphs that are requested and
2348 are not defined in FONT. `glXUseXFont' is ignored if there is no
2349 current GLX context.
2351 `BadFont' is generated if FONT is not a valid font.
2353 `GLXBadContextState' is generated if the current GLX context is in
2354 display-list construction mode.
2356 `GLXBadCurrentWindow' is generated if the drawable associated with the
2357 current context of the calling thread is a window, and that window is no
2360 (define-glx-procedures
2361 ((glXWaitGL -> void))
2362 "Complete GL execution prior to subsequent X calls.
2364 GL rendering calls made prior to `glXWaitGL' are guaranteed to be
2365 executed before X rendering calls made after `glXWaitGL'. Although this
2366 same result can be achieved using `glFinish', `glXWaitGL' does not
2367 require a round trip to the server, and it is therefore more efficient
2368 in cases where client and server are on separate machines.
2370 `glXWaitGL' is ignored if there is no current GLX context.
2372 `GLXBadCurrentWindow' is generated if the drawable associated with the
2373 current context of the calling thread is a window, and that window is no
2376 (define-glx-procedures
2377 ((glXWaitX -> void))
2378 "Complete X execution prior to subsequent GL calls.
2380 X rendering calls made prior to `glXWaitX' are guaranteed to be executed
2381 before GL rendering calls made after `glXWaitX'. Although the same
2382 result can be achieved using `XSync', `glXWaitX' does not require a
2383 round trip to the server, and it is therefore more efficient in cases
2384 where client and server are on separate machines.
2386 `glXWaitX' is ignored if there is no current GLX context.
2388 `GLXBadCurrentWindow' is generated if the drawable associated with the
2389 current context of the calling thread is a window, and that window is no