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