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 licensed
21 ;;; 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 ATTRIB_LIST,
116 then the default value (see below) is used (and the attribute is said to
117 be specified implicitly). For example, if `GLX_STEREO' is not specified,
118 then it is assumed to be `False'. For some attributes, the default is
119 `GLX_DONT_CARE', meaning that any value is OK for this attribute, so the
120 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 if
145 `GLX_COLOR_INDEX_BIT' is not set in `GLX_RENDER_TYPE'. The default
151 Must be followed by an integer buffer-level specification. This
152 specification is honored exactly. Buffer level 0 corresponds to the
153 default frame buffer of the display. Buffer level 1 is the first
154 overlay frame buffer, level two the second overlay frame buffer,
155 and so on. Negative buffer levels correspond to underlay frame
156 buffers. The default value is 0.
161 Must be followed by `True' or `False'. If `True' is specified, then
162 only double-buffered frame buffer configurations are considered; if
163 `False' is specified, then only single-buffered frame buffer
164 configurations are considered. The default value is
170 Must be followed by `True' or `False'. If `True' is specified, then
171 only stereo frame buffer configurations are considered; if `False'
172 is specified, then only monoscopic frame buffer configurations are
173 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 is
192 0 or `GLX_DONT_CARE', it is not considered. The default value for
193 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 buffer
201 of at least the minimum size is preferred. The default value is 0.
206 Must be followed by a nonnegative integer that indicates the
207 desired number of stencil bitplanes. The smallest stencil buffer of
208 at least the specified size is preferred. If the desired value is
209 zero, frame buffer configurations with no stencil buffer are
210 preferred. The default value is 0.
215 Must be followed by a nonnegative minimum size specification. If
216 this value is zero, frame buffer configurations with no red
217 accumulation buffer are preferred. Otherwise, the largest possible
218 red accumulation buffer of at least the minimum size is preferred.
219 The default value is 0.
221 `GLX_ACCUM_GREEN_SIZE'
224 Must be followed by a nonnegative minimum size specification. If
225 this value is zero, frame buffer configurations with no green
226 accumulation buffer are preferred. Otherwise, the largest possible
227 green accumulation buffer of at least the minimum size is
228 preferred. The default value is 0.
230 `GLX_ACCUM_BLUE_SIZE'
233 Must be followed by a nonnegative minimum size specification. If
234 this value is zero, frame buffer configurations with no blue
235 accumulation buffer are preferred. Otherwise, the largest possible
236 blue accumulation buffer of at least the minimum size is preferred.
237 The default value is 0.
239 `GLX_ACCUM_ALPHA_SIZE'
242 Must be followed by a nonnegative minimum size specification. If
243 this value is zero, frame buffer configurations with no alpha
244 accumulation buffer are preferred. Otherwise, the largest possible
245 alpha accumulation buffer of at least the minimum size is
246 preferred. The default value is 0.
251 Must be followed by a mask indicating which OpenGL rendering modes
252 the frame buffer configuration must support. Valid bits are
253 `GLX_RGBA_BIT' and `GLX_COLOR_INDEX_BIT'. If the mask is set to
254 `GLX_RGBA_BIT' | `GLX_COLOR_INDEX_BIT', then only frame buffer
255 configurations that can be bound to both RGBA contexts and color
256 index contexts will be considered. The default value is
262 Must be followed by a mask indicating which GLX drawable types the
263 frame buffer configuration must support. Valid bits are
264 `GLX_WINDOW_BIT', `GLX_PIXMAP_BIT', and `GLX_PBUFFER_BIT'. For
265 example, if mask is set to `GLX_WINDOW_BIT' | `GLX_PIXMAP_BIT',
266 only frame buffer configurations that support both windows and GLX
267 pixmaps will be considered. The default value is `GLX_WINDOW_BIT'.
272 Must be followed by `True' or `False'. If `True' is specified, then
273 only frame buffer configurations that have associated X visuals
274 (and can be used to render to Windows and/or GLX pixmaps) will be
275 considered. The default value is `GLX_DONT_CARE'.
280 Must be followed by one of `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR',
281 `GLX_PSEUDO_COLOR', `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', or
282 `GLX_STATIC_GRAY', indicating the desired X visual type. Not all
283 frame buffer configurations have an associated X visual. If
284 `GLX_DRAWABLE_TYPE' is specified in ATTRIB_LIST and the mask that
285 follows does not have `GLX_WINDOW_BIT' set, then this value is
286 ignored. It is also ignored if `GLX_X_RENDERABLE' is specified as
287 `False'. RGBA rendering may be supported for visuals of type
288 `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR', or
289 `GLX_STATIC_COLOR', but color index rendering is only supported for
290 visuals of type `GLX_PSEUDO_COLOR' or `GLX_STATIC_COLOR' (i.e.,
291 single-channel visuals). The tokens `GLX_GRAY_SCALE' and
292 `GLX_STATIC_GRAY' will not match current OpenGL enabled visuals,
293 but are included for future use. The default value for
294 `GLX_X_VISUAL_TYPE' is `GLX_DONT_CARE'.
299 Must be followed by one of `GLX_NONE', `GLX_SLOW_CONFIG',
300 `GLX_NON_CONFORMANT_CONFIG'. If `GLX_NONE' is specified, then only
301 frame buffer configurations with no caveats will be considered; if
302 `GLX_SLOW_CONFIG' is specified, then only slow frame buffer
303 configurations will be considered; if `GLX_NON_CONFORMANT_CONFIG'
304 is specified, then only nonconformant frame buffer configurations
305 will be considered. The default value is `GLX_DONT_CARE'.
307 `GLX_TRANSPARENT_TYPE'
310 Must be followed by one of `GLX_NONE', `GLX_TRANSPARENT_RGB',
311 `GLX_TRANSPARENT_INDEX'. If `GLX_NONE' is specified, then only
312 opaque frame buffer configurations will be considered; if
313 `GLX_TRANSPARENT_RGB' is specified, then only transparent frame
314 buffer configurations that support RGBA rendering will be
315 considered; if `GLX_TRANSPARENT_INDEX' is specified, then only
316 transparent frame buffer configurations that support color index
317 rendering will be considered. The default value is `GLX_NONE'.
319 `GLX_TRANSPARENT_INDEX_VALUE'
322 Must be followed by an integer value indicating the transparent
323 index value; the value must be between 0 and the maximum frame
324 buffer value for indices. Only frame buffer configurations that use
325 the specified transparent index value will be considered. The
326 default value is `GLX_DONT_CARE'. This attribute is ignored unless
327 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
328 `GLX_TRANSPARENT_INDEX'.
330 `GLX_TRANSPARENT_RED_VALUE'
333 Must be followed by an integer value indicating the transparent red
334 value; the value must be between 0 and the maximum frame buffer
335 value for red. Only frame buffer configurations that use the
336 specified transparent red value will be considered. The default
337 value is `GLX_DONT_CARE'. This attribute is ignored unless
338 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
339 `GLX_TRANSPARENT_RGB'.
341 `GLX_TRANSPARENT_GREEN_VALUE'
344 Must be followed by an integer value indicating the transparent
345 green value; the value must be between 0 and the maximum frame
346 buffer value for green. Only frame buffer configurations that use
347 the specified transparent green value will be considered. The
348 default value is `GLX_DONT_CARE'. This attribute is ignored unless
349 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
350 `GLX_TRANSPARENT_RGB'.
352 `GLX_TRANSPARENT_BLUE_VALUE'
355 Must be followed by an integer value indicating the transparent
356 blue value; the value must be between 0 and the maximum frame
357 buffer value for blue. Only frame buffer configurations that use
358 the specified transparent blue value will be considered. The
359 default value is `GLX_DONT_CARE'. This attribute is ignored unless
360 `GLX_TRANSPARENT_TYPE' is included in ATTRIB_LIST and specified as
361 `GLX_TRANSPARENT_RGB'.
363 `GLX_TRANSPARENT_ALPHA_VALUE'
366 Must be followed by an integer value indicating the transparent
367 alpha value; the value must be between 0 and the maximum frame
368 buffer value for alpha. Only frame buffer configurations that use
369 the specified transparent alpha value will be considered. The
370 default value is `GLX_DONT_CARE'.
372 When more than one GLX frame buffer configuration matches the specified
373 attributes, a list of matching configurations is returned. The list is
374 sorted according to the following precedence rules, which are applied in
375 ascending order (i.e., configurations that are considered equal by a
376 lower numbered rule are sorted by the higher numbered rule):
379 By `GLX_CONFIG_CAVEAT' where the precedence is `GLX_NONE',
380 `GLX_SLOW_CONFIG', and `GLX_NON_CONFORMANT_CONFIG'.
383 Larger total number of RGBA color components (`GLX_RED_SIZE',
384 `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', plus `GLX_ALPHA_SIZE') that have
385 higher number of bits. If the requested number of bits in
386 ATTRIB_LIST is zero or `GLX_DONT_CARE' for a particular color
387 component, then the number of bits for that component is not
391 Smaller `GLX_BUFFER_SIZE'.
394 Single buffered configuration (`GLX_DOUBLEBUFFER' being `False'
395 precedes a double buffered one.
398 Smaller `GLX_AUX_BUFFERS'.
401 Larger `GLX_DEPTH_SIZE'.
404 Smaller `GLX_STENCIL_SIZE'.
407 Larger total number of accumulation buffer color components
408 (`GLX_ACCUM_RED_SIZE', `GLX_ACCUM_GREEN_SIZE',
409 `GLX_ACCUM_BLUE_SIZE', plus `GLX_ACCUM_ALPHA_SIZE') that have
410 higher number of bits. If the requested number of bits in
411 ATTRIB_LIST is zero or `GLX_DONT_CARE' for a particular color
412 component, then the number of bits for that component is not
416 By `GLX_X_VISUAL_TYPE' where the precedence order is
417 `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR',
418 `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', `GLX_STATIC_GRAY'.
420 `NULL' is returned if an undefined GLX attribute is encountered in
421 ATTRIB_LIST, if SCREEN is invalid, or if DPY does not support the GLX
424 (define-glx-procedures
431 "Return a visual that matches specified attributes.
434 Specifies the connection to the X server.
437 Specifies the screen number.
440 Specifies a list of boolean attributes and integer attribute/value
441 pairs. The last attribute must be `None'.
443 `glXChooseVisual' returns a pointer to an XVisualInfo structure
444 describing the visual that best meets a minimum specification. The
445 boolean GLX attributes of the visual that is returned will match the
446 specified values, and the integer GLX attributes will meet or exceed the
447 specified minimum values. If all other attributes are equivalent, then
448 TrueColor and PseudoColor visuals have priority over DirectColor and
449 StaticColor visuals, respectively. If no conforming visual exists,
450 `NULL' is returned. To free the data returned by this function, use
453 All boolean GLX attributes default to `False' except `GLX_USE_GL', which
454 defaults to `True'. All integer GLX attributes default to zero. Default
455 specifications are superseded by attributes included in ATTRIBLIST.
456 Boolean attributes included in ATTRIBLIST are understood to be `True'.
457 Integer attributes and enumerated type attributes are followed
458 immediately by the corresponding desired or minimum value. The list must
459 be terminated with `None'.
461 The interpretations of the various GLX visual attributes are as follows:
464 Ignored. Only visuals that can be rendered with GLX are considered.
467 Must be followed by a nonnegative integer that indicates the
468 desired color index buffer size. The smallest index buffer of at
469 least the specified size is preferred. Ignored if `GLX_RGBA' is
473 Must be followed by an integer buffer-level specification. This
474 specification is honored exactly. Buffer level zero corresponds to
475 the main frame buffer of the display. Buffer level one is the first
476 overlay frame buffer, level two the second overlay frame buffer,
477 and so on. Negative buffer levels correspond to underlay frame
481 If present, only TrueColor and DirectColor visuals are considered.
482 Otherwise, only PseudoColor and StaticColor visuals are considered.
485 If present, only double-buffered visuals are considered. Otherwise,
486 only single-buffered visuals are considered.
489 If present, only stereo visuals are considered. Otherwise, only
490 monoscopic visuals are considered.
493 Must be followed by a nonnegative integer that indicates the
494 desired number of auxiliary buffers. Visuals with the smallest
495 number of auxiliary buffers that meets or exceeds the specified
496 number are preferred.
499 Must be followed by a nonnegative minimum size specification. If
500 this value is zero, the smallest available red buffer is preferred.
501 Otherwise, the largest available red buffer of at least the minimum
505 Must be followed by a nonnegative minimum size specification. If
506 this value is zero, the smallest available green buffer is
507 preferred. Otherwise, the largest available green buffer of at
508 least the minimum size is preferred.
511 Must be followed by a nonnegative minimum size specification. If
512 this value is zero, the smallest available blue buffer is
513 preferred. Otherwise, the largest available blue buffer of at least
514 the minimum size is preferred.
517 Must be followed by a nonnegative minimum size specification. If
518 this value is zero, the smallest available alpha buffer is
519 preferred. Otherwise, the largest available alpha buffer of at
520 least the minimum size is preferred.
523 Must be followed by a nonnegative minimum size specification. If
524 this value is zero, visuals with no depth buffer are preferred.
525 Otherwise, the largest available depth buffer of at least the
526 minimum size is preferred.
529 Must be followed by a nonnegative integer that indicates the
530 desired number of stencil bitplanes. The smallest stencil buffer of
531 at least the specified size is preferred. If the desired value is
532 zero, visuals with no stencil buffer are preferred.
535 Must be followed by a nonnegative minimum size specification. If
536 this value is zero, visuals with no red accumulation buffer are
537 preferred. Otherwise, the largest possible red accumulation buffer
538 of at least the minimum size is preferred.
540 `GLX_ACCUM_GREEN_SIZE'
541 Must be followed by a nonnegative minimum size specification. If
542 this value is zero, visuals with no green accumulation buffer are
543 preferred. Otherwise, the largest possible green accumulation
544 buffer of at least the minimum size is preferred.
546 `GLX_ACCUM_BLUE_SIZE'
547 Must be followed by a nonnegative minimum size specification. If
548 this value is zero, visuals with no blue accumulation buffer are
549 preferred. Otherwise, the largest possible blue accumulation buffer
550 of at least the minimum size is preferred.
552 `GLX_ACCUM_ALPHA_SIZE'
553 Must be followed by a nonnegative minimum size specification. If
554 this value is zero, visuals with no alpha accumulation buffer are
555 preferred. Otherwise, the largest possible alpha accumulation
556 buffer of at least the minimum size is preferred.
558 `NULL' is returned if an undefined GLX attribute is encountered in
561 (define-glx-procedures
569 "Copy state from one rendering context to another.
572 Specifies the connection to the X server.
575 Specifies the source context.
578 Specifies the destination context.
581 Specifies which portions of SRC state are to be copied to DST.
583 `glXCopyContext' copies selected groups of state variables from SRC to
584 DST. MASK indicates which groups of state variables are to be copied.
585 MASK contains the bitwise OR of the same symbolic names that are passed
586 to the GL command `glPushAttrib'. The single symbolic constant
587 `GLX_ALL_ATTRIB_BITS' can be used to copy the maximum possible portion
590 The copy can be done only if the renderers named by SRC and DST share an
591 address space. Two rendering contexts share an address space if both are
592 nondirect using the same server, or if both are direct and owned by a
593 single process. Note that in the nondirect case it is not necessary for
594 the calling threads to share an address space, only for their related
595 rendering contexts to share an address space.
597 Not all values for GL state can be copied. For example, pixel pack and
598 unpack state, render mode state, and select and feedback state are not
599 copied. The state that can be copied is exactly the state that is
600 manipulated by the GL command `glPushAttrib'.
602 An implicit `glFlush' is done by `glXCopyContext' if SRC is the current
603 context for the calling thread.
605 `BadMatch' is generated if rendering contexts SRC and DST do not share
606 an address space or were not created with respect to the same screen.
608 `BadAccess' is generated if DST is current to any thread (including the
609 calling thread) at the time `glXCopyContext' is called.
611 `GLXBadCurrentWindow' is generated if SRC is the current context and the
612 current drawable is a window that is no longer valid.
614 `GLXBadContext' is generated if either SRC or DST is not a valid GLX
617 (define-glx-procedures
621 (shareList GLXContext)
625 "Create a new GLX rendering context.
628 Specifies the connection to the X server.
631 Specifies the visual that defines the frame buffer resources
632 available to the rendering context. It is a pointer to an
633 `XVisualInfo' structure, not a visual ID or a pointer to a
637 Specifies the context with which to share display lists. `NULL'
638 indicates that no sharing is to take place.
641 Specifies whether rendering is to be done with a direct connection
642 to the graphics system if possible (`True') or through the X server
645 `glXCreateContext' creates a GLX rendering context and returns its
646 handle. This context can be used to render into both windows and GLX
647 pixmaps. If `glXCreateContext' fails to create a rendering context,
650 If DIRECT is `True', then a direct rendering context is created if the
651 implementation supports direct rendering, if the connection is to an X
652 server that is local, and if a direct rendering context is available.
653 (An implementation may return an indirect context when DIRECT is
654 `True'.) If DIRECT is `False', then a rendering context that renders
655 through the X server is always created. Direct rendering provides a
656 performance advantage in some implementations. However, direct rendering
657 contexts cannot be shared outside a single process, and they may be
658 unable to render to GLX pixmaps.
660 If SHARELIST is not `NULL', then all display-list indexes and
661 definitions are shared by context SHARELIST and by the newly created
662 context. An arbitrary number of contexts can share a single display-list
663 space. However, all rendering contexts that share a single display-list
664 space must themselves exist in the same address space. Two rendering
665 contexts share an address space if both are nondirect using the same
666 server, or if both are direct and owned by a single process. Note that
667 in the nondirect case, it is not necessary for the calling threads to
668 share an address space, only for their related rendering contexts to
669 share an address space.
671 If the GL version is 1.1 or greater, then all texture objects except
672 object 0 are shared by any contexts that share display lists.
674 `NULL' is returned if execution fails on the client side.
676 `BadMatch' is generated if the context to be created would not share the
677 address space or the screen of the context specified by SHARELIST.
679 `BadValue' is generated if VIS is not a valid visual (for example, if a
680 particular GLX implementation does not support it).
682 `GLXBadContext' is generated if SHARELIST is not a GLX context and is
685 `BadAlloc' is generated if the server does not have enough resources to
686 allocate the new context.")
688 (define-glx-procedures
695 "Create an off-screen GLX rendering area.
698 Specifies the connection to the X server.
701 Specifies the visual that defines the structure of the rendering
702 area. It is a pointer to an `XVisualInfo' structure, not a visual
703 ID or a pointer to a `Visual'.
706 Specifies the X pixmap that will be used as the front left color
707 buffer of the off-screen rendering area.
709 `glXCreateGLXPixmap' creates an off-screen rendering area and returns
710 its XID. Any GLX rendering context that was created with respect to VIS
711 can be used to render into this off-screen area. Use `glXMakeCurrent' to
712 associate the rendering area with a GLX rendering context.
714 The X pixmap identified by PIXMAP is used as the front left buffer of
715 the resulting off-screen rendering area. All other buffers specified by
716 VIS, including color buffers other than the front left buffer, are
717 created without externally visible names. GLX pixmaps with
718 double-buffering are supported. However, `glXSwapBuffers' is ignored by
721 Some implementations may not support GLX pixmaps with direct rendering
724 `BadMatch' is generated if the depth of PIXMAP does not match the depth
725 value reported by core X11 for VIS, or if PIXMAP was not created with
726 respect to the same screen as VIS.
728 `BadValue' is generated if VIS is not a valid XVisualInfo pointer (for
729 example, if a particular GLX implementation does not support this
732 `BadPixmap' is generated if PIXMAP is not a valid pixmap.
734 `BadAlloc' is generated if the server cannot allocate the GLX pixmap.")
736 (define-glx-procedures
737 ((glXCreateNewContext
741 (share_list GLXContext)
745 "Create a new GLX rendering context.
748 Specifies the connection to the X server.
751 Specifies the GLXFBConfig structure with the desired attributes for
755 Specifies the type of the context to be created. Must be one of
756 `GLX_RGBA_TYPE' or `GLX_COLOR_INDEX_TYPE'.
759 Specifies the context with which to share display lists. `NULL'
760 indicates that no sharing is to take place.
763 Specifies whether rendering is to be done with a direct connection
764 to the graphics system if possible (`True') or through the X server
767 `glXCreateNewContext' creates a GLX rendering context and returns its
768 handle. This context can be used to render into GLX windows, pixmaps, or
769 pixel buffers. If `glXCreateNewContext' fails to create a rendering
770 context, `NULL' is returned.
772 If RENDER_TYPE is `GLX_RGBA_TYPE', then a context that supports RGBA
773 rendering is created. If CONFIG is `GLX_COLOR_INDEX_TYPE', then context
774 supporting color-index rendering is created.
776 If RENDER_TYPE is not `NULL', then all display-list indexes and
777 definitions are shared by context RENDER_TYPE and by the newly created
778 context. An arbitrary number of contexts can share a single display-list
779 space. However, all rendering contexts that share a single display-list
780 space must themselves exist in the same address space. Two rendering
781 contexts share an address space if both are nondirect using the same
782 server, or if both are direct and owned by a single process. Note that
783 in the nondirect case, it is not necessary for the calling threads to
784 share an address space, only for their related rendering contexts to
785 share an address space.
787 If SHARE_LIST is `True', then a direct-rendering context is created if
788 the implementation supports direct rendering, if the connection is to an
789 X server that is local, and if a direct-rendering context is available.
790 (An implementation may return an indirect context when SHARE_LIST is
791 `True'.) If SHARE_LIST is `False', then a rendering context that renders
792 through the X server is always created. Direct rendering provides a
793 performance advantage in some implementations. However, direct-rendering
794 contexts cannot be shared outside a single process, and they may be
795 unable to render to GLX pixmaps.
797 `NULL' is returned if execution fails on the client side.
799 `GLXBadContext' is generated if RENDER_TYPE is not a GLX context and is
802 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.
804 `BadMatch' is generated if the context to be created would not share the
805 address space or the screen of the context specified by RENDER_TYPE.
807 `BadAlloc' is generated if the server does not have enough resources to
808 allocate the new context.
810 `BadValue' is generated if CONFIG is not a valid visual (for example, if
811 a particular GLX implementation does not support it).")
813 (define-glx-procedures
817 (attrib_list const-int-*)
820 "Create an off-screen rendering area.
823 Specifies the connection to the X server.
826 Specifies a GLXFBConfig structure with the desired attributes for
830 Specifies a list of attribute value pairs, which must be terminated
831 with `None' or `NULL'. Accepted attributes are `GLX_PBUFFER_WIDTH',
832 `GLX_PBUFFER_HEIGHT', `GLX_PRESERVED_CONTENTS', and
833 `GLX_LARGEST_PBUFFER'.
835 `glXCreatePbuffer' creates an off-screen rendering area and returns its
836 XID. Any GLX rendering context that was created with respect to CONFIG
837 can be used to render into this window. Use `glXMakeContextCurrent' to
838 associate the rendering area with a GLX rendering context.
840 The accepted attributes for a GLXPbuffer are:
843 Specify the pixel width of the requested GLXPbuffer. The default
847 Specify the pixel height of the requested GLXPbuffer. The default
850 `GLX_LARGEST_PBUFFER'
851 Specify to obtain the largest available pixel buffer, if the
852 requested allocation would have failed. The width and height of the
853 allocated pixel buffer will never exceed the specified
854 `GLX_PBUFFER_WIDTH' or `GLX_PBUFFER_HEIGHT', respectively. Use
855 `glXQueryDrawable' to retrieve the dimensions of the allocated
856 pixel buffer. The default value is `False'.
858 `GLX_PRESERVED_CONTENTS'
859 Specify if the contents of the pixel buffer should be preserved
860 when a resource conflict occurs. If set to `False', the contents of
861 the pixel buffer may be lost at any time. If set to `True', or not
862 specified in ATTRIB_LIST, then the contents of the pixel buffer
863 will be preserved (most likely by copying the contents into main
864 system memory from the frame buffer). In either case, the client
865 can register (using `glXSelectEvent', to receive pixel buffer
866 clobber events that are generated when the pbuffer contents have
867 been preserved or damaged.
869 GLXPbuffers contain the color and ancillary buffers specified by CONFIG.
870 It is possible to create a pixel buffer with back buffers and to swap
871 those buffers using `glXSwapBuffers'.
873 `BadAlloc' is generated if there are insufficient resources to allocate
874 the requested GLXPbuffer.
876 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.
878 `BadMatch' is generated if CONFIG does not support rendering to pixel
879 buffers (e.g., `GLX_DRAWABLE_TYPE' does not contain `GLX_PBUFFER_BIT').")
881 (define-glx-procedures
886 (attrib_list const-int-*)
889 "Create an off-screen rendering area.
892 Specifies the connection to the X server.
895 Specifies a GLXFBConfig structure with the desired attributes for
899 Specifies the X pixmap to be used as the rendering area.
902 Currently unused. This must be set to `NULL' or be an empty list
903 (i.e., one in which the first element is `None').
905 `glXCreatePixmap' creates an off-screen rendering area and returns its
906 XID. Any GLX rendering context that was created with respect to CONFIG
907 can be used to render into this window. Use `glXMakeCurrent' to
908 associate the rendering area with a GLX rendering context.
910 `BadMatch' is generated if PIXMAP was not created with a visual that
911 corresponds to CONFIG.
913 `BadMatch' is generated if CONFIG does not support rendering to windows
914 (e.g., `GLX_DRAWABLE_TYPE' does not contain `GLX_WINDOW_BIT').
916 `BadWindow' is generated if PIXMAP is not a valid window XID. `BadAlloc'
917 is generated if there is already a GLXFBConfig associated with PIXMAP.
919 `BadAlloc' is generated if the X server cannot allocate a new GLX
922 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.")
924 (define-glx-procedures
929 (attrib_list const-int-*)
932 "Create an on-screen rendering area.
935 Specifies the connection to the X server.
938 Specifies a GLXFBConfig structure with the desired attributes for
942 Specifies the X window to be used as the rendering area.
945 Currently unused. This must be set to `NULL' or be an empty list
946 (i.e., one in which the first element is `None').
948 `glXCreateWindow' creates an on-screen rendering area from an existing X
949 window that was created with a visual matching CONFIG. The XID of the
950 GLXWindow is returned. Any GLX rendering context that was created with
951 respect to CONFIG can be used to render into this window. Use
952 `glXMakeContextCurrent' to associate the rendering area with a GLX
955 `BadMatch' is generated if WIN was not created with a visual that
956 corresponds to CONFIG.
958 `BadMatch' is generated if CONFIG does not support rendering to windows
959 (i.e., `GLX_DRAWABLE_TYPE' does not contain `GLX_WINDOW_BIT').
961 `BadWindow' is generated if WIN is not a valid pixmap XID.
963 `BadAlloc' is generated if there is already a GLXFBConfig associated
966 `BadAlloc' is generated if the X server cannot allocate a new GLX
969 `GLXBadFBConfig' is generated if CONFIG is not a valid GLXFBConfig.")
971 (define-glx-procedures
977 "Destroy a GLX context.
980 Specifies the connection to the X server.
983 Specifies the GLX context to be destroyed.
985 If the GLX rendering context CTX is not current to any thread,
986 `glXDestroyContext' destroys it immediately. Otherwise, CTX is destroyed
987 when it becomes not current to any thread. In either case, the resource
988 ID referenced by CTX is freed immediately.
990 `GLXBadContext' is generated if CTX is not a valid GLX context.")
992 (define-glx-procedures
993 ((glXDestroyGLXPixmap
998 "Destroy a GLX pixmap.
1001 Specifies the connection to the X server.
1004 Specifies the GLX pixmap to be destroyed.
1006 If the GLX pixmap PIX is not current to any client,
1007 `glXDestroyGLXPixmap' destroys it immediately. Otherwise, PIX is
1008 destroyed when it becomes not current to any client. In either case, the
1009 resource ID is freed immediately.
1011 `GLXBadPixmap' is generated if PIX is not a valid GLX pixmap.")
1013 (define-glx-procedures
1019 "Destroy an off-screen rendering area.
1022 Specifies the connection to the X server.
1025 Specifies the GLXPbuffer to be destroyed.
1027 `glXDestroyPbuffer' destroys a GLXPbuffer created by `glXCreatePbuffer'.
1029 `GLXBadPbuffer' is generated if PBUF is not a valid GLXPbuffer.")
1031 (define-glx-procedures
1037 "Destroy an off-screen rendering area.
1040 Specifies the connection to the X server.
1043 Specifies the GLXPixmap to be destroyed.
1045 `glXDestroyPixmap' destroys a GLXPixmap created by `glXCreatePixmap'.
1047 `GLXBadPixmap' is generated if PIXMAP is not a valid GLXPixmap.")
1049 (define-glx-procedures
1055 "Destroy an on-screen rendering area.
1058 Specifies the connection to the X server.
1061 Specifies the GLXWindow to be destroyed.
1063 `glXDestroyWindow' destroys a GLXWindow created by `glXCreateWindow'.
1065 `GLXBadWindow' is generated if WIN is not a valid GLXPixmap.")
1067 (define-glx-procedures
1073 "Free client-side memory for imported context.
1076 Specifies the connection to the X server.
1079 Specifies a GLX rendering context.
1081 `glXFreeContextEXT' frees the client-side part of a GLXContext that was
1082 created with `glXImportContextEXT'. `glXFreeContextEXT' does not free
1083 the server-side context information or the XID associated with the
1084 server-side context.
1086 `glXFreeContextEXT' is part of the `EXT_import_context' extension, not
1087 part of the core GLX command set. If _glxextstring(EXT_import_context)
1088 is included in the string returned by `glXQueryExtensionsString', when
1089 called with argument `GLX_EXTENSIONS', extension `EXT_vertex_array' is
1092 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1094 (define-glx-procedures
1095 ((glXGetClientString
1100 "Return a string describing the client.
1103 Specifies the connection to the X server.
1106 Specifies which string is returned. The symbolic constants
1107 `GLX_VENDOR', `GLX_VERSION', and `GLX_EXTENSIONS' are accepted.
1109 `glXGetClientString' returns a string describing some aspect of the
1110 client library. The possible values for NAME are `GLX_VENDOR',
1111 `GLX_VERSION', and `GLX_EXTENSIONS'. If NAME is not set to one of these
1112 values, `glXGetClientString' returns `NULL'. The format and contents of
1113 the vendor string is implementation dependent.
1115 The extensions string is null-terminated and contains a space-separated
1116 list of extension names. (The extension names never contain spaces.) If
1117 there are no extensions to GLX, then the empty string is returned.
1119 The version string is laid out as follows:
1121 <major_version.minor_version><space><vendor-specific info>
1123 Both the major and minor portions of the version number are of arbitrary
1124 length. The vendor-specific information is optional. However, if it is
1125 present, the format and contents are implementation specific.")
1127 (define-glx-procedures
1135 "Return information about GLX visuals.
1138 Specifies the connection to the X server.
1141 Specifies the visual to be queried. It is a pointer to an
1142 `XVisualInfo' structure, not a visual ID or a pointer to a
1146 Specifies the visual attribute to be returned.
1149 Returns the requested value.
1151 `glXGetConfig' sets VALUE to the ATTRIB value of windows or GLX pixmaps
1152 created with respect to VIS. `glXGetConfig' returns an error code if it
1153 fails for any reason. Otherwise, zero is returned.
1155 ATTRIB is one of the following:
1160 `True' if OpenGL rendering is supported by this visual, `False'
1164 Number of bits per color buffer. For RGBA visuals,
1165 `GLX_BUFFER_SIZE' is the sum of `GLX_RED_SIZE', `GLX_GREEN_SIZE',
1166 `GLX_BLUE_SIZE', and `GLX_ALPHA_SIZE'. For color index visuals,
1167 `GLX_BUFFER_SIZE' is the size of the color indexes.
1170 Frame buffer level of the visual. Level zero is the default frame
1171 buffer. Positive levels correspond to frame buffers that overlay
1172 the default buffer, and negative levels correspond to frame buffers
1173 that underlay the default buffer.
1176 `True' if color buffers store red, green, blue, and alpha values.
1177 `False' if they store color indexes.
1180 `True' if color buffers exist in front/back pairs that can be
1181 swapped, `False' otherwise.
1184 `True' if color buffers exist in left/right pairs, `False'
1188 Number of auxiliary color buffers that are available. Zero
1189 indicates that no auxiliary color buffers exist.
1192 Number of bits of red stored in each color buffer. Undefined if
1193 `GLX_RGBA' is `False'.
1196 Number of bits of green stored in each color buffer. Undefined if
1197 `GLX_RGBA' is `False'.
1200 Number of bits of blue stored in each color buffer. Undefined if
1201 `GLX_RGBA' is `False'.
1204 Number of bits of alpha stored in each color buffer. Undefined if
1205 `GLX_RGBA' is `False'.
1208 Number of bits in the depth buffer.
1211 Number of bits in the stencil buffer.
1213 `GLX_ACCUM_RED_SIZE'
1214 Number of bits of red stored in the accumulation buffer.
1216 `GLX_ACCUM_GREEN_SIZE'
1217 Number of bits of green stored in the accumulation buffer.
1219 `GLX_ACCUM_BLUE_SIZE'
1220 Number of bits of blue stored in the accumulation buffer.
1222 `GLX_ACCUM_ALPHA_SIZE'
1223 Number of bits of alpha stored in the accumulation buffer.
1225 The X protocol allows a single visual ID to be instantiated with
1226 different numbers of bits per pixel. Windows or GLX pixmaps that will be
1227 rendered with OpenGL, however, must be instantiated with a color buffer
1228 depth of `GLX_BUFFER_SIZE'.
1230 Although a GLX implementation can export many visuals that support GL
1231 rendering, it must support at least one RGBA visual. This visual must
1232 have at least one color buffer, a stencil buffer of at least 1 bit, a
1233 depth buffer of at least 12 bits, and an accumulation buffer. Alpha
1234 bitplanes are optional in this visual. However, its color buffer size
1235 must be as great as that of the deepest `TrueColor', `DirectColor',
1236 `PseudoColor', or `StaticColor' visual supported on level zero, and it
1237 must itself be made available on level zero.
1239 In addition, if the X server exports a `PseudoColor' or `StaticColor'
1240 visual on framebuffer level 0, a color index visual is also required on
1241 that level. It must have at least one color buffer, a stencil buffer of
1242 at least 1 bit, and a depth buffer of at least 12 bits. This visual must
1243 have as many color bitplanes as the deepest `PseudoColor' or
1244 `StaticColor' visual supported on level 0.
1246 Applications are best written to select the visual that most closely
1247 meets their requirements. Creating windows or GLX pixmaps with
1248 unnecessary buffers can result in reduced rendering performance as well
1249 as poor resource allocation.
1251 `GLX_NO_EXTENSION' is returned if DPY does not support the GLX
1254 `GLX_BAD_SCREEN' is returned if the screen of VIS does not correspond to
1257 `GLX_BAD_ATTRIBUTE' is returned if ATTRIB is not a valid GLX attribute.
1259 `GLX_BAD_VISUAL' is returned if VIS doesn't support GLX and an attribute
1260 other than `GLX_USE_GL' is requested.")
1262 (define-glx-procedures
1263 ((glXGetContextIDEXT
1264 (ctx const-GLXContext)
1267 "Get the XID for a context..
1270 Specifies a GLX rendering context.
1272 `glXGetContextIDEXT' returns the XID associated with a GLXContext.
1274 No round trip is forced to the server; unlike most X calls that return a
1275 value, `glXGetContextIDEXT' does not flush any pending events.
1277 `glXGetContextIDEXT' is part of the `EXT_import_context' extension, not
1278 part of the core GLX command set. If _glxextstring(EXT_import_context)
1279 is included in the string returned by `glXQueryExtensionsString', when
1280 called with argument `GLX_EXTENSIONS', extension `EXT_import_context' is
1283 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1285 (define-glx-procedures
1286 ((glXGetCurrentContext -> GLXContext))
1287 "Return the current context.
1289 `glXGetCurrentContext' returns the current context, as specified by
1290 `glXMakeCurrent'. If there is no current context, `NULL' is returned.
1292 `glXGetCurrentContext' returns client-side information. It does not make
1293 a round trip to the server.")
1295 (define-glx-procedures
1296 ((glXGetCurrentDisplay -> Display-*))
1297 "Get display for current context.
1299 `glXGetCurrentDisplay' returns the display for the current context. If
1300 no context is current, `NULL' is returned.
1302 `glXGetCurrentDisplay' returns client-side information. It does not make
1303 a round-trip to the server, and therefore does not flush any pending
1306 (define-glx-procedures
1307 ((glXGetCurrentDrawable -> GLXDrawable))
1308 "Return the current drawable.
1310 `glXGetCurrentDrawable' returns the current drawable, as specified by
1311 `glXMakeCurrent'. If there is no current drawable, `None' is returned.
1313 `glXGetCurrentDrawable' returns client-side information. It does not
1314 make a round trip to the server.")
1316 (define-glx-procedures
1317 ((glXGetCurrentReadDrawable -> GLXDrawable))
1318 "Return the current drawable.
1320 `glXGetCurrentReadDrawable' returns the current read drawable, as
1321 specified by `read' parameter of `glXMakeContextCurrent'. If there is no
1322 current drawable, `None' is returned.
1324 `glXGetCurrentReadDrawable' returns client-side information. It does not
1325 make a round-trip to the server.")
1327 (define-glx-procedures
1328 ((glXGetFBConfigAttrib
1330 (config GLXFBConfig)
1335 "Return information about a GLX frame buffer configuration.
1338 Specifies the connection to the X server.
1341 Specifies the GLX frame buffer configuration to be queried.
1344 Specifies the attribute to be returned.
1347 Returns the requested value.
1349 `glXGetFBConfigAttrib' sets VALUE to the ATTRIBUTE value of GLX
1350 drawables created with respect to CONFIG. `glXGetFBConfigAttrib' returns
1351 an error code if it fails for any reason. Otherwise, `Success' is
1354 ATTRIBUTE is one of the following:
1359 XID of the given GLXFBConfig.
1364 Number of bits per color buffer. If the frame buffer configuration
1365 supports RGBA contexts, then `GLX_BUFFER_SIZE' is the sum of
1366 `GLX_RED_SIZE', `GLX_GREEN_SIZE', `GLX_BLUE_SIZE', and
1367 `GLX_ALPHA_SIZE'. If the frame buffer configuration supports only
1368 color index contexts, `GLX_BUFFER_SIZE' is the size of the color
1374 Frame buffer level of the configuration. Level zero is the default
1375 frame buffer. Positive levels correspond to frame buffers that
1376 overlay the default buffer, and negative levels correspond to frame
1377 buffers that underlie the default buffer.
1382 `True' if color buffers exist in front/back pairs that can be
1383 swapped, `False' otherwise.
1388 `True' if color buffers exist in left/right pairs, `False'
1394 Number of auxiliary color buffers that are available. Zero
1395 indicates that no auxiliary color buffers exist.
1400 Number of bits of red stored in each color buffer. Undefined if
1401 RGBA contexts are not supported by the frame buffer configuration.
1406 Number of bits of green stored in each color buffer. Undefined if
1407 RGBA contexts are not supported by the frame buffer configuration.
1412 Number of bits of blue stored in each color buffer. Undefined if
1413 RGBA contexts are not supported by the frame buffer configuration.
1418 Number of bits of alpha stored in each color buffer. Undefined if
1419 RGBA contexts are not supported by the frame buffer configuration.
1424 Number of bits in the depth buffer.
1429 Number of bits in the stencil buffer.
1431 `GLX_ACCUM_RED_SIZE'
1434 Number of bits of red stored in the accumulation buffer.
1436 `GLX_ACCUM_GREEN_SIZE'
1439 Number of bits of green stored in the accumulation buffer.
1441 `GLX_ACCUM_BLUE_SIZE'
1444 Number of bits of blue stored in the accumulation buffer.
1446 `GLX_ACCUM_ALPHA_SIZE'
1449 Number of bits of alpha stored in the accumulation buffer.
1454 Mask indicating what type of GLX contexts can be made current to
1455 the frame buffer configuration. Valid bits are `GLX_RGBA_BIT' and
1456 `GLX_COLOR_INDEX_BIT'.
1461 Mask indicating what drawable types the frame buffer configuration
1462 supports. Valid bits are `GLX_WINDOW_BIT', `GLX_PIXMAP_BIT', and
1468 `True' if drawables created with the frame buffer configuration can
1469 be rendered to by X.
1474 XID of the corresponding visual, or zero if there is no associated
1475 visual (i.e., if `GLX_X_RENDERABLE' is `False' or
1476 `GLX_DRAWABLE_TYPE' does not have the `GLX_WINDOW_BIT' bit set).
1481 Visual type of associated visual. The returned value will be one
1482 of: `GLX_TRUE_COLOR', `GLX_DIRECT_COLOR', `GLX_PSEUDO_COLOR',
1483 `GLX_STATIC_COLOR', `GLX_GRAY_SCALE', `GLX_STATIC_GRAY', or
1484 `GLX_NONE', if there is no associated visual (i.e., if
1485 `GLX_X_RENDERABLE' is `False' or `GLX_DRAWABLE_TYPE' does not have
1486 the `GLX_WINDOW_BIT' bit set).
1491 One of `GLX_NONE', `GLX_SLOW_CONFIG', or
1492 `GLX_NON_CONFORMANT_CONFIG', indicating that the frame buffer
1493 configuration has no caveats, some aspect of the frame buffer
1494 configuration runs slower than other frame buffer configurations,
1495 or some aspect of the frame buffer configuration is nonconformant,
1498 `GLX_TRANSPARENT_TYPE'
1501 One of `GLX_NONE', `GLX_TRANSPARENT_RGB', `GLX_TRANSPARENT_INDEX',
1502 indicating that the frame buffer configuration is opaque, is
1503 transparent for particular values of red, green, and blue, or is
1504 transparent for particular index values, respectively.
1506 `GLX_TRANSPARENT_INDEX_VALUE'
1509 Integer value between 0 and the maximum frame buffer value for
1510 indices, indicating the transparent index value for the frame
1511 buffer configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1512 `GLX_TRANSPARENT_INDEX'.
1514 `GLX_TRANSPARENT_RED_VALUE'
1517 Integer value between 0 and the maximum frame buffer value for red,
1518 indicating the transparent red value for the frame buffer
1519 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1520 `GLX_TRANSPARENT_RGB'.
1522 `GLX_TRANSPARENT_GREEN_VALUE'
1525 Integer value between 0 and the maximum frame buffer value for
1526 green, indicating the transparent green value for the frame buffer
1527 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1528 `GLX_TRANSPARENT_RGB'.
1530 `GLX_TRANSPARENT_BLUE_VALUE'
1533 Integer value between 0 and the maximum frame buffer value for
1534 blue, indicating the transparent blue value for the frame buffer
1535 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1536 `GLX_TRANSPARENT_RGB'.
1538 `GLX_TRANSPARENT_ALPHA_VALUE'
1541 Integer value between 0 and the maximum frame buffer value for
1542 alpha, indicating the transparent blue value for the frame buffer
1543 configuration. Undefined if `GLX_TRANSPARENT_TYPE' is not
1544 `GLX_TRANSPARENT_RGB'.
1546 `GLX_MAX_PBUFFER_WIDTH'
1549 The maximum width that can be specified to `glXCreatePbuffer'.
1551 `GLX_MAX_PBUFFER_HEIGHT'
1554 The maximum height that can be specified to `glXCreatePbuffer'.
1556 `GLX_MAX_PBUFFER_PIXELS'
1559 The maximum number of pixels (width times height) for a pixel
1560 buffer. Note that this value may be less than
1561 `GLX_MAX_PBUFFER_WIDTH' times `GLX_MAX_PBUFFER_HEIGHT'. Also, this
1562 value is static and assumes that no other pixel buffers or X
1563 resources are contending for the frame buffer memory. As a result,
1564 it may not be possible to allocate a pixel buffer of the size given
1565 by `GLX_MAX_PBUFFER_PIXELS'.
1567 Applications should choose the frame buffer configuration that most
1568 closely meets their requirements. Creating windows, GLX pixmaps, or GLX
1569 pixel buffers with unnecessary buffers can result in reduced rendering
1570 performance as well as poor resource allocation.
1572 `GLX_NO_EXTENSION' is returned if DPY does not support the GLX
1573 extension. `GLX_BAD_ATTRIBUTE' is returned if ATTRIBUTE is not a valid
1576 (define-glx-procedures
1583 "List all GLX frame buffer configurations for a given screen.
1586 Specifies the connection to the X server.
1589 Specifies the screen number.
1592 Returns the number of GLXFBConfigs returned.
1594 `glXGetFBConfigs' returns a list of all GLXFBConfigs available on the
1595 screen specified by SCREEN. Use `glXGetFBConfigAttrib' to obtain
1596 attribute values from a specific GLXFBConfig.")
1598 (define-glx-procedures
1600 (procName const-GLubyte-*)
1602 #{void\x28;*\x29;\x28;\x29;}#))
1603 "Obtain a pointer to an OpenGL or GLX function.
1606 Specifies the name of the OpenGL or GLX function whose address is
1609 `glXGetProcAddress' returns the address of the function specified in
1610 PROCNAME. This is necessary in environments where the OpenGL link
1611 library exports a different set of functions than the runtime library.")
1613 (define-glx-procedures
1614 ((glXGetSelectedEvent
1617 (event_mask unsigned-long-*)
1620 "Returns GLX events that are selected for a window or a GLX pixel buffer.
1623 Specifies the connection to the X server.
1626 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
1629 Returns the events that are selected for DRAW.
1631 `glXGetSelectedEvent' returns in EVENT_MASK the events selected for
1634 `GLXBadDrawable' is generated if DRAW is not a valid window or a valid
1637 (define-glx-procedures
1638 ((glXGetVisualFromFBConfig
1640 (config GLXFBConfig)
1643 "Return visual that is associated with the frame buffer configuration.
1646 Specifies the connection to the X server.
1649 Specifies the GLX frame buffer configuration.
1651 If CONFIG is a valid GLX frame buffer configuration and it has an
1652 associated X Visual, then information describing that visual is
1653 returned; otherwise `NULL' is returned. Use `XFree' to free the data
1656 Returns `NULL' if CONFIG is not a valid GLXFBConfig.")
1658 (define-glx-procedures
1659 ((glXImportContextEXT
1661 (contextID GLXContextID)
1664 "Import another process's indirect rendering context..
1667 Specifies the connection to the X server.
1670 Specifies a GLX rendering context.
1672 `glXImportContextEXT' creates a GLXContext given the XID of an existing
1673 GLXContext. It may be used in place of `glXCreateContext', to share
1674 another process's indirect rendering context.
1676 Only the server-side context information can be shared between X
1677 clients; client-side state, such as pixel storage modes, cannot be
1678 shared. Thus, `glXImportContextEXT' must allocate memory to store
1679 client-side information. This memory is freed by calling
1680 `glXFreeContextEXT'.
1682 This call does not create a new XID. It merely makes an existing object
1683 available to the importing client (Display *). Like any XID, it goes
1684 away when the creating client drops its connection or the ID is
1685 explicitly deleted. Note that this is when the XID goes away. The object
1686 goes away when the XID goes away AND the context is not current to any
1689 If CONTEXTID refers to a direct rendering context then no error is
1690 generated but `glXImportContextEXT' returns NULL.
1692 `glXImportContextEXT' is part of the `EXT_import_context' extension, not
1693 part of the core GLX command set. If _glxextstring(EXT_import_context)
1694 is included in the string returned by `glXQueryExtensionsString', when
1695 called with argument `GLX_EXTENSIONS', extension `EXT_import_context' is
1698 `GLXBadContext' is generated if CONTEXTID does not refer to a valid
1701 (define-glx-procedures
1707 "Indicate whether direct rendering is enabled.
1710 Specifies the connection to the X server.
1713 Specifies the GLX context that is being queried.
1715 `glXIsDirect' returns `True' if CTX is a direct rendering context,
1716 `False' otherwise. Direct rendering contexts pass rendering commands
1717 directly from the calling process's address space to the rendering
1718 system, bypassing the X server. Nondirect rendering contexts pass all
1719 rendering commands to the X server.
1721 `GLXBadContext' is generated if CTX is not a valid GLX context.")
1723 (define-glx-procedures
1724 ((glXMakeContextCurrent
1731 "Attach a GLX context to a GLX drawable.
1734 Specifies the connection to the X server.
1737 Specifies a GLX drawable to render into. Must be an XID
1738 representing a GLXWindow, GLXPixmap, or GLXPbuffer.
1741 Specifies a GLX drawable to read from. Must be an XID representing
1742 a GLXWindow, GLXPixmap, or GLXPbuffer.
1745 Specifies the GLX context to be bound to READ and CTX.
1747 `glXMakeContextCurrent' binds CTX to the current rendering thread and to
1748 the DRAW and READ GLX drawables. DRAW and READ may be the same.
1750 DRAW is used for all OpenGL operations except:
1752 Any pixel data that are read based on the value of `GLX_READ_BUFFER'.
1753 Note that accumulation operations use the value of `GLX_READ_BUFFER',
1754 but are not allowed unless DRAW is identical to READ.
1756 Any depth values that are retrieved by `glReadPixels' or `glCopyPixels'.
1758 Any stencil values that are retrieved by `glReadPixels' or
1761 Frame buffer values are taken from DRAW.
1763 If the current rendering thread has a current rendering context, that
1764 context is flushed and replaced by CTX.
1766 The first time that CTX is made current, the viewport and scissor
1767 dimensions are set to the size of the DRAW drawable. The viewport and
1768 scissor are not modified when CTX is subsequently made current.
1770 To release the current context without assigning a new one, call
1771 `glXMakeContextCurrent' with DRAW and READ set to `None' and CTX set to
1774 `glXMakeContextCurrent' returns `True' if it is successful, `False'
1775 otherwise. If `False' is returned, the previously current rendering
1776 context and drawable (if any) remain unchanged.
1778 `BadMatch' is generated if DRAW and READ are not compatible.
1780 `BadAccess' is generated if CTX is current to some other thread.
1782 `GLXContextState' is generated if there is a current rendering context
1783 and its render mode is either `GLX_FEEDBACK' or `GLX_SELECT'.
1785 `GLXBadContext' is generated if CTX is not a valid GLX rendering
1788 `GLXBadDrawable' is generated if DRAW or READ is not a valid GLX
1791 `GLXBadWindow' is generated if the underlying X window for either DRAW
1792 or READ is no longer valid.
1794 `GLXBadCurrentDrawable' is generated if the previous context of the
1795 calling thread has unflushed commands and the previous drawable is no
1798 `BadAlloc' is generated if the X server does not have enough resources
1799 to allocate the buffers.
1801 `BadMatch' is generated if:
1803 DRAW and READ cannot fit into frame buffer memory simultaneously.
1805 DRAW or READ is a GLXPixmap and CTX is a direct-rendering context.
1807 DRAW or READ is a GLXPixmap and CTX was previously bound to a GLXWindow
1810 DRAW or READ is a GLXWindow or GLXPbuffer and CTX was previously bound
1813 (define-glx-procedures
1816 (drawable GLXDrawable)
1820 "Attach a GLX context to a window or a GLX pixmap.
1823 Specifies the connection to the X server.
1826 Specifies a GLX drawable. Must be either an X window ID or a GLX
1830 Specifies a GLX rendering context that is to be attached to
1833 `glXMakeCurrent' does two things: It makes CTX the current GLX rendering
1834 context of the calling thread, replacing the previously current context
1835 if there was one, and it attaches CTX to a GLX drawable, either a window
1836 or a GLX pixmap. As a result of these two actions, subsequent GL
1837 rendering calls use rendering context CTX to modify GLX drawable
1838 DRAWABLE (for reading and writing). Because `glXMakeCurrent' always
1839 replaces the current rendering context with CTX, there can be only one
1840 current context per thread.
1842 Pending commands to the previous context, if any, are flushed before it
1845 The first time CTX is made current to any thread, its viewport is set to
1846 the full size of DRAWABLE. Subsequent calls by any thread to
1847 `glXMakeCurrent' with CTX have no effect on its viewport.
1849 To release the current context without assigning a new one, call
1850 `glXMakeCurrent' with DRAWABLE set to `None' and CTX set to `NULL'.
1852 `glXMakeCurrent' returns `True' if it is successful, `False' otherwise.
1853 If `False' is returned, the previously current rendering context and
1854 drawable (if any) remain unchanged.
1856 `BadMatch' is generated if DRAWABLE was not created with the same X
1857 screen and visual as CTX. It is also generated if DRAWABLE is `None' and
1860 `BadAccess' is generated if CTX was current to another thread at the
1861 time `glXMakeCurrent' was called.
1863 `GLXBadDrawable' is generated if DRAWABLE is not a valid GLX drawable.
1865 `GLXBadContext' is generated if CTX is not a valid GLX context.
1867 `GLXBadContextState' is generated if `glXMakeCurrent' is executed
1868 between the execution of `glBegin' and the corresponding execution of
1871 `GLXBadContextState' is also generated if the rendering context current
1872 to the calling thread has GL renderer state `GLX_FEEDBACK' or
1875 `GLXBadCurrentWindow' is generated if there are pending GL commands for
1876 the previous context and the current drawable is a window that is no
1879 `BadAlloc' may be generated if the server has delayed allocation of
1880 ancillary buffers until `glXMakeCurrent' is called, only to find that it
1881 has insufficient resources to complete the allocation.")
1883 (define-glx-procedures
1884 ((glXQueryContextInfoEXT
1891 "Query context information.
1894 Specifies the connection to the X server.
1897 Specifies a GLX rendering context.
1900 Specifies that a context parameter should be retrieved. Must be one
1901 of `GLX_SHARED_CONTEXT_EXT', `GLX_VISUAL_ID_EXT', or
1905 Contains the return value for ATTRIBUTE.
1907 `glXQueryContextInfoEXT' sets VALUE to the value of ATTRIBUTE with
1908 respect to CTX. `glXQueryContextInfoEXT' returns an error code if it
1909 fails for any reason. Otherwise, `Success' is returned.
1911 ATTRIBUTE may be one of the following:
1913 `GLX_SHARED_CONTEXT_EXT'
1914 Returns the XID of the share list context associated with CTX at
1918 Returns the XID of the GLX Visual associated with CTX.
1921 Returns the screen number associated with CTX.
1923 This call may cause a round-trip to the server.
1925 `glXQueryContextInfoEXT' is part of the `EXT_import_context' extension,
1926 not part of the core GLX command set. If
1927 _glxextstring(EXT_import_context) is included in the string returned by
1928 `glXQueryExtensionsString', when called with argument `GLX_EXTENSIONS',
1929 extension `EXT_import_context' is supported.
1931 `GLXBadContext' is generated if CTX does not refer to a valid context.
1933 `GLX_BAD_ATTRIBUTE' is returned if ATTRIBUTE is not a valid GLX context
1936 fred `GLX_BAD_CONTEXT' is returned if ATTRIBUTE is not a valid context.")
1938 (define-glx-procedures
1946 "Query context information.
1949 Specifies the connection to the X server.
1952 Specifies a GLX rendering context.
1955 Specifies that a context parameter should be retrieved. Must be one
1956 of `GLX_FBCONFIG_ID', `GLX_RENDER_TYPE', or `GLX_SCREEN'.
1959 Contains the return value for ATTRIBUTE.
1961 `glXQueryContext' sets VALUE to the value of ATTRIBUTE with respect to
1962 CTX. ATTRIBUTE may be one of the following:
1965 Returns the XID of the GLXFBConfig associated with CTX.
1968 Returns the rendering type supported by CTX.
1971 Returns the screen number associated with CTX.
1973 `Success' is returned unless ATTRIBUTE is not a valid GLX context
1974 attribute, in which case `GLX_BAD_ATTRIBUTE' is returned.
1976 This call may cause a round-trip to the server.
1978 `GLXBadContext' is generated if CTX does not refer to a valid context.")
1980 (define-glx-procedures
1985 (value unsigned-int-*)
1988 "Returns an attribute assoicated with a GLX drawable.
1991 Specifies the connection to the X server.
1994 Specifies the GLX drawable to be queried.
1997 Specifies the attribute to be returned. Must be one of `GLX_WIDTH',
1998 `GLX_HEIGHT', `GLX_PRESERVED_CONTENTS', `GLX_LARGEST_PBUFFER', or
2002 Contains the return value for ATTRIBUTE.
2004 `glXQueryDrawable' sets VALUE to the value of ATTRIBUTE with respect to
2005 the GLXDrawable DRAW.
2007 ATTRIBUTE may be one of the following:
2010 Returns the width of CTX.
2013 Returns the height of CTX.
2015 `GLX_PRESERVED_CONTENTS'
2016 Returns `True' if the contents of a GLXPbuffer are preserved when a
2017 resource conflict occurs; `False' otherwise.
2019 `GLX_LARGEST_PBUFFER'
2020 Returns the value set when `glXCreatePbuffer' was called to create
2021 the GLXPbuffer. If `False' is returned, then the call to
2022 `glXCreatePbuffer' will fail to create a GLXPbuffer if the
2023 requested size is larger than the implementation maximum or
2024 available resources. If `True' is returned, a GLXPbuffer of the
2025 maximum availble size (if less than the requested width and height)
2029 Returns the XID for DRAW.
2031 If DRAW is a GLXWindow or GLXPixmap and ATTRIBUTE is set to
2032 `GLX_PRESERVED_CONTENTS' or `GLX_LARGETST_PBUFFER', the contents of
2033 VALUE are undefined. If ATTRIBUTE is not one of the attributes listed
2034 above, the contents of VALUE are unedfined.
2036 A `GLXBadDrawable' is generated if DRAW is not a valid GLXDrawable.")
2038 (define-glx-procedures
2039 ((glXQueryExtensionsString
2044 "Return list of supported extensions.
2047 Specifies the connection to the X server.
2050 Specifies the screen number.
2052 `glXQueryExtensionsString' returns a pointer to a string describing
2053 which GLX extensions are supported on the connection. The string is
2054 null-terminated and contains a space-separated list of extension names.
2055 (The extension names themselves never contain spaces.) If there are no
2056 extensions to GLX, then the empty string is returned.")
2058 (define-glx-procedures
2065 "Indicate whether the GLX extension is supported.
2068 Specifies the connection to the X server.
2071 Returns the base error code of the GLX server extension.
2074 Returns the base event code of the GLX server extension.
2076 `glXQueryExtension' returns `True' if the X server of connection DPY
2077 supports the GLX extension, `False' otherwise. If `True' is returned,
2078 then ERRORBASE and EVENTBASE return the error base and event base of the
2079 GLX extension. These values should be added to the constant error and
2080 event values to determine the actual event or error values. Otherwise,
2081 ERRORBASE and EVENTBASE are unchanged.
2083 ERRORBASE and EVENTBASE do not return values if they are specified as
2086 (define-glx-procedures
2087 ((glXQueryServerString
2093 "Return string describing the server.
2096 Specifies the connection to the X server.
2099 Specifies the screen number.
2102 Specifies which string is returned: one of `GLX_VENDOR',
2103 `GLX_VERSION', or `GLX_EXTENSIONS'.
2105 `glXQueryServerString' returns a pointer to a static, null-terminated
2106 string describing some aspect of the server's GLX extension. The
2107 possible values for NAME and the format of the strings is the same as
2108 for `glXGetClientString'. If NAME is not set to a recognized value,
2109 `NULL' is returned.")
2111 (define-glx-procedures
2118 "Return the version numbers of the GLX extension.
2121 Specifies the connection to the X server.
2124 Returns the major version number of the GLX server extension.
2127 Returns the minor version number of the GLX server extension.
2129 `glXQueryVersion' returns the major and minor version numbers of the GLX
2130 extension implemented by the server associated with connection DPY.
2131 Implementations with the same major version number are upward
2132 compatible, meaning that the implementation with the higher minor number
2133 is a superset of the version with the lower minor number.
2135 MAJOR and MINOR do not return values if they are specified as `NULL'.
2137 `glXQueryVersion' returns `False' if it fails, `True' otherwise.
2139 MAJOR and MINOR are not updated when `False' is returned.")
2141 (define-glx-procedures
2145 (event_mask unsigned-long)
2148 "Select GLX events for a window or a GLX pixel buffer.
2151 Specifies the connection to the X server.
2154 Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
2157 Specifies the events to be returned for DRAW.
2159 `glXSelectEvent' sets the GLX event mask for a GLX pixel buffer or a
2160 window. Calling `glXSelectEvent' overrides any previous event mask that
2161 was set by the client for DRAW. Note that it does not affect the event
2162 masks that other clients may have specified for DRAW since each client
2163 rendering to DRAW has a separate event mask for it.
2165 Currently, only one GLX event, `GLX_PBUFFER_CLOBBER_MASK', can be
2166 selected. The following data is returned to the client when a
2167 `GLX_PBUFFER_CLOBBER_MASK' event occurs:
2172 /* GLX_DAMAGED or GLX_SAVED */
2175 /* GLX_WINDOW or GLX_PBUFFER */
2177 unsigned long SERIAL;
2178 /* # of last request processed by server */
2181 /* true if this came for SendEvent request */
2184 /* display the event was read from */
2186 GLXDrawable DRAWABLE;
2187 /* i.d. of Drawable */
2189 unsigned int BUFFER_MASK;
2190 /* mask indicating affected buffers */
2199 /* if nonzero, at least this many more */
2201 } GLXPbufferClobberEvent; The valid bit masks used in BUFFER_MASK are:
2206 *Corresponding Buffer*
2208 `GLX_FRONT_LEFT_BUFFER_BIT'
2209 Front left color buffer
2211 `GLX_FRONT_RIGHT_BUFFER_BIT'
2212 Front right color buffer
2214 `GLX_BACK_LEFT_BUFFER_BIT'
2215 Back left color buffer
2217 `GLX_BACK_RIGHT_BUFFER_BIT'
2218 Back right color buffer
2220 `GLX_AUX_BUFFERS_BIT'
2223 `GLX_DEPTH_BUFFER_BIT'
2226 `GLX_STENCIL_BUFFER_BIT'
2229 `GLX_ACCUM_BUFFER_BIT'
2232 A single X server operation can cause several buffer clobber events to
2233 be sent. (e.g., a single GLX pixel buffer may be damaged and cause
2234 multiple buffer clobber events to be generated). Each event specifies
2235 one region of the GLX drawable that was affected by the X Server
2236 operation. The BUFFER_MASK field indicates which color buffers and
2237 ancillary buffers were affected. All the buffer clobber events generated
2238 by a single X server action are guaranteed to be contiguous in the event
2239 queue. The conditions under which this event is generated and the
2240 EVENT_TYPE varies, depending on the type of the GLX drawable.
2242 When the `GLX_AUX_BUFFERS_BIT' is set in BUFFER_MASK, then AUX_BUFFER is
2243 set to indicate which buffer was affected. If more than one aux buffer
2244 was affected, then additional events are generated as part of the same
2245 contiguous event group. Each additional event will have only the
2246 `GLX_AUX_BUFFERS_BIT' set in BUFFER_MASK, and the AUX_BUFFER field will
2247 be set appropriately. For nonstereo drawables,
2248 `GLX_FRONT_LEFT_BUFFER_BIT' and `GLX_BACK_LEFT_BUFFER_BIT' are used to
2249 specify the front and back color buffers.
2251 For preserved GLX pixel buffers, a buffer clobber event with type
2252 `GLX_SAVED' is generated whenever the contents of the GLX pixel buffer
2253 is moved out of offscreen memory. The event(s) describes which portions
2254 of the GLX pixel buffer were affected. Clients who receive many buffer
2255 clobber events, referring to different save actions, should consider
2256 freeing the GLX pixel buffer resource in order to prevent the system
2257 from thrashing due to insufficient resources.
2259 For an unpreserved GLXPbuffer, a buffer clobber event, with type
2260 `GLX_DAMAGED', is generated whenever a portion of the GLX pixel buffer
2261 becomes invalid. The client may wish to regenerate the invalid portions
2262 of the GLX pixel buffer.
2264 For Windows, buffer clobber events, with type `GLX_SAVED', occur
2265 whenever an ancillary buffer, associated with the window, gets clobbered
2266 or moved out of off-screen memory. The event contains information
2267 indicating which color buffers and ancillary buffers\\(emand which
2268 portions of those buffers\\(emwere affected.
2270 `GLXBadDrawable' is generated if DRAW is not a valid window or a valid
2273 (define-glx-procedures
2276 (drawable GLXDrawable)
2279 "Exchange front and back buffers.
2282 Specifies the connection to the X server.
2285 Specifies the drawable whose buffers are to be swapped.
2287 `glXSwapBuffers' promotes the contents of the back buffer of DRAWABLE to
2288 become the contents of the front buffer of DRAWABLE. The contents of the
2289 back buffer then become undefined. The update typically takes place
2290 during the vertical retrace of the monitor, rather than immediately
2291 after `glXSwapBuffers' is called.
2293 `glXSwapBuffers' performs an implicit `glFlush' before it returns.
2294 Subsequent OpenGL commands may be issued immediately after calling
2295 `glXSwapBuffers', but are not executed until the buffer exchange is
2298 If DRAWABLE was not created with respect to a double-buffered visual,
2299 `glXSwapBuffers' has no effect, and no error is generated.
2301 `GLXBadDrawable' is generated if DRAWABLE is not a valid GLX drawable.
2303 `GLXBadCurrentWindow' is generated if DPY and DRAWABLE are respectively
2304 the display and drawable associated with the current context of the
2305 calling thread, and DRAWABLE identifies a window that is no longer
2308 (define-glx-procedures
2316 "Create bitmap display lists from an X font.
2319 Specifies the font from which character glyphs are to be taken.
2322 Specifies the index of the first glyph to be taken.
2325 Specifies the number of glyphs to be taken.
2328 Specifies the index of the first display list to be generated.
2330 `glXUseXFont' generates COUNT display lists, named LISTBASE through
2331 LISTBASE+COUNT-1 , each containing a single `glBitmap' command. The
2332 parameters of the `glBitmap' command of display list LISTBASE+I are
2333 derived from glyph FIRST+I . Bitmap parameters XORIG , YORIG , WIDTH ,
2334 and HEIGHT are computed from font metrics as DESCENT-1 , -LBEARING ,
2335 RBEARING-LBEARING , and ASCENT+DESCENT , respectively. XMOVE is taken
2336 from the glyph's WIDTH metric, and YMOVE is set to zero. Finally, the
2337 glyph's image is converted to the appropriate format for `glBitmap'.
2339 Using `glXUseXFont' may be more efficient than accessing the X font and
2340 generating the display lists explicitly, both because the display lists
2341 are created on the server without requiring a round trip of the glyph
2342 data, and because the server may choose to delay the creation of each
2343 bitmap until it is accessed.
2345 Empty display lists are created for all glyphs that are requested and
2346 are not defined in FONT. `glXUseXFont' is ignored if there is no current
2349 `BadFont' is generated if FONT is not a valid font.
2351 `GLXBadContextState' is generated if the current GLX context is in
2352 display-list construction mode.
2354 `GLXBadCurrentWindow' is generated if the drawable associated with the
2355 current context of the calling thread is a window, and that window is no
2358 (define-glx-procedures
2359 ((glXWaitGL -> void))
2360 "Complete GL execution prior to subsequent X calls.
2362 GL rendering calls made prior to `glXWaitGL' are guaranteed to be
2363 executed before X rendering calls made after `glXWaitGL'. Although this
2364 same result can be achieved using `glFinish', `glXWaitGL' does not
2365 require a round trip to the server, and it is therefore more efficient
2366 in cases where client and server are on separate machines.
2368 `glXWaitGL' is ignored if there is no current GLX context.
2370 `GLXBadCurrentWindow' is generated if the drawable associated with the
2371 current context of the calling thread is a window, and that window is no
2374 (define-glx-procedures
2375 ((glXWaitX -> void))
2376 "Complete X execution prior to subsequent GL calls.
2378 X rendering calls made prior to `glXWaitX' are guaranteed to be executed
2379 before GL rendering calls made after `glXWaitX'. Although the same
2380 result can be achieved using `XSync', `glXWaitX' does not require a
2381 round trip to the server, and it is therefore more efficient in cases
2382 where client and server are on separate machines.
2384 `glXWaitX' is ignored if there is no current GLX context.
2386 `GLXBadCurrentWindow' is generated if the drawable associated with the
2387 current context of the calling thread is a window, and that window is no