5211970293f8db8c3afec346e518cfa3f7617a2b
[clinton/guile-figl.git] / figl / gl / low-level.scm
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 ;;;
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 ;;; Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be
25 ;;; distributed subject to the terms and conditions set forth in the Open
26 ;;; Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
27 ;;; (http://opencontent.org/openpub/).
28 ;;;
29 ;;; Copyright (C) 2005 Addison-Wesley. This material may be distributed
30 ;;; subject to the terms and conditions set forth in the Open Publication
31 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
32 ;;; (http://opencontent.org/openpub/).
33 ;;;
34 ;;; Copyright (C) 2006 Khronos Group. This material may be distributed
35 ;;; subject to the terms and conditions set forth in the Open Publication
36 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
37 ;;; (http://opencontent.org/openpub/).
38 ;;;
39 ;;; Automatically generated; you probably don't want to edit this. To
40 ;;; update, run "make update" in the top-level build tree.
41 ;;;
42
43 (define-module
44 (figl gl low-level)
45 #:use-module
46 (figl gl runtime)
47 #:use-module
48 (figl gl types)
49 #:export
50 (glAccum
51 glActiveTexture
52 glAlphaFunc
53 glAreTexturesResident
54 glArrayElement
55 glAttachShader
56 glBeginQuery
57 glEndQuery
58 glBegin
59 glEnd
60 glBindAttribLocation
61 glBindBuffer
62 glBindTexture
63 glBitmap
64 glBlendColor
65 glBlendEquationSeparate
66 glBlendEquation
67 glBlendFuncSeparate
68 glBlendFunc
69 glBufferData
70 glBufferSubData
71 glCallLists
72 glCallList
73 glClearAccum
74 glClearColor
75 glClearDepth
76 glClearIndex
77 glClearStencil
78 glClear
79 glClientActiveTexture
80 glClipPlane
81 glColorMask
82 glColorMaterial
83 glColorPointer
84 glColorSubTable
85 glColorTable
86 glColor3i
87 glColor3f
88 glColor3ui
89 glColor4i
90 glColor4f
91 glColor4ui
92 glCompileShader
93 glCompressedTexImage1D
94 glCompressedTexImage2D
95 glCompressedTexImage3D
96 glCompressedTexSubImage1D
97 glCompressedTexSubImage2D
98 glCompressedTexSubImage3D
99 glConvolutionFilter1D
100 glConvolutionFilter2D
101 glConvolutionParameterf
102 glConvolutionParameteri
103 glCopyColorSubTable
104 glCopyColorTable
105 glCopyConvolutionFilter1D
106 glCopyConvolutionFilter2D
107 glCopyPixels
108 glCopyTexImage1D
109 glCopyTexImage2D
110 glCopyTexSubImage1D
111 glCopyTexSubImage2D
112 glCopyTexSubImage3D
113 glCreateProgram
114 glCreateShader
115 glCullFace
116 glDeleteBuffers
117 glDeleteLists
118 glDeleteProgram
119 glDeleteQueries
120 glDeleteShader
121 glDeleteTextures
122 glDepthFunc
123 glDepthMask
124 glDepthRange
125 glDetachShader
126 glDrawArrays
127 glDrawBuffers
128 glDrawBuffer
129 glDrawElements
130 glDrawPixels
131 glDrawRangeElements
132 glEdgeFlagPointer
133 glEdgeFlag
134 glEnableClientState
135 glDisableClientState
136 glEnableVertexAttribArray
137 glDisableVertexAttribArray
138 glEnable
139 glDisable
140 glEvalCoord1f
141 glEvalCoord2f
142 glEvalMesh1
143 glEvalMesh2
144 glEvalPoint1
145 glEvalPoint2
146 glFeedbackBuffer
147 glFinish
148 glFlush
149 glFogCoordPointer
150 glFogCoordf
151 glFogf
152 glFogi
153 glFrontFace
154 glFrustum
155 glGenBuffers
156 glGenLists
157 glGenQueries
158 glGenTextures
159 glGetActiveAttrib
160 glGetActiveUniform
161 glGetAttachedShaders
162 glGetAttribLocation
163 glGetBufferSubData
164 glGetClipPlane
165 glGetColorTable
166 glGetCompressedTexImage
167 glGetConvolutionFilter
168 glGetError
169 glGetHistogram
170 glGetMinmax
171 glGetPolygonStipple
172 glGetProgramInfoLog
173 glGetSeparableFilter
174 glGetShaderInfoLog
175 glGetShaderSource
176 glGetString
177 glGetTexImage
178 glGetUniformLocation
179 glHint
180 glHistogram
181 glIndexMask
182 glIndexPointer
183 glIndexi
184 glIndexf
185 glIndexub
186 glInitNames
187 glInterleavedArrays
188 glIsBuffer
189 glIsEnabled
190 glIsList
191 glIsProgram
192 glIsQuery
193 glIsShader
194 glIsTexture
195 glLightModelf
196 glLightModeli
197 glLightf
198 glLighti
199 glLineStipple
200 glLineWidth
201 glLinkProgram
202 glListBase
203 glLoadIdentity
204 glLoadMatrixf
205 glLoadName
206 glLoadTransposeMatrixf
207 glLogicOp
208 glMap1f
209 glMap2f
210 glMapBuffer
211 glUnmapBuffer
212 glMapGrid1f
213 glMapGrid2f
214 glMaterialf
215 glMateriali
216 glMatrixMode
217 glMinmax
218 glMultiDrawArrays
219 glMultiDrawElements
220 glMultiTexCoord1i
221 glMultiTexCoord1f
222 glMultiTexCoord2i
223 glMultiTexCoord2f
224 glMultiTexCoord3i
225 glMultiTexCoord3f
226 glMultiTexCoord4i
227 glMultiTexCoord4f
228 glMultMatrixf
229 glMultTransposeMatrixf
230 glNewList
231 glEndList
232 glNormalPointer
233 glNormal3f
234 glNormal3i
235 glOrtho
236 glPassThrough
237 glPixelStoref
238 glPixelStorei
239 glPixelTransferf
240 glPixelTransferi
241 glPixelZoom
242 glPointParameterf
243 glPointParameteri
244 glPointSize
245 glPolygonMode
246 glPolygonOffset
247 glPolygonStipple
248 glPrioritizeTextures
249 glPushAttrib
250 glPopAttrib
251 glPushClientAttrib
252 glPopClientAttrib
253 glPushMatrix
254 glPopMatrix
255 glPushName
256 glPopName
257 glRasterPos2i
258 glRasterPos2f
259 glRasterPos3i
260 glRasterPos3f
261 glRasterPos4i
262 glRasterPos4f
263 glReadBuffer
264 glReadPixels
265 glRectf
266 glRecti
267 glRenderMode
268 glResetHistogram
269 glResetMinmax
270 glRotatef
271 glSampleCoverage
272 glScalef
273 glScissor
274 glSecondaryColorPointer
275 glSecondaryColor3i
276 glSecondaryColor3f
277 glSecondaryColor3ui
278 glSelectBuffer
279 glSeparableFilter2D
280 glShadeModel
281 glShaderSource
282 glStencilFuncSeparate
283 glStencilFunc
284 glStencilMaskSeparate
285 glStencilMask
286 glStencilOpSeparate
287 glStencilOp
288 glTexCoordPointer
289 glTexCoord1i
290 glTexCoord1f
291 glTexCoord2i
292 glTexCoord2f
293 glTexCoord3i
294 glTexCoord3f
295 glTexCoord4i
296 glTexCoord4f
297 glTexEnvf
298 glTexEnvi
299 glTexGeni
300 glTexGenf
301 glTexImage1D
302 glTexImage2D
303 glTexImage3D
304 glTexParameterf
305 glTexParameteri
306 glTexSubImage1D
307 glTexSubImage2D
308 glTexSubImage3D
309 glTranslatef
310 glUniform1f
311 glUniform2f
312 glUniform3f
313 glUniform4f
314 glUniform1i
315 glUniform2i
316 glUniform3i
317 glUniform4i
318 glUseProgram
319 glValidateProgram
320 glVertexAttribPointer
321 glVertexAttrib1f
322 glVertexAttrib1s
323 glVertexAttrib2f
324 glVertexAttrib2s
325 glVertexAttrib3f
326 glVertexAttrib3s
327 glVertexAttrib4f
328 glVertexAttrib4s
329 glVertexAttrib4Nub
330 glVertexPointer
331 glVertex2i
332 glVertex2f
333 glVertex3i
334 glVertex3f
335 glVertex4i
336 glVertex4f
337 glViewport
338 glWindowPos2i
339 glWindowPos2f
340 glWindowPos3i
341 glWindowPos3f))
342
343 (define-gl-procedures
344 ((glAccum (op GLenum) (value GLfloat) -> void))
345 "Operate on the accumulation buffer.
346
347 OP
348 Specifies the accumulation buffer operation. Symbolic constants
349 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
350 accepted.
351
352 VALUE
353 Specifies a floating-point value used in the accumulation buffer
354 operation. OP determines how VALUE is used.
355
356 The accumulation buffer is an extended-range color buffer. Images are
357 not rendered into it. Rather, images rendered into one of the color
358 buffers are added to the contents of the accumulation buffer after
359 rendering. Effects such as antialiasing (of points, lines, and
360 polygons), motion blur, and depth of field can be created by
361 accumulating images generated with different transformation matrices.
362
363 Each pixel in the accumulation buffer consists of red, green, blue, and
364 alpha values. The number of bits per component in the accumulation
365 buffer depends on the implementation. You can examine this number by
366 calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
367 `GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
368 Regardless of the number of bits per component, the range of values
369 stored by each component is [-1,1] . The accumulation buffer pixels are
370 mapped one-to-one with frame buffer pixels.
371
372 `glAccum' operates on the accumulation buffer. The first argument, OP,
373 is a symbolic constant that selects an accumulation buffer operation.
374 The second argument, VALUE, is a floating-point value to be used in that
375 operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
376 `GL_ADD', `GL_MULT', and `GL_RETURN'.
377
378 All accumulation buffer operations are limited to the area of the
379 current scissor box and applied identically to the red, green, blue, and
380 alpha components of each pixel. If a `glAccum' operation results in a
381 value outside the range [-1,1] , the contents of an accumulation buffer
382 pixel component are undefined.
383
384 The operations are as follows:
385
386 `GL_ACCUM'
387 Obtains R, G, B, and A values from the buffer currently selected
388 for reading (see `glReadBuffer'). Each component value is divided
389 by 2^N-1 , where N is the number of bits allocated to each color
390 component in the currently selected buffer. The result is a
391 floating-point value in the range [0,1] , which is multiplied by
392 VALUE and added to the corresponding pixel component in the
393 accumulation buffer, thereby updating the accumulation buffer.
394
395 `GL_LOAD'
396 Similar to `GL_ACCUM', except that the current value in the
397 accumulation buffer is not used in the calculation of the new
398 value. That is, the R, G, B, and A values from the currently
399 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
400 then stored in the corresponding accumulation buffer cell,
401 overwriting the current value.
402
403 `GL_ADD'
404 Adds VALUE to each R, G, B, and A in the accumulation buffer.
405
406 `GL_MULT'
407 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
408 and returns the scaled component to its corresponding accumulation
409 buffer location.
410
411 `GL_RETURN'
412 Transfers accumulation buffer values to the color buffer or buffers
413 currently selected for writing. Each R, G, B, and A component is
414 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
415 range [0,2^N-1] , and stored in the corresponding display buffer
416 cell. The only fragment operations that are applied to this
417 transfer are pixel ownership, scissor, dithering, and color
418 writemasks.
419
420 To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
421 A values to set it to, then call `glClear' with the accumulation buffer
422 enabled.
423
424 `GL_INVALID_ENUM' is generated if OP is not an accepted value.
425
426 `GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
427
428 `GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
429 execution of `glBegin' and the corresponding execution of `glEnd'.")
430
431 (define-gl-procedures
432 ((glActiveTexture (texture GLenum) -> void))
433 "Select active texture unit.
434
435 TEXTURE
436 Specifies which texture unit to make active. The number of texture
437 units is implementation dependent, but must be at least two.
438 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
439 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
440 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
441 `GL_TEXTURE0'.
442
443 `glActiveTexture' selects which texture unit subsequent texture state
444 calls will affect. The number of texture units an implementation
445 supports is implementation dependent, but must be at least 2.
446
447 Vertex arrays are client-side GL resources, which are selected by the
448 `glClientActiveTexture' routine.
449
450 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
451 where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
452 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
453
454 (define-gl-procedures
455 ((glAlphaFunc
456 (func GLenum)
457 (ref GLclampf)
458 ->
459 void))
460 "Specify the alpha test function.
461
462 FUNC
463 Specifies the alpha comparison function. Symbolic constants
464 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
465 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
466 initial value is `GL_ALWAYS'.
467
468 REF
469 Specifies the reference value that incoming alpha values are
470 compared to. This value is clamped to the range [0,1] , where 0
471 represents the lowest possible alpha value and 1 the highest
472 possible value. The initial reference value is 0.
473
474 The alpha test discards fragments depending on the outcome of a
475 comparison between an incoming fragment's alpha value and a constant
476 reference value. `glAlphaFunc' specifies the reference value and the
477 comparison function. The comparison is performed only if alpha testing
478 is enabled. By default, it is not enabled. (See `glEnable' and
479 `glDisable' of `GL_ALPHA_TEST'.)
480
481 FUNC and REF specify the conditions under which the pixel is drawn. The
482 incoming alpha value is compared to REF using the function specified by
483 FUNC. If the value passes the comparison, the incoming fragment is drawn
484 if it also passes subsequent stencil and depth buffer tests. If the
485 value fails the comparison, no change is made to the frame buffer at
486 that pixel location. The comparison functions are as follows:
487
488 `GL_NEVER'
489 Never passes.
490
491 `GL_LESS'
492 Passes if the incoming alpha value is less than the reference
493 value.
494
495 `GL_EQUAL'
496 Passes if the incoming alpha value is equal to the reference value.
497
498 `GL_LEQUAL'
499 Passes if the incoming alpha value is less than or equal to the
500 reference value.
501
502 `GL_GREATER'
503 Passes if the incoming alpha value is greater than the reference
504 value.
505
506 `GL_NOTEQUAL'
507 Passes if the incoming alpha value is not equal to the reference
508 value.
509
510 `GL_GEQUAL'
511 Passes if the incoming alpha value is greater than or equal to the
512 reference value.
513
514 `GL_ALWAYS'
515 Always passes (initial value).
516
517 `glAlphaFunc' operates on all pixel write operations, including those
518 resulting from the scan conversion of points, lines, polygons, and
519 bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
520 affect screen clear operations.
521
522 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
523
524 `GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
525 the execution of `glBegin' and the corresponding execution of `glEnd'.")
526
527 (define-gl-procedures
528 ((glAreTexturesResident
529 (n GLsizei)
530 (textures const-GLuint-*)
531 (residences GLboolean-*)
532 ->
533 GLboolean))
534 "Determine if textures are loaded in texture memory.
535
536 N
537 Specifies the number of textures to be queried.
538
539 TEXTURES
540 Specifies an array containing the names of the textures to be
541 queried.
542
543 RESIDENCES
544 Specifies an array in which the texture residence status is
545 returned. The residence status of a texture named by an element of
546 TEXTURES is returned in the corresponding element of RESIDENCES.
547
548 GL establishes a ``working set'' of textures that are resident in
549 texture memory. These textures can be bound to a texture target much
550 more efficiently than textures that are not resident.
551
552 `glAreTexturesResident' queries the texture residence status of the N
553 textures named by the elements of TEXTURES. If all the named textures
554 are resident, `glAreTexturesResident' returns `GL_TRUE', and the
555 contents of RESIDENCES are undisturbed. If not all the named textures
556 are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
557 status is returned in the N elements of RESIDENCES. If an element of
558 RESIDENCES is `GL_TRUE', then the texture named by the corresponding
559 element of TEXTURES is resident.
560
561 The residence status of a single bound texture may also be queried by
562 calling `glGetTexParameter' with the TARGET argument set to the target
563 to which the texture is bound, and the PNAME argument set to
564 `GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
565 a default texture can be queried.
566
567 `GL_INVALID_VALUE' is generated if N is negative.
568
569 `GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
570 not name a texture. In that case, the function returns `GL_FALSE' and
571 the contents of RESIDENCES is indeterminate.
572
573 `GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
574 executed between the execution of `glBegin' and the corresponding
575 execution of `glEnd'.")
576
577 (define-gl-procedures
578 ((glArrayElement (i GLint) -> void))
579 "Render a vertex using the specified vertex array element.
580
581 I
582 Specifies an index into the enabled vertex data arrays.
583
584 `glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
585 specify vertex and attribute data for point, line, and polygon
586 primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
587 called, a single vertex is drawn, using vertex and attribute data taken
588 from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
589 enabled, no drawing occurs but the attributes corresponding to the
590 enabled arrays are modified.
591
592 Use `glArrayElement' to construct primitives by indexing vertex data,
593 rather than by streaming through arrays of data in first-to-last order.
594 Because each call specifies only a single vertex, it is possible to
595 explicitly specify per-primitive attributes such as a single normal for
596 each triangle.
597
598 Changes made to array data between the execution of `glBegin' and the
599 corresponding execution of `glEnd' may affect calls to `glArrayElement'
600 that are made within the same `glBegin'/`glEnd' period in nonsequential
601 ways. That is, a call to `glArrayElement' that precedes a change to
602 array data may access the changed data, and a call that follows a change
603 to array data may access original data.
604
605 `GL_INVALID_VALUE' may be generated if I is negative.
606
607 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
608 bound to an enabled array and the buffer object's data store is
609 currently mapped.")
610
611 (define-gl-procedures
612 ((glAttachShader
613 (program GLuint)
614 (shader GLuint)
615 ->
616 void))
617 "Attaches a shader object to a program object.
618
619 PROGRAM
620 Specifies the program object to which a shader object will be
621 attached.
622
623 SHADER
624 Specifies the shader object that is to be attached.
625
626 In order to create an executable, there must be a way to specify the
627 list of things that will be linked together. Program objects provide
628 this mechanism. Shaders that are to be linked together in a program
629 object must first be attached to that program object. `glAttachShader'
630 attaches the shader object specified by SHADER to the program object
631 specified by PROGRAM. This indicates that SHADER will be included in
632 link operations that will be performed on PROGRAM.
633
634 All operations that can be performed on a shader object are valid
635 whether or not the shader object is attached to a program object. It is
636 permissible to attach a shader object to a program object before source
637 code has been loaded into the shader object or before the shader object
638 has been compiled. It is permissible to attach multiple shader objects
639 of the same type because each may contain a portion of the complete
640 shader. It is also permissible to attach a shader object to more than
641 one program object. If a shader object is deleted while it is attached
642 to a program object, it will be flagged for deletion, and deletion will
643 not occur until `glDetachShader' is called to detach it from all program
644 objects to which it is attached.
645
646 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
647 value generated by OpenGL.
648
649 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
650
651 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
652
653 `GL_INVALID_OPERATION' is generated if SHADER is already attached to
654 PROGRAM.
655
656 `GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
657 between the execution of `glBegin' and the corresponding execution of
658 `glEnd'.")
659
660 (define-gl-procedures
661 ((glBeginQuery
662 (target GLenum)
663 (id GLuint)
664 ->
665 void)
666 (glEndQuery (target GLenum) -> void))
667 "Delimit the boundaries of a query object.
668
669 TARGET
670 Specifies the target type of query object established between
671 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
672 constant must be `GL_SAMPLES_PASSED'.
673
674 ID
675 Specifies the name of a query object.
676
677 `glBeginQuery' and `glEndQuery' delimit the boundaries of a query
678 object. If a query object with name ID does not yet exist it is created.
679
680 When `glBeginQuery' is executed, the query object's samples-passed
681 counter is reset to 0. Subsequent rendering will increment the counter
682 once for every sample that passes the depth test. When `glEndQuery' is
683 executed, the samples-passed counter is assigned to the query object's
684 result value. This value can be queried by calling `glGetQueryObject'
685 with PNAME`GL_QUERY_RESULT'.
686
687 Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
688 the rendering delimited by the query object has completed and the result
689 is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
690 the result is immediately available or if the rendering is not yet
691 complete.
692
693 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
694
695 `GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
696 a query object of the same TARGET is already active.
697
698 `GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
699 query object of the same TARGET is not active.
700
701 `GL_INVALID_OPERATION' is generated if ID is 0.
702
703 `GL_INVALID_OPERATION' is generated if ID is the name of an already
704 active query object.
705
706 `GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
707 executed between the execution of `glBegin' and the corresponding
708 execution of `glEnd'.")
709
710 (define-gl-procedures
711 ((glBegin (mode GLenum) -> void) (glEnd -> void))
712 "Delimit the vertices of a primitive or a group of like primitives.
713
714 MODE
715 Specifies the primitive or primitives that will be created from
716 vertices presented between `glBegin' and the subsequent `glEnd'.
717 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
718 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
719 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
720 `GL_QUAD_STRIP', and `GL_POLYGON'.
721
722 `glBegin' and `glEnd' delimit the vertices that define a primitive or a
723 group of like primitives. `glBegin' accepts a single argument that
724 specifies in which of ten ways the vertices are interpreted. Taking N as
725 an integer count starting at one, and N as the total number of vertices
726 specified, the interpretations are as follows:
727
728 `GL_POINTS'
729 Treats each vertex as a single point. Vertex N defines point N . N
730 points are drawn.
731
732 `GL_LINES'
733 Treats each pair of vertices as an independent line segment.
734 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
735
736 `GL_LINE_STRIP'
737 Draws a connected group of line segments from the first vertex to
738 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
739
740 `GL_LINE_LOOP'
741 Draws a connected group of line segments from the first vertex to
742 the last, then back to the first. Vertices N and N+1 define line N
743 . The last line, however, is defined by vertices N and 1 . N lines
744 are drawn.
745
746 `GL_TRIANGLES'
747 Treats each triplet of vertices as an independent triangle.
748 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
749 are drawn.
750
751 `GL_TRIANGLE_STRIP'
752 Draws a connected group of triangles. One triangle is defined for
753 each vertex presented after the first two vertices. For odd N ,
754 vertices N , N+1 , and N+2 define triangle N . For even N ,
755 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
756 drawn.
757
758 `GL_TRIANGLE_FAN'
759 Draws a connected group of triangles. One triangle is defined for
760 each vertex presented after the first two vertices. Vertices 1 ,
761 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
762
763 `GL_QUADS'
764 Treats each group of four vertices as an independent quadrilateral.
765 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
766 N/4 quadrilaterals are drawn.
767
768 `GL_QUAD_STRIP'
769 Draws a connected group of quadrilaterals. One quadrilateral is
770 defined for each pair of vertices presented after the first pair.
771 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
772 N/2-1 quadrilaterals are drawn. Note that the order in which
773 vertices are used to construct a quadrilateral from strip data is
774 different from that used with independent data.
775
776 `GL_POLYGON'
777 Draws a single, convex polygon. Vertices 1 through N define this
778 polygon.
779
780 Only a subset of GL commands can be used between `glBegin' and `glEnd'.
781 The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
782 `glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
783 `glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
784 `glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
785 `glCallList' or `glCallLists' to execute display lists that include only
786 the preceding commands. If any other GL command is executed between
787 `glBegin' and `glEnd', the error flag is set and the command is ignored.
788
789 Regardless of the value chosen for MODE, there is no limit to the number
790 of vertices that can be defined between `glBegin' and `glEnd'. Lines,
791 triangles, quadrilaterals, and polygons that are incompletely specified
792 are not drawn. Incomplete specification results when either too few
793 vertices are provided to specify even a single primitive or when an
794 incorrect multiple of vertices is specified. The incomplete primitive is
795 ignored; the rest are drawn.
796
797 The minimum specification of vertices for each primitive is as follows:
798 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
799 and 3 for a polygon. Modes that require a certain multiple of vertices
800 are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
801 `GL_QUAD_STRIP' (2).
802
803 `GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
804
805 `GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
806 `glBegin' and the corresponding execution of `glEnd'.
807
808 `GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
809 preceded by a `glBegin'.
810
811 `GL_INVALID_OPERATION' is generated if a command other than `glVertex',
812 `glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
813 `glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
814 `glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
815 `glCallList', or `glCallLists' is executed between the execution of
816 `glBegin' and the corresponding execution `glEnd'.
817
818 Execution of `glEnableClientState', `glDisableClientState',
819 `glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
820 `glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
821 `glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
822 `glInterleavedArrays', or `glPixelStore' is not allowed after a call to
823 `glBegin' and before the corresponding call to `glEnd', but an error may
824 or may not be generated.")
825
826 (define-gl-procedures
827 ((glBindAttribLocation
828 (program GLuint)
829 (index GLuint)
830 (name const-GLchar-*)
831 ->
832 void))
833 "Associates a generic vertex attribute index with a named attribute
834 variable.
835
836 PROGRAM
837 Specifies the handle of the program object in which the association
838 is to be made.
839
840 INDEX
841 Specifies the index of the generic vertex attribute to be bound.
842
843 NAME
844 Specifies a null terminated string containing the name of the
845 vertex shader attribute variable to which INDEX is to be bound.
846
847 `glBindAttribLocation' is used to associate a user-defined attribute
848 variable in the program object specified by PROGRAM with a generic
849 vertex attribute index. The name of the user-defined attribute variable
850 is passed as a null terminated string in NAME. The generic vertex
851 attribute index to be bound to this variable is specified by INDEX. When
852 PROGRAM is made part of current state, values provided via the generic
853 vertex attribute INDEX will modify the value of the user-defined
854 attribute variable specified by NAME.
855
856 If NAME refers to a matrix attribute variable, INDEX refers to the first
857 column of the matrix. Other matrix columns are then automatically bound
858 to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
859 a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
860 type mat4.
861
862 This command makes it possible for vertex shaders to use descriptive
863 names for attribute variables rather than generic variables that are
864 numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
865 generic attribute index are part of current state, just like standard
866 vertex attributes such as color, normal, and vertex position. If a
867 different program object is made current by calling `glUseProgram', the
868 generic vertex attributes are tracked in such a way that the same values
869 will be observed by attributes in the new program object that are also
870 bound to INDEX.
871
872 Attribute variable name-to-generic attribute index bindings for a
873 program object can be explicitly assigned at any time by calling
874 `glBindAttribLocation'. Attribute bindings do not go into effect until
875 `glLinkProgram' is called. After a program object has been linked
876 successfully, the index values for generic attributes remain fixed (and
877 their values can be queried) until the next link command occurs.
878
879 Applications are not allowed to bind any of the standard OpenGL vertex
880 attributes using this command, as they are bound automatically when
881 needed. Any attribute binding that occurs after the program object has
882 been linked will not take effect until the next time the program object
883 is linked.
884
885 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
886 `GL_MAX_VERTEX_ATTRIBS'.
887
888 `GL_INVALID_OPERATION' is generated if NAME starts with the reserved
889 prefix \"gl_\".
890
891 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
892 OpenGL.
893
894 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
895
896 `GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
897 executed between the execution of `glBegin' and the corresponding
898 execution of `glEnd'.")
899
900 (define-gl-procedures
901 ((glBindBuffer
902 (target GLenum)
903 (buffer GLuint)
904 ->
905 void))
906 "Bind a named buffer object.
907
908 TARGET
909 Specifies the target to which the buffer object is bound. The
910 symbolic constant must be `GL_ARRAY_BUFFER',
911 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
912 `GL_PIXEL_UNPACK_BUFFER'.
913
914 BUFFER
915 Specifies the name of a buffer object.
916
917 `glBindBuffer' lets you create or use a named buffer object. Calling
918 `glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
919 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
920 `GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
921 object binds the buffer object name to the target. When a buffer object
922 is bound to a target, the previous binding for that target is
923 automatically broken.
924
925 Buffer object names are unsigned integers. The value zero is reserved,
926 but there is no default buffer object for each buffer object target.
927 Instead, BUFFER set to zero effectively unbinds any buffer object
928 previously bound, and restores client memory usage for that buffer
929 object target. Buffer object names and the corresponding buffer object
930 contents are local to the shared display-list space (see
931 `glXCreateContext') of the current GL rendering context; two rendering
932 contexts share buffer object names only if they also share display
933 lists.
934
935 You may use `glGenBuffers' to generate a set of new buffer object names.
936
937 The state of a buffer object immediately after it is first bound is an
938 unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
939 `GL_STATIC_DRAW' usage.
940
941 While a non-zero buffer object name is bound, GL operations on the
942 target to which it is bound affect the bound buffer object, and queries
943 of the target to which it is bound return state from the bound buffer
944 object. While buffer object name zero is bound, as in the initial state,
945 attempts to modify or query state on the target to which it is bound
946 generates an `GL_INVALID_OPERATION' error.
947
948 When vertex array pointer state is changed, for example by a call to
949 `glNormalPointer', the current buffer object binding
950 (`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
951 state for the vertex array type being changed, for example
952 `GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
953 bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
954 parameter that is traditionally interpreted as a pointer to client-side
955 memory is instead interpreted as an offset within the buffer object
956 measured in basic machine units.
957
958 While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
959 target, the indices parameter of `glDrawElements',
960 `glDrawRangeElements', or `glMultiDrawElements' that is traditionally
961 interpreted as a pointer to client-side memory is instead interpreted as
962 an offset within the buffer object measured in basic machine units.
963
964 While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
965 target, the following commands are affected: `glGetCompressedTexImage',
966 `glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
967 `glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
968 `glGetTexImage', and `glReadPixels'. The pointer parameter that is
969 traditionally interpreted as a pointer to client-side memory where the
970 pixels are to be packed is instead interpreted as an offset within the
971 buffer object measured in basic machine units.
972
973 While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
974 target, the following commands are affected: `glBitmap',
975 `glColorSubTable', `glColorTable', `glCompressedTexImage1D',
976 `glCompressedTexImage2D', `glCompressedTexImage3D',
977 `glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
978 `glCompressedTexSubImage3D', `glConvolutionFilter1D',
979 `glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
980 `glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
981 `glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
982 and `glTexSubImage3D'. The pointer parameter that is traditionally
983 interpreted as a pointer to client-side memory from which the pixels are
984 to be unpacked is instead interpreted as an offset within the buffer
985 object measured in basic machine units.
986
987 A buffer object binding created with `glBindBuffer' remains active until
988 a different buffer object name is bound to the same target, or until the
989 bound buffer object is deleted with `glDeleteBuffers'.
990
991 Once created, a named buffer object may be re-bound to any target as
992 often as needed. However, the GL implementation may make choices about
993 how to optimize the storage of a buffer object based on its initial
994 binding target.
995
996 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
997 values.
998
999 `GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
1000 between the execution of `glBegin' and the corresponding execution of
1001 `glEnd'.")
1002
1003 (define-gl-procedures
1004 ((glBindTexture
1005 (target GLenum)
1006 (texture GLuint)
1007 ->
1008 void))
1009 "Bind a named texture to a texturing target.
1010
1011 TARGET
1012 Specifies the target to which the texture is bound. Must be either
1013 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1014 `GL_TEXTURE_CUBE_MAP'.
1015
1016 TEXTURE
1017 Specifies the name of a texture.
1018
1019 `glBindTexture' lets you create or use a named texture. Calling
1020 `glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1021 `GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1022 the new texture binds the texture name to the target. When a texture is
1023 bound to a target, the previous binding for that target is automatically
1024 broken.
1025
1026 Texture names are unsigned integers. The value zero is reserved to
1027 represent the default texture for each texture target. Texture names and
1028 the corresponding texture contents are local to the shared display-list
1029 space (see `glXCreateContext') of the current GL rendering context; two
1030 rendering contexts share texture names only if they also share display
1031 lists.
1032
1033 You may use `glGenTextures' to generate a set of new texture names.
1034
1035 When a texture is first bound, it assumes the specified target: A
1036 texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1037 a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1038 texture, a texture first bound to `GL_TEXTURE_3D' becomes
1039 three-dimensional texture, and a texture first bound to
1040 `GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1041 one-dimensional texture immediately after it is first bound is
1042 equivalent to the state of the default `GL_TEXTURE_1D' at GL
1043 initialization, and similarly for two- and three-dimensional textures
1044 and cube-mapped textures.
1045
1046 While a texture is bound, GL operations on the target to which it is
1047 bound affect the bound texture, and queries of the target to which it is
1048 bound return state from the bound texture. If texture mapping is active
1049 on the target to which a texture is bound, the bound texture is used. In
1050 effect, the texture targets become aliases for the textures currently
1051 bound to them, and the texture name zero refers to the default textures
1052 that were bound to them at initialization.
1053
1054 A texture binding created with `glBindTexture' remains active until a
1055 different texture is bound to the same target, or until the bound
1056 texture is deleted with `glDeleteTextures'.
1057
1058 Once created, a named texture may be re-bound to its same original
1059 target as often as needed. It is usually much faster to use
1060 `glBindTexture' to bind an existing named texture to one of the texture
1061 targets than it is to reload the texture image using `glTexImage1D',
1062 `glTexImage2D', or `glTexImage3D'. For additional control over
1063 performance, use `glPrioritizeTextures'.
1064
1065 `glBindTexture' is included in display lists.
1066
1067 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1068 values.
1069
1070 `GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1071 with a target that doesn't match that of TARGET.
1072
1073 `GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1074 between the execution of `glBegin' and the corresponding execution of
1075 `glEnd'.")
1076
1077 (define-gl-procedures
1078 ((glBitmap
1079 (width GLsizei)
1080 (height GLsizei)
1081 (xorig GLfloat)
1082 (yorig GLfloat)
1083 (xmove GLfloat)
1084 (ymove GLfloat)
1085 (bitmap const-GLubyte-*)
1086 ->
1087 void))
1088 "Draw a bitmap.
1089
1090 WIDTH
1091 HEIGHT
1092
1093 Specify the pixel width and height of the bitmap image.
1094
1095 XORIG
1096 YORIG
1097
1098 Specify the location of the origin in the bitmap image. The origin
1099 is measured from the lower left corner of the bitmap, with right
1100 and up being the positive axes.
1101
1102 XMOVE
1103 YMOVE
1104
1105 Specify the X and Y offsets to be added to the current raster
1106 position after the bitmap is drawn.
1107
1108 BITMAP
1109 Specifies the address of the bitmap image.
1110
1111 A bitmap is a binary image. When drawn, the bitmap is positioned
1112 relative to the current raster position, and frame buffer pixels
1113 corresponding to 1's in the bitmap are written using the current raster
1114 color or index. Frame buffer pixels corresponding to 0's in the bitmap
1115 are not modified.
1116
1117 `glBitmap' takes seven arguments. The first pair specifies the width and
1118 height of the bitmap image. The second pair specifies the location of
1119 the bitmap origin relative to the lower left corner of the bitmap image.
1120 The third pair of arguments specifies X and Y offsets to be added to the
1121 current raster position after the bitmap has been drawn. The final
1122 argument is a pointer to the bitmap image itself.
1123
1124 If a non-zero named buffer object is bound to the
1125 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1126 image is specified, BITMAP is treated as a byte offset into the buffer
1127 object's data store.
1128
1129 The bitmap image is interpreted like image data for the `glDrawPixels'
1130 command, with WIDTH and HEIGHT corresponding to the width and height
1131 arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1132 set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1133 interpretation of bitmap image data; modes specified using
1134 `glPixelTransfer' do not.
1135
1136 If the current raster position is invalid, `glBitmap' is ignored.
1137 Otherwise, the lower left corner of the bitmap image is positioned at
1138 the window coordinates
1139
1140 X_W=⌊X_R-X_O,⌋
1141
1142 Y_W=⌊Y_R-Y_O,⌋
1143
1144 where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1145 origin. Fragments are then generated for each pixel corresponding to a 1
1146 (one) in the bitmap image. These fragments are generated using the
1147 current raster Z coordinate, color or color index, and current raster
1148 texture coordinates. They are then treated just as if they had been
1149 generated by a point, line, or polygon, including texture mapping,
1150 fogging, and all per-fragment operations such as alpha and depth
1151 testing.
1152
1153 After the bitmap has been drawn, the X and Y coordinates of the current
1154 raster position are offset by XMOVE and YMOVE. No change is made to the
1155 Z coordinate of the current raster position, or to the current raster
1156 color, texture coordinates, or index.
1157
1158 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1159
1160 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1161 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1162 data store is currently mapped.
1163
1164 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1165 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1166 unpacked from the buffer object such that the memory reads required
1167 would exceed the data store size.
1168
1169 `GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1170 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1171
1172 (define-gl-procedures
1173 ((glBlendColor
1174 (red GLclampf)
1175 (green GLclampf)
1176 (blue GLclampf)
1177 (alpha GLclampf)
1178 ->
1179 void))
1180 "Set the blend color.
1181
1182 RED
1183 GREEN
1184
1185 BLUE
1186
1187 ALPHA
1188
1189 specify the components of `GL_BLEND_COLOR'
1190
1191 The `GL_BLEND_COLOR' may be used to calculate the source and destination
1192 blending factors. The color components are clamped to the range [0,1]
1193 before being stored. See `glBlendFunc' for a complete description of the
1194 blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
1195 0).
1196
1197 `GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1198 between the execution of `glBegin' and the corresponding execution of
1199 `glEnd'.")
1200
1201 (define-gl-procedures
1202 ((glBlendEquationSeparate
1203 (modeRGB GLenum)
1204 (modeAlpha GLenum)
1205 ->
1206 void))
1207 "Set the RGB blend equation and the alpha blend equation separately.
1208
1209 MODERGB
1210 specifies the RGB blend equation, how the red, green, and blue
1211 components of the source and destination colors are combined. It
1212 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1213 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1214
1215 MODEALPHA
1216 specifies the alpha blend equation, how the alpha component of the
1217 source and destination colors are combined. It must be
1218 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1219 `GL_MIN', `GL_MAX'.
1220
1221 The blend equations determines how a new pixel (the ''source'' color) is
1222 combined with a pixel already in the framebuffer (the ''destination''
1223 color). This function specifies one blend equation for the RGB-color
1224 components and one blend equation for the alpha component.
1225
1226 The blend equations use the source and destination blend factors
1227 specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1228 `glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1229 blend factors.
1230
1231 In the equations that follow, source and destination color components
1232 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1233 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1234 destination blend factors are denoted (S_R,S_GS_BS_A) and
1235 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1236 are understood to have values in the range [0,1] .
1237
1238 *Mode*
1239 *RGB Components*, *Alpha Component*
1240
1241 `GL_FUNC_ADD'
1242 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1243 AR=A_S\u2062S_A+A_D\u2062D_A
1244
1245 `GL_FUNC_SUBTRACT'
1246 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1247 AR=A_S\u2062S_A-A_D\u2062D_A
1248
1249 `GL_FUNC_REVERSE_SUBTRACT'
1250 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1251 AR=A_D\u2062D_A-A_S\u2062S_A
1252
1253 `GL_MIN'
1254 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1255 AR=MIN\u2061(A_S,A_D)
1256
1257 `GL_MAX'
1258 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1259 AR=MAX\u2061(A_S,A_D)
1260
1261 The results of these equations are clamped to the range [0,1] .
1262
1263 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1264 analyze image data (image thresholding against a constant color, for
1265 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1266 transparency, among other things.
1267
1268 Initially, both the RGB blend equation and the alpha blend equation are
1269 set to `GL_FUNC_ADD'.
1270
1271
1272
1273 `GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1274 of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1275 `GL_MAX', or `GL_MIN'.
1276
1277 `GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1278 executed between the execution of `glBegin' and the corresponding
1279 execution of `glEnd'.")
1280
1281 (define-gl-procedures
1282 ((glBlendEquation (mode GLenum) -> void))
1283 "Specify the equation used for both the RGB blend equation and the Alpha
1284 blend equation.
1285
1286 MODE
1287 specifies how source and destination colors are combined. It must
1288 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1289 `GL_MIN', `GL_MAX'.
1290
1291 The blend equations determine how a new pixel (the ''source'' color) is
1292 combined with a pixel already in the framebuffer (the ''destination''
1293 color). This function sets both the RGB blend equation and the alpha
1294 blend equation to a single equation.
1295
1296 These equations use the source and destination blend factors specified
1297 by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1298 `glBlendFuncSeparate' for a description of the various blend factors.
1299
1300 In the equations that follow, source and destination color components
1301 are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1302 The result color is referred to as (R_R,G_RB_RA_R) . The source and
1303 destination blend factors are denoted (S_R,S_GS_BS_A) and
1304 (D_R,D_GD_BD_A) , respectively. For these equations all color components
1305 are understood to have values in the range [0,1] .
1306
1307 *Mode*
1308 *RGB Components*, *Alpha Component*
1309
1310 `GL_FUNC_ADD'
1311 RR=R_S\u2062S_R+R_D\u2062D_R GR=G_S\u2062S_G+G_D\u2062D_G BR=B_S\u2062S_B+B_D\u2062D_B ,
1312 AR=A_S\u2062S_A+A_D\u2062D_A
1313
1314 `GL_FUNC_SUBTRACT'
1315 RR=R_S\u2062S_R-R_D\u2062D_R GR=G_S\u2062S_G-G_D\u2062D_G BR=B_S\u2062S_B-B_D\u2062D_B ,
1316 AR=A_S\u2062S_A-A_D\u2062D_A
1317
1318 `GL_FUNC_REVERSE_SUBTRACT'
1319 RR=R_D\u2062D_R-R_S\u2062S_R GR=G_D\u2062D_G-G_S\u2062S_G BR=B_D\u2062D_B-B_S\u2062S_B ,
1320 AR=A_D\u2062D_A-A_S\u2062S_A
1321
1322 `GL_MIN'
1323 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1324 AR=MIN\u2061(A_S,A_D)
1325
1326 `GL_MAX'
1327 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1328 AR=MAX\u2061(A_S,A_D)
1329
1330 The results of these equations are clamped to the range [0,1] .
1331
1332 The `GL_MIN' and `GL_MAX' equations are useful for applications that
1333 analyze image data (image thresholding against a constant color, for
1334 example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1335 transparency, among other things.
1336
1337 Initially, both the RGB blend equation and the alpha blend equation are
1338 set to `GL_FUNC_ADD'.
1339
1340
1341
1342 `GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1343 `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1344
1345 `GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1346 between the execution of `glBegin' and the corresponding execution of
1347 `glEnd'.")
1348
1349 (define-gl-procedures
1350 ((glBlendFuncSeparate
1351 (srcRGB GLenum)
1352 (dstRGB GLenum)
1353 (srcAlpha GLenum)
1354 (dstAlpha GLenum)
1355 ->
1356 void))
1357 "Specify pixel arithmetic for RGB and alpha components separately.
1358
1359 SRCRGB
1360 Specifies how the red, green, and blue blending factors are
1361 computed. The following symbolic constants are accepted: `GL_ZERO',
1362 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1363 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1364 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1365 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1366 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1367 initial value is `GL_ONE'.
1368
1369 DSTRGB
1370 Specifies how the red, green, and blue destination blending factors
1371 are computed. The following symbolic constants are accepted:
1372 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1373 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1374 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1375 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1376 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1377 value is `GL_ZERO'.
1378
1379 SRCALPHA
1380 Specified how the alpha source blending factor is computed. The
1381 same symbolic constants are accepted as for SRCRGB. The initial
1382 value is `GL_ONE'.
1383
1384 DSTALPHA
1385 Specified how the alpha destination blending factor is computed.
1386 The same symbolic constants are accepted as for DSTRGB. The initial
1387 value is `GL_ZERO'.
1388
1389 In RGBA mode, pixels can be drawn using a function that blends the
1390 incoming (source) RGBA values with the RGBA values that are already in
1391 the frame buffer (the destination values). Blending is initially
1392 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1393 enable and disable blending.
1394
1395 `glBlendFuncSeparate' defines the operation of blending when it is
1396 enabled. SRCRGB specifies which method is used to scale the source
1397 RGB-color components. DSTRGB specifies which method is used to scale the
1398 destination RGB-color components. Likewise, SRCALPHA specifies which
1399 method is used to scale the source alpha color component, and DSTALPHA
1400 specifies which method is used to scale the destination alpha component.
1401 The possible methods are described in the following table. Each method
1402 defines four scale factors, one each for red, green, blue, and alpha.
1403
1404 In the table and in subsequent equations, source and destination color
1405 components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1406 color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1407 They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1408 , where
1409
1410 K_C=2^M_C,-1
1411
1412 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1413 bitplanes.
1414
1415 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1416 and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1417
1418
1419
1420 *Parameter*
1421 *RGB Factor*, *Alpha Factor*
1422
1423 `GL_ZERO'
1424 (0,00) , 0
1425
1426 `GL_ONE'
1427 (1,11) , 1
1428
1429 `GL_SRC_COLOR'
1430 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1431
1432 `GL_ONE_MINUS_SRC_COLOR'
1433 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1434
1435 `GL_DST_COLOR'
1436 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1437
1438 `GL_ONE_MINUS_DST_COLOR'
1439 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1440
1441 `GL_SRC_ALPHA'
1442 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1443
1444 `GL_ONE_MINUS_SRC_ALPHA'
1445 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1446
1447 `GL_DST_ALPHA'
1448 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1449
1450 `GL_ONE_MINUS_DST_ALPHA'
1451 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1452
1453 `GL_CONSTANT_COLOR'
1454 (R_C,G_CB_C) , A_C
1455
1456 `GL_ONE_MINUS_CONSTANT_COLOR'
1457 (1,11)-(R_C,G_CB_C) , 1-A_C
1458
1459 `GL_CONSTANT_ALPHA'
1460 (A_C,A_CA_C) , A_C
1461
1462 `GL_ONE_MINUS_CONSTANT_ALPHA'
1463 (1,11)-(A_C,A_CA_C) , 1-A_C
1464
1465 `GL_SRC_ALPHA_SATURATE'
1466 (I,II) , 1
1467
1468 In the table,
1469
1470 I=MIN\u2061(A_S,1-A_D,)
1471
1472 To determine the blended RGBA values of a pixel when drawing in RGBA
1473 mode, the system uses the following equations:
1474
1475 R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1476 B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1477
1478 Despite the apparent precision of the above equations, blending
1479 arithmetic is not exactly specified, because blending operates with
1480 imprecise integer color values. However, a blend factor that should be
1481 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1482 factor equal to 0 reduces its multiplicand to 0. For example, when
1483 SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1484 equal to K_A , the equations reduce to simple replacement:
1485
1486 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1487
1488
1489
1490 `GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1491 accepted value.
1492
1493 `GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1494 between the execution of `glBegin' and the corresponding execution of
1495 `glEnd'.")
1496
1497 (define-gl-procedures
1498 ((glBlendFunc
1499 (sfactor GLenum)
1500 (dfactor GLenum)
1501 ->
1502 void))
1503 "Specify pixel arithmetic.
1504
1505 SFACTOR
1506 Specifies how the red, green, blue, and alpha source blending
1507 factors are computed. The following symbolic constants are
1508 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1509 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1510 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1511 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1512 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1513 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1514 initial value is `GL_ONE'.
1515
1516 DFACTOR
1517 Specifies how the red, green, blue, and alpha destination blending
1518 factors are computed. The following symbolic constants are
1519 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1520 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1521 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1522 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1523 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1524 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
1525
1526 In RGBA mode, pixels can be drawn using a function that blends the
1527 incoming (source) RGBA values with the RGBA values that are already in
1528 the frame buffer (the destination values). Blending is initially
1529 disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1530 enable and disable blending.
1531
1532 `glBlendFunc' defines the operation of blending when it is enabled.
1533 SFACTOR specifies which method is used to scale the source color
1534 components. DFACTOR specifies which method is used to scale the
1535 destination color components. The possible methods are described in the
1536 following table. Each method defines four scale factors, one each for
1537 red, green, blue, and alpha. In the table and in subsequent equations,
1538 source and destination color components are referred to as
1539 (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1540 `glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1541 to have integer values between 0 and (K_R,K_GK_BK_A) , where
1542
1543 K_C=2^M_C,-1
1544
1545 and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1546 bitplanes.
1547
1548 Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1549 and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1550 (F_R,F_GF_BF_A) , represent either source or destination factors. All
1551 scale factors have range [0,1] .
1552
1553
1554
1555 *Parameter*
1556 * (F_R,F_GF_BF_A) *
1557
1558 `GL_ZERO'
1559 (0,000)
1560
1561 `GL_ONE'
1562 (1,111)
1563
1564 `GL_SRC_COLOR'
1565 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1566
1567 `GL_ONE_MINUS_SRC_COLOR'
1568 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1569
1570 `GL_DST_COLOR'
1571 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1572
1573 `GL_ONE_MINUS_DST_COLOR'
1574 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1575
1576 `GL_SRC_ALPHA'
1577 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1578
1579 `GL_ONE_MINUS_SRC_ALPHA'
1580 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1581
1582 `GL_DST_ALPHA'
1583 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1584
1585 `GL_ONE_MINUS_DST_ALPHA'
1586 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1587
1588 `GL_CONSTANT_COLOR'
1589 (R_C,G_CB_CA_C)
1590
1591 `GL_ONE_MINUS_CONSTANT_COLOR'
1592 (1,111)-(R_C,G_CB_CA_C)
1593
1594 `GL_CONSTANT_ALPHA'
1595 (A_C,A_CA_CA_C)
1596
1597 `GL_ONE_MINUS_CONSTANT_ALPHA'
1598 (1,111)-(A_C,A_CA_CA_C)
1599
1600 `GL_SRC_ALPHA_SATURATE'
1601 (I,II1)
1602
1603 In the table,
1604
1605 I=MIN\u2061(A_S,K_A-A_D)/K_A
1606
1607 To determine the blended RGBA values of a pixel when drawing in RGBA
1608 mode, the system uses the following equations:
1609
1610 R_D=MIN\u2061(K_R,R_S\u2062S_R+R_D\u2062D_R) G_D=MIN\u2061(K_G,G_S\u2062S_G+G_D\u2062D_G)
1611 B_D=MIN\u2061(K_B,B_S\u2062S_B+B_D\u2062D_B) A_D=MIN\u2061(K_A,A_S\u2062S_A+A_D\u2062D_A)
1612
1613 Despite the apparent precision of the above equations, blending
1614 arithmetic is not exactly specified, because blending operates with
1615 imprecise integer color values. However, a blend factor that should be
1616 equal to 1 is guaranteed not to modify its multiplicand, and a blend
1617 factor equal to 0 reduces its multiplicand to 0. For example, when
1618 SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1619 is equal to K_A , the equations reduce to simple replacement:
1620
1621 R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1622
1623
1624
1625 `GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1626 accepted value.
1627
1628 `GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1629 the execution of `glBegin' and the corresponding execution of `glEnd'.")
1630
1631 (define-gl-procedures
1632 ((glBufferData
1633 (target GLenum)
1634 (size GLsizeiptr)
1635 (data const-GLvoid-*)
1636 (usage GLenum)
1637 ->
1638 void))
1639 "Creates and initializes a buffer object's data store.
1640
1641 TARGET
1642 Specifies the target buffer object. The symbolic constant must be
1643 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1644 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1645
1646 SIZE
1647 Specifies the size in bytes of the buffer object's new data store.
1648
1649 DATA
1650 Specifies a pointer to data that will be copied into the data store
1651 for initialization, or `NULL' if no data is to be copied.
1652
1653 USAGE
1654 Specifies the expected usage pattern of the data store. The
1655 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1656 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1657 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1658 `GL_DYNAMIC_COPY'.
1659
1660 `glBufferData' creates a new data store for the buffer object currently
1661 bound to TARGET. Any pre-existing data store is deleted. The new data
1662 store is created with the specified SIZE in bytes and USAGE. If DATA is
1663 not `NULL', the data store is initialized with data from this pointer.
1664 In its initial state, the new data store is not mapped, it has a `NULL'
1665 mapped pointer, and its mapped access is `GL_READ_WRITE'.
1666
1667 USAGE is a hint to the GL implementation as to how a buffer object's
1668 data store will be accessed. This enables the GL implementation to make
1669 more intelligent decisions that may significantly impact buffer object
1670 performance. It does not, however, constrain the actual usage of the
1671 data store. USAGE can be broken down into two parts: first, the
1672 frequency of access (modification and usage), and second, the nature of
1673 that access. The frequency of access may be one of these:
1674
1675 STREAM
1676 The data store contents will be modified once and used at most a
1677 few times.
1678
1679 STATIC
1680 The data store contents will be modified once and used many times.
1681
1682 DYNAMIC
1683 The data store contents will be modified repeatedly and used many
1684 times.
1685
1686 The nature of access may be one of these:
1687
1688 DRAW
1689 The data store contents are modified by the application, and used
1690 as the source for GL drawing and image specification commands.
1691
1692 READ
1693 The data store contents are modified by reading data from the GL,
1694 and used to return that data when queried by the application.
1695
1696 COPY
1697 The data store contents are modified by reading data from the GL,
1698 and used as the source for GL drawing and image specification
1699 commands.
1700
1701 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1702 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1703 `GL_PIXEL_UNPACK_BUFFER'.
1704
1705 `GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1706 `GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1707 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1708 `GL_DYNAMIC_COPY'.
1709
1710 `GL_INVALID_VALUE' is generated if SIZE is negative.
1711
1712 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1713 is bound to TARGET.
1714
1715 `GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1716 store with the specified SIZE.
1717
1718 `GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1719 between the execution of `glBegin' and the corresponding execution of
1720 `glEnd'.")
1721
1722 (define-gl-procedures
1723 ((glBufferSubData
1724 (target GLenum)
1725 (offset GLintptr)
1726 (size GLsizeiptr)
1727 (data const-GLvoid-*)
1728 ->
1729 void))
1730 "Updates a subset of a buffer object's data store.
1731
1732 TARGET
1733 Specifies the target buffer object. The symbolic constant must be
1734 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1735 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1736
1737 OFFSET
1738 Specifies the offset into the buffer object's data store where data
1739 replacement will begin, measured in bytes.
1740
1741 SIZE
1742 Specifies the size in bytes of the data store region being
1743 replaced.
1744
1745 DATA
1746 Specifies a pointer to the new data that will be copied into the
1747 data store.
1748
1749 `glBufferSubData' redefines some or all of the data store for the buffer
1750 object currently bound to TARGET. Data starting at byte offset OFFSET
1751 and extending for SIZE bytes is copied to the data store from the memory
1752 pointed to by DATA. An error is thrown if OFFSET and SIZE together
1753 define a range beyond the bounds of the buffer object's data store.
1754
1755 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1756 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1757 `GL_PIXEL_UNPACK_BUFFER'.
1758
1759 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1760 together they define a region of memory that extends beyond the buffer
1761 object's allocated data store.
1762
1763 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1764 is bound to TARGET.
1765
1766 `GL_INVALID_OPERATION' is generated if the buffer object being updated
1767 is mapped.
1768
1769 `GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1770 between the execution of `glBegin' and the corresponding execution of
1771 `glEnd'.")
1772
1773 (define-gl-procedures
1774 ((glCallLists
1775 (n GLsizei)
1776 (type GLenum)
1777 (lists const-GLvoid-*)
1778 ->
1779 void))
1780 "Execute a list of display lists.
1781
1782 N
1783 Specifies the number of display lists to be executed.
1784
1785 TYPE
1786 Specifies the type of values in LISTS. Symbolic constants
1787 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1788 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1789 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1790
1791 LISTS
1792 Specifies the address of an array of name offsets in the display
1793 list. The pointer type is void because the offsets can be bytes,
1794 shorts, ints, or floats, depending on the value of TYPE.
1795
1796 `glCallLists' causes each display list in the list of names passed as
1797 LISTS to be executed. As a result, the commands saved in each display
1798 list are executed in order, just as if they were called without using a
1799 display list. Names of display lists that have not been defined are
1800 ignored.
1801
1802 `glCallLists' provides an efficient means for executing more than one
1803 display list. TYPE allows lists with various name formats to be
1804 accepted. The formats are as follows:
1805
1806 `GL_BYTE'
1807 LISTS is treated as an array of signed bytes, each in the range
1808 -128 through 127.
1809
1810 `GL_UNSIGNED_BYTE'
1811 LISTS is treated as an array of unsigned bytes, each in the range 0
1812 through 255.
1813
1814 `GL_SHORT'
1815 LISTS is treated as an array of signed two-byte integers, each in
1816 the range -32768 through 32767.
1817
1818 `GL_UNSIGNED_SHORT'
1819 LISTS is treated as an array of unsigned two-byte integers, each in
1820 the range 0 through 65535.
1821
1822 `GL_INT'
1823 LISTS is treated as an array of signed four-byte integers.
1824
1825 `GL_UNSIGNED_INT'
1826 LISTS is treated as an array of unsigned four-byte integers.
1827
1828 `GL_FLOAT'
1829 LISTS is treated as an array of four-byte floating-point values.
1830
1831 `GL_2_BYTES'
1832 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1833 specifies a single display-list name. The value of the pair is
1834 computed as 256 times the unsigned value of the first byte plus the
1835 unsigned value of the second byte.
1836
1837 `GL_3_BYTES'
1838 LISTS is treated as an array of unsigned bytes. Each triplet of
1839 bytes specifies a single display-list name. The value of the
1840 triplet is computed as 65536 times the unsigned value of the first
1841 byte, plus 256 times the unsigned value of the second byte, plus
1842 the unsigned value of the third byte.
1843
1844 `GL_4_BYTES'
1845 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1846 bytes specifies a single display-list name. The value of the
1847 quadruplet is computed as 16777216 times the unsigned value of the
1848 first byte, plus 65536 times the unsigned value of the second byte,
1849 plus 256 times the unsigned value of the third byte, plus the
1850 unsigned value of the fourth byte.
1851
1852 The list of display-list names is not null-terminated. Rather, N
1853 specifies how many names are to be taken from LISTS.
1854
1855 An additional level of indirection is made available with the
1856 `glListBase' command, which specifies an unsigned offset that is added
1857 to each display-list name specified in LISTS before that display list is
1858 executed.
1859
1860 `glCallLists' can appear inside a display list. To avoid the possibility
1861 of infinite recursion resulting from display lists calling one another,
1862 a limit is placed on the nesting level of display lists during
1863 display-list execution. This limit must be at least 64, and it depends
1864 on the implementation.
1865
1866 GL state is not saved and restored across a call to `glCallLists'. Thus,
1867 changes made to GL state during the execution of the display lists
1868 remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1869 `glPushMatrix', and `glPopMatrix' to preserve GL state across
1870 `glCallLists' calls.
1871
1872 `GL_INVALID_VALUE' is generated if N is negative.
1873
1874 `GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1875 `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1876 `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
1877
1878 (define-gl-procedures
1879 ((glCallList (list GLuint) -> void))
1880 "Execute a display list.
1881
1882 LIST
1883 Specifies the integer name of the display list to be executed.
1884
1885 `glCallList' causes the named display list to be executed. The commands
1886 saved in the display list are executed in order, just as if they were
1887 called without using a display list. If LIST has not been defined as a
1888 display list, `glCallList' is ignored.
1889
1890 `glCallList' can appear inside a display list. To avoid the possibility
1891 of infinite recursion resulting from display lists calling one another,
1892 a limit is placed on the nesting level of display lists during
1893 display-list execution. This limit is at least 64, and it depends on the
1894 implementation.
1895
1896 GL state is not saved and restored across a call to `glCallList'. Thus,
1897 changes made to GL state during the execution of a display list remain
1898 after execution of the display list is completed. Use `glPushAttrib',
1899 `glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1900 across `glCallList' calls.")
1901
1902 (define-gl-procedures
1903 ((glClearAccum
1904 (red GLfloat)
1905 (green GLfloat)
1906 (blue GLfloat)
1907 (alpha GLfloat)
1908 ->
1909 void))
1910 "Specify clear values for the accumulation buffer.
1911
1912 RED
1913 GREEN
1914
1915 BLUE
1916
1917 ALPHA
1918
1919 Specify the red, green, blue, and alpha values used when the
1920 accumulation buffer is cleared. The initial values are all 0.
1921
1922 `glClearAccum' specifies the red, green, blue, and alpha values used by
1923 `glClear' to clear the accumulation buffer.
1924
1925 Values specified by `glClearAccum' are clamped to the range [-1,1] .
1926
1927 `GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1928 between the execution of `glBegin' and the corresponding execution of
1929 `glEnd'.")
1930
1931 (define-gl-procedures
1932 ((glClearColor
1933 (red GLclampf)
1934 (green GLclampf)
1935 (blue GLclampf)
1936 (alpha GLclampf)
1937 ->
1938 void))
1939 "Specify clear values for the color buffers.
1940
1941 RED
1942 GREEN
1943
1944 BLUE
1945
1946 ALPHA
1947
1948 Specify the red, green, blue, and alpha values used when the color
1949 buffers are cleared. The initial values are all 0.
1950
1951 `glClearColor' specifies the red, green, blue, and alpha values used by
1952 `glClear' to clear the color buffers. Values specified by `glClearColor'
1953 are clamped to the range [0,1] .
1954
1955 `GL_INVALID_OPERATION' is generated if `glClearColor' is executed
1956 between the execution of `glBegin' and the corresponding execution of
1957 `glEnd'.")
1958
1959 (define-gl-procedures
1960 ((glClearDepth (depth GLclampd) -> void))
1961 "Specify the clear value for the depth buffer.
1962
1963 DEPTH
1964 Specifies the depth value used when the depth buffer is cleared.
1965 The initial value is 1.
1966
1967 `glClearDepth' specifies the depth value used by `glClear' to clear the
1968 depth buffer. Values specified by `glClearDepth' are clamped to the
1969 range [0,1] .
1970
1971 `GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
1972 between the execution of `glBegin' and the corresponding execution of
1973 `glEnd'.")
1974
1975 (define-gl-procedures
1976 ((glClearIndex (c GLfloat) -> void))
1977 "Specify the clear value for the color index buffers.
1978
1979 C
1980 Specifies the index used when the color index buffers are cleared.
1981 The initial value is 0.
1982
1983 `glClearIndex' specifies the index used by `glClear' to clear the color
1984 index buffers. C is not clamped. Rather, C is converted to a fixed-point
1985 value with unspecified precision to the right of the binary point. The
1986 integer part of this value is then masked with 2^M-1 , where M is the
1987 number of bits in a color index stored in the frame buffer.
1988
1989 `GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
1990 between the execution of `glBegin' and the corresponding execution of
1991 `glEnd'.")
1992
1993 (define-gl-procedures
1994 ((glClearStencil (s GLint) -> void))
1995 "Specify the clear value for the stencil buffer.
1996
1997 S
1998 Specifies the index used when the stencil buffer is cleared. The
1999 initial value is 0.
2000
2001 `glClearStencil' specifies the index used by `glClear' to clear the
2002 stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2003 in the stencil buffer.
2004
2005 `GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2006 between the execution of `glBegin' and the corresponding execution of
2007 `glEnd'.")
2008
2009 (define-gl-procedures
2010 ((glClear (mask GLbitfield) -> void))
2011 "Clear buffers to preset values.
2012
2013 MASK
2014 Bitwise OR of masks that indicate the buffers to be cleared. The
2015 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2016 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2017
2018 `glClear' sets the bitplane area of the window to values previously
2019 selected by `glClearColor', `glClearIndex', `glClearDepth',
2020 `glClearStencil', and `glClearAccum'. Multiple color buffers can be
2021 cleared simultaneously by selecting more than one buffer at a time using
2022 `glDrawBuffer'.
2023
2024 The pixel ownership test, the scissor test, dithering, and the buffer
2025 writemasks affect the operation of `glClear'. The scissor box bounds the
2026 cleared region. Alpha function, blend function, logical operation,
2027 stenciling, texture mapping, and depth-buffering are ignored by
2028 `glClear'.
2029
2030 `glClear' takes a single argument that is the bitwise OR of several
2031 values indicating which buffer is to be cleared.
2032
2033 The values are as follows:
2034
2035 `GL_COLOR_BUFFER_BIT'
2036 Indicates the buffers currently enabled for color writing.
2037
2038 `GL_DEPTH_BUFFER_BIT'
2039 Indicates the depth buffer.
2040
2041 `GL_ACCUM_BUFFER_BIT'
2042 Indicates the accumulation buffer.
2043
2044 `GL_STENCIL_BUFFER_BIT'
2045 Indicates the stencil buffer.
2046
2047 The value to which each buffer is cleared depends on the setting of the
2048 clear value for that buffer.
2049
2050 `GL_INVALID_VALUE' is generated if any bit other than the four defined
2051 bits is set in MASK.
2052
2053 `GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2054 execution of `glBegin' and the corresponding execution of `glEnd'.")
2055
2056 (define-gl-procedures
2057 ((glClientActiveTexture (texture GLenum) -> void))
2058 "Select active texture unit.
2059
2060 TEXTURE
2061 Specifies which texture unit to make active. The number of texture
2062 units is implementation dependent, but must be at least two.
2063 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2064 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2065 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2066
2067 `glClientActiveTexture' selects the vertex array client state parameters
2068 to be modified by `glTexCoordPointer', and enabled or disabled with
2069 `glEnableClientState' or `glDisableClientState', respectively, when
2070 called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2071
2072 `GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2073 where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
2074
2075 (define-gl-procedures
2076 ((glClipPlane
2077 (plane GLenum)
2078 (equation const-GLdouble-*)
2079 ->
2080 void))
2081 "Specify a plane against which all geometry is clipped.
2082
2083 PLANE
2084 Specifies which clipping plane is being positioned. Symbolic names
2085 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2086 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2087
2088 EQUATION
2089 Specifies the address of an array of four double-precision
2090 floating-point values. These values are interpreted as a plane
2091 equation.
2092
2093 Geometry is always clipped against the boundaries of a six-plane frustum
2094 in X, Y, and Z. `glClipPlane' allows the specification of additional
2095 planes, not necessarily perpendicular to the X, Y, or Z axis, against
2096 which all geometry is clipped. To determine the maximum number of
2097 additional clipping planes, call `glGetIntegerv' with argument
2098 `GL_MAX_CLIP_PLANES'. All implementations support at least six such
2099 clipping planes. Because the resulting clipping region is the
2100 intersection of the defined half-spaces, it is always convex.
2101
2102 `glClipPlane' specifies a half-space using a four-component plane
2103 equation. When `glClipPlane' is called, EQUATION is transformed by the
2104 inverse of the modelview matrix and stored in the resulting eye
2105 coordinates. Subsequent changes to the modelview matrix have no effect
2106 on the stored plane-equation components. If the dot product of the eye
2107 coordinates of a vertex with the stored plane equation components is
2108 positive or zero, the vertex is IN with respect to that clipping plane.
2109 Otherwise, it is OUT.
2110
2111 To enable and disable clipping planes, call `glEnable' and `glDisable'
2112 with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2113
2114 All clipping planes are initially defined as (0, 0, 0, 0) in eye
2115 coordinates and are disabled.
2116
2117 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2118
2119 `GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2120 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2121
2122 (define-gl-procedures
2123 ((glColorMask
2124 (red GLboolean)
2125 (green GLboolean)
2126 (blue GLboolean)
2127 (alpha GLboolean)
2128 ->
2129 void))
2130 "Enable and disable writing of frame buffer color components.
2131
2132 RED
2133 GREEN
2134
2135 BLUE
2136
2137 ALPHA
2138
2139 Specify whether red, green, blue, and alpha can or cannot be
2140 written into the frame buffer. The initial values are all
2141 `GL_TRUE', indicating that the color components can be written.
2142
2143 `glColorMask' specifies whether the individual color components in the
2144 frame buffer can or cannot be written. If RED is `GL_FALSE', for
2145 example, no change is made to the red component of any pixel in any of
2146 the color buffers, regardless of the drawing operation attempted.
2147
2148 Changes to individual bits of components cannot be controlled. Rather,
2149 changes are either enabled or disabled for entire color components.
2150
2151 `GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2152 the execution of `glBegin' and the corresponding execution of `glEnd'.")
2153
2154 (define-gl-procedures
2155 ((glColorMaterial
2156 (face GLenum)
2157 (mode GLenum)
2158 ->
2159 void))
2160 "Cause a material color to track the current color.
2161
2162 FACE
2163 Specifies whether front, back, or both front and back material
2164 parameters should track the current color. Accepted values are
2165 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2166 is `GL_FRONT_AND_BACK'.
2167
2168 MODE
2169 Specifies which of several material parameters track the current
2170 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2171 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2172 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2173
2174 `glColorMaterial' specifies which material parameters track the current
2175 color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2176 parameters specified by MODE, of the material or materials specified by
2177 FACE, track the current color at all times.
2178
2179 To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2180 `glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2181 initially disabled.
2182
2183 `GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2184
2185 `GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2186 between the execution of `glBegin' and the corresponding execution of
2187 `glEnd'.")
2188
2189 (define-gl-procedures
2190 ((glColorPointer
2191 (size GLint)
2192 (type GLenum)
2193 (stride GLsizei)
2194 (pointer const-GLvoid-*)
2195 ->
2196 void))
2197 "Define an array of colors.
2198
2199 SIZE
2200 Specifies the number of components per color. Must be 3 or 4. The
2201 initial value is 4.
2202
2203 TYPE
2204 Specifies the data type of each color component in the array.
2205 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2206 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2207 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2208
2209 STRIDE
2210 Specifies the byte offset between consecutive colors. If STRIDE is
2211 0, the colors are understood to be tightly packed in the array. The
2212 initial value is 0.
2213
2214 POINTER
2215 Specifies a pointer to the first component of the first color
2216 element in the array. The initial value is 0.
2217
2218 `glColorPointer' specifies the location and data format of an array of
2219 color components to use when rendering. SIZE specifies the number of
2220 components per color, and must be 3 or 4. TYPE specifies the data type
2221 of each color component, and STRIDE specifies the byte stride from one
2222 color to the next, allowing vertices and attributes to be packed into a
2223 single array or stored in separate arrays. (Single-array storage may be
2224 more efficient on some implementations; see `glInterleavedArrays'.)
2225
2226 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2227 target (see `glBindBuffer') while a color array is specified, POINTER is
2228 treated as a byte offset into the buffer object's data store. Also, the
2229 buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2230 vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2231
2232 When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2233 saved as client-side state, in addition to the current vertex array
2234 buffer object binding.
2235
2236 To enable and disable the color array, call `glEnableClientState' and
2237 `glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2238 the color array is used when `glDrawArrays', `glMultiDrawArrays',
2239 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2240 `glArrayElement' is called.
2241
2242 `GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2243
2244 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2245
2246 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
2247
2248 (define-gl-procedures
2249 ((glColorSubTable
2250 (target GLenum)
2251 (start GLsizei)
2252 (count GLsizei)
2253 (format GLenum)
2254 (type GLenum)
2255 (data const-GLvoid-*)
2256 ->
2257 void))
2258 "Respecify a portion of a color table.
2259
2260 TARGET
2261 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2262 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2263
2264 START
2265 The starting index of the portion of the color table to be
2266 replaced.
2267
2268 COUNT
2269 The number of table entries to replace.
2270
2271 FORMAT
2272 The format of the pixel data in DATA. The allowable values are
2273 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2274 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2275
2276 TYPE
2277 The type of the pixel data in DATA. The allowable values are
2278 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2279 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2280 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2281 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2282 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2283 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2284 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2285 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2286
2287 DATA
2288 Pointer to a one-dimensional array of pixel data that is processed
2289 to replace the specified region of the color table.
2290
2291 `glColorSubTable' is used to respecify a contiguous portion of a color
2292 table previously defined using `glColorTable'. The pixels referenced by
2293 DATA replace the portion of the existing table from indices START to
2294 START+COUNT-1 , inclusive. This region may not include any entries
2295 outside the range of the color table as it was originally specified. It
2296 is not an error to specify a subtexture with width of 0, but such a
2297 specification has no effect.
2298
2299 If a non-zero named buffer object is bound to the
2300 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2301 a color table is respecified, DATA is treated as a byte offset into the
2302 buffer object's data store.
2303
2304 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2305 values.
2306
2307 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2308 values.
2309
2310 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2311 values.
2312
2313 `GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2314
2315 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2316 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2317 data store is currently mapped.
2318
2319 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2320 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2321 unpacked from the buffer object such that the memory reads required
2322 would exceed the data store size.
2323
2324 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2325 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2326 divisible into the number of bytes needed to store in memory a datum
2327 indicated by TYPE.
2328
2329 `GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2330 between the execution of `glBegin' and the corresponding execution of
2331 `glEnd'.")
2332
2333 (define-gl-procedures
2334 ((glColorTable
2335 (target GLenum)
2336 (internalformat GLenum)
2337 (width GLsizei)
2338 (format GLenum)
2339 (type GLenum)
2340 (data const-GLvoid-*)
2341 ->
2342 void))
2343 "Define a color lookup table.
2344
2345 TARGET
2346 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2347 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2348 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2349 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
2350
2351 INTERNALFORMAT
2352 The internal format of the color table. The allowable values are
2353 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2354 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2355 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2356 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2357 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2358 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2359 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2360 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2361 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2362 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
2363
2364 WIDTH
2365 The number of entries in the color lookup table specified by DATA.
2366
2367 FORMAT
2368 The format of the pixel data in DATA. The allowable values are
2369 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2370 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2371
2372 TYPE
2373 The type of the pixel data in DATA. The allowable values are
2374 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2375 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2376 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2377 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2378 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2379 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2380 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2381 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2382
2383 DATA
2384 Pointer to a one-dimensional array of pixel data that is processed
2385 to build the color table.
2386
2387 `glColorTable' may be used in two ways: to test the actual size and
2388 color resolution of a lookup table given a particular set of parameters,
2389 or to load the contents of a color lookup table. Use the targets
2390 `GL_PROXY_*' for the first case and the other targets for the second
2391 case.
2392
2393 If a non-zero named buffer object is bound to the
2394 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2395 is specified, DATA is treated as a byte offset into the buffer object's
2396 data store.
2397
2398 If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2399 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2400 table from an array of pixels. The pixel array specified by WIDTH,
2401 FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2402 `glDrawPixels' were called, but processing stops after the final
2403 expansion to RGBA is completed.
2404
2405 The four scale parameters and the four bias parameters that are defined
2406 for the table are then used to scale and bias the R, G, B, and A
2407 components of each pixel. (Use `glColorTableParameter' to set these
2408 scale and bias parameters.)
2409
2410 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2411 pixel is then converted to the internal format specified by
2412 INTERNALFORMAT. This conversion simply maps the component values of the
2413 pixel (R, G, B, and A) to the values included in the internal format
2414 (red, green, blue, alpha, luminance, and intensity). The mapping is as
2415 follows:
2416
2417
2418
2419 *Internal Format*
2420 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2421
2422 `GL_ALPHA'
2423 , , , A , ,
2424
2425 `GL_LUMINANCE'
2426 , , , , R ,
2427
2428 `GL_LUMINANCE_ALPHA'
2429 , , , A , R ,
2430
2431 `GL_INTENSITY'
2432 , , , , , R
2433
2434 `GL_RGB'
2435 R , G , B , , ,
2436
2437 `GL_RGBA'
2438 R , G , B , A , ,
2439
2440 Finally, the red, green, blue, alpha, luminance, and/or intensity
2441 components of the resulting pixels are stored in the color table. They
2442 form a one-dimensional table with indices in the range [0,WIDTH-1] .
2443
2444 If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2445 values of the proxy color table's state variables
2446 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2447 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2448 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2449 `GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2450 There is no effect on the image or state of any actual color table. If
2451 the specified color table is too large to be supported, then all the
2452 proxy state variables listed above are set to zero. Otherwise, the color
2453 table could be supported by `glColorTable' using the corresponding
2454 non-proxy target, and the proxy state variables are set as if that
2455 target were being defined.
2456
2457 The proxy state variables can be retrieved by calling
2458 `glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2459 the application to decide if a particular `glColorTable' command would
2460 succeed, and to determine what the resulting color table attributes
2461 would be.
2462
2463 If a color table is enabled, and its width is non-zero, then its
2464 contents are used to replace a subset of the components of each RGBA
2465 pixel group, based on the internal format of the table.
2466
2467 Each pixel group has color components (R, G, B, A) that are in the range
2468 [0.0,1.0] . The color components are rescaled to the size of the color
2469 lookup table to form an index. Then a subset of the components based on
2470 the internal format of the table are replaced by the table entry
2471 selected by that index. If the color components and contents of the
2472 table are represented as follows:
2473
2474
2475
2476 *Representation*
2477 *Meaning*
2478
2479 `r'
2480 Table index computed from `R'
2481
2482 `g'
2483 Table index computed from `G'
2484
2485 `b'
2486 Table index computed from `B'
2487
2488 `a'
2489 Table index computed from `A'
2490
2491 `L[i]'
2492 Luminance value at table index `i'
2493
2494 `I[i]'
2495 Intensity value at table index `i'
2496
2497 `R[i]'
2498 Red value at table index `i'
2499
2500 `G[i]'
2501 Green value at table index `i'
2502
2503 `B[i]'
2504 Blue value at table index `i'
2505
2506 `A[i]'
2507 Alpha value at table index `i'
2508
2509 then the result of color table lookup is as follows:
2510
2511
2512
2513 **
2514 *Resulting Texture Components*
2515
2516 *Table Internal Format*
2517 *R*, *G*, *B*, *A*
2518
2519 `GL_ALPHA'
2520 `R', `G', `B', `A[a]'
2521
2522 `GL_LUMINANCE'
2523 `L[r]', `L[g]', `L[b]', `At'
2524
2525 `GL_LUMINANCE_ALPHA'
2526 `L[r]', `L[g]', `L[b]', `A[a]'
2527
2528 `GL_INTENSITY'
2529 `I[r]', `I[g]', `I[b]', `I[a]'
2530
2531 `GL_RGB'
2532 `R[r]', `G[g]', `B[b]', `A'
2533
2534 `GL_RGBA'
2535 `R[r]', `G[g]', `B[b]', `A[a]'
2536
2537 When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2538 map operation (if it is enabled) are mapped by the color lookup table
2539 before being passed to the convolution operation. The colors resulting
2540 from the convolution operation are modified by the post convolution
2541 color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2542 These modified colors are then sent to the color matrix operation.
2543 Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2544 resulting from the color matrix operation are mapped by the post color
2545 matrix color lookup table before being used by the histogram operation.
2546
2547
2548
2549 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2550 values.
2551
2552 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2553 allowable values.
2554
2555 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2556 values.
2557
2558 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2559 values.
2560
2561 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2562
2563 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2564 large to be supported by the implementation, and TARGET is not a
2565 `GL_PROXY_*' target.
2566
2567 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2568 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2569 data store is currently mapped.
2570
2571 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2572 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2573 unpacked from the buffer object such that the memory reads required
2574 would exceed the data store size.
2575
2576 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2577 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2578 divisible into the number of bytes needed to store in memory a datum
2579 indicated by TYPE.
2580
2581 `GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2582 between the execution of `glBegin' and the corresponding execution of
2583 `glEnd'.")
2584
2585 (define-gl-procedures
2586 ((glColor3i
2587 (red GLint)
2588 (green GLint)
2589 (blue GLint)
2590 ->
2591 void)
2592 (glColor3f
2593 (red GLfloat)
2594 (green GLfloat)
2595 (blue GLfloat)
2596 ->
2597 void)
2598 (glColor3ui
2599 (red GLuint)
2600 (green GLuint)
2601 (blue GLuint)
2602 ->
2603 void)
2604 (glColor4i
2605 (red GLint)
2606 (green GLint)
2607 (blue GLint)
2608 (alpha GLint)
2609 ->
2610 void)
2611 (glColor4f
2612 (red GLfloat)
2613 (green GLfloat)
2614 (blue GLfloat)
2615 (alpha GLfloat)
2616 ->
2617 void)
2618 (glColor4ui
2619 (red GLuint)
2620 (green GLuint)
2621 (blue GLuint)
2622 (alpha GLuint)
2623 ->
2624 void))
2625 "Set the current color.
2626
2627 RED
2628 GREEN
2629
2630 BLUE
2631
2632 Specify new red, green, and blue values for the current color.
2633
2634 ALPHA
2635 Specifies a new alpha value for the current color. Included only in
2636 the four-argument `glColor4' commands.
2637
2638 The GL stores both a current single-valued color index and a current
2639 four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2640 `glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2641 variants specify new red, green, and blue values explicitly and set the
2642 current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2643 variants specify all four color components explicitly.
2644
2645 `glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2646 `glColor4i' take three or four signed byte, short, or long integers as
2647 arguments. When *v* is appended to the name, the color commands can take
2648 a pointer to an array of such values.
2649
2650 Current color values are stored in floating-point format, with
2651 unspecified mantissa and exponent sizes. Unsigned integer color
2652 components, when specified, are linearly mapped to floating-point values
2653 such that the largest representable value maps to 1.0 (full intensity),
2654 and 0 maps to 0.0 (zero intensity). Signed integer color components,
2655 when specified, are linearly mapped to floating-point values such that
2656 the most positive representable value maps to 1.0, and the most negative
2657 representable value maps to -1.0 . (Note that this mapping does not
2658 convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2659
2660 Neither floating-point nor signed integer values are clamped to the
2661 range [0,1] before the current color is updated. However, color
2662 components are clamped to this range before they are interpolated or
2663 written into a color buffer.")
2664
2665 (define-gl-procedures
2666 ((glCompileShader (shader GLuint) -> void))
2667 "Compiles a shader object.
2668
2669 SHADER
2670 Specifies the shader object to be compiled.
2671
2672 `glCompileShader' compiles the source code strings that have been stored
2673 in the shader object specified by SHADER.
2674
2675 The compilation status will be stored as part of the shader object's
2676 state. This value will be set to `GL_TRUE' if the shader was compiled
2677 without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2678 queried by calling `glGetShader' with arguments SHADER and
2679 `GL_COMPILE_STATUS'.
2680
2681 Compilation of a shader can fail for a number of reasons as specified by
2682 the OpenGL Shading Language Specification. Whether or not the
2683 compilation was successful, information about the compilation can be
2684 obtained from the shader object's information log by calling
2685 `glGetShaderInfoLog'.
2686
2687 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2688 OpenGL.
2689
2690 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2691
2692 `GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2693 between the execution of `glBegin' and the corresponding execution of
2694 `glEnd'.")
2695
2696 (define-gl-procedures
2697 ((glCompressedTexImage1D
2698 (target GLenum)
2699 (level GLint)
2700 (internalformat GLenum)
2701 (width GLsizei)
2702 (border GLint)
2703 (imageSize GLsizei)
2704 (data const-GLvoid-*)
2705 ->
2706 void))
2707 "Specify a one-dimensional texture image in a compressed format.
2708
2709 TARGET
2710 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2711 `GL_PROXY_TEXTURE_1D'.
2712
2713 LEVEL
2714 Specifies the level-of-detail number. Level 0 is the base image
2715 level. Level N is the Nth mipmap reduction image.
2716
2717 INTERNALFORMAT
2718 Specifies the format of the compressed image data stored at address
2719 DATA.
2720
2721 WIDTH
2722 Specifies the width of the texture image including the border if
2723 any. If the GL version does not support non-power-of-two sizes,
2724 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2725 implementations support texture images that are at least 64 texels
2726 wide. The height of the 1D texture image is 1.
2727
2728 BORDER
2729 Specifies the width of the border. Must be either 0 or 1.
2730
2731 IMAGESIZE
2732 Specifies the number of unsigned bytes of image data starting at
2733 the address specified by DATA.
2734
2735 DATA
2736 Specifies a pointer to the compressed image data in memory.
2737
2738 Texturing maps a portion of a specified texture image onto each
2739 graphical primitive for which texturing is enabled. To enable and
2740 disable one-dimensional texturing, call `glEnable' and `glDisable' with
2741 argument `GL_TEXTURE_1D'.
2742
2743 `glCompressedTexImage1D' loads a previously defined, and retrieved,
2744 compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2745 (see `glTexImage1D').
2746
2747 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2748 of the texture image state is recalculated, checked for consistency, and
2749 checked against the implementation's capabilities. If the implementation
2750 cannot handle a texture of the requested texture size, it sets all of
2751 the image state to 0, but does not generate an error (see `glGetError').
2752 To query for an entire mipmap array, use an image array level greater
2753 than or equal to 1.
2754
2755 INTERNALFORMAT must be extension-specified compressed-texture format.
2756 When a texture is loaded with `glTexImage1D' using a generic compressed
2757 texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2758 its extensions supporting compressed textures. In order to load the
2759 compressed texture image using `glCompressedTexImage1D', query the
2760 compressed texture image's size and format using
2761 `glGetTexLevelParameter'.
2762
2763 If a non-zero named buffer object is bound to the
2764 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2765 image is specified, DATA is treated as a byte offset into the buffer
2766 object's data store.
2767
2768 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2769 compressed internal formats: `GL_COMPRESSED_ALPHA',
2770 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2771 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2772
2773 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2774 format, dimensions, and contents of the specified compressed image data.
2775
2776 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2777 supported by the specific compressed internal format as specified in the
2778 specific texture compression extension.
2779
2780 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2781 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2782 data store is currently mapped.
2783
2784 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2785 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2786 unpacked from the buffer object such that the memory reads required
2787 would exceed the data store size.
2788
2789 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2790 executed between the execution of `glBegin' and the corresponding
2791 execution of `glEnd'.
2792
2793 Undefined results, including abnormal program termination, are generated
2794 if DATA is not encoded in a manner consistent with the extension
2795 specification defining the internal compression format.")
2796
2797 (define-gl-procedures
2798 ((glCompressedTexImage2D
2799 (target GLenum)
2800 (level GLint)
2801 (internalformat GLenum)
2802 (width GLsizei)
2803 (height GLsizei)
2804 (border GLint)
2805 (imageSize GLsizei)
2806 (data const-GLvoid-*)
2807 ->
2808 void))
2809 "Specify a two-dimensional texture image in a compressed format.
2810
2811 TARGET
2812 Specifies the target texture. Must be `GL_TEXTURE_2D',
2813 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2814 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2815 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2816 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2817
2818 LEVEL
2819 Specifies the level-of-detail number. Level 0 is the base image
2820 level. Level N is the Nth mipmap reduction image.
2821
2822 INTERNALFORMAT
2823 Specifies the format of the compressed image data stored at address
2824 DATA.
2825
2826 WIDTH
2827 Specifies the width of the texture image including the border if
2828 any. If the GL version does not support non-power-of-two sizes,
2829 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2830 implementations support 2D texture images that are at least 64
2831 texels wide and cube-mapped texture images that are at least 16
2832 texels wide.
2833
2834 HEIGHT
2835 Specifies the height of the texture image including the border if
2836 any. If the GL version does not support non-power-of-two sizes,
2837 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2838 implementations support 2D texture images that are at least 64
2839 texels high and cube-mapped texture images that are at least 16
2840 texels high.
2841
2842 BORDER
2843 Specifies the width of the border. Must be either 0 or 1.
2844
2845 IMAGESIZE
2846 Specifies the number of unsigned bytes of image data starting at
2847 the address specified by DATA.
2848
2849 DATA
2850 Specifies a pointer to the compressed image data in memory.
2851
2852 Texturing maps a portion of a specified texture image onto each
2853 graphical primitive for which texturing is enabled. To enable and
2854 disable two-dimensional texturing, call `glEnable' and `glDisable' with
2855 argument `GL_TEXTURE_2D'. To enable and disable texturing using
2856 cube-mapped textures, call `glEnable' and `glDisable' with argument
2857 `GL_TEXTURE_CUBE_MAP'.
2858
2859 `glCompressedTexImage2D' loads a previously defined, and retrieved,
2860 compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2861 (see `glTexImage2D').
2862
2863 If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2864 of the texture image state is recalculated, checked for consistency, and
2865 checked against the implementation's capabilities. If the implementation
2866 cannot handle a texture of the requested texture size, it sets all of
2867 the image state to 0, but does not generate an error (see `glGetError').
2868 To query for an entire mipmap array, use an image array level greater
2869 than or equal to 1.
2870
2871 INTERNALFORMAT must be an extension-specified compressed-texture format.
2872 When a texture is loaded with `glTexImage2D' using a generic compressed
2873 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2874 its extensions supporting compressed textures. In order to load the
2875 compressed texture image using `glCompressedTexImage2D', query the
2876 compressed texture image's size and format using
2877 `glGetTexLevelParameter'.
2878
2879 If a non-zero named buffer object is bound to the
2880 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2881 image is specified, DATA is treated as a byte offset into the buffer
2882 object's data store.
2883
2884 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2885 compressed internal formats: `GL_COMPRESSED_ALPHA',
2886 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2887 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2888
2889 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2890 format, dimensions, and contents of the specified compressed image data.
2891
2892 `GL_INVALID_OPERATION' is generated if parameter combinations are not
2893 supported by the specific compressed internal format as specified in the
2894 specific texture compression extension.
2895
2896 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2897 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2898 data store is currently mapped.
2899
2900 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2901 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2902 unpacked from the buffer object such that the memory reads required
2903 would exceed the data store size.
2904
2905 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
2906 executed between the execution of `glBegin' and the corresponding
2907 execution of `glEnd'.
2908
2909 Undefined results, including abnormal program termination, are generated
2910 if DATA is not encoded in a manner consistent with the extension
2911 specification defining the internal compression format.")
2912
2913 (define-gl-procedures
2914 ((glCompressedTexImage3D
2915 (target GLenum)
2916 (level GLint)
2917 (internalformat GLenum)
2918 (width GLsizei)
2919 (height GLsizei)
2920 (depth GLsizei)
2921 (border GLint)
2922 (imageSize GLsizei)
2923 (data const-GLvoid-*)
2924 ->
2925 void))
2926 "Specify a three-dimensional texture image in a compressed format.
2927
2928 TARGET
2929 Specifies the target texture. Must be `GL_TEXTURE_3D' or
2930 `GL_PROXY_TEXTURE_3D'.
2931
2932 LEVEL
2933 Specifies the level-of-detail number. Level 0 is the base image
2934 level. Level N is the Nth mipmap reduction image.
2935
2936 INTERNALFORMAT
2937 Specifies the format of the compressed image data stored at address
2938 DATA.
2939
2940 WIDTH
2941 Specifies the width of the texture image including the border if
2942 any. If the GL version does not support non-power-of-two sizes,
2943 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2944 implementations support 3D texture images that are at least 16
2945 texels wide.
2946
2947 HEIGHT
2948 Specifies the height of the texture image including the border if
2949 any. If the GL version does not support non-power-of-two sizes,
2950 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2951 implementations support 3D texture images that are at least 16
2952 texels high.
2953
2954 DEPTH
2955 Specifies the depth of the texture image including the border if
2956 any. If the GL version does not support non-power-of-two sizes,
2957 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2958 implementations support 3D texture images that are at least 16
2959 texels deep.
2960
2961 BORDER
2962 Specifies the width of the border. Must be either 0 or 1.
2963
2964 IMAGESIZE
2965 Specifies the number of unsigned bytes of image data starting at
2966 the address specified by DATA.
2967
2968 DATA
2969 Specifies a pointer to the compressed image data in memory.
2970
2971 Texturing maps a portion of a specified texture image onto each
2972 graphical primitive for which texturing is enabled. To enable and
2973 disable three-dimensional texturing, call `glEnable' and `glDisable'
2974 with argument `GL_TEXTURE_3D'.
2975
2976 `glCompressedTexImage3D' loads a previously defined, and retrieved,
2977 compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
2978 (see `glTexImage3D').
2979
2980 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
2981 of the texture image state is recalculated, checked for consistency, and
2982 checked against the implementation's capabilities. If the implementation
2983 cannot handle a texture of the requested texture size, it sets all of
2984 the image state to 0, but does not generate an error (see `glGetError').
2985 To query for an entire mipmap array, use an image array level greater
2986 than or equal to 1.
2987
2988 INTERNALFORMAT must be an extension-specified compressed-texture format.
2989 When a texture is loaded with `glTexImage2D' using a generic compressed
2990 texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2991 its extensions supporting compressed textures. In order to load the
2992 compressed texture image using `glCompressedTexImage3D', query the
2993 compressed texture image's size and format using
2994 `glGetTexLevelParameter'.
2995
2996 If a non-zero named buffer object is bound to the
2997 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2998 image is specified, DATA is treated as a byte offset into the buffer
2999 object's data store.
3000
3001 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3002 compressed internal formats: `GL_COMPRESSED_ALPHA',
3003 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3004 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3005
3006 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3007 format, dimensions, and contents of the specified compressed image data.
3008
3009 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3010 supported by the specific compressed internal format as specified in the
3011 specific texture compression extension.
3012
3013 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3014 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3015 data store is currently mapped.
3016
3017 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3018 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3019 unpacked from the buffer object such that the memory reads required
3020 would exceed the data store size.
3021
3022 `GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3023 executed between the execution of `glBegin' and the corresponding
3024 execution of `glEnd'.
3025
3026 Undefined results, including abnormal program termination, are generated
3027 if DATA is not encoded in a manner consistent with the extension
3028 specification defining the internal compression format.")
3029
3030 (define-gl-procedures
3031 ((glCompressedTexSubImage1D
3032 (target GLenum)
3033 (level GLint)
3034 (xoffset GLint)
3035 (width GLsizei)
3036 (format GLenum)
3037 (imageSize GLsizei)
3038 (data const-GLvoid-*)
3039 ->
3040 void))
3041 "Specify a one-dimensional texture subimage in a compressed format.
3042
3043 TARGET
3044 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3045
3046 LEVEL
3047 Specifies the level-of-detail number. Level 0 is the base image
3048 level. Level N is the Nth mipmap reduction image.
3049
3050 XOFFSET
3051 Specifies a texel offset in the x direction within the texture
3052 array.
3053
3054 WIDTH
3055 Specifies the width of the texture subimage.
3056
3057 FORMAT
3058 Specifies the format of the compressed image data stored at address
3059 DATA.
3060
3061 IMAGESIZE
3062 Specifies the number of unsigned bytes of image data starting at
3063 the address specified by DATA.
3064
3065 DATA
3066 Specifies a pointer to the compressed image data in memory.
3067
3068 Texturing maps a portion of a specified texture image onto each
3069 graphical primitive for which texturing is enabled. To enable and
3070 disable one-dimensional texturing, call `glEnable' and `glDisable' with
3071 argument `GL_TEXTURE_1D'.
3072
3073 `glCompressedTexSubImage1D' redefines a contiguous subregion of an
3074 existing one-dimensional texture image. The texels referenced by DATA
3075 replace the portion of the existing texture array with x indices XOFFSET
3076 and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3077 outside the range of the texture array as it was originally specified.
3078 It is not an error to specify a subtexture with width of 0, but such a
3079 specification has no effect.
3080
3081 FORMAT must be an extension-specified compressed-texture format. The
3082 FORMAT of the compressed texture image is selected by the GL
3083 implementation that compressed it (see `glTexImage1D'), and should be
3084 queried at the time the texture was compressed with
3085 `glGetTexLevelParameter'.
3086
3087 If a non-zero named buffer object is bound to the
3088 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3089 image is specified, DATA is treated as a byte offset into the buffer
3090 object's data store.
3091
3092 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3093 compressed internal formats: `GL_COMPRESSED_ALPHA',
3094 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3095 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3096 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3097 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3098 `GL_COMPRESSED_SRGB_ALPHA'.
3099
3100 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3101 format, dimensions, and contents of the specified compressed image data.
3102
3103 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3104 supported by the specific compressed internal format as specified in the
3105 specific texture compression extension.
3106
3107 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3108 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3109 data store is currently mapped.
3110
3111 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3112 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3113 unpacked from the buffer object such that the memory reads required
3114 would exceed the data store size.
3115
3116 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3117 executed between the execution of `glBegin' and the corresponding
3118 execution of `glEnd'.
3119
3120 Undefined results, including abnormal program termination, are generated
3121 if DATA is not encoded in a manner consistent with the extension
3122 specification defining the internal compression format.")
3123
3124 (define-gl-procedures
3125 ((glCompressedTexSubImage2D
3126 (target GLenum)
3127 (level GLint)
3128 (xoffset GLint)
3129 (yoffset GLint)
3130 (width GLsizei)
3131 (height GLsizei)
3132 (format GLenum)
3133 (imageSize GLsizei)
3134 (data const-GLvoid-*)
3135 ->
3136 void))
3137 "Specify a two-dimensional texture subimage in a compressed format.
3138
3139 TARGET
3140 Specifies the target texture. Must be `GL_TEXTURE_2D',
3141 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3142 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3143 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3144 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3145
3146 LEVEL
3147 Specifies the level-of-detail number. Level 0 is the base image
3148 level. Level N is the Nth mipmap reduction image.
3149
3150 XOFFSET
3151 Specifies a texel offset in the x direction within the texture
3152 array.
3153
3154 YOFFSET
3155 Specifies a texel offset in the y direction within the texture
3156 array.
3157
3158 WIDTH
3159 Specifies the width of the texture subimage.
3160
3161 HEIGHT
3162 Specifies the height of the texture subimage.
3163
3164 FORMAT
3165 Specifies the format of the compressed image data stored at address
3166 DATA.
3167
3168 IMAGESIZE
3169 Specifies the number of unsigned bytes of image data starting at
3170 the address specified by DATA.
3171
3172 DATA
3173 Specifies a pointer to the compressed image data in memory.
3174
3175 Texturing maps a portion of a specified texture image onto each
3176 graphical primitive for which texturing is enabled. To enable and
3177 disable two-dimensional texturing, call `glEnable' and `glDisable' with
3178 argument `GL_TEXTURE_2D'. To enable and disable texturing using
3179 cube-mapped texture, call `glEnable' and `glDisable' with argument
3180 `GL_TEXTURE_CUBE_MAP'.
3181
3182 `glCompressedTexSubImage2D' redefines a contiguous subregion of an
3183 existing two-dimensional texture image. The texels referenced by DATA
3184 replace the portion of the existing texture array with x indices XOFFSET
3185 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3186 inclusive. This region may not include any texels outside the range of
3187 the texture array as it was originally specified. It is not an error to
3188 specify a subtexture with width of 0, but such a specification has no
3189 effect.
3190
3191 FORMAT must be an extension-specified compressed-texture format. The
3192 FORMAT of the compressed texture image is selected by the GL
3193 implementation that compressed it (see `glTexImage2D') and should be
3194 queried at the time the texture was compressed with
3195 `glGetTexLevelParameter'.
3196
3197 If a non-zero named buffer object is bound to the
3198 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3199 image is specified, DATA is treated as a byte offset into the buffer
3200 object's data store.
3201
3202 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3203 compressed internal formats: `GL_COMPRESSED_ALPHA',
3204 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3205 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3206 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3207 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3208 `GL_COMPRESSED_SRGB_ALPHA'.
3209
3210 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3211 format, dimensions, and contents of the specified compressed image data.
3212
3213 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3214 supported by the specific compressed internal format as specified in the
3215 specific texture compression extension.
3216
3217 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3218 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3219 data store is currently mapped.
3220
3221 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3222 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3223 unpacked from the buffer object such that the memory reads required
3224 would exceed the data store size.
3225
3226 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3227 executed between the execution of `glBegin' and the corresponding
3228 execution of `glEnd'.
3229
3230 Undefined results, including abnormal program termination, are generated
3231 if DATA is not encoded in a manner consistent with the extension
3232 specification defining the internal compression format.")
3233
3234 (define-gl-procedures
3235 ((glCompressedTexSubImage3D
3236 (target GLenum)
3237 (level GLint)
3238 (xoffset GLint)
3239 (yoffset GLint)
3240 (zoffset GLint)
3241 (width GLsizei)
3242 (height GLsizei)
3243 (depth GLsizei)
3244 (format GLenum)
3245 (imageSize GLsizei)
3246 (data const-GLvoid-*)
3247 ->
3248 void))
3249 "Specify a three-dimensional texture subimage in a compressed format.
3250
3251 TARGET
3252 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3253
3254 LEVEL
3255 Specifies the level-of-detail number. Level 0 is the base image
3256 level. Level N is the Nth mipmap reduction image.
3257
3258 XOFFSET
3259 Specifies a texel offset in the x direction within the texture
3260 array.
3261
3262 YOFFSET
3263 Specifies a texel offset in the y direction within the texture
3264 array.
3265
3266 WIDTH
3267 Specifies the width of the texture subimage.
3268
3269 HEIGHT
3270 Specifies the height of the texture subimage.
3271
3272 DEPTH
3273 Specifies the depth of the texture subimage.
3274
3275 FORMAT
3276 Specifies the format of the compressed image data stored at address
3277 DATA.
3278
3279 IMAGESIZE
3280 Specifies the number of unsigned bytes of image data starting at
3281 the address specified by DATA.
3282
3283 DATA
3284 Specifies a pointer to the compressed image data in memory.
3285
3286 Texturing maps a portion of a specified texture image onto each
3287 graphical primitive for which texturing is enabled. To enable and
3288 disable three-dimensional texturing, call `glEnable' and `glDisable'
3289 with argument `GL_TEXTURE_3D'.
3290
3291 `glCompressedTexSubImage3D' redefines a contiguous subregion of an
3292 existing three-dimensional texture image. The texels referenced by DATA
3293 replace the portion of the existing texture array with x indices XOFFSET
3294 and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3295 and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3296 may not include any texels outside the range of the texture array as it
3297 was originally specified. It is not an error to specify a subtexture
3298 with width of 0, but such a specification has no effect.
3299
3300 FORMAT must be an extension-specified compressed-texture format. The
3301 FORMAT of the compressed texture image is selected by the GL
3302 implementation that compressed it (see `glTexImage3D') and should be
3303 queried at the time the texture was compressed with
3304 `glGetTexLevelParameter'.
3305
3306 If a non-zero named buffer object is bound to the
3307 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3308 image is specified, DATA is treated as a byte offset into the buffer
3309 object's data store.
3310
3311 `GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3312 compressed internal formats: `GL_COMPRESSED_ALPHA',
3313 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3314 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3315 `GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3316 `GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3317 `GL_COMPRESSED_SRGB_ALPHA'.
3318
3319 `GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3320 format, dimensions, and contents of the specified compressed image data.
3321
3322 `GL_INVALID_OPERATION' is generated if parameter combinations are not
3323 supported by the specific compressed internal format as specified in the
3324 specific texture compression extension.
3325
3326 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3327 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3328 data store is currently mapped.
3329
3330 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3331 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3332 unpacked from the buffer object such that the memory reads required
3333 would exceed the data store size.
3334
3335 `GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3336 executed between the execution of `glBegin' and the corresponding
3337 execution of `glEnd'.
3338
3339 Undefined results, including abnormal program termination, are generated
3340 if DATA is not encoded in a manner consistent with the extension
3341 specification defining the internal compression format.")
3342
3343 (define-gl-procedures
3344 ((glConvolutionFilter1D
3345 (target GLenum)
3346 (internalformat GLenum)
3347 (width GLsizei)
3348 (format GLenum)
3349 (type GLenum)
3350 (data const-GLvoid-*)
3351 ->
3352 void))
3353 "Define a one-dimensional convolution filter.
3354
3355 TARGET
3356 Must be `GL_CONVOLUTION_1D'.
3357
3358 INTERNALFORMAT
3359 The internal format of the convolution filter kernel. The allowable
3360 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3361 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3362 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3363 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3364 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3365 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3366 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3367 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3368 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3369 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3370 `GL_RGBA12', or `GL_RGBA16'.
3371
3372 WIDTH
3373 The width of the pixel array referenced by DATA.
3374
3375 FORMAT
3376 The format of the pixel data in DATA. The allowable values are
3377 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3378 `GL_RGB', and `GL_RGBA'.
3379
3380 TYPE
3381 The type of the pixel data in DATA. Symbolic constants
3382 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3383 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3384 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3385 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3386 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3387 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3388 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3389 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3390 are accepted.
3391
3392 DATA
3393 Pointer to a one-dimensional array of pixel data that is processed
3394 to build the convolution filter kernel.
3395
3396 `glConvolutionFilter1D' builds a one-dimensional convolution filter
3397 kernel from an array of pixels.
3398
3399 The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3400 from memory and processed just as if `glDrawPixels' were called, but
3401 processing stops after the final expansion to RGBA is completed.
3402
3403 If a non-zero named buffer object is bound to the
3404 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3405 filter is specified, DATA is treated as a byte offset into the buffer
3406 object's data store.
3407
3408 The R, G, B, and A components of each pixel are next scaled by the four
3409 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3410 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3411 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3412 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3413 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3414 four values that are applied to red, green, blue, and alpha, in that
3415 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3416 during this process.
3417
3418 Each pixel is then converted to the internal format specified by
3419 INTERNALFORMAT. This conversion simply maps the component values of the
3420 pixel (R, G, B, and A) to the values included in the internal format
3421 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3422 follows:
3423
3424
3425
3426 *Internal Format*
3427 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3428
3429 `GL_ALPHA'
3430 , , , A , ,
3431
3432 `GL_LUMINANCE'
3433 , , , , R ,
3434
3435 `GL_LUMINANCE_ALPHA'
3436 , , , A , R ,
3437
3438 `GL_INTENSITY'
3439 , , , , , R
3440
3441 `GL_RGB'
3442 R , G , B , , ,
3443
3444 `GL_RGBA'
3445 R , G , B , A , ,
3446
3447 The red, green, blue, alpha, luminance, and/or intensity components of
3448 the resulting pixels are stored in floating-point rather than integer
3449 format. They form a one-dimensional filter kernel image indexed with
3450 coordinate I such that I starts at 0 and increases from left to right.
3451 Kernel location I is derived from the Ith pixel, counting from 0.
3452
3453 Note that after a convolution is performed, the resulting color
3454 components are also scaled by their corresponding
3455 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3456 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3457 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3458 set by `glPixelTransfer'.
3459
3460 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3461
3462 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3463 allowable values.
3464
3465 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3466 values.
3467
3468 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3469 values.
3470
3471 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3472 than the maximum supported value. This value may be queried with
3473 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3474 `GL_MAX_CONVOLUTION_WIDTH'.
3475
3476 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3477 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3478 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3479 not `GL_RGB'.
3480
3481 `GL_INVALID_OPERATION' is generated if FORMAT is one of
3482 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3483 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3484 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3485 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3486 TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3487
3488 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3489 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3490 data store is currently mapped.
3491
3492 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3493 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3494 unpacked from the buffer object such that the memory reads required
3495 would exceed the data store size.
3496
3497 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3498 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3499 divisible into the number of bytes needed to store in memory a datum
3500 indicated by TYPE.
3501
3502 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3503 executed between the execution of `glBegin' and the corresponding
3504 execution of `glEnd'.")
3505
3506 (define-gl-procedures
3507 ((glConvolutionFilter2D
3508 (target GLenum)
3509 (internalformat GLenum)
3510 (width GLsizei)
3511 (height GLsizei)
3512 (format GLenum)
3513 (type GLenum)
3514 (data const-GLvoid-*)
3515 ->
3516 void))
3517 "Define a two-dimensional convolution filter.
3518
3519 TARGET
3520 Must be `GL_CONVOLUTION_2D'.
3521
3522 INTERNALFORMAT
3523 The internal format of the convolution filter kernel. The allowable
3524 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3525 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3526 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3527 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3528 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3529 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3530 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3531 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3532 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3533 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3534 `GL_RGBA12', or `GL_RGBA16'.
3535
3536 WIDTH
3537 The width of the pixel array referenced by DATA.
3538
3539 HEIGHT
3540 The height of the pixel array referenced by DATA.
3541
3542 FORMAT
3543 The format of the pixel data in DATA. The allowable values are
3544 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3545 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3546
3547 TYPE
3548 The type of the pixel data in DATA. Symbolic constants
3549 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3550 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3551 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3552 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3553 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3554 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3555 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3556 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3557 are accepted.
3558
3559 DATA
3560 Pointer to a two-dimensional array of pixel data that is processed
3561 to build the convolution filter kernel.
3562
3563 `glConvolutionFilter2D' builds a two-dimensional convolution filter
3564 kernel from an array of pixels.
3565
3566 The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3567 extracted from memory and processed just as if `glDrawPixels' were
3568 called, but processing stops after the final expansion to RGBA is
3569 completed.
3570
3571 If a non-zero named buffer object is bound to the
3572 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3573 filter is specified, DATA is treated as a byte offset into the buffer
3574 object's data store.
3575
3576 The R, G, B, and A components of each pixel are next scaled by the four
3577 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3578 `GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3579 are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3580 and the names `GL_CONVOLUTION_FILTER_SCALE' and
3581 `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3582 four values that are applied to red, green, blue, and alpha, in that
3583 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3584 during this process.
3585
3586 Each pixel is then converted to the internal format specified by
3587 INTERNALFORMAT. This conversion simply maps the component values of the
3588 pixel (R, G, B, and A) to the values included in the internal format
3589 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3590 follows:
3591
3592
3593
3594 *Internal Format*
3595 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3596
3597 `GL_ALPHA'
3598 , , , A , ,
3599
3600 `GL_LUMINANCE'
3601 , , , , R ,
3602
3603 `GL_LUMINANCE_ALPHA'
3604 , , , A , R ,
3605
3606 `GL_INTENSITY'
3607 , , , , , R
3608
3609 `GL_RGB'
3610 R , G , B , , ,
3611
3612 `GL_RGBA'
3613 R , G , B , A , ,
3614
3615 The red, green, blue, alpha, luminance, and/or intensity components of
3616 the resulting pixels are stored in floating-point rather than integer
3617 format. They form a two-dimensional filter kernel image indexed with
3618 coordinates I and J such that I starts at zero and increases from left
3619 to right, and J starts at zero and increases from bottom to top. Kernel
3620 location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3621
3622 Note that after a convolution is performed, the resulting color
3623 components are also scaled by their corresponding
3624 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3625 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3626 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3627 set by `glPixelTransfer'.
3628
3629 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3630
3631 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3632 allowable values.
3633
3634 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3635 values.
3636
3637 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3638 values.
3639
3640 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3641 than the maximum supported value. This value may be queried with
3642 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3643 `GL_MAX_CONVOLUTION_WIDTH'.
3644
3645 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3646 than the maximum supported value. This value may be queried with
3647 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3648 `GL_MAX_CONVOLUTION_HEIGHT'.
3649
3650 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3651 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3652 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3653 is not `GL_RGB'.
3654
3655 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
3656 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3657 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3658 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3659 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3660 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3661
3662 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3663 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3664 data store is currently mapped.
3665
3666 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3667 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3668 unpacked from the buffer object such that the memory reads required
3669 would exceed the data store size.
3670
3671 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3672 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3673 divisible into the number of bytes needed to store in memory a datum
3674 indicated by TYPE.
3675
3676 `GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3677 executed between the execution of `glBegin' and the corresponding
3678 execution of `glEnd'.")
3679
3680 (define-gl-procedures
3681 ((glConvolutionParameterf
3682 (target GLenum)
3683 (pname GLenum)
3684 (params GLfloat)
3685 ->
3686 void)
3687 (glConvolutionParameteri
3688 (target GLenum)
3689 (pname GLenum)
3690 (params GLint)
3691 ->
3692 void))
3693 "Set convolution parameters.
3694
3695 TARGET
3696 The target for the convolution parameter. Must be one of
3697 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3698
3699 PNAME
3700 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3701
3702 PARAMS
3703 The parameter value. Must be one of `GL_REDUCE',
3704 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3705
3706
3707
3708 `glConvolutionParameter' sets the value of a convolution parameter.
3709
3710 TARGET selects the convolution filter to be affected:
3711 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
3712 1D, 2D, or separable 2D filter, respectively.
3713
3714 PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3715 and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3716 convolution filter kernel; see `glConvolutionFilter1D',
3717 `glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3718 cases, PARAMSv is an array of four values to be applied to red, green,
3719 blue, and alpha values, respectively. The initial value for
3720 `GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3721 `GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3722
3723 A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3724 border mode. The accepted modes are:
3725
3726 `GL_REDUCE'
3727 The image resulting from convolution is smaller than the source
3728 image. If the filter width is WF and height is HF , and the source
3729 image width is WS and height is HS , then the convolved image width
3730 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3731 would generate an image with zero or negative width and/or height,
3732 the output is simply null, with no error generated.) The
3733 coordinates of the image resulting from convolution are zero
3734 through WS-WF in width and zero through HS-HF in height.
3735
3736 `GL_CONSTANT_BORDER'
3737 The image resulting from convolution is the same size as the source
3738 image, and processed as if the source image were surrounded by
3739 pixels with their color specified by the
3740 `GL_CONVOLUTION_BORDER_COLOR'.
3741
3742 `GL_REPLICATE_BORDER'
3743 The image resulting from convolution is the same size as the source
3744 image, and processed as if the outermost pixel on the border of the
3745 source image were replicated.
3746
3747 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3748 values.
3749
3750 `GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3751 values.
3752
3753 `GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3754 and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3755 `GL_REPLICATE_BORDER'.
3756
3757 `GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3758 executed between the execution of `glBegin' and the corresponding
3759 execution of `glEnd'.")
3760
3761 (define-gl-procedures
3762 ((glCopyColorSubTable
3763 (target GLenum)
3764 (start GLsizei)
3765 (x GLint)
3766 (y GLint)
3767 (width GLsizei)
3768 ->
3769 void))
3770 "Respecify a portion of a color table.
3771
3772 TARGET
3773 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3774 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3775
3776 START
3777 The starting index of the portion of the color table to be
3778 replaced.
3779
3780 X
3781 Y
3782
3783 The window coordinates of the left corner of the row of pixels to
3784 be copied.
3785
3786 WIDTH
3787 The number of table entries to replace.
3788
3789 `glCopyColorSubTable' is used to respecify a contiguous portion of a
3790 color table previously defined using `glColorTable'. The pixels copied
3791 from the framebuffer replace the portion of the existing table from
3792 indices START to START+X-1 , inclusive. This region may not include any
3793 entries outside the range of the color table, as was originally
3794 specified. It is not an error to specify a subtexture with width of 0,
3795 but such a specification has no effect.
3796
3797 `GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3798 color table.
3799
3800 `GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3801 values.
3802
3803 `GL_INVALID_VALUE' is generated if START+X>WIDTH .
3804
3805 `GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3806 between the execution of `glBegin' and the corresponding execution of
3807 `glEnd'.")
3808
3809 (define-gl-procedures
3810 ((glCopyColorTable
3811 (target GLenum)
3812 (internalformat GLenum)
3813 (x GLint)
3814 (y GLint)
3815 (width GLsizei)
3816 ->
3817 void))
3818 "Copy pixels into a color table.
3819
3820 TARGET
3821 The color table target. Must be `GL_COLOR_TABLE',
3822 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3823 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3824
3825 INTERNALFORMAT
3826 The internal storage format of the texture image. Must be one of
3827 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3828 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3829 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3830 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3831 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3832 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3833 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3834 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3835 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3836 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3837 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3838
3839 X
3840 The x coordinate of the lower-left corner of the pixel rectangle to
3841 be transferred to the color table.
3842
3843 Y
3844 The y coordinate of the lower-left corner of the pixel rectangle to
3845 be transferred to the color table.
3846
3847 WIDTH
3848 The width of the pixel rectangle.
3849
3850 `glCopyColorTable' loads a color table with pixels from the current
3851 `GL_READ_BUFFER' (rather than from main memory, as is the case for
3852 `glColorTable').
3853
3854 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3855 having width WIDTH and height 1 is loaded into the color table. If any
3856 pixels within this region are outside the window that is associated with
3857 the GL context, the values obtained for those pixels are undefined.
3858
3859 The pixels in the rectangle are processed just as if `glReadPixels' were
3860 called, with INTERNALFORMAT set to RGBA, but processing stops after the
3861 final conversion to RGBA.
3862
3863 The four scale parameters and the four bias parameters that are defined
3864 for the table are then used to scale and bias the R, G, B, and A
3865 components of each pixel. The scale and bias parameters are set by
3866 calling `glColorTableParameter'.
3867
3868 Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3869 pixel is then converted to the internal format specified by
3870 INTERNALFORMAT. This conversion simply maps the component values of the
3871 pixel (R, G, B, and A) to the values included in the internal format
3872 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3873 follows:
3874
3875
3876
3877 *Internal Format*
3878 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3879
3880 `GL_ALPHA'
3881 , , , A , ,
3882
3883 `GL_LUMINANCE'
3884 , , , , R ,
3885
3886 `GL_LUMINANCE_ALPHA'
3887 , , , A , R ,
3888
3889 `GL_INTENSITY'
3890 , , , , , R
3891
3892 `GL_RGB'
3893 R , G , B , , ,
3894
3895 `GL_RGBA'
3896 R , G , B , A , ,
3897
3898 Finally, the red, green, blue, alpha, luminance, and/or intensity
3899 components of the resulting pixels are stored in the color table. They
3900 form a one-dimensional table with indices in the range [0,WIDTH-1] .
3901
3902
3903
3904 `GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
3905 values.
3906
3907 `GL_INVALID_VALUE' is generated if WIDTH is less than zero.
3908
3909 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
3910 allowable values.
3911
3912 `GL_TABLE_TOO_LARGE' is generated if the requested color table is too
3913 large to be supported by the implementation.
3914
3915 `GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
3916 between the execution of `glBegin' and the corresponding execution of
3917 `glEnd'.")
3918
3919 (define-gl-procedures
3920 ((glCopyConvolutionFilter1D
3921 (target GLenum)
3922 (internalformat GLenum)
3923 (x GLint)
3924 (y GLint)
3925 (width GLsizei)
3926 ->
3927 void))
3928 "Copy pixels into a one-dimensional convolution filter.
3929
3930 TARGET
3931 Must be `GL_CONVOLUTION_1D'.
3932
3933 INTERNALFORMAT
3934 The internal format of the convolution filter kernel. The allowable
3935 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3936 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3937 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3938 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3939 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3940 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3941 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3942 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3943 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3944 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3945 `GL_RGBA12', or `GL_RGBA16'.
3946
3947 X
3948 Y
3949
3950 The window space coordinates of the lower-left coordinate of the
3951 pixel array to copy.
3952
3953 WIDTH
3954 The width of the pixel array to copy.
3955
3956 `glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
3957 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
3958 main memory, as is the case for `glConvolutionFilter1D').
3959
3960 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
3961 width WIDTH and height 1 is used to define the convolution filter. If
3962 any pixels within this region are outside the window that is associated
3963 with the GL context, the values obtained for those pixels are undefined.
3964
3965 The pixels in the rectangle are processed exactly as if `glReadPixels'
3966 had been called with FORMAT set to RGBA, but the process stops just
3967 before final conversion. The R, G, B, and A components of each pixel are
3968 next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
3969 biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
3970 scale and bias parameters are set by `glConvolutionParameter' using the
3971 `GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
3972 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
3973 of four values that are applied to red, green, blue, and alpha, in that
3974 order.) The R, G, B, and A values are not clamped to [0,1] at any time
3975 during this process.
3976
3977 Each pixel is then converted to the internal format specified by
3978 INTERNALFORMAT. This conversion simply maps the component values of the
3979 pixel (R, G, B, and A) to the values included in the internal format
3980 (red, green, blue, alpha, luminance, and intensity). The mapping is as
3981 follows:
3982
3983
3984
3985 *Internal Format*
3986 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3987
3988 `GL_ALPHA'
3989 , , , A , ,
3990
3991 `GL_LUMINANCE'
3992 , , , , R ,
3993
3994 `GL_LUMINANCE_ALPHA'
3995 , , , A , R ,
3996
3997 `GL_INTENSITY'
3998 , , , , , R
3999
4000 `GL_RGB'
4001 R , G , B , , ,
4002
4003 `GL_RGBA'
4004 R , G , B , A , ,
4005
4006 The red, green, blue, alpha, luminance, and/or intensity components of
4007 the resulting pixels are stored in floating-point rather than integer
4008 format.
4009
4010 Pixel ordering is such that lower x screen coordinates correspond to
4011 lower I filter image coordinates.
4012
4013 Note that after a convolution is performed, the resulting color
4014 components are also scaled by their corresponding
4015 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4016 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4017 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4018 set by `glPixelTransfer'.
4019
4020 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4021
4022 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4023 allowable values.
4024
4025 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4026 than the maximum supported value. This value may be queried with
4027 `glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4028 `GL_MAX_CONVOLUTION_WIDTH'.
4029
4030 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4031 executed between the execution of `glBegin' and the corresponding
4032 execution of `glEnd'.")
4033
4034 (define-gl-procedures
4035 ((glCopyConvolutionFilter2D
4036 (target GLenum)
4037 (internalformat GLenum)
4038 (x GLint)
4039 (y GLint)
4040 (width GLsizei)
4041 (height GLsizei)
4042 ->
4043 void))
4044 "Copy pixels into a two-dimensional convolution filter.
4045
4046 TARGET
4047 Must be `GL_CONVOLUTION_2D'.
4048
4049 INTERNALFORMAT
4050 The internal format of the convolution filter kernel. The allowable
4051 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4052 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4053 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4054 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4055 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4056 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4057 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4058 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4059 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4060 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4061 `GL_RGBA12', or `GL_RGBA16'.
4062
4063 X
4064 Y
4065
4066 The window space coordinates of the lower-left coordinate of the
4067 pixel array to copy.
4068
4069 WIDTH
4070 The width of the pixel array to copy.
4071
4072 HEIGHT
4073 The height of the pixel array to copy.
4074
4075 `glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4076 kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4077 main memory, as is the case for `glConvolutionFilter2D').
4078
4079 The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4080 width WIDTH and height HEIGHT is used to define the convolution filter.
4081 If any pixels within this region are outside the window that is
4082 associated with the GL context, the values obtained for those pixels are
4083 undefined.
4084
4085 The pixels in the rectangle are processed exactly as if `glReadPixels'
4086 had been called with FORMAT set to RGBA, but the process stops just
4087 before final conversion. The R, G, B, and A components of each pixel are
4088 next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4089 biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4090 scale and bias parameters are set by `glConvolutionParameter' using the
4091 `GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4092 and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4093 of four values that are applied to red, green, blue, and alpha, in that
4094 order.) The R, G, B, and A values are not clamped to [0,1] at any time
4095 during this process.
4096
4097 Each pixel is then converted to the internal format specified by
4098 INTERNALFORMAT. This conversion simply maps the component values of the
4099 pixel (R, G, B, and A) to the values included in the internal format
4100 (red, green, blue, alpha, luminance, and intensity). The mapping is as
4101 follows:
4102
4103
4104
4105 *Internal Format*
4106 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4107
4108 `GL_ALPHA'
4109 , , , A , ,
4110
4111 `GL_LUMINANCE'
4112 , , , , R ,
4113
4114 `GL_LUMINANCE_ALPHA'
4115 , , , A , R ,
4116
4117 `GL_INTENSITY'
4118 , , , , , R
4119
4120 `GL_RGB'
4121 R , G , B , , ,
4122
4123 `GL_RGBA'
4124 R , G , B , A , ,
4125
4126 The red, green, blue, alpha, luminance, and/or intensity components of
4127 the resulting pixels are stored in floating-point rather than integer
4128 format.
4129
4130 Pixel ordering is such that lower x screen coordinates correspond to
4131 lower I filter image coordinates, and lower y screen coordinates
4132 correspond to lower J filter image coordinates.
4133
4134 Note that after a convolution is performed, the resulting color
4135 components are also scaled by their corresponding
4136 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4137 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4138 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4139 set by `glPixelTransfer'.
4140
4141 `GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4142
4143 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4144 allowable values.
4145
4146 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4147 than the maximum supported value. This value may be queried with
4148 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4149 `GL_MAX_CONVOLUTION_WIDTH'.
4150
4151 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4152 than the maximum supported value. This value may be queried with
4153 `glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4154 `GL_MAX_CONVOLUTION_HEIGHT'.
4155
4156 `GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4157 executed between the execution of `glBegin' and the corresponding
4158 execution of `glEnd'.")
4159
4160 (define-gl-procedures
4161 ((glCopyPixels
4162 (x GLint)
4163 (y GLint)
4164 (width GLsizei)
4165 (height GLsizei)
4166 (type GLenum)
4167 ->
4168 void))
4169 "Copy pixels in the frame buffer.
4170
4171 X
4172 Y
4173
4174 Specify the window coordinates of the lower left corner of the
4175 rectangular region of pixels to be copied.
4176
4177 WIDTH
4178 HEIGHT
4179
4180 Specify the dimensions of the rectangular region of pixels to be
4181 copied. Both must be nonnegative.
4182
4183 TYPE
4184 Specifies whether color values, depth values, or stencil values are
4185 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4186 `GL_STENCIL' are accepted.
4187
4188 `glCopyPixels' copies a screen-aligned rectangle of pixels from the
4189 specified frame buffer location to a region relative to the current
4190 raster position. Its operation is well defined only if the entire pixel
4191 source region is within the exposed portion of the window. Results of
4192 copies from outside the window, or from regions of the window that are
4193 not exposed, are hardware dependent and undefined.
4194
4195 X and Y specify the window coordinates of the lower left corner of the
4196 rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4197 of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4198 be negative.
4199
4200 Several parameters control the processing of the pixel data while it is
4201 being copied. These parameters are set with three commands:
4202 `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4203 describes the effects on `glCopyPixels' of most, but not all, of the
4204 parameters specified by these three commands.
4205
4206 `glCopyPixels' copies values from each pixel with the lower left-hand
4207 corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4208 to be the I th pixel in the J th row. Pixels are copied in row order
4209 from the lowest to the highest row, left to right in each row.
4210
4211 TYPE specifies whether color, depth, or stencil data is to be copied.
4212 The details of the transfer for each data type are as follows:
4213
4214 `GL_COLOR'
4215 Indices or RGBA colors are read from the buffer currently specified
4216 as the read source buffer (see `glReadBuffer'). If the GL is in
4217 color index mode, each index that is read from this buffer is
4218 converted to a fixed-point format with an unspecified number of
4219 bits to the right of the binary point. Each index is then shifted
4220 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4221 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4222 case, zero bits fill otherwise unspecified bit locations in the
4223 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4224 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4225 Whether the lookup replacement of the index is done or not, the
4226 integer part of the index is then ANDed with 2^B-1 , where B is the
4227 number of bits in a color index buffer.
4228
4229 If the GL is in RGBA mode, the red, green, blue, and alpha
4230 components of each pixel that is read are converted to an internal
4231 floating-point format with unspecified precision. The conversion
4232 maps the largest representable component value to 1.0, and
4233 component value 0 to 0.0. The resulting floating-point color values
4234 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4235 C is RED, GREEN, BLUE, and ALPHA for the respective color
4236 components. The results are clamped to the range [0,1]. If
4237 `GL_MAP_COLOR' is true, each color component is scaled by the size
4238 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4239 that it references in that table. C is R, G, B, or A.
4240
4241 If the `ARB_imaging' extension is supported, the color values may
4242 be additionally processed by color-table lookups, color-matrix
4243 transformations, and convolution filters.
4244
4245 The GL then converts the resulting indices or RGBA colors to
4246 fragments by attaching the current raster position Z coordinate and
4247 texture coordinates to each pixel, then assigning window
4248 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4249 position, and the pixel was the I th pixel in the J th row. These
4250 pixel fragments are then treated just like the fragments generated
4251 by rasterizing points, lines, or polygons. Texture mapping, fog,
4252 and all the fragment operations are applied before the fragments
4253 are written to the frame buffer.
4254
4255 `GL_DEPTH'
4256 Depth values are read from the depth buffer and converted directly
4257 to an internal floating-point format with unspecified precision.
4258 The resulting floating-point depth value is then multiplied by
4259 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4260 clamped to the range [0,1].
4261
4262 The GL then converts the resulting depth components to fragments by
4263 attaching the current raster position color or color index and
4264 texture coordinates to each pixel, then assigning window
4265 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4266 position, and the pixel was the I th pixel in the J th row. These
4267 pixel fragments are then treated just like the fragments generated
4268 by rasterizing points, lines, or polygons. Texture mapping, fog,
4269 and all the fragment operations are applied before the fragments
4270 are written to the frame buffer.
4271
4272 `GL_STENCIL'
4273 Stencil indices are read from the stencil buffer and converted to
4274 an internal fixed-point format with an unspecified number of bits
4275 to the right of the binary point. Each fixed-point index is then
4276 shifted left by `GL_INDEX_SHIFT' bits, and added to
4277 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4278 the right. In either case, zero bits fill otherwise unspecified bit
4279 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4280 replaced with the value that it references in lookup table
4281 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4282 is done or not, the integer part of the index is then ANDed with
4283 2^B-1 , where B is the number of bits in the stencil buffer. The
4284 resulting stencil indices are then written to the stencil buffer
4285 such that the index read from the I th location of the J th row is
4286 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4287 raster position. Only the pixel ownership test, the scissor test,
4288 and the stencil writemask affect these write operations.
4289
4290 The rasterization described thus far assumes pixel zoom factors of 1.0.
4291 If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4292 pixels are converted to fragments as follows. If (X_R,Y_R) is the
4293 current raster position, and a given pixel is in the I th location in
4294 the J th row of the source pixel rectangle, then fragments are generated
4295 for pixels whose centers are in the rectangle with corners at
4296
4297 (X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4298
4299 and
4300
4301 (X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4302
4303 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4304 `GL_ZOOM_Y'.
4305
4306 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4307
4308 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4309
4310 `GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4311 no depth buffer.
4312
4313 `GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4314 no stencil buffer.
4315
4316 `GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4317 between the execution of `glBegin' and the corresponding execution of
4318 `glEnd'.")
4319
4320 (define-gl-procedures
4321 ((glCopyTexImage1D
4322 (target GLenum)
4323 (level GLint)
4324 (internalformat GLenum)
4325 (x GLint)
4326 (y GLint)
4327 (width GLsizei)
4328 (border GLint)
4329 ->
4330 void))
4331 "Copy pixels into a 1D texture image.
4332
4333 TARGET
4334 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4335
4336 LEVEL
4337 Specifies the level-of-detail number. Level 0 is the base image
4338 level. Level N is the Nth mipmap reduction image.
4339
4340 INTERNALFORMAT
4341 Specifies the internal format of the texture. Must be one of the
4342 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4343 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4344 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4345 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4346 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4347 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4348 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4349 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4350 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4351 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4352 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4353 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4354 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4355 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4356 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4357 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4358 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4359 `GL_SRGB8_ALPHA8'.
4360
4361 X
4362 Y
4363
4364 Specify the window coordinates of the left corner of the row of
4365 pixels to be copied.
4366
4367 WIDTH
4368 Specifies the width of the texture image. Must be 0 or
4369 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4370 image is 1.
4371
4372 BORDER
4373 Specifies the width of the border. Must be either 0 or 1.
4374
4375 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4376 from the current `GL_READ_BUFFER'.
4377
4378 The screen-aligned pixel row with left corner at (X,Y) and with a length
4379 of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4380 specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4381 texture array.
4382
4383 The pixels in the row are processed exactly as if `glCopyPixels' had
4384 been called, but the process stops just before final conversion. At this
4385 point all pixel component values are clamped to the range [0,1] and then
4386 converted to the texture's internal format for storage in the texel
4387 array.
4388
4389 Pixel ordering is such that lower X screen coordinates correspond to
4390 lower texture coordinates.
4391
4392 If any of the pixels within the specified row of the current
4393 `GL_READ_BUFFER' are outside the window associated with the current
4394 rendering context, then the values obtained for those pixels are
4395 undefined.
4396
4397 `glCopyTexImage1D' defines a one-dimensional texture image with pixels
4398 from the current `GL_READ_BUFFER'.
4399
4400 When INTERNALFORMAT is one of the sRGB types, the GL does not
4401 automatically convert the source pixels to the sRGB color space. In this
4402 case, the `glPixelMap' function can be used to accomplish the
4403 conversion.
4404
4405 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4406 values.
4407
4408 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4409
4410 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4411 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4412
4413 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4414 value.
4415
4416 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4417 2 + `GL_MAX_TEXTURE_SIZE'.
4418
4419 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4420 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4421 some integer value of N.
4422
4423 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4424
4425 `GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4426 between the execution of `glBegin' and the corresponding execution of
4427 `glEnd'.
4428
4429 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4430 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4431 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4432
4433 (define-gl-procedures
4434 ((glCopyTexImage2D
4435 (target GLenum)
4436 (level GLint)
4437 (internalformat GLenum)
4438 (x GLint)
4439 (y GLint)
4440 (width GLsizei)
4441 (height GLsizei)
4442 (border GLint)
4443 ->
4444 void))
4445 "Copy pixels into a 2D texture image.
4446
4447 TARGET
4448 Specifies the target texture. Must be `GL_TEXTURE_2D',
4449 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4450 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4451 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4452 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4453
4454 LEVEL
4455 Specifies the level-of-detail number. Level 0 is the base image
4456 level. Level N is the Nth mipmap reduction image.
4457
4458 INTERNALFORMAT
4459 Specifies the internal format of the texture. Must be one of the
4460 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4461 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4462 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4463 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4464 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4465 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4466 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4467 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4468 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4469 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4470 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4471 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4472 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4473 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4474 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4475 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4476 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4477 `GL_SRGB8_ALPHA8'.
4478
4479 X
4480 Y
4481
4482 Specify the window coordinates of the lower left corner of the
4483 rectangular region of pixels to be copied.
4484
4485 WIDTH
4486 Specifies the width of the texture image. Must be 0 or
4487 2^N+2\u2061(BORDER,) for some integer N .
4488
4489 HEIGHT
4490 Specifies the height of the texture image. Must be 0 or
4491 2^M+2\u2061(BORDER,) for some integer M .
4492
4493 BORDER
4494 Specifies the width of the border. Must be either 0 or 1.
4495
4496 `glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4497 texture image with pixels from the current `GL_READ_BUFFER'.
4498
4499 The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4500 with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4501 defines the texture array at the mipmap level specified by LEVEL.
4502 INTERNALFORMAT specifies the internal format of the texture array.
4503
4504 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4505 had been called, but the process stops just before final conversion. At
4506 this point all pixel component values are clamped to the range [0,1] and
4507 then converted to the texture's internal format for storage in the texel
4508 array.
4509
4510 Pixel ordering is such that lower X and Y screen coordinates correspond
4511 to lower S and T texture coordinates.
4512
4513 If any of the pixels within the specified rectangle of the current
4514 `GL_READ_BUFFER' are outside the window associated with the current
4515 rendering context, then the values obtained for those pixels are
4516 undefined.
4517
4518 When INTERNALFORMAT is one of the sRGB types, the GL does not
4519 automatically convert the source pixels to the sRGB color space. In this
4520 case, the `glPixelMap' function can be used to accomplish the
4521 conversion.
4522
4523 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4524 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4525 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4526 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4527
4528 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4529
4530 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4531 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4532
4533 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
4534 2 + `GL_MAX_TEXTURE_SIZE'.
4535
4536 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4537 supported and the WIDTH or DEPTH cannot be represented as
4538 2^K+2\u2061(BORDER,) for some integer K .
4539
4540 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4541
4542 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4543 format.
4544
4545 `GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4546 between the execution of `glBegin' and the corresponding execution of
4547 `glEnd'.
4548
4549 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4550 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4551 `GL_DEPTH_COMPONENT32' and there is no depth buffer.")
4552
4553 (define-gl-procedures
4554 ((glCopyTexSubImage1D
4555 (target GLenum)
4556 (level GLint)
4557 (xoffset GLint)
4558 (x GLint)
4559 (y GLint)
4560 (width GLsizei)
4561 ->
4562 void))
4563 "Copy a one-dimensional texture subimage.
4564
4565 TARGET
4566 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4567
4568 LEVEL
4569 Specifies the level-of-detail number. Level 0 is the base image
4570 level. Level N is the Nth mipmap reduction image.
4571
4572 XOFFSET
4573 Specifies the texel offset within the texture array.
4574
4575 X
4576 Y
4577
4578 Specify the window coordinates of the left corner of the row of
4579 pixels to be copied.
4580
4581 WIDTH
4582 Specifies the width of the texture subimage.
4583
4584 `glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4585 image with pixels from the current `GL_READ_BUFFER' (rather than from
4586 main memory, as is the case for `glTexSubImage1D').
4587
4588 The screen-aligned pixel row with left corner at (X,\\ Y), and with
4589 length WIDTH replaces the portion of the texture array with x indices
4590 XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4591 texture array may not include any texels outside the texture array as it
4592 was originally specified.
4593
4594 The pixels in the row are processed exactly as if `glCopyPixels' had
4595 been called, but the process stops just before final conversion. At this
4596 point, all pixel component values are clamped to the range [0,1] and
4597 then converted to the texture's internal format for storage in the texel
4598 array.
4599
4600 It is not an error to specify a subtexture with zero width, but such a
4601 specification has no effect. If any of the pixels within the specified
4602 row of the current `GL_READ_BUFFER' are outside the read window
4603 associated with the current rendering context, then the values obtained
4604 for those pixels are undefined.
4605
4606 No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4607 the specified texture array or to texel values outside the specified
4608 subregion.
4609
4610 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4611
4612 `GL_INVALID_OPERATION' is generated if the texture array has not been
4613 defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4614
4615 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4616
4617 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4618 the returned value of `GL_MAX_TEXTURE_SIZE'.
4619
4620 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4621 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4622 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4623 includes twice the border width.")
4624
4625 (define-gl-procedures
4626 ((glCopyTexSubImage2D
4627 (target GLenum)
4628 (level GLint)
4629 (xoffset GLint)
4630 (yoffset GLint)
4631 (x GLint)
4632 (y GLint)
4633 (width GLsizei)
4634 (height GLsizei)
4635 ->
4636 void))
4637 "Copy a two-dimensional texture subimage.
4638
4639 TARGET
4640 Specifies the target texture. Must be `GL_TEXTURE_2D',
4641 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4642 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4643 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4644 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4645
4646 LEVEL
4647 Specifies the level-of-detail number. Level 0 is the base image
4648 level. Level N is the Nth mipmap reduction image.
4649
4650 XOFFSET
4651 Specifies a texel offset in the x direction within the texture
4652 array.
4653
4654 YOFFSET
4655 Specifies a texel offset in the y direction within the texture
4656 array.
4657
4658 X
4659 Y
4660
4661 Specify the window coordinates of the lower left corner of the
4662 rectangular region of pixels to be copied.
4663
4664 WIDTH
4665 Specifies the width of the texture subimage.
4666
4667 HEIGHT
4668 Specifies the height of the texture subimage.
4669
4670 `glCopyTexSubImage2D' replaces a rectangular portion of a
4671 two-dimensional texture image or cube-map texture image with pixels from
4672 the current `GL_READ_BUFFER' (rather than from main memory, as is the
4673 case for `glTexSubImage2D').
4674
4675 The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4676 with width WIDTH and height HEIGHT replaces the portion of the texture
4677 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4678 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4679 level specified by LEVEL.
4680
4681 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4682 had been called, but the process stops just before final conversion. At
4683 this point, all pixel component values are clamped to the range [0,1]
4684 and then converted to the texture's internal format for storage in the
4685 texel array.
4686
4687 The destination rectangle in the texture array may not include any
4688 texels outside the texture array as it was originally specified. It is
4689 not an error to specify a subtexture with zero width or height, but such
4690 a specification has no effect.
4691
4692 If any of the pixels within the specified rectangle of the current
4693 `GL_READ_BUFFER' are outside the read window associated with the current
4694 rendering context, then the values obtained for those pixels are
4695 undefined.
4696
4697 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4698 parameters of the specified texture array or to texel values outside the
4699 specified subregion.
4700
4701 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4702 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4703 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4704 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4705
4706 `GL_INVALID_OPERATION' is generated if the texture array has not been
4707 defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4708
4709 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4710
4711 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4712 the returned value of `GL_MAX_TEXTURE_SIZE'.
4713
4714 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4715 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4716 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4717 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4718 H include twice the border width.
4719
4720 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4721 between the execution of `glBegin' and the corresponding execution of
4722 `glEnd'.")
4723
4724 (define-gl-procedures
4725 ((glCopyTexSubImage3D
4726 (target GLenum)
4727 (level GLint)
4728 (xoffset GLint)
4729 (yoffset GLint)
4730 (zoffset GLint)
4731 (x GLint)
4732 (y GLint)
4733 (width GLsizei)
4734 (height GLsizei)
4735 ->
4736 void))
4737 "Copy a three-dimensional texture subimage.
4738
4739 TARGET
4740 Specifies the target texture. Must be `GL_TEXTURE_3D'
4741
4742 LEVEL
4743 Specifies the level-of-detail number. Level 0 is the base image
4744 level. Level N is the Nth mipmap reduction image.
4745
4746 XOFFSET
4747 Specifies a texel offset in the x direction within the texture
4748 array.
4749
4750 YOFFSET
4751 Specifies a texel offset in the y direction within the texture
4752 array.
4753
4754 ZOFFSET
4755 Specifies a texel offset in the z direction within the texture
4756 array.
4757
4758 X
4759 Y
4760
4761 Specify the window coordinates of the lower left corner of the
4762 rectangular region of pixels to be copied.
4763
4764 WIDTH
4765 Specifies the width of the texture subimage.
4766
4767 HEIGHT
4768 Specifies the height of the texture subimage.
4769
4770 `glCopyTexSubImage3D' replaces a rectangular portion of a
4771 three-dimensional texture image with pixels from the current
4772 `GL_READ_BUFFER' (rather than from main memory, as is the case for
4773 `glTexSubImage3D').
4774
4775 The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4776 with width WIDTH and height HEIGHT replaces the portion of the texture
4777 array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4778 indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4779 and at the mipmap level specified by LEVEL.
4780
4781 The pixels in the rectangle are processed exactly as if `glCopyPixels'
4782 had been called, but the process stops just before final conversion. At
4783 this point, all pixel component values are clamped to the range [0,1]
4784 and then converted to the texture's internal format for storage in the
4785 texel array.
4786
4787 The destination rectangle in the texture array may not include any
4788 texels outside the texture array as it was originally specified. It is
4789 not an error to specify a subtexture with zero width or height, but such
4790 a specification has no effect.
4791
4792 If any of the pixels within the specified rectangle of the current
4793 `GL_READ_BUFFER' are outside the read window associated with the current
4794 rendering context, then the values obtained for those pixels are
4795 undefined.
4796
4797 No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4798 parameters of the specified texture array or to texel values outside the
4799 specified subregion.
4800
4801 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4802
4803 `GL_INVALID_OPERATION' is generated if the texture array has not been
4804 defined by a previous `glTexImage3D' operation.
4805
4806 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4807
4808 `GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4809 the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4810
4811 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4812 , YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4813 (ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4814 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4815 `GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4816 , and D include twice the border width.
4817
4818 `GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4819 between the execution of `glBegin' and the corresponding execution of
4820 `glEnd'.")
4821
4822 (define-gl-procedures
4823 ((glCreateProgram -> GLuint))
4824 "Creates a program object.
4825
4826 `glCreateProgram' creates an empty program object and returns a non-zero
4827 value by which it can be referenced. A program object is an object to
4828 which shader objects can be attached. This provides a mechanism to
4829 specify the shader objects that will be linked to create a program. It
4830 also provides a means for checking the compatibility of the shaders that
4831 will be used to create a program (for instance, checking the
4832 compatibility between a vertex shader and a fragment shader). When no
4833 longer needed as part of a program object, shader objects can be
4834 detached.
4835
4836 One or more executables are created in a program object by successfully
4837 attaching shader objects to it with `glAttachShader', successfully
4838 compiling the shader objects with `glCompileShader', and successfully
4839 linking the program object with `glLinkProgram'. These executables are
4840 made part of current state when `glUseProgram' is called. Program
4841 objects can be deleted by calling `glDeleteProgram'. The memory
4842 associated with the program object will be deleted when it is no longer
4843 part of current rendering state for any context.
4844
4845 This function returns 0 if an error occurs creating the program object.
4846
4847 `GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
4848 between the execution of `glBegin' and the corresponding execution of
4849 `glEnd'.")
4850
4851 (define-gl-procedures
4852 ((glCreateShader (shaderType GLenum) -> GLuint))
4853 "Creates a shader object.
4854
4855 SHADERTYPE
4856 Specifies the type of shader to be created. Must be either
4857 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
4858
4859 `glCreateShader' creates an empty shader object and returns a non-zero
4860 value by which it can be referenced. A shader object is used to maintain
4861 the source code strings that define a shader. SHADERTYPE indicates the
4862 type of shader to be created. Two types of shaders are supported. A
4863 shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
4864 the programmable vertex processor and replace the fixed functionality
4865 vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
4866 shader that is intended to run on the programmable fragment processor
4867 and replace the fixed functionality fragment processing in OpenGL.
4868
4869 When created, a shader object's `GL_SHADER_TYPE' parameter is set to
4870 either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
4871 value of SHADERTYPE.
4872
4873 This function returns 0 if an error occurs creating the shader object.
4874
4875 `GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
4876
4877 `GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
4878 between the execution of `glBegin' and the corresponding execution of
4879 `glEnd'.")
4880
4881 (define-gl-procedures
4882 ((glCullFace (mode GLenum) -> void))
4883 "Specify whether front- or back-facing facets can be culled.
4884
4885 MODE
4886 Specifies whether front- or back-facing facets are candidates for
4887 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
4888 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
4889
4890 `glCullFace' specifies whether front- or back-facing facets are culled
4891 (as specified by MODE) when facet culling is enabled. Facet culling is
4892 initially disabled. To enable and disable facet culling, call the
4893 `glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
4894 Facets include triangles, quadrilaterals, polygons, and rectangles.
4895
4896 `glFrontFace' specifies which of the clockwise and counterclockwise
4897 facets are front-facing and back-facing. See `glFrontFace'.
4898
4899 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
4900
4901 `GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
4902 the execution of `glBegin' and the corresponding execution of `glEnd'.")
4903
4904 (define-gl-procedures
4905 ((glDeleteBuffers
4906 (n GLsizei)
4907 (buffers const-GLuint-*)
4908 ->
4909 void))
4910 "Delete named buffer objects.
4911
4912 N
4913 Specifies the number of buffer objects to be deleted.
4914
4915 BUFFERS
4916 Specifies an array of buffer objects to be deleted.
4917
4918 `glDeleteBuffers' deletes N buffer objects named by the elements of the
4919 array BUFFERS. After a buffer object is deleted, it has no contents, and
4920 its name is free for reuse (for example by `glGenBuffers'). If a buffer
4921 object that is currently bound is deleted, the binding reverts to 0 (the
4922 absence of any buffer object, which reverts to client memory usage).
4923
4924 `glDeleteBuffers' silently ignores 0's and names that do not correspond
4925 to existing buffer objects.
4926
4927 `GL_INVALID_VALUE' is generated if N is negative.
4928
4929 `GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
4930 between the execution of `glBegin' and the corresponding execution of
4931 `glEnd'.")
4932
4933 (define-gl-procedures
4934 ((glDeleteLists
4935 (list GLuint)
4936 (range GLsizei)
4937 ->
4938 void))
4939 "Delete a contiguous group of display lists.
4940
4941 LIST
4942 Specifies the integer name of the first display list to delete.
4943
4944 RANGE
4945 Specifies the number of display lists to delete.
4946
4947 `glDeleteLists' causes a contiguous group of display lists to be
4948 deleted. LIST is the name of the first display list to be deleted, and
4949 RANGE is the number of display lists to delete. All display lists D with
4950 LIST<=D<=LIST+RANGE-1 are deleted.
4951
4952 All storage locations allocated to the specified display lists are
4953 freed, and the names are available for reuse at a later time. Names
4954 within the range that do not have an associated display list are
4955 ignored. If RANGE is 0, nothing happens.
4956
4957 `GL_INVALID_VALUE' is generated if RANGE is negative.
4958
4959 `GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
4960 between the execution of `glBegin' and the corresponding execution of
4961 `glEnd'.")
4962
4963 (define-gl-procedures
4964 ((glDeleteProgram (program GLuint) -> void))
4965 "Deletes a program object.
4966
4967 PROGRAM
4968 Specifies the program object to be deleted.
4969
4970 `glDeleteProgram' frees the memory and invalidates the name associated
4971 with the program object specified by PROGRAM. This command effectively
4972 undoes the effects of a call to `glCreateProgram'.
4973
4974 If a program object is in use as part of current rendering state, it
4975 will be flagged for deletion, but it will not be deleted until it is no
4976 longer part of current state for any rendering context. If a program
4977 object to be deleted has shader objects attached to it, those shader
4978 objects will be automatically detached but not deleted unless they have
4979 already been flagged for deletion by a previous call to
4980 `glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
4981
4982 To determine whether a program object has been flagged for deletion,
4983 call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
4984
4985 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
4986 OpenGL.
4987
4988 `GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
4989 between the execution of `glBegin' and the corresponding execution of
4990 `glEnd'.")
4991
4992 (define-gl-procedures
4993 ((glDeleteQueries
4994 (n GLsizei)
4995 (ids const-GLuint-*)
4996 ->
4997 void))
4998 "Delete named query objects.
4999
5000 N
5001 Specifies the number of query objects to be deleted.
5002
5003 IDS
5004 Specifies an array of query objects to be deleted.
5005
5006 `glDeleteQueries' deletes N query objects named by the elements of the
5007 array IDS. After a query object is deleted, it has no contents, and its
5008 name is free for reuse (for example by `glGenQueries').
5009
5010 `glDeleteQueries' silently ignores 0's and names that do not correspond
5011 to existing query objects.
5012
5013 `GL_INVALID_VALUE' is generated if N is negative.
5014
5015 `GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5016 between the execution of `glBegin' and the corresponding execution of
5017 `glEnd'.")
5018
5019 (define-gl-procedures
5020 ((glDeleteShader (shader GLuint) -> void))
5021 "Deletes a shader object.
5022
5023 SHADER
5024 Specifies the shader object to be deleted.
5025
5026 `glDeleteShader' frees the memory and invalidates the name associated
5027 with the shader object specified by SHADER. This command effectively
5028 undoes the effects of a call to `glCreateShader'.
5029
5030 If a shader object to be deleted is attached to a program object, it
5031 will be flagged for deletion, but it will not be deleted until it is no
5032 longer attached to any program object, for any rendering context (i.e.,
5033 it must be detached from wherever it was attached before it will be
5034 deleted). A value of 0 for SHADER will be silently ignored.
5035
5036 To determine whether an object has been flagged for deletion, call
5037 `glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5038
5039 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5040 OpenGL.
5041
5042 `GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5043 between the execution of `glBegin' and the corresponding execution of
5044 `glEnd'.")
5045
5046 (define-gl-procedures
5047 ((glDeleteTextures
5048 (n GLsizei)
5049 (textures const-GLuint-*)
5050 ->
5051 void))
5052 "Delete named textures.
5053
5054 N
5055 Specifies the number of textures to be deleted.
5056
5057 TEXTURES
5058 Specifies an array of textures to be deleted.
5059
5060 `glDeleteTextures' deletes N textures named by the elements of the array
5061 TEXTURES. After a texture is deleted, it has no contents or
5062 dimensionality, and its name is free for reuse (for example by
5063 `glGenTextures'). If a texture that is currently bound is deleted, the
5064 binding reverts to 0 (the default texture).
5065
5066 `glDeleteTextures' silently ignores 0's and names that do not correspond
5067 to existing textures.
5068
5069 `GL_INVALID_VALUE' is generated if N is negative.
5070
5071 `GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5072 between the execution of `glBegin' and the corresponding execution of
5073 `glEnd'.")
5074
5075 (define-gl-procedures
5076 ((glDepthFunc (func GLenum) -> void))
5077 "Specify the value used for depth buffer comparisons.
5078
5079 FUNC
5080 Specifies the depth comparison function. Symbolic constants
5081 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5082 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5083 initial value is `GL_LESS'.
5084
5085 `glDepthFunc' specifies the function used to compare each incoming pixel
5086 depth value with the depth value present in the depth buffer. The
5087 comparison is performed only if depth testing is enabled. (See
5088 `glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5089
5090 FUNC specifies the conditions under which the pixel will be drawn. The
5091 comparison functions are as follows:
5092
5093 `GL_NEVER'
5094 Never passes.
5095
5096 `GL_LESS'
5097 Passes if the incoming depth value is less than the stored depth
5098 value.
5099
5100 `GL_EQUAL'
5101 Passes if the incoming depth value is equal to the stored depth
5102 value.
5103
5104 `GL_LEQUAL'
5105 Passes if the incoming depth value is less than or equal to the
5106 stored depth value.
5107
5108 `GL_GREATER'
5109 Passes if the incoming depth value is greater than the stored depth
5110 value.
5111
5112 `GL_NOTEQUAL'
5113 Passes if the incoming depth value is not equal to the stored depth
5114 value.
5115
5116 `GL_GEQUAL'
5117 Passes if the incoming depth value is greater than or equal to the
5118 stored depth value.
5119
5120 `GL_ALWAYS'
5121 Always passes.
5122
5123 The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5124 disabled. If depth testing is disabled or if no depth buffer exists, it
5125 is as if the depth test always passes.
5126
5127 `GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5128
5129 `GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5130 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5131
5132 (define-gl-procedures
5133 ((glDepthMask (flag GLboolean) -> void))
5134 "Enable or disable writing into the depth buffer.
5135
5136 FLAG
5137 Specifies whether the depth buffer is enabled for writing. If FLAG
5138 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5139 enabled. Initially, depth buffer writing is enabled.
5140
5141 `glDepthMask' specifies whether the depth buffer is enabled for writing.
5142 If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5143 is enabled. Initially, depth buffer writing is enabled.
5144
5145 `GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5146 the execution of `glBegin' and the corresponding execution of `glEnd'.")
5147
5148 (define-gl-procedures
5149 ((glDepthRange
5150 (nearVal GLclampd)
5151 (farVal GLclampd)
5152 ->
5153 void))
5154 "Specify mapping of depth values from normalized device coordinates to
5155 window coordinates.
5156
5157 NEARVAL
5158 Specifies the mapping of the near clipping plane to window
5159 coordinates. The initial value is 0.
5160
5161 FARVAL
5162 Specifies the mapping of the far clipping plane to window
5163 coordinates. The initial value is 1.
5164
5165 After clipping and division by W, depth coordinates range from -1 to 1,
5166 corresponding to the near and far clipping planes. `glDepthRange'
5167 specifies a linear mapping of the normalized depth coordinates in this
5168 range to window depth coordinates. Regardless of the actual depth buffer
5169 implementation, window coordinate depth values are treated as though
5170 they range from 0 through 1 (like color components). Thus, the values
5171 accepted by `glDepthRange' are both clamped to this range before they
5172 are accepted.
5173
5174 The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5175 With this mapping, the depth buffer range is fully utilized.
5176
5177 `GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5178 between the execution of `glBegin' and the corresponding execution of
5179 `glEnd'.")
5180
5181 (define-gl-procedures
5182 ((glDetachShader
5183 (program GLuint)
5184 (shader GLuint)
5185 ->
5186 void))
5187 "Detaches a shader object from a program object to which it is attached.
5188
5189 PROGRAM
5190 Specifies the program object from which to detach the shader
5191 object.
5192
5193 SHADER
5194 Specifies the shader object to be detached.
5195
5196 `glDetachShader' detaches the shader object specified by SHADER from the
5197 program object specified by PROGRAM. This command can be used to undo
5198 the effect of the command `glAttachShader'.
5199
5200 If SHADER has already been flagged for deletion by a call to
5201 `glDeleteShader' and it is not attached to any other program object, it
5202 will be deleted after it has been detached.
5203
5204 `GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5205 that was not generated by OpenGL.
5206
5207 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5208
5209 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5210
5211 `GL_INVALID_OPERATION' is generated if SHADER is not attached to
5212 PROGRAM.
5213
5214 `GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5215 between the execution of `glBegin' and the corresponding execution of
5216 `glEnd'.")
5217
5218 (define-gl-procedures
5219 ((glDrawArrays
5220 (mode GLenum)
5221 (first GLint)
5222 (count GLsizei)
5223 ->
5224 void))
5225 "Render primitives from array data.
5226
5227 MODE
5228 Specifies what kind of primitives to render. Symbolic constants
5229 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5230 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5231 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5232
5233 FIRST
5234 Specifies the starting index in the enabled arrays.
5235
5236 COUNT
5237 Specifies the number of indices to be rendered.
5238
5239 `glDrawArrays' specifies multiple geometric primitives with very few
5240 subroutine calls. Instead of calling a GL procedure to pass each
5241 individual vertex, normal, texture coordinate, edge flag, or color, you
5242 can prespecify separate arrays of vertices, normals, and colors and use
5243 them to construct a sequence of primitives with a single call to
5244 `glDrawArrays'.
5245
5246 When `glDrawArrays' is called, it uses COUNT sequential elements from
5247 each enabled array to construct a sequence of geometric primitives,
5248 beginning with element FIRST. MODE specifies what kind of primitives are
5249 constructed and how the array elements construct those primitives. If
5250 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5251
5252 Vertex attributes that are modified by `glDrawArrays' have an
5253 unspecified value after `glDrawArrays' returns. For example, if
5254 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5255 after `glDrawArrays' executes. Attributes that aren't modified remain
5256 well defined.
5257
5258 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5259
5260 `GL_INVALID_VALUE' is generated if COUNT is negative.
5261
5262 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5263 bound to an enabled array and the buffer object's data store is
5264 currently mapped.
5265
5266 `GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5267 between the execution of `glBegin' and the corresponding `glEnd'.")
5268
5269 (define-gl-procedures
5270 ((glDrawBuffers
5271 (n GLsizei)
5272 (bufs const-GLenum-*)
5273 ->
5274 void))
5275 "Specifies a list of color buffers to be drawn into.
5276
5277 N
5278 Specifies the number of buffers in BUFS.
5279
5280 BUFS
5281 Points to an array of symbolic constants specifying the buffers
5282 into which fragment colors or data values will be written.
5283
5284 `glDrawBuffers' defines an array of buffers into which fragment color
5285 values or fragment data will be written. If no fragment shader is
5286 active, rendering operations will generate only one fragment color per
5287 fragment and it will be written into each of the buffers specified by
5288 BUFS. If a fragment shader is active and it writes a value to the output
5289 variable `gl_FragColor', then that value will be written into each of
5290 the buffers specified by BUFS. If a fragment shader is active and it
5291 writes a value to one or more elements of the output array variable
5292 `gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5293 into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5294 will be written into the second buffer specified by BUFS, and so on up
5295 to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5296 beyond is implicitly set to be `GL_NONE'.
5297
5298 The symbolic constants contained in BUFS may be any of the following:
5299
5300 `GL_NONE'
5301 The fragment color/data value is not written into any color buffer.
5302
5303 `GL_FRONT_LEFT'
5304 The fragment color/data value is written into the front left color
5305 buffer.
5306
5307 `GL_FRONT_RIGHT'
5308 The fragment color/data value is written into the front right color
5309 buffer.
5310
5311 `GL_BACK_LEFT'
5312 The fragment color/data value is written into the back left color
5313 buffer.
5314
5315 `GL_BACK_RIGHT'
5316 The fragment color/data value is written into the back right color
5317 buffer.
5318
5319 `GL_AUXi'
5320 The fragment color/data value is written into auxiliary buffer `i'.
5321
5322 Except for `GL_NONE', the preceding symbolic constants may not appear
5323 more than once in BUFS. The maximum number of draw buffers supported is
5324 implementation dependent and can be queried by calling `glGet' with the
5325 argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5326 queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5327
5328 `GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5329 accepted value.
5330
5331 `GL_INVALID_ENUM' is generated if N is less than 0.
5332
5333 `GL_INVALID_OPERATION' is generated if a symbolic constant other than
5334 `GL_NONE' appears more than once in BUFS.
5335
5336 `GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5337 than `GL_NONE' ) indicates a color buffer that does not exist in the
5338 current GL context.
5339
5340 `GL_INVALID_VALUE' is generated if N is greater than
5341 `GL_MAX_DRAW_BUFFERS'.
5342
5343 `GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5344 between the execution of `glBegin' and the corresponding execution of
5345 `glEnd'.")
5346
5347 (define-gl-procedures
5348 ((glDrawBuffer (mode GLenum) -> void))
5349 "Specify which color buffers are to be drawn into.
5350
5351 MODE
5352 Specifies up to four color buffers to be drawn into. Symbolic
5353 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5354 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5355 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5356 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5357 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5358 number of available aux buffers.) The initial value is `GL_FRONT'
5359 for single-buffered contexts, and `GL_BACK' for double-buffered
5360 contexts.
5361
5362 When colors are written to the frame buffer, they are written into the
5363 color buffers specified by `glDrawBuffer'. The specifications are as
5364 follows:
5365
5366 `GL_NONE'
5367 No color buffers are written.
5368
5369 `GL_FRONT_LEFT'
5370 Only the front left color buffer is written.
5371
5372 `GL_FRONT_RIGHT'
5373 Only the front right color buffer is written.
5374
5375 `GL_BACK_LEFT'
5376 Only the back left color buffer is written.
5377
5378 `GL_BACK_RIGHT'
5379 Only the back right color buffer is written.
5380
5381 `GL_FRONT'
5382 Only the front left and front right color buffers are written. If
5383 there is no front right color buffer, only the front left color
5384 buffer is written.
5385
5386 `GL_BACK'
5387 Only the back left and back right color buffers are written. If
5388 there is no back right color buffer, only the back left color
5389 buffer is written.
5390
5391 `GL_LEFT'
5392 Only the front left and back left color buffers are written. If
5393 there is no back left color buffer, only the front left color
5394 buffer is written.
5395
5396 `GL_RIGHT'
5397 Only the front right and back right color buffers are written. If
5398 there is no back right color buffer, only the front right color
5399 buffer is written.
5400
5401 `GL_FRONT_AND_BACK'
5402 All the front and back color buffers (front left, front right, back
5403 left, back right) are written. If there are no back color buffers,
5404 only the front left and front right color buffers are written. If
5405 there are no right color buffers, only the front left and back left
5406 color buffers are written. If there are no right or back color
5407 buffers, only the front left color buffer is written.
5408
5409 `GL_AUX'I
5410 Only auxiliary color buffer I is written.
5411
5412 If more than one color buffer is selected for drawing, then blending or
5413 logical operations are computed and applied independently for each color
5414 buffer and can produce different results in each buffer.
5415
5416 Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5417 include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5418 include only FRONT buffers, and double-buffered contexts include both
5419 FRONT and BACK buffers. The context is selected at GL initialization.
5420
5421 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5422
5423 `GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5424 MODE exists.
5425
5426 `GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5427 between the execution of `glBegin' and the corresponding execution of
5428 `glEnd'.")
5429
5430 (define-gl-procedures
5431 ((glDrawElements
5432 (mode GLenum)
5433 (count GLsizei)
5434 (type GLenum)
5435 (indices const-GLvoid-*)
5436 ->
5437 void))
5438 "Render primitives from array data.
5439
5440 MODE
5441 Specifies what kind of primitives to render. Symbolic constants
5442 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5443 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5444 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5445
5446 COUNT
5447 Specifies the number of elements to be rendered.
5448
5449 TYPE
5450 Specifies the type of the values in INDICES. Must be one of
5451 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5452
5453 INDICES
5454 Specifies a pointer to the location where the indices are stored.
5455
5456 `glDrawElements' specifies multiple geometric primitives with very few
5457 subroutine calls. Instead of calling a GL function to pass each
5458 individual vertex, normal, texture coordinate, edge flag, or color, you
5459 can prespecify separate arrays of vertices, normals, and so on, and use
5460 them to construct a sequence of primitives with a single call to
5461 `glDrawElements'.
5462
5463 When `glDrawElements' is called, it uses COUNT sequential elements from
5464 an enabled array, starting at INDICES to construct a sequence of
5465 geometric primitives. MODE specifies what kind of primitives are
5466 constructed and how the array elements construct these primitives. If
5467 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5468 not enabled, no geometric primitives are constructed.
5469
5470 Vertex attributes that are modified by `glDrawElements' have an
5471 unspecified value after `glDrawElements' returns. For example, if
5472 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5473 after `glDrawElements' executes. Attributes that aren't modified
5474 maintain their previous values.
5475
5476 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5477
5478 `GL_INVALID_VALUE' is generated if COUNT is negative.
5479
5480 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5481 bound to an enabled array or the element array and the buffer object's
5482 data store is currently mapped.
5483
5484 `GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5485 between the execution of `glBegin' and the corresponding `glEnd'.")
5486
5487 (define-gl-procedures
5488 ((glDrawPixels
5489 (width GLsizei)
5490 (height GLsizei)
5491 (format GLenum)
5492 (type GLenum)
5493 (data const-GLvoid-*)
5494 ->
5495 void))
5496 "Write a block of pixels to the frame buffer.
5497
5498 WIDTH
5499 HEIGHT
5500
5501 Specify the dimensions of the pixel rectangle to be written into
5502 the frame buffer.
5503
5504 FORMAT
5505 Specifies the format of the pixel data. Symbolic constants
5506 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5507 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5508 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5509 accepted.
5510
5511 TYPE
5512 Specifies the data type for DATA. Symbolic constants
5513 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5514 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5515 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5516 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5517 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5518 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5519 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5520 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5521 are accepted.
5522
5523 DATA
5524 Specifies a pointer to the pixel data.
5525
5526 `glDrawPixels' reads pixel data from memory and writes it into the frame
5527 buffer relative to the current raster position, provided that the raster
5528 position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5529 raster position; use `glGet' with argument
5530 `GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5531 position is valid, and `glGet' with argument
5532 `GL_CURRENT_RASTER_POSITION' to query the raster position.
5533
5534 Several parameters define the encoding of pixel data in memory and
5535 control the processing of the pixel data before it is placed in the
5536 frame buffer. These parameters are set with four commands:
5537 `glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5538 reference page describes the effects on `glDrawPixels' of many, but not
5539 all, of the parameters specified by these four commands.
5540
5541 Data is read from DATA as a sequence of signed or unsigned bytes, signed
5542 or unsigned shorts, signed or unsigned integers, or single-precision
5543 floating-point values, depending on TYPE. When TYPE is one of
5544 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5545 `GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5546 integers, or floating-point values is interpreted as one color or depth
5547 component, or one index, depending on FORMAT. When TYPE is one of
5548 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5549 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5550 `GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5551 unsigned value is interpreted as containing all the components for a
5552 single pixel, with the color components arranged according to FORMAT.
5553 When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5554 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5555 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5556 `GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5557 containing all color components, specified by FORMAT, for a single pixel
5558 in a reversed order. Indices are always treated individually. Color
5559 components are treated as groups of one, two, three, or four values,
5560 again based on FORMAT. Both individual indices and groups of components
5561 are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5562 unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5563 `GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5564 with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5565 `glPixelStore').
5566
5567 WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5568 default, these pixels are taken from adjacent memory locations, except
5569 that after all WIDTH pixels are read, the read pointer is advanced to
5570 the next four-byte boundary. The four-byte row alignment is specified by
5571 `glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5572 one, two, four, or eight bytes. Other pixel store parameters specify
5573 different read pointer advancements, both before the first pixel is read
5574 and after all WIDTH pixels are read. See the `glPixelStore' reference
5575 page for details on these options.
5576
5577 If a non-zero named buffer object is bound to the
5578 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5579 pixels is specified, DATA is treated as a byte offset into the buffer
5580 object's data store.
5581
5582 The WIDTH×HEIGHT pixels that are read from memory are each operated on
5583 in the same way, based on the values of several parameters specified by
5584 `glPixelTransfer' and `glPixelMap'. The details of these operations, as
5585 well as the target buffer into which the pixels are drawn, are specific
5586 to the format of the pixels, as specified by FORMAT. FORMAT can assume
5587 one of 13 symbolic values:
5588
5589 `GL_COLOR_INDEX'
5590 Each pixel is a single value, a color index. It is converted to
5591 fixed-point format, with an unspecified number of bits to the right
5592 of the binary point, regardless of the memory data type.
5593 Floating-point values convert to true fixed-point values. Signed
5594 and unsigned integer data is converted with all fraction bits set
5595 to 0. Bitmap data convert to either 0 or 1.
5596
5597 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5598 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5599 negative, the shift is to the right. In either case, zero bits fill
5600 otherwise unspecified bit locations in the result.
5601
5602 If the GL is in RGBA mode, the resulting index is converted to an
5603 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5604 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5605 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5606 if `GL_MAP_COLOR' is true, the index is replaced with the value
5607 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5608 the lookup replacement of the index is done or not, the integer
5609 part of the index is then ANDed with 2^B-1 , where B is the number
5610 of bits in a color index buffer.
5611
5612 The GL then converts the resulting indices or RGBA colors to
5613 fragments by attaching the current raster position Z coordinate and
5614 texture coordinates to each pixel, then assigning X and Y window
5615 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5616 Y_N=Y_R+⌊N/WIDTH,⌋
5617
5618 where (X_R,Y_R) is the current raster position. These pixel
5619 fragments are then treated just like the fragments generated by
5620 rasterizing points, lines, or polygons. Texture mapping, fog, and
5621 all the fragment operations are applied before the fragments are
5622 written to the frame buffer.
5623
5624 `GL_STENCIL_INDEX'
5625 Each pixel is a single value, a stencil index. It is converted to
5626 fixed-point format, with an unspecified number of bits to the right
5627 of the binary point, regardless of the memory data type.
5628 Floating-point values convert to true fixed-point values. Signed
5629 and unsigned integer data is converted with all fraction bits set
5630 to 0. Bitmap data convert to either 0 or 1.
5631
5632 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5633 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5634 negative, the shift is to the right. In either case, zero bits fill
5635 otherwise unspecified bit locations in the result. If
5636 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5637 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5638 lookup replacement of the index is done or not, the integer part of
5639 the index is then ANDed with 2^B-1 , where B is the number of bits
5640 in the stencil buffer. The resulting stencil indices are then
5641 written to the stencil buffer such that the N th index is written
5642 to location
5643
5644 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5645
5646 where (X_R,Y_R) is the current raster position. Only the pixel
5647 ownership test, the scissor test, and the stencil writemask affect
5648 these write operations.
5649
5650 `GL_DEPTH_COMPONENT'
5651 Each pixel is a single-depth component. Floating-point data is
5652 converted directly to an internal floating-point format with
5653 unspecified precision. Signed integer data is mapped linearly to
5654 the internal floating-point format such that the most positive
5655 representable integer value maps to 1.0, and the most negative
5656 representable value maps to -1.0 . Unsigned integer data is mapped
5657 similarly: the largest integer value maps to 1.0, and 0 maps to
5658 0.0. The resulting floating-point depth value is then multiplied by
5659 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5660 clamped to the range [0,1] .
5661
5662 The GL then converts the resulting depth components to fragments by
5663 attaching the current raster position color or color index and
5664 texture coordinates to each pixel, then assigning X and Y window
5665 coordinates to the N th fragment such that
5666
5667 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5668
5669 where (X_R,Y_R) is the current raster position. These pixel
5670 fragments are then treated just like the fragments generated by
5671 rasterizing points, lines, or polygons. Texture mapping, fog, and
5672 all the fragment operations are applied before the fragments are
5673 written to the frame buffer.
5674
5675 `GL_RGBA'
5676 `GL_BGRA'
5677 Each pixel is a four-component group: For `GL_RGBA', the red
5678 component is first, followed by green, followed by blue, followed
5679 by alpha; for `GL_BGRA' the order is blue, green, red and then
5680 alpha. Floating-point values are converted directly to an internal
5681 floating-point format with unspecified precision. Signed integer
5682 values are mapped linearly to the internal floating-point format
5683 such that the most positive representable integer value maps to
5684 1.0, and the most negative representable value maps to -1.0 . (Note
5685 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5686 integer data is mapped similarly: The largest integer value maps to
5687 1.0, and 0 maps to 0.0. The resulting floating-point color values
5688 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5689 C is RED, GREEN, BLUE, and ALPHA for the respective color
5690 components. The results are clamped to the range [0,1] .
5691
5692 If `GL_MAP_COLOR' is true, each color component is scaled by the
5693 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5694 value that it references in that table. C is R, G, B, or A
5695 respectively.
5696
5697 The GL then converts the resulting RGBA colors to fragments by
5698 attaching the current raster position Z coordinate and texture
5699 coordinates to each pixel, then assigning X and Y window
5700 coordinates to the N th fragment such that
5701
5702 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5703
5704 where (X_R,Y_R) is the current raster position. These pixel
5705 fragments are then treated just like the fragments generated by
5706 rasterizing points, lines, or polygons. Texture mapping, fog, and
5707 all the fragment operations are applied before the fragments are
5708 written to the frame buffer.
5709
5710 `GL_RED'
5711 Each pixel is a single red component. This component is converted
5712 to the internal floating-point format in the same way the red
5713 component of an RGBA pixel is. It is then converted to an RGBA
5714 pixel with green and blue set to 0, and alpha set to 1. After this
5715 conversion, the pixel is treated as if it had been read as an RGBA
5716 pixel.
5717
5718 `GL_GREEN'
5719 Each pixel is a single green component. This component is converted
5720 to the internal floating-point format in the same way the green
5721 component of an RGBA pixel is. It is then converted to an RGBA
5722 pixel with red and blue set to 0, and alpha set to 1. After this
5723 conversion, the pixel is treated as if it had been read as an RGBA
5724 pixel.
5725
5726 `GL_BLUE'
5727 Each pixel is a single blue component. This component is converted
5728 to the internal floating-point format in the same way the blue
5729 component of an RGBA pixel is. It is then converted to an RGBA
5730 pixel with red and green set to 0, and alpha set to 1. After this
5731 conversion, the pixel is treated as if it had been read as an RGBA
5732 pixel.
5733
5734 `GL_ALPHA'
5735 Each pixel is a single alpha component. This component is converted
5736 to the internal floating-point format in the same way the alpha
5737 component of an RGBA pixel is. It is then converted to an RGBA
5738 pixel with red, green, and blue set to 0. After this conversion,
5739 the pixel is treated as if it had been read as an RGBA pixel.
5740
5741 `GL_RGB'
5742 `GL_BGR'
5743 Each pixel is a three-component group: red first, followed by
5744 green, followed by blue; for `GL_BGR', the first component is blue,
5745 followed by green and then red. Each component is converted to the
5746 internal floating-point format in the same way the red, green, and
5747 blue components of an RGBA pixel are. The color triple is converted
5748 to an RGBA pixel with alpha set to 1. After this conversion, the
5749 pixel is treated as if it had been read as an RGBA pixel.
5750
5751 `GL_LUMINANCE'
5752 Each pixel is a single luminance component. This component is
5753 converted to the internal floating-point format in the same way the
5754 red component of an RGBA pixel is. It is then converted to an RGBA
5755 pixel with red, green, and blue set to the converted luminance
5756 value, and alpha set to 1. After this conversion, the pixel is
5757 treated as if it had been read as an RGBA pixel.
5758
5759 `GL_LUMINANCE_ALPHA'
5760 Each pixel is a two-component group: luminance first, followed by
5761 alpha. The two components are converted to the internal
5762 floating-point format in the same way the red component of an RGBA
5763 pixel is. They are then converted to an RGBA pixel with red, green,
5764 and blue set to the converted luminance value, and alpha set to the
5765 converted alpha value. After this conversion, the pixel is treated
5766 as if it had been read as an RGBA pixel.
5767
5768 The following table summarizes the meaning of the valid constants for
5769 the TYPE parameter:
5770
5771
5772
5773 *Type*
5774 *Corresponding Type*
5775
5776 `GL_UNSIGNED_BYTE'
5777 unsigned 8-bit integer
5778
5779 `GL_BYTE'
5780 signed 8-bit integer
5781
5782 `GL_BITMAP'
5783 single bits in unsigned 8-bit integers
5784
5785 `GL_UNSIGNED_SHORT'
5786 unsigned 16-bit integer
5787
5788 `GL_SHORT'
5789 signed 16-bit integer
5790
5791 `GL_UNSIGNED_INT'
5792 unsigned 32-bit integer
5793
5794 `GL_INT'
5795 32-bit integer
5796
5797 `GL_FLOAT'
5798 single-precision floating-point
5799
5800 `GL_UNSIGNED_BYTE_3_3_2'
5801 unsigned 8-bit integer
5802
5803 `GL_UNSIGNED_BYTE_2_3_3_REV'
5804 unsigned 8-bit integer with reversed component ordering
5805
5806 `GL_UNSIGNED_SHORT_5_6_5'
5807 unsigned 16-bit integer
5808
5809 `GL_UNSIGNED_SHORT_5_6_5_REV'
5810 unsigned 16-bit integer with reversed component ordering
5811
5812 `GL_UNSIGNED_SHORT_4_4_4_4'
5813 unsigned 16-bit integer
5814
5815 `GL_UNSIGNED_SHORT_4_4_4_4_REV'
5816 unsigned 16-bit integer with reversed component ordering
5817
5818 `GL_UNSIGNED_SHORT_5_5_5_1'
5819 unsigned 16-bit integer
5820
5821 `GL_UNSIGNED_SHORT_1_5_5_5_REV'
5822 unsigned 16-bit integer with reversed component ordering
5823
5824 `GL_UNSIGNED_INT_8_8_8_8'
5825 unsigned 32-bit integer
5826
5827 `GL_UNSIGNED_INT_8_8_8_8_REV'
5828 unsigned 32-bit integer with reversed component ordering
5829
5830 `GL_UNSIGNED_INT_10_10_10_2'
5831 unsigned 32-bit integer
5832
5833 `GL_UNSIGNED_INT_2_10_10_10_REV'
5834 unsigned 32-bit integer with reversed component ordering
5835
5836
5837
5838 The rasterization described so far assumes pixel zoom factors of 1. If
5839 `glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
5840 are converted to fragments as follows. If (X_R,Y_R) is the current
5841 raster position, and a given pixel is in the N th column and M th row of
5842 the pixel rectangle, then fragments are generated for pixels whose
5843 centers are in the rectangle with corners at
5844
5845 (X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
5846
5847 where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
5848 `GL_ZOOM_Y'.
5849
5850 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
5851 accepted values.
5852
5853 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
5854 either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
5855
5856 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
5857
5858 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
5859 there is no stencil buffer.
5860
5861 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
5862 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
5863 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
5864 mode.
5865
5866 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5867 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5868 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
5869 is not `GL_RGB'.
5870
5871 `GL_INVALID_OPERATION' is generated if FORMAT is one of
5872 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5873 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5874 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5875 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
5876 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
5877
5878 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5879 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
5880 data store is currently mapped.
5881
5882 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5883 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
5884 unpacked from the buffer object such that the memory reads required
5885 would exceed the data store size.
5886
5887 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5888 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
5889 divisible into the number of bytes needed to store in memory a datum
5890 indicated by TYPE.
5891
5892 `GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
5893 between the execution of `glBegin' and the corresponding execution of
5894 `glEnd'.")
5895
5896 (define-gl-procedures
5897 ((glDrawRangeElements
5898 (mode GLenum)
5899 (start GLuint)
5900 (end GLuint)
5901 (count GLsizei)
5902 (type GLenum)
5903 (indices const-GLvoid-*)
5904 ->
5905 void))
5906 "Render primitives from array data.
5907
5908 MODE
5909 Specifies what kind of primitives to render. Symbolic constants
5910 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5911 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5912 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5913
5914 START
5915 Specifies the minimum array index contained in INDICES.
5916
5917 END
5918 Specifies the maximum array index contained in INDICES.
5919
5920 COUNT
5921 Specifies the number of elements to be rendered.
5922
5923 TYPE
5924 Specifies the type of the values in INDICES. Must be one of
5925 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5926
5927 INDICES
5928 Specifies a pointer to the location where the indices are stored.
5929
5930 `glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
5931 START, END, and COUNT match the corresponding arguments to
5932 `glDrawElements', with the additional constraint that all values in the
5933 arrays COUNT must lie between START and END, inclusive.
5934
5935 Implementations denote recommended maximum amounts of vertex and index
5936 data, which may be queried by calling `glGet' with argument
5937 `GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
5938 is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
5939 greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
5940 operate at reduced performance. There is no requirement that all
5941 vertices in the range [START,END] be referenced. However, the
5942 implementation may partially process unused vertices, reducing
5943 performance from what could be achieved with an optimal index set.
5944
5945 When `glDrawRangeElements' is called, it uses COUNT sequential elements
5946 from an enabled array, starting at START to construct a sequence of
5947 geometric primitives. MODE specifies what kind of primitives are
5948 constructed, and how the array elements construct these primitives. If
5949 more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5950 not enabled, no geometric primitives are constructed.
5951
5952 Vertex attributes that are modified by `glDrawRangeElements' have an
5953 unspecified value after `glDrawRangeElements' returns. For example, if
5954 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5955 after `glDrawRangeElements' executes. Attributes that aren't modified
5956 maintain their previous values.
5957
5958 It is an error for indices to lie outside the range [START,END] , but
5959 implementations may not check for this situation. Such indices cause
5960 implementation-dependent behavior.
5961
5962 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5963
5964 `GL_INVALID_VALUE' is generated if COUNT is negative.
5965
5966 `GL_INVALID_VALUE' is generated if END<START .
5967
5968 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5969 bound to an enabled array or the element array and the buffer object's
5970 data store is currently mapped.
5971
5972 `GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
5973 between the execution of `glBegin' and the corresponding `glEnd'.")
5974
5975 (define-gl-procedures
5976 ((glEdgeFlagPointer
5977 (stride GLsizei)
5978 (pointer const-GLvoid-*)
5979 ->
5980 void))
5981 "Define an array of edge flags.
5982
5983 STRIDE
5984 Specifies the byte offset between consecutive edge flags. If STRIDE
5985 is 0, the edge flags are understood to be tightly packed in the
5986 array. The initial value is 0.
5987
5988 POINTER
5989 Specifies a pointer to the first edge flag in the array. The
5990 initial value is 0.
5991
5992 `glEdgeFlagPointer' specifies the location and data format of an array
5993 of boolean edge flags to use when rendering. STRIDE specifies the byte
5994 stride from one edge flag to the next, allowing vertices and attributes
5995 to be packed into a single array or stored in separate arrays.
5996
5997 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
5998 target (see `glBindBuffer') while an edge flag array is specified,
5999 POINTER is treated as a byte offset into the buffer object's data store.
6000 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
6001 edge flag vertex array client-side state
6002 (`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
6003
6004 When an edge flag array is specified, STRIDE and POINTER are saved as
6005 client-side state, in addition to the current vertex array buffer object
6006 binding.
6007
6008 To enable and disable the edge flag array, call `glEnableClientState'
6009 and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
6010 enabled, the edge flag array is used when `glDrawArrays',
6011 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
6012 `glDrawRangeElements', or `glArrayElement' is called.
6013
6014 `GL_INVALID_ENUM' is generated if STRIDE is negative.")
6015
6016 (define-gl-procedures
6017 ((glEdgeFlag (flag GLboolean) -> void))
6018 "Flag edges as either boundary or nonboundary.
6019
6020 FLAG
6021 Specifies the current edge flag value, either `GL_TRUE' or
6022 `GL_FALSE'. The initial value is `GL_TRUE'.
6023
6024 Each vertex of a polygon, separate triangle, or separate quadrilateral
6025 specified between a `glBegin'/`glEnd' pair is marked as the start of
6026 either a boundary or nonboundary edge. If the current edge flag is true
6027 when the vertex is specified, the vertex is marked as the start of a
6028 boundary edge. Otherwise, the vertex is marked as the start of a
6029 nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6030 FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6031
6032 The vertices of connected triangles and connected quadrilaterals are
6033 always marked as boundary, regardless of the value of the edge flag.
6034
6035 Boundary and nonboundary edge flags on vertices are significant only if
6036 `GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6037 `glPolygonMode'.")
6038
6039 (define-gl-procedures
6040 ((glEnableClientState (cap GLenum) -> void)
6041 (glDisableClientState (cap GLenum) -> void))
6042 "Enable or disable client-side capability.
6043
6044 CAP
6045 Specifies the capability to enable. Symbolic constants
6046 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6047 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6048 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6049
6050 `glEnableClientState' and `glDisableClientState' enable or disable
6051 individual client-side capabilities. By default, all client-side
6052 capabilities are disabled. Both `glEnableClientState' and
6053 `glDisableClientState' take a single argument, CAP, which can assume one
6054 of the following values:
6055
6056 `GL_COLOR_ARRAY'
6057 If enabled, the color array is enabled for writing and used during
6058 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6059 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6060 is called. See `glColorPointer'.
6061
6062 `GL_EDGE_FLAG_ARRAY'
6063 If enabled, the edge flag array is enabled for writing and used
6064 during rendering when `glArrayElement', `glDrawArrays',
6065 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6066 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6067
6068 `GL_FOG_COORD_ARRAY'
6069 If enabled, the fog coordinate array is enabled for writing and
6070 used during rendering when `glArrayElement', `glDrawArrays',
6071 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6072 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6073
6074 `GL_INDEX_ARRAY'
6075 If enabled, the index array is enabled for writing and used during
6076 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6077 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6078 is called. See `glIndexPointer'.
6079
6080 `GL_NORMAL_ARRAY'
6081 If enabled, the normal array is enabled for writing and used during
6082 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6083 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6084 is called. See `glNormalPointer'.
6085
6086 `GL_SECONDARY_COLOR_ARRAY'
6087 If enabled, the secondary color array is enabled for writing and
6088 used during rendering when `glArrayElement', `glDrawArrays',
6089 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6090 `glMultiDrawElements' is called. See `glColorPointer'.
6091
6092 `GL_TEXTURE_COORD_ARRAY'
6093 If enabled, the texture coordinate array is enabled for writing and
6094 used during rendering when `glArrayElement', `glDrawArrays',
6095 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6096 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6097
6098 `GL_VERTEX_ARRAY'
6099 If enabled, the vertex array is enabled for writing and used during
6100 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6101 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6102 is called. See `glVertexPointer'.
6103
6104 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6105
6106 `glEnableClientState' is not allowed between the execution of `glBegin'
6107 and the corresponding `glEnd', but an error may or may not be generated.
6108 If no error is generated, the behavior is undefined.")
6109
6110 (define-gl-procedures
6111 ((glEnableVertexAttribArray
6112 (index GLuint)
6113 ->
6114 void)
6115 (glDisableVertexAttribArray
6116 (index GLuint)
6117 ->
6118 void))
6119 "Enable or disable a generic vertex attribute array.
6120
6121 INDEX
6122 Specifies the index of the generic vertex attribute to be enabled
6123 or disabled.
6124
6125 `glEnableVertexAttribArray' enables the generic vertex attribute array
6126 specified by INDEX. `glDisableVertexAttribArray' disables the generic
6127 vertex attribute array specified by INDEX. By default, all client-side
6128 capabilities are disabled, including all generic vertex attribute
6129 arrays. If enabled, the values in the generic vertex attribute array
6130 will be accessed and used for rendering when calls are made to vertex
6131 array commands such as `glDrawArrays', `glDrawElements',
6132 `glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6133 `glMultiDrawArrays'.
6134
6135 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6136 `GL_MAX_VERTEX_ATTRIBS'.
6137
6138 `GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6139 ' or `glDisableVertexAttribArray ' is executed between the execution of
6140 `glBegin' and the corresponding execution of `glEnd'.")
6141
6142 (define-gl-procedures
6143 ((glEnable (cap GLenum) -> void)
6144 (glDisable (cap GLenum) -> void))
6145 "Enable or disable server-side GL capabilities.
6146
6147 CAP
6148 Specifies a symbolic constant indicating a GL capability.
6149
6150 `glEnable' and `glDisable' enable and disable various capabilities. Use
6151 `glIsEnabled' or `glGet' to determine the current setting of any
6152 capability. The initial value for each capability with the exception of
6153 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6154 `GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6155
6156 Both `glEnable' and `glDisable' take a single argument, CAP, which can
6157 assume one of the following values:
6158
6159 `GL_ALPHA_TEST'
6160
6161
6162 If enabled, do alpha testing. See `glAlphaFunc'.
6163
6164 `GL_AUTO_NORMAL'
6165
6166
6167 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6168 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6169
6170 `GL_BLEND'
6171
6172
6173 If enabled, blend the computed fragment color values with the
6174 values in the color buffers. See `glBlendFunc'.
6175
6176 `GL_CLIP_PLANE'I
6177
6178
6179 If enabled, clip geometry against user-defined clipping plane I.
6180 See `glClipPlane'.
6181
6182 `GL_COLOR_LOGIC_OP'
6183
6184
6185 If enabled, apply the currently selected logical operation to the
6186 computed fragment color and color buffer values. See `glLogicOp'.
6187
6188 `GL_COLOR_MATERIAL'
6189
6190
6191 If enabled, have one or more material parameters track the current
6192 color. See `glColorMaterial'.
6193
6194 `GL_COLOR_SUM'
6195
6196
6197 If enabled and no fragment shader is active, add the secondary
6198 color value to the computed fragment color. See `glSecondaryColor'.
6199
6200 `GL_COLOR_TABLE'
6201
6202
6203 If enabled, perform a color table lookup on the incoming RGBA color
6204 values. See `glColorTable'.
6205
6206 `GL_CONVOLUTION_1D'
6207
6208
6209 If enabled, perform a 1D convolution operation on incoming RGBA
6210 color values. See `glConvolutionFilter1D'.
6211
6212 `GL_CONVOLUTION_2D'
6213
6214
6215 If enabled, perform a 2D convolution operation on incoming RGBA
6216 color values. See `glConvolutionFilter2D'.
6217
6218 `GL_CULL_FACE'
6219
6220
6221 If enabled, cull polygons based on their winding in window
6222 coordinates. See `glCullFace'.
6223
6224 `GL_DEPTH_TEST'
6225
6226
6227 If enabled, do depth comparisons and update the depth buffer. Note
6228 that even if the depth buffer exists and the depth mask is
6229 non-zero, the depth buffer is not updated if the depth test is
6230 disabled. See `glDepthFunc' and `glDepthRange'.
6231
6232 `GL_DITHER'
6233
6234
6235 If enabled, dither color components or indices before they are
6236 written to the color buffer.
6237
6238 `GL_FOG'
6239
6240
6241 If enabled and no fragment shader is active, blend a fog color into
6242 the post-texturing color. See `glFog'.
6243
6244 `GL_HISTOGRAM'
6245
6246
6247 If enabled, histogram incoming RGBA color values. See
6248 `glHistogram'.
6249
6250 `GL_INDEX_LOGIC_OP'
6251
6252
6253 If enabled, apply the currently selected logical operation to the
6254 incoming index and color buffer indices. See `glLogicOp'.
6255
6256 `GL_LIGHT'I
6257
6258
6259 If enabled, include light I in the evaluation of the lighting
6260 equation. See `glLightModel' and `glLight'.
6261
6262 `GL_LIGHTING'
6263
6264
6265 If enabled and no vertex shader is active, use the current lighting
6266 parameters to compute the vertex color or index. Otherwise, simply
6267 associate the current color or index with each vertex. See
6268 `glMaterial', `glLightModel', and `glLight'.
6269
6270 `GL_LINE_SMOOTH'
6271
6272
6273 If enabled, draw lines with correct filtering. Otherwise, draw
6274 aliased lines. See `glLineWidth'.
6275
6276 `GL_LINE_STIPPLE'
6277
6278
6279 If enabled, use the current line stipple pattern when drawing
6280 lines. See `glLineStipple'.
6281
6282 `GL_MAP1_COLOR_4'
6283
6284
6285 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6286 `glEvalPoint1' generate RGBA values. See `glMap1'.
6287
6288 `GL_MAP1_INDEX'
6289
6290
6291 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6292 `glEvalPoint1' generate color indices. See `glMap1'.
6293
6294 `GL_MAP1_NORMAL'
6295
6296
6297 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6298 `glEvalPoint1' generate normals. See `glMap1'.
6299
6300 `GL_MAP1_TEXTURE_COORD_1'
6301
6302
6303 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6304 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6305
6306 `GL_MAP1_TEXTURE_COORD_2'
6307
6308
6309 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6310 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6311
6312 `GL_MAP1_TEXTURE_COORD_3'
6313
6314
6315 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6316 `glEvalPoint1' generate S, T, and R texture coordinates. See
6317 `glMap1'.
6318
6319 `GL_MAP1_TEXTURE_COORD_4'
6320
6321
6322 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6323 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6324 `glMap1'.
6325
6326 `GL_MAP1_VERTEX_3'
6327
6328
6329 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6330 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6331 `glMap1'.
6332
6333 `GL_MAP1_VERTEX_4'
6334
6335
6336 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6337 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6338 coordinates. See `glMap1'.
6339
6340 `GL_MAP2_COLOR_4'
6341
6342
6343 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6344 `glEvalPoint2' generate RGBA values. See `glMap2'.
6345
6346 `GL_MAP2_INDEX'
6347
6348
6349 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6350 `glEvalPoint2' generate color indices. See `glMap2'.
6351
6352 `GL_MAP2_NORMAL'
6353
6354
6355 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6356 `glEvalPoint2' generate normals. See `glMap2'.
6357
6358 `GL_MAP2_TEXTURE_COORD_1'
6359
6360
6361 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6362 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6363
6364 `GL_MAP2_TEXTURE_COORD_2'
6365
6366
6367 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6368 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6369
6370 `GL_MAP2_TEXTURE_COORD_3'
6371
6372
6373 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6374 `glEvalPoint2' generate S, T, and R texture coordinates. See
6375 `glMap2'.
6376
6377 `GL_MAP2_TEXTURE_COORD_4'
6378
6379
6380 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6381 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6382 `glMap2'.
6383
6384 `GL_MAP2_VERTEX_3'
6385
6386
6387 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6388 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6389 `glMap2'.
6390
6391 `GL_MAP2_VERTEX_4'
6392
6393
6394 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6395 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6396 coordinates. See `glMap2'.
6397
6398 `GL_MINMAX'
6399
6400
6401 If enabled, compute the minimum and maximum values of incoming RGBA
6402 color values. See `glMinmax'.
6403
6404 `GL_MULTISAMPLE'
6405
6406
6407 If enabled, use multiple fragment samples in computing the final
6408 color of a pixel. See `glSampleCoverage'.
6409
6410 `GL_NORMALIZE'
6411
6412
6413 If enabled and no vertex shader is active, normal vectors are
6414 normalized to unit length after transformation and before lighting.
6415 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6416 See `glNormal' and `glNormalPointer'.
6417
6418 `GL_POINT_SMOOTH'
6419
6420
6421 If enabled, draw points with proper filtering. Otherwise, draw
6422 aliased points. See `glPointSize'.
6423
6424 `GL_POINT_SPRITE'
6425
6426
6427 If enabled, calculate texture coordinates for points based on
6428 texture environment and point parameter settings. Otherwise texture
6429 coordinates are constant across points.
6430
6431 `GL_POLYGON_OFFSET_FILL'
6432
6433
6434 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6435 offset is added to depth values of a polygon's fragments before the
6436 depth comparison is performed. See `glPolygonOffset'.
6437
6438 `GL_POLYGON_OFFSET_LINE'
6439
6440
6441 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6442 offset is added to depth values of a polygon's fragments before the
6443 depth comparison is performed. See `glPolygonOffset'.
6444
6445 `GL_POLYGON_OFFSET_POINT'
6446
6447
6448 If enabled, an offset is added to depth values of a polygon's
6449 fragments before the depth comparison is performed, if the polygon
6450 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6451
6452 `GL_POLYGON_SMOOTH'
6453
6454
6455 If enabled, draw polygons with proper filtering. Otherwise, draw
6456 aliased polygons. For correct antialiased polygons, an alpha buffer
6457 is needed and the polygons must be sorted front to back.
6458
6459 `GL_POLYGON_STIPPLE'
6460
6461
6462 If enabled, use the current polygon stipple pattern when rendering
6463 polygons. See `glPolygonStipple'.
6464
6465 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
6466
6467
6468 If enabled, perform a color table lookup on RGBA color values after
6469 color matrix transformation. See `glColorTable'.
6470
6471 `GL_POST_CONVOLUTION_COLOR_TABLE'
6472
6473
6474 If enabled, perform a color table lookup on RGBA color values after
6475 convolution. See `glColorTable'.
6476
6477 `GL_RESCALE_NORMAL'
6478
6479
6480 If enabled and no vertex shader is active, normal vectors are
6481 scaled after transformation and before lighting by a factor
6482 computed from the modelview matrix. If the modelview matrix scales
6483 space uniformly, this has the effect of restoring the transformed
6484 normal to unit length. This method is generally more efficient than
6485 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6486
6487 `GL_SAMPLE_ALPHA_TO_COVERAGE'
6488
6489
6490 If enabled, compute a temporary coverage value where each bit is
6491 determined by the alpha value at the corresponding sample location.
6492 The temporary coverage value is then ANDed with the fragment
6493 coverage value.
6494
6495 `GL_SAMPLE_ALPHA_TO_ONE'
6496
6497
6498 If enabled, each sample alpha value is replaced by the maximum
6499 representable alpha value.
6500
6501 `GL_SAMPLE_COVERAGE'
6502
6503
6504 If enabled, the fragment's coverage is ANDed with the temporary
6505 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6506 invert the coverage value. See `glSampleCoverage'.
6507
6508 `GL_SEPARABLE_2D'
6509
6510
6511 If enabled, perform a two-dimensional convolution operation using a
6512 separable convolution filter on incoming RGBA color values. See
6513 `glSeparableFilter2D'.
6514
6515 `GL_SCISSOR_TEST'
6516
6517
6518 If enabled, discard fragments that are outside the scissor
6519 rectangle. See `glScissor'.
6520
6521 `GL_STENCIL_TEST'
6522
6523
6524 If enabled, do stencil testing and update the stencil buffer. See
6525 `glStencilFunc' and `glStencilOp'.
6526
6527 `GL_TEXTURE_1D'
6528
6529
6530 If enabled and no fragment shader is active, one-dimensional
6531 texturing is performed (unless two- or three-dimensional or
6532 cube-mapped texturing is also enabled). See `glTexImage1D'.
6533
6534 `GL_TEXTURE_2D'
6535
6536
6537 If enabled and no fragment shader is active, two-dimensional
6538 texturing is performed (unless three-dimensional or cube-mapped
6539 texturing is also enabled). See `glTexImage2D'.
6540
6541 `GL_TEXTURE_3D'
6542
6543
6544 If enabled and no fragment shader is active, three-dimensional
6545 texturing is performed (unless cube-mapped texturing is also
6546 enabled). See `glTexImage3D'.
6547
6548 `GL_TEXTURE_CUBE_MAP'
6549
6550
6551 If enabled and no fragment shader is active, cube-mapped texturing
6552 is performed. See `glTexImage2D'.
6553
6554 `GL_TEXTURE_GEN_Q'
6555
6556
6557 If enabled and no vertex shader is active, the Q texture coordinate
6558 is computed using the texture generation function defined with
6559 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6560 See `glTexGen'.
6561
6562 `GL_TEXTURE_GEN_R'
6563
6564
6565 If enabled and no vertex shader is active, the R texture coordinate
6566 is computed using the texture generation function defined with
6567 `glTexGen'. Otherwise, the current R texture coordinate is used.
6568 See `glTexGen'.
6569
6570 `GL_TEXTURE_GEN_S'
6571
6572
6573 If enabled and no vertex shader is active, the S texture coordinate
6574 is computed using the texture generation function defined with
6575 `glTexGen'. Otherwise, the current S texture coordinate is used.
6576 See `glTexGen'.
6577
6578 `GL_TEXTURE_GEN_T'
6579
6580
6581 If enabled and no vertex shader is active, the T texture coordinate
6582 is computed using the texture generation function defined with
6583 `glTexGen'. Otherwise, the current T texture coordinate is used.
6584 See `glTexGen'.
6585
6586 `GL_VERTEX_PROGRAM_POINT_SIZE'
6587
6588
6589 If enabled and a vertex shader is active, then the derived point
6590 size is taken from the (potentially clipped) shader builtin
6591 `gl_PointSize' and clamped to the implementation-dependent point
6592 size range.
6593
6594 `GL_VERTEX_PROGRAM_TWO_SIDE'
6595
6596
6597 If enabled and a vertex shader is active, it specifies that the GL
6598 will choose between front and back colors based on the polygon's
6599 face direction of which the vertex being shaded is a part. It has
6600 no effect on points or lines.
6601
6602 `GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6603 previously.
6604
6605 `GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6606 executed between the execution of `glBegin' and the corresponding
6607 execution of `glEnd'.")
6608
6609 (define-gl-procedures
6610 ((glEvalCoord1f (u GLfloat) -> void)
6611 (glEvalCoord2f (u GLfloat) (v GLfloat) -> void))
6612 "Evaluate enabled one- and two-dimensional maps.
6613
6614 U
6615 Specifies a value that is the domain coordinate U to the basis
6616 function defined in a previous `glMap1' or `glMap2' command.
6617
6618 V
6619 Specifies a value that is the domain coordinate V to the basis
6620 function defined in a previous `glMap2' command. This argument is
6621 not present in a `glEvalCoord1' command.
6622
6623 `glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6624 `glEvalCoord2' does the same for two-dimensional maps using two domain
6625 values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6626 and disable it, call `glEnable' and `glDisable'.
6627
6628 When one of the `glEvalCoord' commands is issued, all currently enabled
6629 maps of the indicated dimension are evaluated. Then, for each enabled
6630 map, it is as if the corresponding GL command had been issued with the
6631 computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6632 enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6633 `GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6634 `GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6635 produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6636 `GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6637 `GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6638 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6639 `GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6640 command is simulated.
6641
6642 For color, color index, normal, and texture coordinates the GL uses
6643 evaluated values instead of current values for those evaluations that
6644 are enabled, and current values otherwise, However, the evaluated values
6645 do not update the current values. Thus, if `glVertex' commands are
6646 interspersed with `glEvalCoord' commands, the color, normal, and texture
6647 coordinates associated with the `glVertex' commands are not affected by
6648 the values generated by the `glEvalCoord' commands, but only by the most
6649 recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6650
6651 No commands are issued for maps that are not enabled. If more than one
6652 texture evaluation is enabled for a particular dimension (for example,
6653 `GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6654 evaluation of the map that produces the larger number of coordinates (in
6655 this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6656 overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6657 `GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6658 four-component vertex map is enabled for the specified dimension, the
6659 `glEvalCoord' command is ignored.
6660
6661 If you have enabled automatic normal generation, by calling `glEnable'
6662 with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6663 analytically, regardless of the contents or enabling of the
6664 `GL_MAP2_NORMAL' map. Let
6665
6666 `m'=∂`p',/∂U,,×∂`p',/∂V,,
6667
6668 Then the generated normal `n' is `n'=`m'/∥`m',∥,
6669
6670 If automatic normal generation is disabled, the corresponding normal map
6671 `GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6672 automatic normal generation nor a normal map is enabled, no normal is
6673 generated for `glEvalCoord2' commands.")
6674
6675 (define-gl-procedures
6676 ((glEvalMesh1
6677 (mode GLenum)
6678 (i1 GLint)
6679 (i2 GLint)
6680 ->
6681 void)
6682 (glEvalMesh2
6683 (mode GLenum)
6684 (i1 GLint)
6685 (i2 GLint)
6686 (j1 GLint)
6687 (j2 GLint)
6688 ->
6689 void))
6690 "Compute a one- or two-dimensional grid of points or lines.
6691
6692 MODE
6693 In `glEvalMesh1', specifies whether to compute a one-dimensional
6694 mesh of points or lines. Symbolic constants `GL_POINT' and
6695 `GL_LINE' are accepted.
6696
6697 I1
6698 I2
6699
6700 Specify the first and last integer values for grid domain variable
6701 I .
6702
6703 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6704 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6705 steps through the integer domain of a one- or two-dimensional grid,
6706 whose range is the domain of the evaluation maps specified by `glMap1'
6707 and `glMap2'. MODE determines whether the resulting vertices are
6708 connected as points, lines, or filled polygons.
6709
6710 In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6711 the following code fragment were executed:
6712
6713 where
6714
6715
6716 glBegin( TYPE );
6717 for ( i = I1; i <= I2; i += 1 )
6718 glEvalCoord1( i·ΔU+U_1
6719
6720 );
6721 glEnd();
6722
6723 ΔU=(U_2-U_1,)/N
6724
6725 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6726 command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6727 MODE is `GL_LINE'.
6728
6729 The one absolute numeric requirement is that if I=N , then the value
6730 computed from I·ΔU+U_1 is exactly U_2 .
6731
6732 In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6733
6734 ΔV=(V_2-V_1,)/M
6735
6736 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6737 recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6738 `glEvalMesh2' command is equivalent to:
6739
6740
6741
6742
6743 for ( j = J1; j < J2; j += 1 ) {
6744 glBegin( GL_QUAD_STRIP );
6745 for ( i = I1; i <= I2; i += 1 ) {
6746 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6747
6748 );
6749 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6750
6751 );
6752 }
6753 glEnd();
6754 }
6755
6756 If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
6757
6758
6759
6760
6761 for ( j = J1; j <= J2; j += 1 ) {
6762 glBegin( GL_LINE_STRIP );
6763 for ( i = I1; i <= I2; i += 1 )
6764 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6765
6766 );
6767 glEnd();
6768 }
6769
6770 for ( i = I1; i <= I2; i += 1 ) {
6771 glBegin( GL_LINE_STRIP );
6772 for ( j = J1; j <= J1; j += 1 )
6773 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6774
6775 );
6776 glEnd();
6777 }
6778
6779 And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
6780 equivalent to:
6781
6782
6783
6784
6785 glBegin( GL_POINTS );
6786 for ( j = J1; j <= J2; j += 1 )
6787 for ( i = I1; i <= I2; i += 1 )
6788 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6789
6790 );
6791 glEnd();
6792
6793 In all three cases, the only absolute numeric requirements are that if
6794 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6795 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6796
6797 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6798
6799 `GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
6800 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6801
6802 (define-gl-procedures
6803 ((glEvalPoint1 (i GLint) -> void)
6804 (glEvalPoint2 (i GLint) (j GLint) -> void))
6805 "Generate and evaluate a single point in a mesh.
6806
6807 I
6808 Specifies the integer value for grid domain variable I .
6809
6810 J
6811 Specifies the integer value for grid domain variable J
6812 (`glEvalPoint2' only).
6813
6814 `glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6815 and evaluate a series of evenly spaced map domain values. `glEvalPoint'
6816 can be used to evaluate a single grid point in the same gridspace that
6817 is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
6818 calling where ΔU=(U_2-U_1,)/N
6819
6820
6821 glEvalCoord1( i·ΔU+U_1
6822
6823 );
6824
6825 and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6826 command. The one absolute numeric requirement is that if I=N , then the
6827 value computed from I·ΔU+U_1 is exactly U_2 .
6828
6829 In the two-dimensional case, `glEvalPoint2', let
6830
6831 ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
6832
6833 where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6834 recent `glMapGrid2' command. Then the `glEvalPoint2' command is
6835 equivalent to calling The only absolute numeric requirements are that if
6836 I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6837 , then the value computed from J·ΔV+V_1 is exactly V_2 .
6838
6839
6840 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6841
6842 );")
6843
6844 (define-gl-procedures
6845 ((glFeedbackBuffer
6846 (size GLsizei)
6847 (type GLenum)
6848 (buffer GLfloat-*)
6849 ->
6850 void))
6851 "Controls feedback mode.
6852
6853 SIZE
6854 Specifies the maximum number of values that can be written into
6855 BUFFER.
6856
6857 TYPE
6858 Specifies a symbolic constant that describes the information that
6859 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
6860 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
6861
6862 BUFFER
6863 Returns the feedback data.
6864
6865 The `glFeedbackBuffer' function controls feedback. Feedback, like
6866 selection, is a GL mode. The mode is selected by calling `glRenderMode'
6867 with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
6868 produced by rasterization. Instead, information about primitives that
6869 would have been rasterized is fed back to the application using the GL.
6870
6871 `glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
6872 of floating-point values into which feedback information is placed. SIZE
6873 indicates the size of the array. TYPE is a symbolic constant describing
6874 the information that is fed back for each vertex. `glFeedbackBuffer'
6875 must be issued before feedback mode is enabled (by calling
6876 `glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
6877 without establishing the feedback buffer, or calling `glFeedbackBuffer'
6878 while the GL is in feedback mode, is an error.
6879
6880 When `glRenderMode' is called while in feedback mode, it returns the
6881 number of entries placed in the feedback array and resets the feedback
6882 array pointer to the base of the feedback buffer. The returned value
6883 never exceeds SIZE. If the feedback data required more room than was
6884 available in BUFFER, `glRenderMode' returns a negative value. To take
6885 the GL out of feedback mode, call `glRenderMode' with a parameter value
6886 other than `GL_FEEDBACK'.
6887
6888 While in feedback mode, each primitive, bitmap, or pixel rectangle that
6889 would be rasterized generates a block of values that are copied into the
6890 feedback array. If doing so would cause the number of entries to exceed
6891 the maximum, the block is partially written so as to fill the array (if
6892 there is any room left at all), and an overflow flag is set. Each block
6893 begins with a code indicating the primitive type, followed by values
6894 that describe the primitive's vertices and associated data. Entries are
6895 also written for bitmaps and pixel rectangles. Feedback occurs after
6896 polygon culling and `glPolygonMode' interpretation of polygons has taken
6897 place, so polygons that are culled are not returned in the feedback
6898 buffer. It can also occur after polygons with more than three edges are
6899 broken up into triangles, if the GL implementation renders polygons by
6900 performing this decomposition.
6901
6902 The `glPassThrough' command can be used to insert a marker into the
6903 feedback buffer. See `glPassThrough'.
6904
6905 Following is the grammar for the blocks of values written into the
6906 feedback buffer. Each primitive is indicated with a unique identifying
6907 value followed by some number of vertices. Polygon entries include an
6908 integer value indicating how many vertices follow. A vertex is fed back
6909 as some number of floating-point values, as determined by TYPE. Colors
6910 are fed back as four values in RGBA mode and one value in color index
6911 mode.
6912
6913 feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
6914 point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
6915 ← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
6916 `GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
6917 polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
6918 `GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
6919 `GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
6920 vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
6921 value 3d ← value value value 3dColor ← value value value color
6922 3dColorTexture ← value value value color tex 4dColorTexture ← value
6923 value value value color tex color ← rgba | index rgba ← value value
6924 value value index ← value tex ← value value value value
6925
6926 VALUE is a floating-point number, and N is a floating-point integer
6927 giving the number of vertices in the polygon. `GL_POINT_TOKEN',
6928 `GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
6929 `GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
6930 `GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
6931 `GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
6932 reset. The data returned as a vertex depends on the feedback TYPE.
6933
6934 The following table gives the correspondence between TYPE and the number
6935 of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
6936
6937
6938
6939 *Type*
6940 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
6941
6942 `GL_2D'
6943 X, Y, , , 2
6944
6945 `GL_3D'
6946 X, Y, Z, , , 3
6947
6948 `GL_3D_COLOR'
6949 X, Y, Z, K , , 3+K
6950
6951 `GL_3D_COLOR_TEXTURE'
6952 X, Y, Z, K , 4 , 7+K
6953
6954 `GL_4D_COLOR_TEXTURE'
6955 X, Y, Z, W, K , 4 , 8+K
6956
6957 Feedback vertex coordinates are in window coordinates, except W, which
6958 is in clip coordinates. Feedback colors are lighted, if lighting is
6959 enabled. Feedback texture coordinates are generated, if texture
6960 coordinate generation is enabled. They are always transformed by the
6961 texture matrix.
6962
6963 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
6964
6965 `GL_INVALID_VALUE' is generated if SIZE is negative.
6966
6967 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
6968 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
6969 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
6970 once.
6971
6972 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
6973 between the execution of `glBegin' and the corresponding execution of
6974 `glEnd'.")
6975
6976 (define-gl-procedures
6977 ((glFinish -> void))
6978 "Block until all GL execution is complete.
6979
6980 `glFinish' does not return until the effects of all previously called GL
6981 commands are complete. Such effects include all changes to GL state, all
6982 changes to connection state, and all changes to the frame buffer
6983 contents.
6984
6985 `GL_INVALID_OPERATION' is generated if `glFinish' is executed between
6986 the execution of `glBegin' and the corresponding execution of `glEnd'.")
6987
6988 (define-gl-procedures
6989 ((glFlush -> void))
6990 "Force execution of GL commands in finite time.
6991
6992 Different GL implementations buffer commands in several different
6993 locations, including network buffers and the graphics accelerator
6994 itself. `glFlush' empties all of these buffers, causing all issued
6995 commands to be executed as quickly as they are accepted by the actual
6996 rendering engine. Though this execution may not be completed in any
6997 particular time period, it does complete in finite time.
6998
6999 Because any GL program might be executed over a network, or on an
7000 accelerator that buffers commands, all programs should call `glFlush'
7001 whenever they count on having all of their previously issued commands
7002 completed. For example, call `glFlush' before waiting for user input
7003 that depends on the generated image.
7004
7005 `GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
7006 execution of `glBegin' and the corresponding execution of `glEnd'.")
7007
7008 (define-gl-procedures
7009 ((glFogCoordPointer
7010 (type GLenum)
7011 (stride GLsizei)
7012 (pointer GLvoid-*)
7013 ->
7014 void))
7015 "Define an array of fog coordinates.
7016
7017 TYPE
7018 Specifies the data type of each fog coordinate. Symbolic constants
7019 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7020 `GL_FLOAT'.
7021
7022 STRIDE
7023 Specifies the byte offset between consecutive fog coordinates. If
7024 STRIDE is 0, the array elements are understood to be tightly
7025 packed. The initial value is 0.
7026
7027 POINTER
7028 Specifies a pointer to the first coordinate of the first fog
7029 coordinate in the array. The initial value is 0.
7030
7031 `glFogCoordPointer' specifies the location and data format of an array
7032 of fog coordinates to use when rendering. TYPE specifies the data type
7033 of each fog coordinate, and STRIDE specifies the byte stride from one
7034 fog coordinate to the next, allowing vertices and attributes to be
7035 packed into a single array or stored in separate arrays.
7036
7037 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7038 target (see `glBindBuffer') while a fog coordinate array is specified,
7039 POINTER is treated as a byte offset into the buffer object's data store.
7040 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7041 fog coordinate vertex array client-side state
7042 (`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7043
7044 When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7045 saved as client-side state, in addition to the current vertex array
7046 buffer object binding.
7047
7048 To enable and disable the fog coordinate array, call
7049 `glEnableClientState' and `glDisableClientState' with the argument
7050 `GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7051 `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7052 `glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7053 called.
7054
7055 `GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7056 `GL_DOUBLE'.
7057
7058 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
7059
7060 (define-gl-procedures
7061 ((glFogCoordf (coord GLfloat) -> void))
7062 "Set the current fog coordinates.
7063
7064 COORD
7065 Specify the fog distance.
7066
7067 `glFogCoord' specifies the fog coordinate that is associated with each
7068 vertex and the current raster position. The value specified is
7069 interpolated and used in computing the fog color (see `glFog').")
7070
7071 (define-gl-procedures
7072 ((glFogf (pname GLenum) (param GLfloat) -> void)
7073 (glFogi (pname GLenum) (param GLint) -> void))
7074 "Specify fog parameters.
7075
7076 PNAME
7077 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7078 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7079 `GL_FOG_COORD_SRC' are accepted.
7080
7081 PARAM
7082 Specifies the value that PNAME will be set to.
7083
7084 Fog is initially disabled. While enabled, fog affects rasterized
7085 geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7086 enable and disable fog, call `glEnable' and `glDisable' with argument
7087 `GL_FOG'.
7088
7089 `glFog' assigns the value or values in PARAMS to the fog parameter
7090 specified by PNAME. The following values are accepted for PNAME:
7091
7092 `GL_FOG_MODE'
7093 PARAMS is a single integer or floating-point value that specifies
7094 the equation to be used to compute the fog blend factor, F . Three
7095 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7096 `GL_EXP2'. The equations corresponding to these symbolic constants
7097 are defined below. The initial fog mode is `GL_EXP'.
7098
7099 `GL_FOG_DENSITY'
7100 PARAMS is a single integer or floating-point value that specifies
7101 DENSITY , the fog density used in both exponential fog equations.
7102 Only nonnegative densities are accepted. The initial fog density is
7103 1.
7104
7105 `GL_FOG_START'
7106 PARAMS is a single integer or floating-point value that specifies
7107 START , the near distance used in the linear fog equation. The
7108 initial near distance is 0.
7109
7110 `GL_FOG_END'
7111 PARAMS is a single integer or floating-point value that specifies
7112 END , the far distance used in the linear fog equation. The initial
7113 far distance is 1.
7114
7115 `GL_FOG_INDEX'
7116 PARAMS is a single integer or floating-point value that specifies
7117 I_F , the fog color index. The initial fog index is 0.
7118
7119 `GL_FOG_COLOR'
7120 PARAMS contains four integer or floating-point values that specify
7121 C_F , the fog color. Integer values are mapped linearly such that
7122 the most positive representable value maps to 1.0, and the most
7123 negative representable value maps to -1.0 . Floating-point values
7124 are mapped directly. After conversion, all color components are
7125 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7126
7127 `GL_FOG_COORD_SRC'
7128 PARAMS contains either of the following symbolic constants:
7129 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7130 that the current fog coordinate should be used as distance value in
7131 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7132 current fragment depth should be used as distance value in the fog
7133 computation.
7134
7135 Fog blends a fog color with each rasterized pixel fragment's
7136 post-texturing color using a blending factor F . Factor F is computed in
7137 one of three ways, depending on the fog mode. Let C be either the
7138 distance in eye coordinate from the origin (in the case that the
7139 `GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7140 (in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7141 for `GL_LINEAR' fog is F=END-C,/END-START,
7142
7143 The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7144
7145 The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7146
7147 Regardless of the fog mode, F is clamped to the range [0,1] after it is
7148 computed. Then, if the GL is in RGBA color mode, the fragment's red,
7149 green, and blue colors, represented by C_R , are replaced by
7150
7151 C_R,^″=F×C_R+(1-F,)×C_F
7152
7153 Fog does not affect a fragment's alpha component.
7154
7155 In color index mode, the fragment's color index I_R is replaced by
7156
7157 I_R,^″=I_R+(1-F,)×I_F
7158
7159
7160
7161 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7162 PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7163
7164 `GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7165 is negative.
7166
7167 `GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7168 execution of `glBegin' and the corresponding execution of `glEnd'.")
7169
7170 (define-gl-procedures
7171 ((glFrontFace (mode GLenum) -> void))
7172 "Define front- and back-facing polygons.
7173
7174 MODE
7175 Specifies the orientation of front-facing polygons. `GL_CW' and
7176 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7177
7178 In a scene composed entirely of opaque closed surfaces, back-facing
7179 polygons are never visible. Eliminating these invisible polygons has the
7180 obvious benefit of speeding up the rendering of the image. To enable and
7181 disable elimination of back-facing polygons, call `glEnable' and
7182 `glDisable' with argument `GL_CULL_FACE'.
7183
7184 The projection of a polygon to window coordinates is said to have
7185 clockwise winding if an imaginary object following the path from its
7186 first vertex, its second vertex, and so on, to its last vertex, and
7187 finally back to its first vertex, moves in a clockwise direction about
7188 the interior of the polygon. The polygon's winding is said to be
7189 counterclockwise if the imaginary object following the same path moves
7190 in a counterclockwise direction about the interior of the polygon.
7191 `glFrontFace' specifies whether polygons with clockwise winding in
7192 window coordinates, or counterclockwise winding in window coordinates,
7193 are taken to be front-facing. Passing `GL_CCW' to MODE selects
7194 counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7195 polygons as front-facing. By default, counterclockwise polygons are
7196 taken to be front-facing.
7197
7198 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7199
7200 `GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7201 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7202
7203 (define-gl-procedures
7204 ((glFrustum
7205 (left GLdouble)
7206 (right GLdouble)
7207 (bottom GLdouble)
7208 (top GLdouble)
7209 (nearVal GLdouble)
7210 (farVal GLdouble)
7211 ->
7212 void))
7213 "Multiply the current matrix by a perspective matrix.
7214
7215 LEFT
7216 RIGHT
7217
7218 Specify the coordinates for the left and right vertical clipping
7219 planes.
7220
7221 BOTTOM
7222 TOP
7223
7224 Specify the coordinates for the bottom and top horizontal clipping
7225 planes.
7226
7227 NEARVAL
7228 FARVAL
7229
7230 Specify the distances to the near and far depth clipping planes.
7231 Both distances must be positive.
7232
7233 `glFrustum' describes a perspective matrix that produces a perspective
7234 projection. The current matrix (see `glMatrixMode') is multiplied by
7235 this matrix and the result replaces the current matrix, as if
7236 `glMultMatrix' were called with the following matrix as its argument:
7237
7238
7239
7240 [(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7241 C D), (0 0 -1 0),]
7242
7243 A=RIGHT+LEFT,/RIGHT-LEFT,
7244
7245 B=TOP+BOTTOM,/TOP-BOTTOM,
7246
7247 C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7248
7249 D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7250
7251
7252
7253 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7254 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7255 that are mapped to the lower left and upper right corners of the window,
7256 assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7257 location of the far clipping plane. Both NEARVAL and FARVAL must be
7258 positive.
7259
7260 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7261 matrix stack.
7262
7263 `GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7264 if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7265
7266 `GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7267 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7268
7269 (define-gl-procedures
7270 ((glGenBuffers
7271 (n GLsizei)
7272 (buffers GLuint-*)
7273 ->
7274 void))
7275 "Generate buffer object names.
7276
7277 N
7278 Specifies the number of buffer object names to be generated.
7279
7280 BUFFERS
7281 Specifies an array in which the generated buffer object names are
7282 stored.
7283
7284 `glGenBuffers' returns N buffer object names in BUFFERS. There is no
7285 guarantee that the names form a contiguous set of integers; however, it
7286 is guaranteed that none of the returned names was in use immediately
7287 before the call to `glGenBuffers'.
7288
7289 Buffer object names returned by a call to `glGenBuffers' are not
7290 returned by subsequent calls, unless they are first deleted with
7291 `glDeleteBuffers'.
7292
7293 No buffer objects are associated with the returned buffer object names
7294 until they are first bound by calling `glBindBuffer'.
7295
7296 `GL_INVALID_VALUE' is generated if N is negative.
7297
7298 `GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7299 between the execution of `glBegin' and the corresponding execution of
7300 `glEnd'.")
7301
7302 (define-gl-procedures
7303 ((glGenLists (range GLsizei) -> GLuint))
7304 "Generate a contiguous set of empty display lists.
7305
7306 RANGE
7307 Specifies the number of contiguous empty display lists to be
7308 generated.
7309
7310 `glGenLists' has one argument, RANGE. It returns an integer N such that
7311 RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7312 are created. If RANGE is 0, if there is no group of RANGE contiguous
7313 names available, or if any error is generated, no display lists are
7314 generated, and 0 is returned.
7315
7316 `GL_INVALID_VALUE' is generated if RANGE is negative.
7317
7318 `GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7319 the execution of `glBegin' and the corresponding execution of `glEnd'.")
7320
7321 (define-gl-procedures
7322 ((glGenQueries (n GLsizei) (ids GLuint-*) -> void))
7323 "Generate query object names.
7324
7325 N
7326 Specifies the number of query object names to be generated.
7327
7328 IDS
7329 Specifies an array in which the generated query object names are
7330 stored.
7331
7332 `glGenQueries' returns N query object names in IDS. There is no
7333 guarantee that the names form a contiguous set of integers; however, it
7334 is guaranteed that none of the returned names was in use immediately
7335 before the call to `glGenQueries'.
7336
7337 Query object names returned by a call to `glGenQueries' are not returned
7338 by subsequent calls, unless they are first deleted with
7339 `glDeleteQueries'.
7340
7341 No query objects are associated with the returned query object names
7342 until they are first used by calling `glBeginQuery'.
7343
7344 `GL_INVALID_VALUE' is generated if N is negative.
7345
7346 `GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7347 between the execution of `glBegin' and the corresponding execution of
7348 `glEnd'.")
7349
7350 (define-gl-procedures
7351 ((glGenTextures
7352 (n GLsizei)
7353 (textures GLuint-*)
7354 ->
7355 void))
7356 "Generate texture names.
7357
7358 N
7359 Specifies the number of texture names to be generated.
7360
7361 TEXTURES
7362 Specifies an array in which the generated texture names are stored.
7363
7364 `glGenTextures' returns N texture names in TEXTURES. There is no
7365 guarantee that the names form a contiguous set of integers; however, it
7366 is guaranteed that none of the returned names was in use immediately
7367 before the call to `glGenTextures'.
7368
7369 The generated textures have no dimensionality; they assume the
7370 dimensionality of the texture target to which they are first bound (see
7371 `glBindTexture').
7372
7373 Texture names returned by a call to `glGenTextures' are not returned by
7374 subsequent calls, unless they are first deleted with `glDeleteTextures'.
7375
7376 `GL_INVALID_VALUE' is generated if N is negative.
7377
7378 `GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7379 between the execution of `glBegin' and the corresponding execution of
7380 `glEnd'.")
7381
7382 (define-gl-procedures
7383 ((glGetActiveAttrib
7384 (program GLuint)
7385 (index GLuint)
7386 (bufSize GLsizei)
7387 (length GLsizei-*)
7388 (size GLint-*)
7389 (type GLenum-*)
7390 (name GLchar-*)
7391 ->
7392 void))
7393 "Returns information about an active attribute variable for the specified
7394 program object.
7395
7396 PROGRAM
7397 Specifies the program object to be queried.
7398
7399 INDEX
7400 Specifies the index of the attribute variable to be queried.
7401
7402 BUFSIZE
7403 Specifies the maximum number of characters OpenGL is allowed to
7404 write in the character buffer indicated by NAME.
7405
7406 LENGTH
7407 Returns the number of characters actually written by OpenGL in the
7408 string indicated by NAME (excluding the null terminator) if a value
7409 other than `NULL' is passed.
7410
7411 SIZE
7412 Returns the size of the attribute variable.
7413
7414 TYPE
7415 Returns the data type of the attribute variable.
7416
7417 NAME
7418 Returns a null terminated string containing the name of the
7419 attribute variable.
7420
7421 `glGetActiveAttrib' returns information about an active attribute
7422 variable in the program object specified by PROGRAM. The number of
7423 active attributes can be obtained by calling `glGetProgram' with the
7424 value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7425 active attribute variable. Permissible values for INDEX range from 0 to
7426 the number of active attribute variables minus 1.
7427
7428 A vertex shader may use either built-in attribute variables,
7429 user-defined attribute variables, or both. Built-in attribute variables
7430 have a prefix of \"gl_\" and reference conventional OpenGL vertex
7431 attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7432 Language specification for a complete list.) User-defined attribute
7433 variables have arbitrary names and obtain their values through numbered
7434 generic vertex attributes. An attribute variable (either built-in or
7435 user-defined) is considered active if it is determined during the link
7436 operation that it may be accessed during program execution. Therefore,
7437 PROGRAM should have previously been the target of a call to
7438 `glLinkProgram', but it is not necessary for it to have been linked
7439 successfully.
7440
7441 The size of the character buffer required to store the longest attribute
7442 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7443 the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7444 allocate a buffer of sufficient size to store the returned attribute
7445 name. The size of this character buffer is passed in BUFSIZE, and a
7446 pointer to this character buffer is passed in NAME.
7447
7448 `glGetActiveAttrib' returns the name of the attribute variable indicated
7449 by INDEX, storing it in the character buffer specified by NAME. The
7450 string returned will be null terminated. The actual number of characters
7451 written into this buffer is returned in LENGTH, and this count does not
7452 include the null termination character. If the length of the returned
7453 string is not required, a value of `NULL' can be passed in the LENGTH
7454 argument.
7455
7456 The TYPE argument will return a pointer to the attribute variable's data
7457 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7458 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7459 `GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7460 `GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7461 `GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7462 size of the attribute, in units of the type returned in TYPE.
7463
7464 The list of active attribute variables may include both built-in
7465 attribute variables (which begin with the prefix \"gl_\") as well as
7466 user-defined attribute variable names.
7467
7468 This function will return as much information as it can about the
7469 specified active attribute variable. If no information is available,
7470 LENGTH will be 0, and NAME will be an empty string. This situation could
7471 occur if this function is called after a link operation that failed. If
7472 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7473 unmodified.
7474
7475 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7476 OpenGL.
7477
7478 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7479
7480 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7481 number of active attribute variables in PROGRAM.
7482
7483 `GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7484 between the execution of `glBegin' and the corresponding execution of
7485 `glEnd'.
7486
7487 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7488
7489 (define-gl-procedures
7490 ((glGetActiveUniform
7491 (program GLuint)
7492 (index GLuint)
7493 (bufSize GLsizei)
7494 (length GLsizei-*)
7495 (size GLint-*)
7496 (type GLenum-*)
7497 (name GLchar-*)
7498 ->
7499 void))
7500 "Returns information about an active uniform variable for the specified
7501 program object.
7502
7503 PROGRAM
7504 Specifies the program object to be queried.
7505
7506 INDEX
7507 Specifies the index of the uniform variable to be queried.
7508
7509 BUFSIZE
7510 Specifies the maximum number of characters OpenGL is allowed to
7511 write in the character buffer indicated by NAME.
7512
7513 LENGTH
7514 Returns the number of characters actually written by OpenGL in the
7515 string indicated by NAME (excluding the null terminator) if a value
7516 other than `NULL' is passed.
7517
7518 SIZE
7519 Returns the size of the uniform variable.
7520
7521 TYPE
7522 Returns the data type of the uniform variable.
7523
7524 NAME
7525 Returns a null terminated string containing the name of the uniform
7526 variable.
7527
7528 `glGetActiveUniform' returns information about an active uniform
7529 variable in the program object specified by PROGRAM. The number of
7530 active uniform variables can be obtained by calling `glGetProgram' with
7531 the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7532 active uniform variable. Permissible values for INDEX range from 0 to
7533 the number of active uniform variables minus 1.
7534
7535 Shaders may use either built-in uniform variables, user-defined uniform
7536 variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7537 and reference existing OpenGL state or values derived from such state
7538 (e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7539 specification for a complete list.) User-defined uniform variables have
7540 arbitrary names and obtain their values from the application through
7541 calls to `glUniform'. A uniform variable (either built-in or
7542 user-defined) is considered active if it is determined during the link
7543 operation that it may be accessed during program execution. Therefore,
7544 PROGRAM should have previously been the target of a call to
7545 `glLinkProgram', but it is not necessary for it to have been linked
7546 successfully.
7547
7548 The size of the character buffer required to store the longest uniform
7549 variable name in PROGRAM can be obtained by calling `glGetProgram' with
7550 the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7551 allocate a buffer of sufficient size to store the returned uniform
7552 variable name. The size of this character buffer is passed in BUFSIZE,
7553 and a pointer to this character buffer is passed in NAME.
7554
7555 `glGetActiveUniform' returns the name of the uniform variable indicated
7556 by INDEX, storing it in the character buffer specified by NAME. The
7557 string returned will be null terminated. The actual number of characters
7558 written into this buffer is returned in LENGTH, and this count does not
7559 include the null termination character. If the length of the returned
7560 string is not required, a value of `NULL' can be passed in the LENGTH
7561 argument.
7562
7563 The TYPE argument will return a pointer to the uniform variable's data
7564 type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7565 `GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7566 `GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7567 `GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7568 `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7569 `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7570 `GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7571 `GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7572
7573 If one or more elements of an array are active, the name of the array is
7574 returned in NAME, the type is returned in TYPE, and the SIZE parameter
7575 returns the highest array element index used, plus one, as determined by
7576 the compiler and/or linker. Only one active uniform variable will be
7577 reported for a uniform array.
7578
7579 Uniform variables that are declared as structures or arrays of
7580 structures will not be returned directly by this function. Instead, each
7581 of these uniform variables will be reduced to its fundamental components
7582 containing the \".\" and \"[]\" operators such that each of the names is
7583 valid as an argument to `glGetUniformLocation'. Each of these reduced
7584 uniform variables is counted as one active uniform variable and is
7585 assigned an index. A valid name cannot be a structure, an array of
7586 structures, or a subcomponent of a vector or matrix.
7587
7588 The size of the uniform variable will be returned in SIZE. Uniform
7589 variables other than arrays will have a size of 1. Structures and arrays
7590 of structures will be reduced as described earlier, such that each of
7591 the names returned will be a data type in the earlier list. If this
7592 reduction results in an array, the size returned will be as described
7593 for uniform arrays; otherwise, the size returned will be 1.
7594
7595 The list of active uniform variables may include both built-in uniform
7596 variables (which begin with the prefix \"gl_\") as well as user-defined
7597 uniform variable names.
7598
7599 This function will return as much information as it can about the
7600 specified active uniform variable. If no information is available,
7601 LENGTH will be 0, and NAME will be an empty string. This situation could
7602 occur if this function is called after a link operation that failed. If
7603 an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7604 unmodified.
7605
7606 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7607 OpenGL.
7608
7609 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7610
7611 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7612 number of active uniform variables in PROGRAM.
7613
7614 `GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7615 between the execution of `glBegin' and the corresponding execution of
7616 `glEnd'.
7617
7618 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7619
7620 (define-gl-procedures
7621 ((glGetAttachedShaders
7622 (program GLuint)
7623 (maxCount GLsizei)
7624 (count GLsizei-*)
7625 (shaders GLuint-*)
7626 ->
7627 void))
7628 "Returns the handles of the shader objects attached to a program object.
7629
7630 PROGRAM
7631 Specifies the program object to be queried.
7632
7633 MAXCOUNT
7634 Specifies the size of the array for storing the returned object
7635 names.
7636
7637 COUNT
7638 Returns the number of names actually returned in OBJECTS.
7639
7640 SHADERS
7641 Specifies an array that is used to return the names of attached
7642 shader objects.
7643
7644 `glGetAttachedShaders' returns the names of the shader objects attached
7645 to PROGRAM. The names of shader objects that are attached to PROGRAM
7646 will be returned in SHADERS. The actual number of shader names written
7647 into SHADERS is returned in COUNT. If no shader objects are attached to
7648 PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7649 be returned in SHADERS is specified by MAXCOUNT.
7650
7651 If the number of names actually returned is not required (for instance,
7652 if it has just been obtained by calling `glGetProgram'), a value of
7653 `NULL' may be passed for count. If no shader objects are attached to
7654 PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7655 attached shaders can be obtained by calling `glGetProgram' with the
7656 value `GL_ATTACHED_SHADERS'.
7657
7658 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7659 OpenGL.
7660
7661 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7662
7663 `GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7664
7665 `GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7666 executed between the execution of `glBegin' and the corresponding
7667 execution of `glEnd'.")
7668
7669 (define-gl-procedures
7670 ((glGetAttribLocation
7671 (program GLuint)
7672 (name const-GLchar-*)
7673 ->
7674 GLint))
7675 "Returns the location of an attribute variable.
7676
7677 PROGRAM
7678 Specifies the program object to be queried.
7679
7680 NAME
7681 Points to a null terminated string containing the name of the
7682 attribute variable whose location is to be queried.
7683
7684 `glGetAttribLocation' queries the previously linked program object
7685 specified by PROGRAM for the attribute variable specified by NAME and
7686 returns the index of the generic vertex attribute that is bound to that
7687 attribute variable. If NAME is a matrix attribute variable, the index of
7688 the first column of the matrix is returned. If the named attribute
7689 variable is not an active attribute in the specified program object or
7690 if NAME starts with the reserved prefix \"gl_\", a value of -1 is
7691 returned.
7692
7693 The association between an attribute variable name and a generic
7694 attribute index can be specified at any time by calling
7695 `glBindAttribLocation'. Attribute bindings do not go into effect until
7696 `glLinkProgram' is called. After a program object has been linked
7697 successfully, the index values for attribute variables remain fixed
7698 until the next link command occurs. The attribute values can only be
7699 queried after a link if the link was successful. `glGetAttribLocation'
7700 returns the binding that actually went into effect the last time
7701 `glLinkProgram' was called for the specified program object. Attribute
7702 bindings that have been specified since the last link operation are not
7703 returned by `glGetAttribLocation'.
7704
7705 `GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
7706 by OpenGL.
7707
7708 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7709
7710 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
7711 linked.
7712
7713 `GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
7714 between the execution of `glBegin' and the corresponding execution of
7715 `glEnd'.")
7716
7717 (define-gl-procedures
7718 ((glGetBufferSubData
7719 (target GLenum)
7720 (offset GLintptr)
7721 (size GLsizeiptr)
7722 (data GLvoid-*)
7723 ->
7724 void))
7725 "Returns a subset of a buffer object's data store.
7726
7727 TARGET
7728 Specifies the target buffer object. The symbolic constant must be
7729 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7730 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7731
7732 OFFSET
7733 Specifies the offset into the buffer object's data store from which
7734 data will be returned, measured in bytes.
7735
7736 SIZE
7737 Specifies the size in bytes of the data store region being
7738 returned.
7739
7740 DATA
7741 Specifies a pointer to the location where buffer object data is
7742 returned.
7743
7744 `glGetBufferSubData' returns some or all of the data from the buffer
7745 object currently bound to TARGET. Data starting at byte offset OFFSET
7746 and extending for SIZE bytes is copied from the data store to the memory
7747 pointed to by DATA. An error is thrown if the buffer object is currently
7748 mapped, or if OFFSET and SIZE together define a range beyond the bounds
7749 of the buffer object's data store.
7750
7751 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
7752 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
7753 `GL_PIXEL_UNPACK_BUFFER'.
7754
7755 `GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
7756 together they define a region of memory that extends beyond the buffer
7757 object's allocated data store.
7758
7759 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7760 is bound to TARGET.
7761
7762 `GL_INVALID_OPERATION' is generated if the buffer object being queried
7763 is mapped.
7764
7765 `GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
7766 between the execution of `glBegin' and the corresponding execution of
7767 `glEnd'.")
7768
7769 (define-gl-procedures
7770 ((glGetClipPlane
7771 (plane GLenum)
7772 (equation GLdouble-*)
7773 ->
7774 void))
7775 "Return the coefficients of the specified clipping plane.
7776
7777 PLANE
7778 Specifies a clipping plane. The number of clipping planes depends
7779 on the implementation, but at least six clipping planes are
7780 supported. They are identified by symbolic names of the form
7781 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
7782 `GL_MAX_CLIP_PLANES' - 1.
7783
7784 EQUATION
7785 Returns four double-precision values that are the coefficients of
7786 the plane equation of PLANE in eye coordinates. The initial value
7787 is (0, 0, 0, 0).
7788
7789 `glGetClipPlane' returns in EQUATION the four coefficients of the plane
7790 equation for PLANE.
7791
7792 `GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
7793
7794 `GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
7795 between the execution of `glBegin' and the corresponding execution of
7796 `glEnd'.")
7797
7798 (define-gl-procedures
7799 ((glGetColorTable
7800 (target GLenum)
7801 (format GLenum)
7802 (type GLenum)
7803 (table GLvoid-*)
7804 ->
7805 void))
7806 "Retrieve contents of a color lookup table.
7807
7808 TARGET
7809 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
7810 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
7811
7812 FORMAT
7813 The format of the pixel data in TABLE. The possible values are
7814 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
7815 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
7816
7817 TYPE
7818 The type of the pixel data in TABLE. Symbolic constants
7819 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7820 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7821 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7822 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
7823 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7824 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7825 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7826 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
7827 are accepted.
7828
7829 TABLE
7830 Pointer to a one-dimensional array of pixel data containing the
7831 contents of the color table.
7832
7833 `glGetColorTable' returns in TABLE the contents of the color table
7834 specified by TARGET. No pixel transfer operations are performed, but
7835 pixel storage modes that are applicable to `glReadPixels' are performed.
7836
7837 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7838 target (see `glBindBuffer') while a histogram table is requested, TABLE
7839 is treated as a byte offset into the buffer object's data store.
7840
7841 Color components that are requested in the specified FORMAT, but which
7842 are not included in the internal format of the color lookup table, are
7843 returned as zero. The assignments of internal color components to the
7844 components requested by FORMAT are
7845
7846 *Internal Component*
7847 *Resulting Component*
7848
7849 Red
7850 Red
7851
7852 Green
7853 Green
7854
7855 Blue
7856 Blue
7857
7858 Alpha
7859 Alpha
7860
7861 Luminance
7862 Red
7863
7864 Intensity
7865 Red
7866
7867
7868
7869 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
7870 values.
7871
7872 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
7873 values.
7874
7875 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
7876 values.
7877
7878 `GL_INVALID_OPERATION' is generated if TYPE is one of
7879 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
7880 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
7881 is not `GL_RGB'.
7882
7883 `GL_INVALID_OPERATION' is generated if TYPE is one of
7884 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
7885 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
7886 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
7887 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
7888 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
7889
7890 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7891 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7892 store is currently mapped.
7893
7894 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7895 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7896 to the buffer object such that the memory writes required would exceed
7897 the data store size.
7898
7899 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7900 bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
7901 divisible into the number of bytes needed to store in memory a datum
7902 indicated by TYPE.
7903
7904 `GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
7905 between the execution of `glBegin' and the corresponding execution of
7906 `glEnd'.")
7907
7908 (define-gl-procedures
7909 ((glGetCompressedTexImage
7910 (target GLenum)
7911 (lod GLint)
7912 (img GLvoid-*)
7913 ->
7914 void))
7915 "Return a compressed texture image.
7916
7917 TARGET
7918 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
7919 `GL_TEXTURE_2D', and
7920 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
7921 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
7922 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
7923 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
7924
7925 LOD
7926 Specifies the level-of-detail number of the desired image. Level 0
7927 is the base image level. Level N is the N th mipmap reduction
7928 image.
7929
7930 IMG
7931 Returns the compressed texture image.
7932
7933 `glGetCompressedTexImage' returns the compressed texture image
7934 associated with TARGET and LOD into IMG. IMG should be an array of
7935 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
7936 desired texture image was one specified by `glTexImage1D'
7937 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
7938 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
7939 specifies the level-of-detail number of the desired image.
7940
7941 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
7942 target (see `glBindBuffer') while a texture image is requested, IMG is
7943 treated as a byte offset into the buffer object's data store.
7944
7945 To minimize errors, first verify that the texture is compressed by
7946 calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
7947 If the texture is compressed, then determine the amount of memory
7948 required to store the compressed texture by calling
7949 `glGetTexLevelParameter' with argument
7950 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
7951 format of the texture by calling `glGetTexLevelParameter' with argument
7952 `GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
7953 associate the internal format and size with the retrieved texture image.
7954 These data can be used by the respective texture or subtexture loading
7955 routine used for loading TARGET textures.
7956
7957 `GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
7958 the maximum number of LODs permitted by the implementation.
7959
7960 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
7961 to retrieve a texture that is in an uncompressed internal format.
7962
7963 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7964 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
7965 store is currently mapped.
7966
7967 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
7968 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
7969 to the buffer object such that the memory writes required would exceed
7970 the data store size.
7971
7972 `GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
7973 executed between the execution of `glBegin' and the corresponding
7974 execution of `glEnd'.")
7975
7976 (define-gl-procedures
7977 ((glGetConvolutionFilter
7978 (target GLenum)
7979 (format GLenum)
7980 (type GLenum)
7981 (image GLvoid-*)
7982 ->
7983 void))
7984 "Get current 1D or 2D convolution filter kernel.
7985
7986 TARGET
7987 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
7988 `GL_CONVOLUTION_2D'.
7989
7990 FORMAT
7991 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
7992 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
7993 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
7994
7995 TYPE
7996 Data type of components in the output image. Symbolic constants
7997 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
7998 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
7999 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8000 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8001 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8002 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8003 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8004 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8005 are accepted.
8006
8007 IMAGE
8008 Pointer to storage for the output image.
8009
8010 `glGetConvolutionFilter' returns the current 1D or 2D convolution filter
8011 kernel as an image. The one- or two-dimensional image is placed in IMAGE
8012 according to the specifications in FORMAT and TYPE. No pixel transfer
8013 operations are performed on this image, but the relevant pixel storage
8014 modes are applied.
8015
8016 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8017 target (see `glBindBuffer') while a convolution filter is requested,
8018 IMAGE is treated as a byte offset into the buffer object's data store.
8019
8020 Color components that are present in FORMAT but not included in the
8021 internal format of the filter are returned as zero. The assignments of
8022 internal color components to the components of FORMAT are as follows.
8023
8024 *Internal Component*
8025 *Resulting Component*
8026
8027 Red
8028 Red
8029
8030 Green
8031 Green
8032
8033 Blue
8034 Blue
8035
8036 Alpha
8037 Alpha
8038
8039 Luminance
8040 Red
8041
8042 Intensity
8043 Red
8044
8045
8046
8047 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8048 values.
8049
8050 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8051 values.
8052
8053 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8054 values.
8055
8056 `GL_INVALID_OPERATION' is generated if TYPE is one of
8057 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8058 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8059 is not `GL_RGB'.
8060
8061 `GL_INVALID_OPERATION' is generated if TYPE is one of
8062 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8063 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8064 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8065 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8066 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8067
8068 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8069 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8070 store is currently mapped.
8071
8072 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8073 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8074 to the buffer object such that the memory writes required would exceed
8075 the data store size.
8076
8077 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8078 bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8079 divisible into the number of bytes needed to store in memory a datum
8080 indicated by TYPE.
8081
8082 `GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8083 executed between the execution of `glBegin' and the corresponding
8084 execution of `glEnd'.")
8085
8086 (define-gl-procedures
8087 ((glGetError -> GLenum))
8088 "Return error information.
8089
8090 `glGetError' returns the value of the error flag. Each detectable error
8091 is assigned a numeric code and symbolic name. When an error occurs, the
8092 error flag is set to the appropriate error code value. No other errors
8093 are recorded until `glGetError' is called, the error code is returned,
8094 and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8095 returns `GL_NO_ERROR', there has been no detectable error since the last
8096 call to `glGetError', or since the GL was initialized.
8097
8098 To allow for distributed implementations, there may be several error
8099 flags. If any single error flag has recorded an error, the value of that
8100 flag is returned and that flag is reset to `GL_NO_ERROR' when
8101 `glGetError' is called. If more than one flag has recorded an error,
8102 `glGetError' returns and clears an arbitrary error flag value. Thus,
8103 `glGetError' should always be called in a loop, until it returns
8104 `GL_NO_ERROR', if all error flags are to be reset.
8105
8106 Initially, all error flags are set to `GL_NO_ERROR'.
8107
8108 The following errors are currently defined:
8109
8110 `GL_NO_ERROR'
8111 No error has been recorded. The value of this symbolic constant is
8112 guaranteed to be 0.
8113
8114 `GL_INVALID_ENUM'
8115 An unacceptable value is specified for an enumerated argument. The
8116 offending command is ignored and has no other side effect than to
8117 set the error flag.
8118
8119 `GL_INVALID_VALUE'
8120 A numeric argument is out of range. The offending command is
8121 ignored and has no other side effect than to set the error flag.
8122
8123 `GL_INVALID_OPERATION'
8124 The specified operation is not allowed in the current state. The
8125 offending command is ignored and has no other side effect than to
8126 set the error flag.
8127
8128 `GL_STACK_OVERFLOW'
8129 This command would cause a stack overflow. The offending command is
8130 ignored and has no other side effect than to set the error flag.
8131
8132 `GL_STACK_UNDERFLOW'
8133 This command would cause a stack underflow. The offending command
8134 is ignored and has no other side effect than to set the error flag.
8135
8136 `GL_OUT_OF_MEMORY'
8137 There is not enough memory left to execute the command. The state
8138 of the GL is undefined, except for the state of the error flags,
8139 after this error is recorded.
8140
8141 `GL_TABLE_TOO_LARGE'
8142 The specified table exceeds the implementation's maximum supported
8143 table size. The offending command is ignored and has no other side
8144 effect than to set the error flag.
8145
8146 When an error flag is set, results of a GL operation are undefined only
8147 if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8148 generating the error is ignored and has no effect on the GL state or
8149 frame buffer contents. If the generating command returns a value, it
8150 returns 0. If `glGetError' itself generates an error, it returns 0.
8151
8152 `GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8153 the execution of `glBegin' and the corresponding execution of `glEnd'.
8154 In this case, `glGetError' returns 0.")
8155
8156 (define-gl-procedures
8157 ((glGetHistogram
8158 (target GLenum)
8159 (reset GLboolean)
8160 (format GLenum)
8161 (type GLenum)
8162 (values GLvoid-*)
8163 ->
8164 void))
8165 "Get histogram table.
8166
8167 TARGET
8168 Must be `GL_HISTOGRAM'.
8169
8170 RESET
8171 If `GL_TRUE', each component counter that is actually returned is
8172 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8173 of the counters in the histogram table is modified.
8174
8175 FORMAT
8176 The format of values to be returned in VALUES. Must be one of
8177 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8178 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8179
8180 TYPE
8181 The type of values to be returned in VALUES. Symbolic constants
8182 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8183 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8184 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8185 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8186 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8187 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8188 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8189 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8190 are accepted.
8191
8192 VALUES
8193 A pointer to storage for the returned histogram table.
8194
8195 `glGetHistogram' returns the current histogram table as a
8196 one-dimensional image with the same width as the histogram. No pixel
8197 transfer operations are performed on this image, but pixel storage modes
8198 that are applicable to 1D images are honored.
8199
8200 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8201 target (see `glBindBuffer') while a histogram table is requested, VALUES
8202 is treated as a byte offset into the buffer object's data store.
8203
8204 Color components that are requested in the specified FORMAT, but which
8205 are not included in the internal format of the histogram, are returned
8206 as zero. The assignments of internal color components to the components
8207 requested by FORMAT are:
8208
8209 *Internal Component*
8210 *Resulting Component*
8211
8212 Red
8213 Red
8214
8215 Green
8216 Green
8217
8218 Blue
8219 Blue
8220
8221 Alpha
8222 Alpha
8223
8224 Luminance
8225 Red
8226
8227
8228
8229 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8230
8231 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8232 values.
8233
8234 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8235 values.
8236
8237 `GL_INVALID_OPERATION' is generated if TYPE is one of
8238 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8239 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8240 is not `GL_RGB'.
8241
8242 `GL_INVALID_OPERATION' is generated if TYPE is one of
8243 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8244 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8245 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8246 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8247 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8248
8249 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8250 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8251 store is currently mapped.
8252
8253 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8254 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8255 to the buffer object such that the memory writes required would exceed
8256 the data store size.
8257
8258 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8259 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8260 divisible into the number of bytes needed to store in memory a datum
8261 indicated by TYPE.
8262
8263 `GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8264 between the execution of `glBegin' and the corresponding execution of
8265 `glEnd'.")
8266
8267 (define-gl-procedures
8268 ((glGetMinmax
8269 (target GLenum)
8270 (reset GLboolean)
8271 (format GLenum)
8272 (types GLenum)
8273 (values GLvoid-*)
8274 ->
8275 void))
8276 "Get minimum and maximum pixel values.
8277
8278 TARGET
8279 Must be `GL_MINMAX'.
8280
8281 RESET
8282 If `GL_TRUE', all entries in the minmax table that are actually
8283 returned are reset to their initial values. (Other entries are
8284 unaltered.) If `GL_FALSE', the minmax table is unaltered.
8285
8286 FORMAT
8287 The format of the data to be returned in VALUES. Must be one of
8288 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8289 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8290
8291 TYPES
8292 The type of the data to be returned in VALUES. Symbolic constants
8293 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8294 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8295 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8296 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8297 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8298 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8299 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8300 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8301 are accepted.
8302
8303 VALUES
8304 A pointer to storage for the returned values.
8305
8306 `glGetMinmax' returns the accumulated minimum and maximum pixel values
8307 (computed on a per-component basis) in a one-dimensional image of width
8308 2. The first set of return values are the minima, and the second set of
8309 return values are the maxima. The format of the return values is
8310 determined by FORMAT, and their type is determined by TYPES.
8311
8312 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8313 target (see `glBindBuffer') while minimum and maximum pixel values are
8314 requested, VALUES is treated as a byte offset into the buffer object's
8315 data store.
8316
8317 No pixel transfer operations are performed on the return values, but
8318 pixel storage modes that are applicable to one-dimensional images are
8319 performed. Color components that are requested in the specified FORMAT,
8320 but that are not included in the internal format of the minmax table,
8321 are returned as zero. The assignment of internal color components to the
8322 components requested by FORMAT are as follows:
8323
8324
8325
8326 *Internal Component*
8327 *Resulting Component*
8328
8329 Red
8330 Red
8331
8332 Green
8333 Green
8334
8335 Blue
8336 Blue
8337
8338 Alpha
8339 Alpha
8340
8341 Luminance
8342 Red
8343
8344 If RESET is `GL_TRUE', the minmax table entries corresponding to the
8345 return values are reset to their initial values. Minimum and maximum
8346 values that are not returned are not modified, even if RESET is
8347 `GL_TRUE'.
8348
8349 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
8350
8351 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8352 values.
8353
8354 `GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
8355 values.
8356
8357 `GL_INVALID_OPERATION' is generated if TYPES is one of
8358 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8359 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8360 is not `GL_RGB'.
8361
8362 `GL_INVALID_OPERATION' is generated if TYPES is one of
8363 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8364 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8365 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8366 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8367 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8368
8369 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8370 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8371 store is currently mapped.
8372
8373 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8374 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8375 to the buffer object such that the memory writes required would exceed
8376 the data store size.
8377
8378 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8379 bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8380 divisible into the number of bytes needed to store in memory a datum
8381 indicated by TYPE.
8382
8383 `GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
8384 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8385
8386 (define-gl-procedures
8387 ((glGetPolygonStipple (pattern GLubyte-*) -> void))
8388 "Return the polygon stipple pattern.
8389
8390 PATTERN
8391 Returns the stipple pattern. The initial value is all 1's.
8392
8393 `glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
8394 pattern. The pattern is packed into memory as if `glReadPixels' with
8395 both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
8396 `GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
8397 internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
8398 transfer operations (shift, offset, pixel map) are not applied to the
8399 returned stipple image.
8400
8401 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8402 target (see `glBindBuffer') while a polygon stipple pattern is
8403 requested, PATTERN is treated as a byte offset into the buffer object's
8404 data store.
8405
8406 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8407 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8408 store is currently mapped.
8409
8410 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8411 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8412 to the buffer object such that the memory writes required would exceed
8413 the data store size.
8414
8415 `GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
8416 between the execution of `glBegin' and the corresponding execution of
8417 `glEnd'.")
8418
8419 (define-gl-procedures
8420 ((glGetProgramInfoLog
8421 (program GLuint)
8422 (maxLength GLsizei)
8423 (length GLsizei-*)
8424 (infoLog GLchar-*)
8425 ->
8426 void))
8427 "Returns the information log for a program object.
8428
8429 PROGRAM
8430 Specifies the program object whose information log is to be
8431 queried.
8432
8433 MAXLENGTH
8434 Specifies the size of the character buffer for storing the returned
8435 information log.
8436
8437 LENGTH
8438 Returns the length of the string returned in INFOLOG (excluding the
8439 null terminator).
8440
8441 INFOLOG
8442 Specifies an array of characters that is used to return the
8443 information log.
8444
8445 `glGetProgramInfoLog' returns the information log for the specified
8446 program object. The information log for a program object is modified
8447 when the program object is linked or validated. The string that is
8448 returned will be null terminated.
8449
8450 `glGetProgramInfoLog' returns in INFOLOG as much of the information log
8451 as it can, up to a maximum of MAXLENGTH characters. The number of
8452 characters actually returned, excluding the null termination character,
8453 is specified by LENGTH. If the length of the returned string is not
8454 required, a value of `NULL' can be passed in the LENGTH argument. The
8455 size of the buffer required to store the returned information log can be
8456 obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
8457
8458 The information log for a program object is either an empty string, or a
8459 string containing information about the last link operation, or a string
8460 containing information about the last validation operation. It may
8461 contain diagnostic messages, warning messages, and other information.
8462 When a program object is created, its information log will be a string
8463 of length 0.
8464
8465 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8466 OpenGL.
8467
8468 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8469
8470 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8471
8472 `GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
8473 between the execution of `glBegin' and the corresponding execution of
8474 `glEnd'.")
8475
8476 (define-gl-procedures
8477 ((glGetSeparableFilter
8478 (target GLenum)
8479 (format GLenum)
8480 (type GLenum)
8481 (row GLvoid-*)
8482 (column GLvoid-*)
8483 (span GLvoid-*)
8484 ->
8485 void))
8486 "Get separable convolution filter kernel images.
8487
8488 TARGET
8489 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
8490
8491 FORMAT
8492 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
8493 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
8494 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8495
8496 TYPE
8497 Data type of components in the output images. Symbolic constants
8498 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8499 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8500 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8501 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8502 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8503 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8504 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8505 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8506 are accepted.
8507
8508 ROW
8509 Pointer to storage for the row filter image.
8510
8511 COLUMN
8512 Pointer to storage for the column filter image.
8513
8514 SPAN
8515 Pointer to storage for the span filter image (currently unused).
8516
8517 `glGetSeparableFilter' returns the two one-dimensional filter kernel
8518 images for the current separable 2D convolution filter. The row image is
8519 placed in ROW and the column image is placed in COLUMN according to the
8520 specifications in FORMAT and TYPE. (In the current implementation, SPAN
8521 is not affected in any way.) No pixel transfer operations are performed
8522 on the images, but the relevant pixel storage modes are applied.
8523
8524 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8525 target (see `glBindBuffer') while a separable convolution filter is
8526 requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
8527 buffer object's data store.
8528
8529 Color components that are present in FORMAT but not included in the
8530 internal format of the filters are returned as zero. The assignments of
8531 internal color components to the components of FORMAT are as follows:
8532
8533
8534
8535 *Internal Component*
8536 *Resulting Component*
8537
8538 Red
8539 Red
8540
8541 Green
8542 Green
8543
8544 Blue
8545 Blue
8546
8547 Alpha
8548 Alpha
8549
8550 Luminance
8551 Red
8552
8553 Intensity
8554 Red
8555
8556
8557
8558 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
8559
8560 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8561 values.
8562
8563 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8564 values.
8565
8566 `GL_INVALID_OPERATION' is generated if TYPE is one of
8567 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8568 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8569 is not `GL_RGB'.
8570
8571 `GL_INVALID_OPERATION' is generated if TYPE is one of
8572 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8573 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8574 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8575 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8576 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8577
8578 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8579 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8580 store is currently mapped.
8581
8582 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8583 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8584 to the buffer object such that the memory writes required would exceed
8585 the data store size.
8586
8587 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8588 bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
8589 evenly divisible into the number of bytes needed to store in memory a
8590 datum indicated by TYPE.
8591
8592 `GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
8593 executed between the execution of `glBegin' and the corresponding
8594 execution of `glEnd'.")
8595
8596 (define-gl-procedures
8597 ((glGetShaderInfoLog
8598 (shader GLuint)
8599 (maxLength GLsizei)
8600 (length GLsizei-*)
8601 (infoLog GLchar-*)
8602 ->
8603 void))
8604 "Returns the information log for a shader object.
8605
8606 SHADER
8607 Specifies the shader object whose information log is to be queried.
8608
8609 MAXLENGTH
8610 Specifies the size of the character buffer for storing the returned
8611 information log.
8612
8613 LENGTH
8614 Returns the length of the string returned in INFOLOG (excluding the
8615 null terminator).
8616
8617 INFOLOG
8618 Specifies an array of characters that is used to return the
8619 information log.
8620
8621 `glGetShaderInfoLog' returns the information log for the specified
8622 shader object. The information log for a shader object is modified when
8623 the shader is compiled. The string that is returned will be null
8624 terminated.
8625
8626 `glGetShaderInfoLog' returns in INFOLOG as much of the information log
8627 as it can, up to a maximum of MAXLENGTH characters. The number of
8628 characters actually returned, excluding the null termination character,
8629 is specified by LENGTH. If the length of the returned string is not
8630 required, a value of `NULL' can be passed in the LENGTH argument. The
8631 size of the buffer required to store the returned information log can be
8632 obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
8633
8634 The information log for a shader object is a string that may contain
8635 diagnostic messages, warning messages, and other information about the
8636 last compile operation. When a shader object is created, its information
8637 log will be a string of length 0.
8638
8639 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8640 OpenGL.
8641
8642 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8643
8644 `GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
8645
8646 `GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
8647 between the execution of `glBegin' and the corresponding execution of
8648 `glEnd'.")
8649
8650 (define-gl-procedures
8651 ((glGetShaderSource
8652 (shader GLuint)
8653 (bufSize GLsizei)
8654 (length GLsizei-*)
8655 (source GLchar-*)
8656 ->
8657 void))
8658 "Returns the source code string from a shader object.
8659
8660 SHADER
8661 Specifies the shader object to be queried.
8662
8663 BUFSIZE
8664 Specifies the size of the character buffer for storing the returned
8665 source code string.
8666
8667 LENGTH
8668 Returns the length of the string returned in SOURCE (excluding the
8669 null terminator).
8670
8671 SOURCE
8672 Specifies an array of characters that is used to return the source
8673 code string.
8674
8675 `glGetShaderSource' returns the concatenation of the source code strings
8676 from the shader object specified by SHADER. The source code strings for
8677 a shader object are the result of a previous call to `glShaderSource'.
8678 The string returned by the function will be null terminated.
8679
8680 `glGetShaderSource' returns in SOURCE as much of the source code string
8681 as it can, up to a maximum of BUFSIZE characters. The number of
8682 characters actually returned, excluding the null termination character,
8683 is specified by LENGTH. If the length of the returned string is not
8684 required, a value of `NULL' can be passed in the LENGTH argument. The
8685 size of the buffer required to store the returned source code string can
8686 be obtained by calling `glGetShader' with the value
8687 `GL_SHADER_SOURCE_LENGTH'.
8688
8689 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
8690 OpenGL.
8691
8692 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
8693
8694 `GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
8695
8696 `GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
8697 between the execution of `glBegin' and the corresponding execution of
8698 `glEnd'.")
8699
8700 (define-gl-procedures
8701 ((glGetString (name GLenum) -> const-GLubyte*))
8702 "Return a string describing the current GL connection.
8703
8704 NAME
8705 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
8706 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
8707
8708 `glGetString' returns a pointer to a static string describing some
8709 aspect of the current GL connection. NAME can be one of the following:
8710
8711 `GL_VENDOR'
8712
8713
8714 Returns the company responsible for this GL implementation. This
8715 name does not change from release to release.
8716
8717 `GL_RENDERER'
8718
8719
8720 Returns the name of the renderer. This name is typically specific
8721 to a particular configuration of a hardware platform. It does not
8722 change from release to release.
8723
8724 `GL_VERSION'
8725
8726
8727 Returns a version or release number.
8728
8729 `GL_SHADING_LANGUAGE_VERSION'
8730
8731
8732 Returns a version or release number for the shading language.
8733
8734 `GL_EXTENSIONS'
8735
8736
8737 Returns a space-separated list of supported extensions to GL.
8738
8739 Because the GL does not include queries for the performance
8740 characteristics of an implementation, some applications are written to
8741 recognize known platforms and modify their GL usage based on known
8742 performance characteristics of these platforms. Strings `GL_VENDOR' and
8743 `GL_RENDERER' together uniquely specify a platform. They do not change
8744 from release to release and should be used by platform-recognition
8745 algorithms.
8746
8747 Some applications want to make use of features that are not part of the
8748 standard GL. These features may be implemented as extensions to the
8749 standard GL. The `GL_EXTENSIONS' string is a space-separated list of
8750 supported GL extensions. (Extension names never contain a space
8751 character.)
8752
8753 The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
8754 version number. The version number uses one of these forms:
8755
8756 MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
8757
8758 Vendor-specific information may follow the version number. Its format
8759 depends on the implementation, but a space always separates the version
8760 number and the vendor-specific information.
8761
8762 All strings are null-terminated.
8763
8764 `GL_INVALID_ENUM' is generated if NAME is not an accepted value.
8765
8766 `GL_INVALID_OPERATION' is generated if `glGetString' is executed between
8767 the execution of `glBegin' and the corresponding execution of `glEnd'.")
8768
8769 (define-gl-procedures
8770 ((glGetTexImage
8771 (target GLenum)
8772 (level GLint)
8773 (format GLenum)
8774 (type GLenum)
8775 (img GLvoid-*)
8776 ->
8777 void))
8778 "Return a texture image.
8779
8780 TARGET
8781 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8782 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8783 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8784 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8785 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8786
8787 LEVEL
8788 Specifies the level-of-detail number of the desired image. Level 0
8789 is the base image level. Level N is the N th mipmap reduction
8790 image.
8791
8792 FORMAT
8793 Specifies a pixel format for the returned data. The supported
8794 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
8795 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
8796 `GL_LUMINANCE_ALPHA'.
8797
8798 TYPE
8799 Specifies a pixel type for the returned data. The supported types
8800 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
8801 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
8802 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
8803 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
8804 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
8805 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
8806 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
8807 `GL_UNSIGNED_INT_2_10_10_10_REV'.
8808
8809 IMG
8810 Returns the texture image. Should be a pointer to an array of the
8811 type specified by TYPE.
8812
8813 `glGetTexImage' returns a texture image into IMG. TARGET specifies
8814 whether the desired texture image is one specified by `glTexImage1D'
8815 (`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8816 `GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
8817 specifies the level-of-detail number of the desired image. FORMAT and
8818 TYPE specify the format and type of the desired image array. See the
8819 reference pages `glTexImage1D' and `glDrawPixels' for a description of
8820 the acceptable values for the FORMAT and TYPE parameters, respectively.
8821
8822 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8823 target (see `glBindBuffer') while a texture image is requested, IMG is
8824 treated as a byte offset into the buffer object's data store.
8825
8826 To understand the operation of `glGetTexImage', consider the selected
8827 internal four-component texture image to be an RGBA color buffer the
8828 size of the image. The semantics of `glGetTexImage' are then identical
8829 to those of `glReadPixels', with the exception that no pixel transfer
8830 operations are performed, when called with the same FORMAT and TYPE,
8831 with X and Y set to 0, WIDTH set to the width of the texture image
8832 (including border if one was specified), and HEIGHT set to 1 for 1D
8833 images, or to the height of the texture image (including border if one
8834 was specified) for 2D images. Because the internal texture image is an
8835 RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
8836 `GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
8837 accepted.
8838
8839 If the selected texture image does not contain four components, the
8840 following mappings are applied. Single-component textures are treated as
8841 RGBA buffers with red set to the single-component value, green set to 0,
8842 blue set to 0, and alpha set to 1. Two-component textures are treated as
8843 RGBA buffers with red set to the value of component zero, alpha set to
8844 the value of component one, and green and blue set to 0. Finally,
8845 three-component textures are treated as RGBA buffers with red set to
8846 component zero, green set to component one, blue set to component two,
8847 and alpha set to 1.
8848
8849 To determine the required size of IMG, use `glGetTexLevelParameter' to
8850 determine the dimensions of the internal texture image, then scale the
8851 required number of pixels by the storage required for each pixel, based
8852 on FORMAT and TYPE. Be sure to take the pixel storage parameters into
8853 account, especially `GL_PACK_ALIGNMENT'.
8854
8855 `GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
8856 accepted value.
8857
8858 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8859
8860 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
8861 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8862
8863 `GL_INVALID_OPERATION' is returned if TYPE is one of
8864 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8865 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8866 is not `GL_RGB'.
8867
8868 `GL_INVALID_OPERATION' is returned if TYPE is one of
8869 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8870 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8871 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8872 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
8873 FORMAT is neither `GL_RGBA' or `GL_BGRA'.
8874
8875 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8876 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8877 store is currently mapped.
8878
8879 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8880 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8881 to the buffer object such that the memory writes required would exceed
8882 the data store size.
8883
8884 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8885 bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
8886 divisible into the number of bytes needed to store in memory a datum
8887 indicated by TYPE.
8888
8889 `GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
8890 between the execution of `glBegin' and the corresponding execution of
8891 `glEnd'.")
8892
8893 (define-gl-procedures
8894 ((glGetUniformLocation
8895 (program GLuint)
8896 (name const-GLchar-*)
8897 ->
8898 GLint))
8899 "Returns the location of a uniform variable.
8900
8901 PROGRAM
8902 Specifies the program object to be queried.
8903
8904 NAME
8905 Points to a null terminated string containing the name of the
8906 uniform variable whose location is to be queried.
8907
8908 `glGetUniformLocation ' returns an integer that represents the location
8909 of a specific uniform variable within a program object. NAME must be a
8910 null terminated string that contains no white space. NAME must be an
8911 active uniform variable name in PROGRAM that is not a structure, an
8912 array of structures, or a subcomponent of a vector or a matrix. This
8913 function returns -1 if NAME does not correspond to an active uniform
8914 variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
8915
8916 Uniform variables that are structures or arrays of structures may be
8917 queried by calling `glGetUniformLocation' for each field within the
8918 structure. The array element operator \"[]\" and the structure field
8919 operator \".\" may be used in NAME in order to select elements within an
8920 array or fields within a structure. The result of using these operators
8921 is not allowed to be another structure, an array of structures, or a
8922 subcomponent of a vector or a matrix. Except if the last part of NAME
8923 indicates a uniform variable array, the location of the first element of
8924 an array can be retrieved by using the name of the array, or by using
8925 the name appended by \"[0]\".
8926
8927 The actual locations assigned to uniform variables are not known until
8928 the program object is linked successfully. After linking has occurred,
8929 the command `glGetUniformLocation' can be used to obtain the location of
8930 a uniform variable. This location value can then be passed to
8931 `glUniform' to set the value of the uniform variable or to
8932 `glGetUniform' in order to query the current value of the uniform
8933 variable. After a program object has been linked successfully, the index
8934 values for uniform variables remain fixed until the next link command
8935 occurs. Uniform variable locations and values can only be queried after
8936 a link if the link was successful.
8937
8938 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8939 OpenGL.
8940
8941 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8942
8943 `GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8944 linked.
8945
8946 `GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
8947 executed between the execution of `glBegin' and the corresponding
8948 execution of `glEnd'.")
8949
8950 (define-gl-procedures
8951 ((glHint (target GLenum) (mode GLenum) -> void))
8952 "Specify implementation-specific hints.
8953
8954 TARGET
8955 Specifies a symbolic constant indicating the behavior to be
8956 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
8957 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
8958 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
8959 `GL_TEXTURE_COMPRESSION_HINT', and
8960 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
8961
8962 MODE
8963 Specifies a symbolic constant indicating the desired behavior.
8964 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
8965
8966 Certain aspects of GL behavior, when there is room for interpretation,
8967 can be controlled with hints. A hint is specified with two arguments.
8968 TARGET is a symbolic constant indicating the behavior to be controlled,
8969 and MODE is another symbolic constant indicating the desired behavior.
8970 The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
8971 the following:
8972
8973 `GL_FASTEST'
8974
8975
8976 The most efficient option should be chosen.
8977
8978 `GL_NICEST'
8979
8980
8981 The most correct, or highest quality, option should be chosen.
8982
8983 `GL_DONT_CARE'
8984
8985
8986 No preference.
8987
8988 Though the implementation aspects that can be hinted are well defined,
8989 the interpretation of the hints depends on the implementation. The hint
8990 aspects that can be specified with TARGET, along with suggested
8991 semantics, are as follows:
8992
8993 `GL_FOG_HINT'
8994
8995
8996 Indicates the accuracy of fog calculation. If per-pixel fog
8997 calculation is not efficiently supported by the GL implementation,
8998 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
8999 calculation of fog effects.
9000
9001 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
9002
9003
9004 Indicates the accuracy of the derivative calculation for the GL
9005 shading language fragment processing built-in functions: `dFdx',
9006 `dFdy', and `fwidth'.
9007
9008 `GL_GENERATE_MIPMAP_HINT'
9009
9010
9011 Indicates the quality of filtering when generating mipmap images.
9012
9013 `GL_LINE_SMOOTH_HINT'
9014
9015
9016 Indicates the sampling quality of antialiased lines. If a larger
9017 filter function is applied, hinting `GL_NICEST' can result in more
9018 pixel fragments being generated during rasterization.
9019
9020 `GL_PERSPECTIVE_CORRECTION_HINT'
9021
9022
9023 Indicates the quality of color, texture coordinate, and fog
9024 coordinate interpolation. If perspective-corrected parameter
9025 interpolation is not efficiently supported by the GL
9026 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
9027 in simple linear interpolation of colors and/or texture
9028 coordinates.
9029
9030 `GL_POINT_SMOOTH_HINT'
9031
9032
9033 Indicates the sampling quality of antialiased points. If a larger
9034 filter function is applied, hinting `GL_NICEST' can result in more
9035 pixel fragments being generated during rasterization.
9036
9037 `GL_POLYGON_SMOOTH_HINT'
9038
9039
9040 Indicates the sampling quality of antialiased polygons. Hinting
9041 `GL_NICEST' can result in more pixel fragments being generated
9042 during rasterization, if a larger filter function is applied.
9043
9044 `GL_TEXTURE_COMPRESSION_HINT'
9045
9046
9047 Indicates the quality and performance of the compressing texture
9048 images. Hinting `GL_FASTEST' indicates that texture images should
9049 be compressed as quickly as possible, while `GL_NICEST' indicates
9050 that texture images should be compressed with as little image
9051 quality loss as possible. `GL_NICEST' should be selected if the
9052 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
9053
9054 `GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
9055 accepted value.
9056
9057 `GL_INVALID_OPERATION' is generated if `glHint' is executed between the
9058 execution of `glBegin' and the corresponding execution of `glEnd'.")
9059
9060 (define-gl-procedures
9061 ((glHistogram
9062 (target GLenum)
9063 (width GLsizei)
9064 (internalformat GLenum)
9065 (sink GLboolean)
9066 ->
9067 void))
9068 "Define histogram table.
9069
9070 TARGET
9071 The histogram whose parameters are to be set. Must be one of
9072 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
9073
9074 WIDTH
9075 The number of entries in the histogram table. Must be a power of 2.
9076
9077 INTERNALFORMAT
9078 The format of entries in the histogram table. Must be one of
9079 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
9080 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
9081 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
9082 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
9083 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
9084 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
9085 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
9086 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
9087 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
9088
9089 SINK
9090 If `GL_TRUE', pixels will be consumed by the histogramming process
9091 and no drawing or texture loading will take place. If `GL_FALSE',
9092 pixels will proceed to the minmax process after histogramming.
9093
9094 When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
9095 histogram table indices by clamping to the range [0,1], multiplying by
9096 the width of the histogram table, and rounding to the nearest integer.
9097 The table entries selected by the RGBA indices are then incremented. (If
9098 the internal format of the histogram table includes luminance, then the
9099 index derived from the R color component determines the luminance table
9100 entry to be incremented.) If a histogram table entry is incremented
9101 beyond its maximum value, then its value becomes undefined. (This is not
9102 an error.)
9103
9104 Histogramming is performed only for RGBA pixels (though these may be
9105 specified originally as color indices and converted to RGBA by index
9106 table lookup). Histogramming is enabled with `glEnable' and disabled
9107 with `glDisable'.
9108
9109 When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
9110 histogram table to have WIDTH entries of the format specified by
9111 INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
9112 entries are initialized to zero. The values in the previous histogram
9113 table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
9114 after histogramming; no further processing of the pixels takes place,
9115 and no drawing, texture loading, or pixel readback will result.
9116
9117 When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
9118 information as if the histogram table were to be redefined, but does not
9119 actually define the new table. If the requested histogram table is too
9120 large to be supported, then the state information will be set to zero.
9121 This provides a way to determine if a histogram table with the given
9122 parameters can be supported.
9123
9124
9125
9126 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
9127 values.
9128
9129 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
9130 power of 2.
9131
9132 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
9133 allowable values.
9134
9135 `GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
9136 histogram table specified is too large for the implementation.
9137
9138 `GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
9139 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9140
9141 (define-gl-procedures
9142 ((glIndexMask (mask GLuint) -> void))
9143 "Control the writing of individual bits in the color index buffers.
9144
9145 MASK
9146 Specifies a bit mask to enable and disable the writing of
9147 individual bits in the color index buffers. Initially, the mask is
9148 all 1's.
9149
9150 `glIndexMask' controls the writing of individual bits in the color index
9151 buffers. The least significant N bits of MASK, where N is the number of
9152 bits in a color index buffer, specify a mask. Where a 1 (one) appears in
9153 the mask, it's possible to write to the corresponding bit in the color
9154 index buffer (or buffers). Where a 0 (zero) appears, the corresponding
9155 bit is write-protected.
9156
9157 This mask is used only in color index mode, and it affects only the
9158 buffers currently selected for writing (see `glDrawBuffer'). Initially,
9159 all bits are enabled for writing.
9160
9161 `GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
9162 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9163
9164 (define-gl-procedures
9165 ((glIndexPointer
9166 (type GLenum)
9167 (stride GLsizei)
9168 (pointer const-GLvoid-*)
9169 ->
9170 void))
9171 "Define an array of color indexes.
9172
9173 TYPE
9174 Specifies the data type of each color index in the array. Symbolic
9175 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
9176 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
9177
9178 STRIDE
9179 Specifies the byte offset between consecutive color indexes. If
9180 STRIDE is 0, the color indexes are understood to be tightly packed
9181 in the array. The initial value is 0.
9182
9183 POINTER
9184 Specifies a pointer to the first index in the array. The initial
9185 value is 0.
9186
9187 `glIndexPointer' specifies the location and data format of an array of
9188 color indexes to use when rendering. TYPE specifies the data type of
9189 each color index and STRIDE specifies the byte stride from one color
9190 index to the next, allowing vertices and attributes to be packed into a
9191 single array or stored in separate arrays.
9192
9193 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
9194 target (see `glBindBuffer') while a color index array is specified,
9195 POINTER is treated as a byte offset into the buffer object's data store.
9196 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
9197 color index vertex array client-side state
9198 (`GL_INDEX_ARRAY_BUFFER_BINDING').
9199
9200 When a color index array is specified, TYPE, STRIDE, and POINTER are
9201 saved as client-side state, in addition to the current vertex array
9202 buffer object binding.
9203
9204 To enable and disable the color index array, call `glEnableClientState'
9205 and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
9206 enabled, the color index array is used when `glDrawArrays',
9207 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
9208 `glDrawRangeElements', or `glArrayElement' is called.
9209
9210 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
9211
9212 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9213
9214 (define-gl-procedures
9215 ((glIndexi (c GLint) -> void)
9216 (glIndexf (c GLfloat) -> void)
9217 (glIndexub (c GLubyte) -> void))
9218 "Set the current color index.
9219
9220 C
9221 Specifies the new value for the current color index.
9222
9223
9224
9225 `glIndex' updates the current (single-valued) color index. It takes one
9226 argument, the new value for the current color index.
9227
9228 The current index is stored as a floating-point value. Integer values
9229 are converted directly to floating-point values, with no special
9230 mapping. The initial value is 1.
9231
9232 Index values outside the representable range of the color index buffer
9233 are not clamped. However, before an index is dithered (if enabled) and
9234 written to the frame buffer, it is converted to fixed-point format. Any
9235 bits in the integer portion of the resulting fixed-point value that do
9236 not correspond to bits in the frame buffer are masked out.")
9237
9238 (define-gl-procedures
9239 ((glInitNames -> void))
9240 "Initialize the name stack.
9241
9242 The name stack is used during selection mode to allow sets of rendering
9243 commands to be uniquely identified. It consists of an ordered set of
9244 unsigned integers. `glInitNames' causes the name stack to be initialized
9245 to its default empty state.
9246
9247 The name stack is always empty while the render mode is not `GL_SELECT'.
9248 Calls to `glInitNames' while the render mode is not `GL_SELECT' are
9249 ignored.
9250
9251 `GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
9252 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9253
9254 (define-gl-procedures
9255 ((glInterleavedArrays
9256 (format GLenum)
9257 (stride GLsizei)
9258 (pointer const-GLvoid-*)
9259 ->
9260 void))
9261 "Simultaneously specify and enable several interleaved arrays.
9262
9263 FORMAT
9264 Specifies the type of array to enable. Symbolic constants `GL_V2F',
9265 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
9266 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
9267 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
9268 `GL_T4F_C4F_N3F_V4F' are accepted.
9269
9270 STRIDE
9271 Specifies the offset in bytes between each aggregate array element.
9272
9273 `glInterleavedArrays' lets you specify and enable individual color,
9274 normal, texture and vertex arrays whose elements are part of a larger
9275 aggregate array element. For some implementations, this is more
9276 efficient than specifying the arrays separately.
9277
9278 If STRIDE is 0, the aggregate elements are stored consecutively.
9279 Otherwise, STRIDE bytes occur between the beginning of one aggregate
9280 array element and the beginning of the next aggregate array element.
9281
9282 FORMAT serves as a ``key'' describing the extraction of individual
9283 arrays from the aggregate array. If FORMAT contains a T, then texture
9284 coordinates are extracted from the interleaved array. If C is present,
9285 color values are extracted. If N is present, normal coordinates are
9286 extracted. Vertex coordinates are always extracted.
9287
9288 The digits 2, 3, and 4 denote how many values are extracted. F indicates
9289 that values are extracted as floating-point values. Colors may also be
9290 extracted as 4 unsigned bytes if 4UB follows the C. If a color is
9291 extracted as 4 unsigned bytes, the vertex array element which follows is
9292 located at the first possible floating-point aligned address.
9293
9294 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
9295
9296 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
9297
9298 (define-gl-procedures
9299 ((glIsBuffer (buffer GLuint) -> GLboolean))
9300 "Determine if a name corresponds to a buffer object.
9301
9302 BUFFER
9303 Specifies a value that may be the name of a buffer object.
9304
9305 `glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
9306 buffer object. If BUFFER is zero, or is a non-zero value that is not
9307 currently the name of a buffer object, or if an error occurs,
9308 `glIsBuffer' returns `GL_FALSE'.
9309
9310 A name returned by `glGenBuffers', but not yet associated with a buffer
9311 object by calling `glBindBuffer', is not the name of a buffer object.
9312
9313 `GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
9314 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9315
9316 (define-gl-procedures
9317 ((glIsEnabled (cap GLenum) -> GLboolean))
9318 "Test whether a capability is enabled.
9319
9320 CAP
9321 Specifies a symbolic constant indicating a GL capability.
9322
9323 `glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
9324 returns `GL_FALSE' otherwise. Initially all capabilities except
9325 `GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
9326
9327 The following capabilities are accepted for CAP:
9328
9329
9330
9331 *Constant*
9332 *See*
9333
9334 `GL_ALPHA_TEST'
9335 `glAlphaFunc'
9336
9337 `GL_AUTO_NORMAL'
9338 `glEvalCoord'
9339
9340 `GL_BLEND'
9341 `glBlendFunc', `glLogicOp'
9342
9343 `GL_CLIP_PLANE'I
9344 `glClipPlane'
9345
9346 `GL_COLOR_ARRAY'
9347 `glColorPointer'
9348
9349 `GL_COLOR_LOGIC_OP'
9350 `glLogicOp'
9351
9352 `GL_COLOR_MATERIAL'
9353 `glColorMaterial'
9354
9355 `GL_COLOR_SUM'
9356 `glSecondaryColor'
9357
9358 `GL_COLOR_TABLE'
9359 `glColorTable'
9360
9361 `GL_CONVOLUTION_1D'
9362 `glConvolutionFilter1D'
9363
9364 `GL_CONVOLUTION_2D'
9365 `glConvolutionFilter2D'
9366
9367 `GL_CULL_FACE'
9368 `glCullFace'
9369
9370 `GL_DEPTH_TEST'
9371 `glDepthFunc', `glDepthRange'
9372
9373 `GL_DITHER'
9374 `glEnable'
9375
9376 `GL_EDGE_FLAG_ARRAY'
9377 `glEdgeFlagPointer'
9378
9379 `GL_FOG'
9380 `glFog'
9381
9382 `GL_FOG_COORD_ARRAY'
9383 `glFogCoordPointer'
9384
9385 `GL_HISTOGRAM'
9386 `glHistogram'
9387
9388 `GL_INDEX_ARRAY'
9389 `glIndexPointer'
9390
9391 `GL_INDEX_LOGIC_OP'
9392 `glLogicOp'
9393
9394 `GL_LIGHT'I
9395 `glLightModel', `glLight'
9396
9397 `GL_LIGHTING'
9398 `glMaterial', `glLightModel', `glLight'
9399
9400 `GL_LINE_SMOOTH'
9401 `glLineWidth'
9402
9403 `GL_LINE_STIPPLE'
9404 `glLineStipple'
9405
9406 `GL_MAP1_COLOR_4'
9407 `glMap1'
9408
9409 `GL_MAP1_INDEX'
9410 `glMap1'
9411
9412 `GL_MAP1_NORMAL'
9413 `glMap1'
9414
9415 `GL_MAP1_TEXTURE_COORD_1'
9416 `glMap1'
9417
9418 `GL_MAP1_TEXTURE_COORD_2'
9419 `glMap1'
9420
9421 `GL_MAP1_TEXTURE_COORD_3'
9422 `glMap1'
9423
9424 `GL_MAP1_TEXTURE_COORD_4'
9425 `glMap1'
9426
9427 `GL_MAP2_COLOR_4'
9428 `glMap2'
9429
9430 `GL_MAP2_INDEX'
9431 `glMap2'
9432
9433 `GL_MAP2_NORMAL'
9434 `glMap2'
9435
9436 `GL_MAP2_TEXTURE_COORD_1'
9437 `glMap2'
9438
9439 `GL_MAP2_TEXTURE_COORD_2'
9440 `glMap2'
9441
9442 `GL_MAP2_TEXTURE_COORD_3'
9443 `glMap2'
9444
9445 `GL_MAP2_TEXTURE_COORD_4'
9446 `glMap2'
9447
9448 `GL_MAP2_VERTEX_3'
9449 `glMap2'
9450
9451 `GL_MAP2_VERTEX_4'
9452 `glMap2'
9453
9454 `GL_MINMAX'
9455 `glMinmax'
9456
9457 `GL_MULTISAMPLE'
9458 `glSampleCoverage'
9459
9460 `GL_NORMAL_ARRAY'
9461 `glNormalPointer'
9462
9463 `GL_NORMALIZE'
9464 `glNormal'
9465
9466 `GL_POINT_SMOOTH'
9467 `glPointSize'
9468
9469 `GL_POINT_SPRITE'
9470 `glEnable'
9471
9472 `GL_POLYGON_SMOOTH'
9473 `glPolygonMode'
9474
9475 `GL_POLYGON_OFFSET_FILL'
9476 `glPolygonOffset'
9477
9478 `GL_POLYGON_OFFSET_LINE'
9479 `glPolygonOffset'
9480
9481 `GL_POLYGON_OFFSET_POINT'
9482 `glPolygonOffset'
9483
9484 `GL_POLYGON_STIPPLE'
9485 `glPolygonStipple'
9486
9487 `GL_POST_COLOR_MATRIX_COLOR_TABLE'
9488 `glColorTable'
9489
9490 `GL_POST_CONVOLUTION_COLOR_TABLE'
9491 `glColorTable'
9492
9493 `GL_RESCALE_NORMAL'
9494 `glNormal'
9495
9496 `GL_SAMPLE_ALPHA_TO_COVERAGE'
9497 `glSampleCoverage'
9498
9499 `GL_SAMPLE_ALPHA_TO_ONE'
9500 `glSampleCoverage'
9501
9502 `GL_SAMPLE_COVERAGE'
9503 `glSampleCoverage'
9504
9505 `GL_SCISSOR_TEST'
9506 `glScissor'
9507
9508 `GL_SECONDARY_COLOR_ARRAY'
9509 `glSecondaryColorPointer'
9510
9511 `GL_SEPARABLE_2D'
9512 `glSeparableFilter2D'
9513
9514 `GL_STENCIL_TEST'
9515 `glStencilFunc', `glStencilOp'
9516
9517 `GL_TEXTURE_1D'
9518 `glTexImage1D'
9519
9520 `GL_TEXTURE_2D'
9521 `glTexImage2D'
9522
9523 `GL_TEXTURE_3D'
9524 `glTexImage3D'
9525
9526 `GL_TEXTURE_COORD_ARRAY'
9527 `glTexCoordPointer'
9528
9529 `GL_TEXTURE_CUBE_MAP'
9530 `glTexImage2D'
9531
9532 `GL_TEXTURE_GEN_Q'
9533 `glTexGen'
9534
9535 `GL_TEXTURE_GEN_R'
9536 `glTexGen'
9537
9538 `GL_TEXTURE_GEN_S'
9539 `glTexGen'
9540
9541 `GL_TEXTURE_GEN_T'
9542 `glTexGen'
9543
9544 `GL_VERTEX_ARRAY'
9545 `glVertexPointer'
9546
9547 `GL_VERTEX_PROGRAM_POINT_SIZE'
9548 `glEnable'
9549
9550 `GL_VERTEX_PROGRAM_TWO_SIDE'
9551 `glEnable'
9552
9553
9554
9555 `GL_INVALID_ENUM' is generated if CAP is not an accepted value.
9556
9557 `GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
9558 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9559
9560 (define-gl-procedures
9561 ((glIsList (list GLuint) -> GLboolean))
9562 "Determine if a name corresponds to a display list.
9563
9564 LIST
9565 Specifies a potential display list name.
9566
9567 `glIsList' returns `GL_TRUE' if LIST is the name of a display list and
9568 returns `GL_FALSE' if it is not, or if an error occurs.
9569
9570 A name returned by `glGenLists', but not yet associated with a display
9571 list by calling `glNewList', is not the name of a display list.
9572
9573 `GL_INVALID_OPERATION' is generated if `glIsList' is executed between
9574 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9575
9576 (define-gl-procedures
9577 ((glIsProgram (program GLuint) -> GLboolean))
9578 "Determines if a name corresponds to a program object.
9579
9580 PROGRAM
9581 Specifies a potential program object.
9582
9583 `glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
9584 object previously created with `glCreateProgram' and not yet deleted
9585 with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
9586 not the name of a program object, or if an error occurs, `glIsProgram'
9587 returns `GL_FALSE'.
9588
9589 `GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
9590 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9591
9592 (define-gl-procedures
9593 ((glIsQuery (id GLuint) -> GLboolean))
9594 "Determine if a name corresponds to a query object.
9595
9596 ID
9597 Specifies a value that may be the name of a query object.
9598
9599 `glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
9600 object. If ID is zero, or is a non-zero value that is not currently the
9601 name of a query object, or if an error occurs, `glIsQuery' returns
9602 `GL_FALSE'.
9603
9604 A name returned by `glGenQueries', but not yet associated with a query
9605 object by calling `glBeginQuery', is not the name of a query object.
9606
9607 `GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
9608 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9609
9610 (define-gl-procedures
9611 ((glIsShader (shader GLuint) -> GLboolean))
9612 "Determines if a name corresponds to a shader object.
9613
9614 SHADER
9615 Specifies a potential shader object.
9616
9617 `glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
9618 previously created with `glCreateShader' and not yet deleted with
9619 `glDeleteShader'. If SHADER is zero or a non-zero value that is not the
9620 name of a shader object, or if an error occurs, `glIsShader ' returns
9621 `GL_FALSE'.
9622
9623 `GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
9624 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9625
9626 (define-gl-procedures
9627 ((glIsTexture (texture GLuint) -> GLboolean))
9628 "Determine if a name corresponds to a texture.
9629
9630 TEXTURE
9631 Specifies a value that may be the name of a texture.
9632
9633 `glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
9634 texture. If TEXTURE is zero, or is a non-zero value that is not
9635 currently the name of a texture, or if an error occurs, `glIsTexture'
9636 returns `GL_FALSE'.
9637
9638 A name returned by `glGenTextures', but not yet associated with a
9639 texture by calling `glBindTexture', is not the name of a texture.
9640
9641 `GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
9642 the execution of `glBegin' and the corresponding execution of `glEnd'.")
9643
9644 (define-gl-procedures
9645 ((glLightModelf
9646 (pname GLenum)
9647 (param GLfloat)
9648 ->
9649 void)
9650 (glLightModeli
9651 (pname GLenum)
9652 (param GLint)
9653 ->
9654 void))
9655 "Set the lighting model parameters.
9656
9657 PNAME
9658 Specifies a single-valued lighting model parameter.
9659 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
9660 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
9661
9662 PARAM
9663 Specifies the value that PARAM will be set to.
9664
9665 `glLightModel' sets the lighting model parameter. PNAME names a
9666 parameter and PARAMS gives the new value. There are three lighting model
9667 parameters:
9668
9669 `GL_LIGHT_MODEL_AMBIENT'
9670
9671
9672 PARAMS contains four integer or floating-point values that specify
9673 the ambient RGBA intensity of the entire scene. Integer values are
9674 mapped linearly such that the most positive representable value
9675 maps to 1.0, and the most negative representable value maps to -1.0
9676 . Floating-point values are mapped directly. Neither integer nor
9677 floating-point values are clamped. The initial ambient scene
9678 intensity is (0.2, 0.2, 0.2, 1.0).
9679
9680 `GL_LIGHT_MODEL_COLOR_CONTROL'
9681
9682
9683 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
9684 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
9685 is generated from the lighting computation for a vertex.
9686 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
9687 computation of lighting be stored separately from the remainder of
9688 the lighting computation. The specular color is summed into the
9689 generated fragment's color after the application of texture mapping
9690 (if enabled). The initial value is `GL_SINGLE_COLOR'.
9691
9692 `GL_LIGHT_MODEL_LOCAL_VIEWER'
9693
9694
9695 PARAMS is a single integer or floating-point value that specifies
9696 how specular reflection angles are computed. If PARAMS is 0 (or
9697 0.0), specular reflection angles take the view direction to be
9698 parallel to and in the direction of the -Z axis, regardless of the
9699 location of the vertex in eye coordinates. Otherwise, specular
9700 reflections are computed from the origin of the eye coordinate
9701 system. The initial value is 0.
9702
9703 `GL_LIGHT_MODEL_TWO_SIDE'
9704
9705
9706 PARAMS is a single integer or floating-point value that specifies
9707 whether one- or two-sided lighting calculations are done for
9708 polygons. It has no effect on the lighting calculations for points,
9709 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
9710 specified, and only the FRONT material parameters are used in the
9711 lighting equation. Otherwise, two-sided lighting is specified. In
9712 this case, vertices of back-facing polygons are lighted using the
9713 BACK material parameters and have their normals reversed before the
9714 lighting equation is evaluated. Vertices of front-facing polygons
9715 are always lighted using the FRONT material parameters, with no
9716 change to their normals. The initial value is 0.
9717
9718 In RGBA mode, the lighted color of a vertex is the sum of the material
9719 emission intensity, the product of the material ambient reflectance and
9720 the lighting model full-scene ambient intensity, and the contribution of
9721 each enabled light source. Each light source contributes the sum of
9722 three terms: ambient, diffuse, and specular. The ambient light source
9723 contribution is the product of the material ambient reflectance and the
9724 light's ambient intensity. The diffuse light source contribution is the
9725 product of the material diffuse reflectance, the light's diffuse
9726 intensity, and the dot product of the vertex's normal with the
9727 normalized vector from the vertex to the light source. The specular
9728 light source contribution is the product of the material specular
9729 reflectance, the light's specular intensity, and the dot product of the
9730 normalized vertex-to-eye and vertex-to-light vectors, raised to the
9731 power of the shininess of the material. All three light source
9732 contributions are attenuated equally based on the distance from the
9733 vertex to the light source and on light source direction, spread
9734 exponent, and spread cutoff angle. All dot products are replaced with 0
9735 if they evaluate to a negative value.
9736
9737 The alpha component of the resulting lighted color is set to the alpha
9738 value of the material diffuse reflectance.
9739
9740 In color index mode, the value of the lighted index of a vertex ranges
9741 from the ambient to the specular values passed to `glMaterial' using
9742 `GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
9743 (.30, .59, .11) weighting of the lights' colors, the shininess of the
9744 material, and the same reflection and attenuation equations as in the
9745 RGBA case, determine how much above ambient the resulting index is.
9746
9747 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9748
9749 `GL_INVALID_ENUM' is generated if PNAME is
9750 `GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
9751 `GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
9752
9753 `GL_INVALID_OPERATION' is generated if `glLightModel' is executed
9754 between the execution of `glBegin' and the corresponding execution of
9755 `glEnd'.")
9756
9757 (define-gl-procedures
9758 ((glLightf
9759 (light GLenum)
9760 (pname GLenum)
9761 (param GLfloat)
9762 ->
9763 void)
9764 (glLighti
9765 (light GLenum)
9766 (pname GLenum)
9767 (param GLint)
9768 ->
9769 void))
9770 "Set light source parameters.
9771
9772 LIGHT
9773 Specifies a light. The number of lights depends on the
9774 implementation, but at least eight lights are supported. They are
9775 identified by symbolic names of the form `GL_LIGHT' I , where i
9776 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
9777
9778 PNAME
9779 Specifies a single-valued light source parameter for LIGHT.
9780 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
9781 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
9782 accepted.
9783
9784 PARAM
9785 Specifies the value that parameter PNAME of light source LIGHT will
9786 be set to.
9787
9788 `glLight' sets the values of individual light source parameters. LIGHT
9789 names the light and is a symbolic name of the form `GL_LIGHT'I , where i
9790 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
9791 of ten light source parameters, again by symbolic name. PARAMS is either
9792 a single value or a pointer to an array that contains the new values.
9793
9794 To enable and disable lighting calculation, call `glEnable' and
9795 `glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
9796 When it is enabled, light sources that are enabled contribute to the
9797 lighting calculation. Light source I is enabled and disabled using
9798 `glEnable' and `glDisable' with argument `GL_LIGHT'I .
9799
9800 The ten light parameters are as follows:
9801
9802 `GL_AMBIENT'
9803 PARAMS contains four integer or floating-point values that specify
9804 the ambient RGBA intensity of the light. Integer values are mapped
9805 linearly such that the most positive representable value maps to
9806 1.0, and the most negative representable value maps to -1.0 .
9807 Floating-point values are mapped directly. Neither integer nor
9808 floating-point values are clamped. The initial ambient light
9809 intensity is (0, 0, 0, 1).
9810
9811 `GL_DIFFUSE'
9812 PARAMS contains four integer or floating-point values that specify
9813 the diffuse RGBA intensity of the light. Integer values are mapped
9814 linearly such that the most positive representable value maps to
9815 1.0, and the most negative representable value maps to -1.0 .
9816 Floating-point values are mapped directly. Neither integer nor
9817 floating-point values are clamped. The initial value for
9818 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9819 (0, 0, 0, 1).
9820
9821 `GL_SPECULAR'
9822 PARAMS contains four integer or floating-point values that specify
9823 the specular RGBA intensity of the light. Integer values are mapped
9824 linearly such that the most positive representable value maps to
9825 1.0, and the most negative representable value maps to -1.0 .
9826 Floating-point values are mapped directly. Neither integer nor
9827 floating-point values are clamped. The initial value for
9828 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
9829 (0, 0, 0, 1).
9830
9831 `GL_POSITION'
9832 PARAMS contains four integer or floating-point values that specify
9833 the position of the light in homogeneous object coordinates. Both
9834 integer and floating-point values are mapped directly. Neither
9835 integer nor floating-point values are clamped.
9836
9837 The position is transformed by the modelview matrix when `glLight'
9838 is called (just as if it were a point), and it is stored in eye
9839 coordinates. If the W component of the position is 0, the light is
9840 treated as a directional source. Diffuse and specular lighting
9841 calculations take the light's direction, but not its actual
9842 position, into account, and attenuation is disabled. Otherwise,
9843 diffuse and specular lighting calculations are based on the actual
9844 location of the light in eye coordinates, and attenuation is
9845 enabled. The initial position is (0, 0, 1, 0); thus, the initial
9846 light source is directional, parallel to, and in the direction of
9847 the -Z axis.
9848
9849 `GL_SPOT_DIRECTION'
9850 PARAMS contains three integer or floating-point values that specify
9851 the direction of the light in homogeneous object coordinates. Both
9852 integer and floating-point values are mapped directly. Neither
9853 integer nor floating-point values are clamped.
9854
9855 The spot direction is transformed by the upper 3x3 of the modelview
9856 matrix when `glLight' is called, and it is stored in eye
9857 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
9858 180, which it is initially. The initial direction is (0,0-1) .
9859
9860 `GL_SPOT_EXPONENT'
9861 PARAMS is a single integer or floating-point value that specifies
9862 the intensity distribution of the light. Integer and floating-point
9863 values are mapped directly. Only values in the range [0,128] are
9864 accepted.
9865
9866 Effective light intensity is attenuated by the cosine of the angle
9867 between the direction of the light and the direction from the light
9868 to the vertex being lighted, raised to the power of the spot
9869 exponent. Thus, higher spot exponents result in a more focused
9870 light source, regardless of the spot cutoff angle (see
9871 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
9872 resulting in uniform light distribution.
9873
9874 `GL_SPOT_CUTOFF'
9875 PARAMS is a single integer or floating-point value that specifies
9876 the maximum spread angle of a light source. Integer and
9877 floating-point values are mapped directly. Only values in the range
9878 [0,90] and the special value 180 are accepted. If the angle between
9879 the direction of the light and the direction from the light to the
9880 vertex being lighted is greater than the spot cutoff angle, the
9881 light is completely masked. Otherwise, its intensity is controlled
9882 by the spot exponent and the attenuation factors. The initial spot
9883 cutoff is 180, resulting in uniform light distribution.
9884
9885 `GL_CONSTANT_ATTENUATION'
9886 `GL_LINEAR_ATTENUATION'
9887 `GL_QUADRATIC_ATTENUATION'
9888 PARAMS is a single integer or floating-point value that specifies
9889 one of the three light attenuation factors. Integer and
9890 floating-point values are mapped directly. Only nonnegative values
9891 are accepted. If the light is positional, rather than directional,
9892 its intensity is attenuated by the reciprocal of the sum of the
9893 constant factor, the linear factor times the distance between the
9894 light and the vertex being lighted, and the quadratic factor times
9895 the square of the same distance. The initial attenuation factors
9896 are (1, 0, 0), resulting in no attenuation.
9897
9898 `GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
9899 accepted value.
9900
9901 `GL_INVALID_VALUE' is generated if a spot exponent value is specified
9902 outside the range [0,128] , or if spot cutoff is specified outside the
9903 range [0,90] (except for the special value 180), or if a negative
9904 attenuation factor is specified.
9905
9906 `GL_INVALID_OPERATION' is generated if `glLight' is executed between the
9907 execution of `glBegin' and the corresponding execution of `glEnd'.")
9908
9909 (define-gl-procedures
9910 ((glLineStipple
9911 (factor GLint)
9912 (pattern GLushort)
9913 ->
9914 void))
9915 "Specify the line stipple pattern.
9916
9917 FACTOR
9918 Specifies a multiplier for each bit in the line stipple pattern. If
9919 FACTOR is 3, for example, each bit in the pattern is used three
9920 times before the next bit in the pattern is used. FACTOR is clamped
9921 to the range [1, 256] and defaults to 1.
9922
9923 PATTERN
9924 Specifies a 16-bit integer whose bit pattern determines which
9925 fragments of a line will be drawn when the line is rasterized. Bit
9926 zero is used first; the default pattern is all 1's.
9927
9928 Line stippling masks out certain fragments produced by rasterization;
9929 those fragments will not be drawn. The masking is achieved by using
9930 three parameters: the 16-bit line stipple pattern PATTERN, the repeat
9931 count FACTOR, and an integer stipple counter S .
9932
9933 Counter S is reset to 0 whenever `glBegin' is called and before each
9934 line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
9935 It is incremented after each fragment of a unit width aliased line
9936 segment is generated or after each I fragments of an I width line
9937 segment are generated. The I fragments associated with count S are
9938 masked out if
9939
9940 PATTERN bit (S/FACTOR,)%16
9941
9942 is 0, otherwise these fragments are sent to the frame buffer. Bit zero
9943 of PATTERN is the least significant bit.
9944
9945 Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
9946 purposes of stippling. Whether rectangle S is rasterized or not depends
9947 on the fragment rule described for aliased lines, counting rectangles
9948 rather than groups of fragments.
9949
9950 To enable and disable line stippling, call `glEnable' and `glDisable'
9951 with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
9952 is applied as described above. When disabled, it is as if the pattern
9953 were all 1's. Initially, line stippling is disabled.
9954
9955 `GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
9956 between the execution of `glBegin' and the corresponding execution of
9957 `glEnd'.")
9958
9959 (define-gl-procedures
9960 ((glLineWidth (width GLfloat) -> void))
9961 "Specify the width of rasterized lines.
9962
9963 WIDTH
9964 Specifies the width of rasterized lines. The initial value is 1.
9965
9966 `glLineWidth' specifies the rasterized width of both aliased and
9967 antialiased lines. Using a line width other than 1 has different
9968 effects, depending on whether line antialiasing is enabled. To enable
9969 and disable line antialiasing, call `glEnable' and `glDisable' with
9970 argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
9971
9972 If line antialiasing is disabled, the actual width is determined by
9973 rounding the supplied width to the nearest integer. (If the rounding
9974 results in the value 0, it is as if the line width were 1.) If
9975 ∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
9976 where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
9977 each row that is rasterized.
9978
9979 If antialiasing is enabled, line rasterization produces a fragment for
9980 each pixel square that intersects the region lying within the rectangle
9981 having width equal to the current line width, length equal to the actual
9982 length of the line, and centered on the mathematical line segment. The
9983 coverage value for each fragment is the window coordinate area of the
9984 intersection of the rectangular region with the corresponding pixel
9985 square. This value is saved and used in the final rasterization step.
9986
9987 Not all widths can be supported when line antialiasing is enabled. If an
9988 unsupported width is requested, the nearest supported width is used.
9989 Only width 1 is guaranteed to be supported; others depend on the
9990 implementation. Likewise, there is a range for aliased line widths as
9991 well. To query the range of supported widths and the size difference
9992 between supported widths within the range, call `glGet' with arguments
9993 `GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
9994 `GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
9995
9996 `GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
9997
9998 `GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
9999 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10000
10001 (define-gl-procedures
10002 ((glLinkProgram (program GLuint) -> void))
10003 "Links a program object.
10004
10005 PROGRAM
10006 Specifies the handle of the program object to be linked.
10007
10008 `glLinkProgram' links the program object specified by PROGRAM. If any
10009 shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
10010 will be used to create an executable that will run on the programmable
10011 vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
10012 attached to PROGRAM, they will be used to create an executable that will
10013 run on the programmable fragment processor.
10014
10015 The status of the link operation will be stored as part of the program
10016 object's state. This value will be set to `GL_TRUE' if the program
10017 object was linked without errors and is ready for use, and `GL_FALSE'
10018 otherwise. It can be queried by calling `glGetProgram' with arguments
10019 PROGRAM and `GL_LINK_STATUS'.
10020
10021 As a result of a successful link operation, all active user-defined
10022 uniform variables belonging to PROGRAM will be initialized to 0, and
10023 each of the program object's active uniform variables will be assigned a
10024 location that can be queried by calling `glGetUniformLocation'. Also,
10025 any active user-defined attribute variables that have not been bound to
10026 a generic vertex attribute index will be bound to one at this time.
10027
10028 Linking of a program object can fail for a number of reasons as
10029 specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
10030 lists some of the conditions that will cause a link error.
10031
10032 * The storage limit for uniform variables has been exceeded.
10033
10034 * The number of active uniform variables supported by the
10035 implementation has been exceeded.
10036
10037 * The `main' function is missing for the vertex shader or the
10038 fragment shader.
10039
10040 * A varying variable actually used in the fragment shader is not
10041 declared in the same way (or is not declared at all) in the vertex
10042 shader.
10043
10044 * A reference to a function or variable name is unresolved.
10045
10046 * A shared global is declared with two different types or two
10047 different initial values.
10048
10049 * One or more of the attached shader objects has not been
10050 successfully compiled.
10051
10052 * Binding a generic attribute matrix caused some rows of the matrix
10053 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
10054
10055 * Not enough contiguous vertex attribute slots could be found to bind
10056 attribute matrices.
10057
10058 When a program object has been successfully linked, the program object
10059 can be made part of current state by calling `glUseProgram'. Whether or
10060 not the link operation was successful, the program object's information
10061 log will be overwritten. The information log can be retrieved by calling
10062 `glGetProgramInfoLog'.
10063
10064 `glLinkProgram' will also install the generated executables as part of
10065 the current rendering state if the link operation was successful and the
10066 specified program object is already currently in use as a result of a
10067 previous call to `glUseProgram'. If the program object currently in use
10068 is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
10069 but the executables and associated state will remain part of the current
10070 state until a subsequent call to `glUseProgram' removes it from use.
10071 After it is removed from use, it cannot be made part of current state
10072 until it has been successfully relinked.
10073
10074 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
10075 not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
10076 shader will be linked against the implicit interface for fixed
10077 functionality fragment processing. Similarly, if PROGRAM contains shader
10078 objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
10079 objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
10080 against the implicit interface for fixed functionality vertex
10081 processing.
10082
10083 The program object's information log is updated and the program is
10084 generated at the time of the link operation. After the link operation,
10085 applications are free to modify attached shader objects, compile
10086 attached shader objects, detach shader objects, delete shader objects,
10087 and attach additional shader objects. None of these operations affects
10088 the information log or the program that is part of the program object.
10089
10090 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10091 OpenGL.
10092
10093 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10094
10095 `GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
10096 between the execution of `glBegin' and the corresponding execution of
10097 `glEnd'.")
10098
10099 (define-gl-procedures
10100 ((glListBase (base GLuint) -> void))
10101 "Set the display-list base for .
10102
10103 BASE
10104 Specifies an integer offset that will be added to `glCallLists'
10105 offsets to generate display-list names. The initial value is 0.
10106
10107 `glCallLists' specifies an array of offsets. Display-list names are
10108 generated by adding BASE to each offset. Names that reference valid
10109 display lists are executed; the others are ignored.
10110
10111 `GL_INVALID_OPERATION' is generated if `glListBase' is executed between
10112 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10113
10114 (define-gl-procedures
10115 ((glLoadIdentity -> void))
10116 "Replace the current matrix with the identity matrix.
10117
10118 `glLoadIdentity' replaces the current matrix with the identity matrix.
10119 It is semantically equivalent to calling `glLoadMatrix' with the
10120 identity matrix
10121
10122
10123
10124 ((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
10125
10126
10127
10128 but in some cases it is more efficient.
10129
10130 `GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
10131 between the execution of `glBegin' and the corresponding execution of
10132 `glEnd'.")
10133
10134 (define-gl-procedures
10135 ((glLoadMatrixf (m const-GLfloat-*) -> void))
10136 "Replace the current matrix with the specified matrix.
10137
10138 M
10139 Specifies a pointer to 16 consecutive values, which are used as the
10140 elements of a 4×4 column-major matrix.
10141
10142 `glLoadMatrix' replaces the current matrix with the one whose elements
10143 are specified by M. The current matrix is the projection matrix,
10144 modelview matrix, or texture matrix, depending on the current matrix
10145 mode (see `glMatrixMode').
10146
10147 The current matrix, M, defines a transformation of coordinates. For
10148 instance, assume M refers to the modelview matrix. If
10149 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10150 vertex, and M points to an array of 16 single- or double-precision
10151 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10152 transformation M\u2061(V,) does the following:
10153
10154 M\u2061(V,)=((M\u2061[0,] M\u2061[4,] M\u2061[8,] M\u2061[12,]), (M\u2061[1,] M\u2061[5,] M\u2061[9,] M\u2061[13,]),
10155 (M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
10156 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10157
10158
10159
10160 Projection and texture transformations are similarly defined.
10161
10162 `GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
10163 between the execution of `glBegin' and the corresponding execution of
10164 `glEnd'.")
10165
10166 (define-gl-procedures
10167 ((glLoadName (name GLuint) -> void))
10168 "Load a name onto the name stack.
10169
10170 NAME
10171 Specifies a name that will replace the top value on the name stack.
10172
10173 The name stack is used during selection mode to allow sets of rendering
10174 commands to be uniquely identified. It consists of an ordered set of
10175 unsigned integers and is initially empty.
10176
10177 `glLoadName' causes NAME to replace the value on the top of the name
10178 stack.
10179
10180 The name stack is always empty while the render mode is not `GL_SELECT'.
10181 Calls to `glLoadName' while the render mode is not `GL_SELECT' are
10182 ignored.
10183
10184 `GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
10185 name stack is empty.
10186
10187 `GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
10188 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10189
10190 (define-gl-procedures
10191 ((glLoadTransposeMatrixf
10192 (m const-GLfloat-*)
10193 ->
10194 void))
10195 "Replace the current matrix with the specified row-major ordered matrix.
10196
10197 M
10198 Specifies a pointer to 16 consecutive values, which are used as the
10199 elements of a 4×4 row-major matrix.
10200
10201 `glLoadTransposeMatrix' replaces the current matrix with the one whose
10202 elements are specified by M. The current matrix is the projection
10203 matrix, modelview matrix, or texture matrix, depending on the current
10204 matrix mode (see `glMatrixMode').
10205
10206 The current matrix, M, defines a transformation of coordinates. For
10207 instance, assume M refers to the modelview matrix. If
10208 V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
10209 vertex, and M points to an array of 16 single- or double-precision
10210 floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
10211 transformation M\u2061(V,) does the following:
10212
10213 M\u2061(V,)=((M\u2061[0,] M\u2061[1,] M\u2061[2,] M\u2061[3,]), (M\u2061[4,] M\u2061[5,] M\u2061[6,] M\u2061[7,]),
10214 (M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
10215 M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
10216
10217
10218
10219 Projection and texture transformations are similarly defined.
10220
10221 Calling `glLoadTransposeMatrix' with matrix M is identical in operation
10222 to `glLoadMatrix' with M^T , where T represents the transpose.
10223
10224 `GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
10225 executed between the execution of `glBegin' and the corresponding
10226 execution of `glEnd'.")
10227
10228 (define-gl-procedures
10229 ((glLogicOp (opcode GLenum) -> void))
10230 "Specify a logical pixel operation for color index rendering.
10231
10232 OPCODE
10233 Specifies a symbolic constant that selects a logical operation. The
10234 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
10235 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
10236 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
10237 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
10238 initial value is `GL_COPY'.
10239
10240 `glLogicOp' specifies a logical operation that, when enabled, is applied
10241 between the incoming color index or RGBA color and the color index or
10242 RGBA color at the corresponding location in the frame buffer. To enable
10243 or disable the logical operation, call `glEnable' and `glDisable' using
10244 the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
10245 `GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
10246 for both operations.
10247
10248
10249
10250 *Opcode*
10251 *Resulting Operation*
10252
10253 `GL_CLEAR'
10254 0
10255
10256 `GL_SET'
10257 1
10258
10259 `GL_COPY'
10260 s
10261
10262 `GL_COPY_INVERTED'
10263 ~s
10264
10265 `GL_NOOP'
10266 d
10267
10268 `GL_INVERT'
10269 ~d
10270
10271 `GL_AND'
10272 s & d
10273
10274 `GL_NAND'
10275 ~(s & d)
10276
10277 `GL_OR'
10278 s | d
10279
10280 `GL_NOR'
10281 ~(s | d)
10282
10283 `GL_XOR'
10284 s ^ d
10285
10286 `GL_EQUIV'
10287 ~(s ^ d)
10288
10289 `GL_AND_REVERSE'
10290 s & ~d
10291
10292 `GL_AND_INVERTED'
10293 ~s & d
10294
10295 `GL_OR_REVERSE'
10296 s | ~d
10297
10298 `GL_OR_INVERTED'
10299 ~s | d
10300
10301 OPCODE is a symbolic constant chosen from the list above. In the
10302 explanation of the logical operations, S represents the incoming color
10303 index and D represents the index in the frame buffer. Standard
10304 C-language operators are used. As these bitwise operators suggest, the
10305 logical operation is applied independently to each bit pair of the
10306 source and destination indices or colors.
10307
10308 `GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
10309
10310 `GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
10311 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10312
10313 (define-gl-procedures
10314 ((glMap1f
10315 (target GLenum)
10316 (u1 GLfloat)
10317 (u2 GLfloat)
10318 (stride GLint)
10319 (order GLint)
10320 (points const-GLfloat-*)
10321 ->
10322 void))
10323 "Define a one-dimensional evaluator.
10324
10325 TARGET
10326 Specifies the kind of values that are generated by the evaluator.
10327 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
10328 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
10329 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
10330 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
10331 accepted.
10332
10333 U1
10334 U2
10335
10336 Specify a linear mapping of U , as presented to `glEvalCoord1', to
10337 U^ , the variable that is evaluated by the equations specified by
10338 this command.
10339
10340 STRIDE
10341 Specifies the number of floats or doubles between the beginning of
10342 one control point and the beginning of the next one in the data
10343 structure referenced in POINTS. This allows control points to be
10344 embedded in arbitrary data structures. The only constraint is that
10345 the values for a particular control point must occupy contiguous
10346 memory locations.
10347
10348 ORDER
10349 Specifies the number of control points. Must be positive.
10350
10351 POINTS
10352 Specifies a pointer to the array of control points.
10353
10354 Evaluators provide a way to use polynomial or rational polynomial
10355 mapping to produce vertices, normals, texture coordinates, and colors.
10356 The values produced by an evaluator are sent to further stages of GL
10357 processing just as if they had been presented using `glVertex',
10358 `glNormal', `glTexCoord', and `glColor' commands, except that the
10359 generated values do not update the current normal, texture coordinates,
10360 or color.
10361
10362 All polynomial or rational polynomial splines of any degree (up to the
10363 maximum degree supported by the GL implementation) can be described
10364 using evaluators. These include almost all splines used in computer
10365 graphics: B-splines, Bezier curves, Hermite splines, and so on.
10366
10367 Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
10368 as
10369
10370 P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
10371
10372
10373
10374 where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
10375 polynomial of degree N (ORDER = N+1 ):
10376
10377 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10378
10379 Recall that
10380
10381 0^0==1 and ((N), (0),,)==1
10382
10383 `glMap1' is used to define the basis and to specify what kind of values
10384 are produced. Once defined, a map can be enabled and disabled by calling
10385 `glEnable' and `glDisable' with the map name, one of the nine predefined
10386 values for TARGET described below. `glEvalCoord1' evaluates the
10387 one-dimensional maps that are enabled. When `glEvalCoord1' presents a
10388 value U , the Bernstein functions are evaluated using U^ , where
10389 U^=U-U1,/U2-U1,
10390
10391 TARGET is a symbolic constant that indicates what kind of control points
10392 are provided in POINTS, and what output is generated when the map is
10393 evaluated. It can assume one of nine predefined values:
10394
10395 `GL_MAP1_VERTEX_3'
10396 Each control point is three floating-point values representing X ,
10397 Y , and Z . Internal `glVertex3' commands are generated when the
10398 map is evaluated.
10399
10400 `GL_MAP1_VERTEX_4'
10401 Each control point is four floating-point values representing X , Y
10402 , Z , and W . Internal `glVertex4' commands are generated when the
10403 map is evaluated.
10404
10405 `GL_MAP1_INDEX'
10406 Each control point is a single floating-point value representing a
10407 color index. Internal `glIndex' commands are generated when the map
10408 is evaluated but the current index is not updated with the value of
10409 these `glIndex' commands.
10410
10411 `GL_MAP1_COLOR_4'
10412 Each control point is four floating-point values representing red,
10413 green, blue, and alpha. Internal `glColor4' commands are generated
10414 when the map is evaluated but the current color is not updated with
10415 the value of these `glColor4' commands.
10416
10417 `GL_MAP1_NORMAL'
10418 Each control point is three floating-point values representing the
10419 X , Y , and Z components of a normal vector. Internal `glNormal'
10420 commands are generated when the map is evaluated but the current
10421 normal is not updated with the value of these `glNormal' commands.
10422
10423 `GL_MAP1_TEXTURE_COORD_1'
10424 Each control point is a single floating-point value representing
10425 the S texture coordinate. Internal `glTexCoord1' commands are
10426 generated when the map is evaluated but the current texture
10427 coordinates are not updated with the value of these `glTexCoord'
10428 commands.
10429
10430 `GL_MAP1_TEXTURE_COORD_2'
10431 Each control point is two floating-point values representing the S
10432 and T texture coordinates. Internal `glTexCoord2' commands are
10433 generated when the map is evaluated but the current texture
10434 coordinates are not updated with the value of these `glTexCoord'
10435 commands.
10436
10437 `GL_MAP1_TEXTURE_COORD_3'
10438 Each control point is three floating-point values representing the
10439 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10440 are generated when the map is evaluated but the current texture
10441 coordinates are not updated with the value of these `glTexCoord'
10442 commands.
10443
10444 `GL_MAP1_TEXTURE_COORD_4'
10445 Each control point is four floating-point values representing the S
10446 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10447 commands are generated when the map is evaluated but the current
10448 texture coordinates are not updated with the value of these
10449 `glTexCoord' commands.
10450
10451 STRIDE, ORDER, and POINTS define the array addressing for accessing the
10452 control points. POINTS is the location of the first control point, which
10453 occupies one, two, three, or four contiguous memory locations, depending
10454 on which map is being defined. ORDER is the number of control points in
10455 the array. STRIDE specifies how many float or double locations to
10456 advance the internal memory pointer to reach the next control point.
10457
10458 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10459
10460 `GL_INVALID_VALUE' is generated if U1 is equal to U2.
10461
10462 `GL_INVALID_VALUE' is generated if STRIDE is less than the number of
10463 values in a control point.
10464
10465 `GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
10466 the return value of `GL_MAX_EVAL_ORDER'.
10467
10468 `GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
10469 execution of `glBegin' and the corresponding execution of `glEnd'.
10470
10471 `GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
10472 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10473
10474 (define-gl-procedures
10475 ((glMap2f
10476 (target GLenum)
10477 (u1 GLfloat)
10478 (u2 GLfloat)
10479 (ustride GLint)
10480 (uorder GLint)
10481 (v1 GLfloat)
10482 (v2 GLfloat)
10483 (vstride GLint)
10484 (vorder GLint)
10485 (points const-GLfloat-*)
10486 ->
10487 void))
10488 "Define a two-dimensional evaluator.
10489
10490 TARGET
10491 Specifies the kind of values that are generated by the evaluator.
10492 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
10493 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
10494 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
10495 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
10496 accepted.
10497
10498 U1
10499 U2
10500
10501 Specify a linear mapping of U , as presented to `glEvalCoord2', to
10502 U^ , one of the two variables that are evaluated by the equations
10503 specified by this command. Initially, U1 is 0 and U2 is 1.
10504
10505 USTRIDE
10506 Specifies the number of floats or doubles between the beginning of
10507 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
10508 where I and J are the U and V control point indices, respectively.
10509 This allows control points to be embedded in arbitrary data
10510 structures. The only constraint is that the values for a particular
10511 control point must occupy contiguous memory locations. The initial
10512 value of USTRIDE is 0.
10513
10514 UORDER
10515 Specifies the dimension of the control point array in the U axis.
10516 Must be positive. The initial value is 1.
10517
10518 V1
10519 V2
10520
10521 Specify a linear mapping of V , as presented to `glEvalCoord2', to
10522 V^ , one of the two variables that are evaluated by the equations
10523 specified by this command. Initially, V1 is 0 and V2 is 1.
10524
10525 VSTRIDE
10526 Specifies the number of floats or doubles between the beginning of
10527 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
10528 where I and J are the U and V control point indices, respectively.
10529 This allows control points to be embedded in arbitrary data
10530 structures. The only constraint is that the values for a particular
10531 control point must occupy contiguous memory locations. The initial
10532 value of VSTRIDE is 0.
10533
10534 VORDER
10535 Specifies the dimension of the control point array in the V axis.
10536 Must be positive. The initial value is 1.
10537
10538 POINTS
10539 Specifies a pointer to the array of control points.
10540
10541 Evaluators provide a way to use polynomial or rational polynomial
10542 mapping to produce vertices, normals, texture coordinates, and colors.
10543 The values produced by an evaluator are sent on to further stages of GL
10544 processing just as if they had been presented using `glVertex',
10545 `glNormal', `glTexCoord', and `glColor' commands, except that the
10546 generated values do not update the current normal, texture coordinates,
10547 or color.
10548
10549 All polynomial or rational polynomial splines of any degree (up to the
10550 maximum degree supported by the GL implementation) can be described
10551 using evaluators. These include almost all surfaces used in computer
10552 graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
10553 and so on.
10554
10555 Evaluators define surfaces based on bivariate Bernstein polynomials.
10556 Define P\u2061(U^,V^) as
10557
10558 P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
10559
10560
10561
10562 where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
10563 polynomial of degree N (UORDER = N+1 )
10564
10565 B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
10566
10567 and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
10568 M+1 )
10569
10570 B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
10571
10572 Recall that 0^0==1 and ((N), (0),,)==1
10573
10574 `glMap2' is used to define the basis and to specify what kind of values
10575 are produced. Once defined, a map can be enabled and disabled by calling
10576 `glEnable' and `glDisable' with the map name, one of the nine predefined
10577 values for TARGET, described below. When `glEvalCoord2' presents values
10578 U and V , the bivariate Bernstein polynomials are evaluated using U^ and
10579 V^ , where
10580
10581 U^=U-U1,/U2-U1,
10582
10583 V^=V-V1,/V2-V1,
10584
10585 TARGET is a symbolic constant that indicates what kind of control points
10586 are provided in POINTS, and what output is generated when the map is
10587 evaluated. It can assume one of nine predefined values:
10588
10589 `GL_MAP2_VERTEX_3'
10590 Each control point is three floating-point values representing X ,
10591 Y , and Z . Internal `glVertex3' commands are generated when the
10592 map is evaluated.
10593
10594 `GL_MAP2_VERTEX_4'
10595 Each control point is four floating-point values representing X , Y
10596 , Z , and W . Internal `glVertex4' commands are generated when the
10597 map is evaluated.
10598
10599 `GL_MAP2_INDEX'
10600 Each control point is a single floating-point value representing a
10601 color index. Internal `glIndex' commands are generated when the map
10602 is evaluated but the current index is not updated with the value of
10603 these `glIndex' commands.
10604
10605 `GL_MAP2_COLOR_4'
10606 Each control point is four floating-point values representing red,
10607 green, blue, and alpha. Internal `glColor4' commands are generated
10608 when the map is evaluated but the current color is not updated with
10609 the value of these `glColor4' commands.
10610
10611 `GL_MAP2_NORMAL'
10612 Each control point is three floating-point values representing the
10613 X , Y , and Z components of a normal vector. Internal `glNormal'
10614 commands are generated when the map is evaluated but the current
10615 normal is not updated with the value of these `glNormal' commands.
10616
10617 `GL_MAP2_TEXTURE_COORD_1'
10618 Each control point is a single floating-point value representing
10619 the S texture coordinate. Internal `glTexCoord1' commands are
10620 generated when the map is evaluated but the current texture
10621 coordinates are not updated with the value of these `glTexCoord'
10622 commands.
10623
10624 `GL_MAP2_TEXTURE_COORD_2'
10625 Each control point is two floating-point values representing the S
10626 and T texture coordinates. Internal `glTexCoord2' commands are
10627 generated when the map is evaluated but the current texture
10628 coordinates are not updated with the value of these `glTexCoord'
10629 commands.
10630
10631 `GL_MAP2_TEXTURE_COORD_3'
10632 Each control point is three floating-point values representing the
10633 S , T , and R texture coordinates. Internal `glTexCoord3' commands
10634 are generated when the map is evaluated but the current texture
10635 coordinates are not updated with the value of these `glTexCoord'
10636 commands.
10637
10638 `GL_MAP2_TEXTURE_COORD_4'
10639 Each control point is four floating-point values representing the S
10640 , T , R , and Q texture coordinates. Internal `glTexCoord4'
10641 commands are generated when the map is evaluated but the current
10642 texture coordinates are not updated with the value of these
10643 `glTexCoord' commands.
10644
10645 USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
10646 for accessing the control points. POINTS is the location of the first
10647 control point, which occupies one, two, three, or four contiguous memory
10648 locations, depending on which map is being defined. There are
10649 UORDER×VORDER control points in the array. USTRIDE specifies how many
10650 float or double locations are skipped to advance the internal memory
10651 pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
10652 specifies how many float or double locations are skipped to advance the
10653 internal memory pointer from control point R_I\u2062J, to control point
10654 R_I\u2061(J+1,), .
10655
10656 `GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
10657
10658 `GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
10659 to V2.
10660
10661 `GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
10662 than the number of values in a control point.
10663
10664 `GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
10665 1 or greater than the return value of `GL_MAX_EVAL_ORDER'.
10666
10667 `GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
10668 execution of `glBegin' and the corresponding execution of `glEnd'.
10669
10670 `GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
10671 of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
10672
10673 (define-gl-procedures
10674 ((glMapBuffer
10675 (target GLenum)
10676 (access GLenum)
10677 ->
10678 void-*)
10679 (glUnmapBuffer (target GLenum) -> GLboolean))
10680 "Map a buffer object's data store.
10681
10682 TARGET
10683 Specifies the target buffer object being mapped. The symbolic
10684 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
10685 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
10686
10687 ACCESS
10688 Specifies the access policy, indicating whether it will be possible
10689 to read from, write to, or both read from and write to the buffer
10690 object's mapped data store. The symbolic constant must be
10691 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10692
10693 `glMapBuffer' maps to the client's address space the entire data store
10694 of the buffer object currently bound to TARGET. The data can then be
10695 directly read and/or written relative to the returned pointer, depending
10696 on the specified ACCESS policy. If the GL is unable to map the buffer
10697 object's data store, `glMapBuffer' generates an error and returns
10698 `NULL'. This may occur for system-specific reasons, such as low virtual
10699 memory availability.
10700
10701 If a mapped data store is accessed in a way inconsistent with the
10702 specified ACCESS policy, no error is generated, but performance may be
10703 negatively impacted and system errors, including program termination,
10704 may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
10705 a hint, and does in fact constrain the usage of the mapped data store on
10706 some GL implementations. In order to achieve the highest performance
10707 available, a buffer object's data store should be used in ways
10708 consistent with both its specified USAGE and ACCESS parameters.
10709
10710 A mapped data store must be unmapped with `glUnmapBuffer' before its
10711 buffer object is used. Otherwise an error will be generated by any GL
10712 command that attempts to dereference the buffer object's data store.
10713 When a data store is unmapped, the pointer to its data store becomes
10714 invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
10715 contents have become corrupt during the time the data store was mapped.
10716 This can occur for system-specific reasons that affect the availability
10717 of graphics memory, such as screen mode changes. In such situations,
10718 `GL_FALSE' is returned and the data store contents are undefined. An
10719 application must detect this rare condition and reinitialize the data
10720 store.
10721
10722 A buffer object's mapped data store is automatically unmapped when the
10723 buffer object is deleted or its data store is recreated with
10724 `glBufferData'.
10725
10726 `GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
10727 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
10728 `GL_PIXEL_UNPACK_BUFFER'.
10729
10730 `GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
10731 `GL_WRITE_ONLY', or `GL_READ_WRITE'.
10732
10733 `GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
10734 is unable to map the buffer object's data store. This may occur for a
10735 variety of system-specific reasons, such as the absence of sufficient
10736 remaining virtual memory.
10737
10738 `GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
10739 is bound to TARGET.
10740
10741 `GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
10742 buffer object whose data store is already mapped.
10743
10744 `GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
10745 buffer object whose data store is not currently mapped.
10746
10747 `GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
10748 is executed between the execution of `glBegin' and the corresponding
10749 execution of `glEnd'.")
10750
10751 (define-gl-procedures
10752 ((glMapGrid1f
10753 (un GLint)
10754 (u1 GLfloat)
10755 (u2 GLfloat)
10756 ->
10757 void)
10758 (glMapGrid2f
10759 (un GLint)
10760 (u1 GLfloat)
10761 (u2 GLfloat)
10762 (vn GLint)
10763 (v1 GLfloat)
10764 (v2 GLfloat)
10765 ->
10766 void))
10767 "Define a one- or two-dimensional mesh.
10768
10769 UN
10770 Specifies the number of partitions in the grid range interval [U1,
10771 U2]. Must be positive.
10772
10773 U1
10774 U2
10775
10776 Specify the mappings for integer grid domain values I=0 and I=UN .
10777
10778 VN
10779 Specifies the number of partitions in the grid range interval [V1,
10780 V2] (`glMapGrid2' only).
10781
10782 V1
10783 V2
10784
10785 Specify the mappings for integer grid domain values J=0 and J=VN
10786 (`glMapGrid2' only).
10787
10788 `glMapGrid' and `glEvalMesh' are used together to efficiently generate
10789 and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
10790 steps through the integer domain of a one- or two-dimensional grid,
10791 whose range is the domain of the evaluation maps specified by `glMap1'
10792 and `glMap2'.
10793
10794 `glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
10795 the I (or I and J ) integer grid coordinates, to the U (or U and V )
10796 floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
10797 details of how U and V coordinates are evaluated.
10798
10799 `glMapGrid1' specifies a single linear mapping such that integer grid
10800 coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
10801 exactly to U2. All other integer grid coordinates I are mapped so that
10802
10803 U=I\u2061(U2-U1,)/UN+U1
10804
10805 `glMapGrid2' specifies two such linear mappings. One maps integer grid
10806 coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
10807 to U2. The other maps integer grid coordinate J=0 exactly to V1, and
10808 integer grid coordinate J=VN exactly to V2. Other integer grid
10809 coordinates I and J are mapped such that
10810
10811 U=I\u2061(U2-U1,)/UN+U1
10812
10813 V=J\u2061(V2-V1,)/VN+V1
10814
10815 The mappings specified by `glMapGrid' are used identically by
10816 `glEvalMesh' and `glEvalPoint'.
10817
10818 `GL_INVALID_VALUE' is generated if either UN or VN is not positive.
10819
10820 `GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
10821 the execution of `glBegin' and the corresponding execution of `glEnd'.")
10822
10823 (define-gl-procedures
10824 ((glMaterialf
10825 (face GLenum)
10826 (pname GLenum)
10827 (param GLfloat)
10828 ->
10829 void)
10830 (glMateriali
10831 (face GLenum)
10832 (pname GLenum)
10833 (param GLint)
10834 ->
10835 void))
10836 "Specify material parameters for the lighting model.
10837
10838 FACE
10839 Specifies which face or faces are being updated. Must be one of
10840 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
10841
10842 PNAME
10843 Specifies the single-valued material parameter of the face or faces
10844 that is being updated. Must be `GL_SHININESS'.
10845
10846 PARAM
10847 Specifies the value that parameter `GL_SHININESS' will be set to.
10848
10849 `glMaterial' assigns values to material parameters. There are two
10850 matched sets of material parameters. One, the FRONT-FACING set, is used
10851 to shade points, lines, bitmaps, and all polygons (when two-sided
10852 lighting is disabled), or just front-facing polygons (when two-sided
10853 lighting is enabled). The other set, BACK-FACING, is used to shade
10854 back-facing polygons only when two-sided lighting is enabled. Refer to
10855 the `glLightModel' reference page for details concerning one- and
10856 two-sided lighting calculations.
10857
10858 `glMaterial' takes three arguments. The first, FACE, specifies whether
10859 the `GL_FRONT' materials, the `GL_BACK' materials, or both
10860 `GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
10861 specifies which of several parameters in one or both sets will be
10862 modified. The third, PARAMS, specifies what value or values will be
10863 assigned to the specified parameter.
10864
10865 Material parameters are used in the lighting equation that is optionally
10866 applied to each vertex. The equation is discussed in the `glLightModel'
10867 reference page. The parameters that can be specified using `glMaterial',
10868 and their interpretations by the lighting equation, are as follows:
10869
10870 `GL_AMBIENT'
10871 PARAMS contains four integer or floating-point values that specify
10872 the ambient RGBA reflectance of the material. Integer values are
10873 mapped linearly such that the most positive representable value
10874 maps to 1.0, and the most negative representable value maps to -1.0
10875 . Floating-point values are mapped directly. Neither integer nor
10876 floating-point values are clamped. The initial ambient reflectance
10877 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
10878
10879 `GL_DIFFUSE'
10880 PARAMS contains four integer or floating-point values that specify
10881 the diffuse RGBA reflectance of the material. Integer values are
10882 mapped linearly such that the most positive representable value
10883 maps to 1.0, and the most negative representable value maps to -1.0
10884 . Floating-point values are mapped directly. Neither integer nor
10885 floating-point values are clamped. The initial diffuse reflectance
10886 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
10887
10888 `GL_SPECULAR'
10889 PARAMS contains four integer or floating-point values that specify
10890 the specular RGBA reflectance of the material. Integer values are
10891 mapped linearly such that the most positive representable value
10892 maps to 1.0, and the most negative representable value maps to -1.0
10893 . Floating-point values are mapped directly. Neither integer nor
10894 floating-point values are clamped. The initial specular reflectance
10895 for both front- and back-facing materials is (0, 0, 0, 1).
10896
10897 `GL_EMISSION'
10898 PARAMS contains four integer or floating-point values that specify
10899 the RGBA emitted light intensity of the material. Integer values
10900 are mapped linearly such that the most positive representable value
10901 maps to 1.0, and the most negative representable value maps to -1.0
10902 . Floating-point values are mapped directly. Neither integer nor
10903 floating-point values are clamped. The initial emission intensity
10904 for both front- and back-facing materials is (0, 0, 0, 1).
10905
10906 `GL_SHININESS'
10907 PARAMS is a single integer or floating-point value that specifies
10908 the RGBA specular exponent of the material. Integer and
10909 floating-point values are mapped directly. Only values in the range
10910 [0,128] are accepted. The initial specular exponent for both front-
10911 and back-facing materials is 0.
10912
10913 `GL_AMBIENT_AND_DIFFUSE'
10914 Equivalent to calling `glMaterial' twice with the same parameter
10915 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
10916
10917 `GL_COLOR_INDEXES'
10918 PARAMS contains three integer or floating-point values specifying
10919 the color indices for ambient, diffuse, and specular lighting.
10920 These three values, and `GL_SHININESS', are the only material
10921 values used by the color index mode lighting equation. Refer to the
10922 `glLightModel' reference page for a discussion of color index
10923 lighting.
10924
10925 `GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
10926 accepted value.
10927
10928 `GL_INVALID_VALUE' is generated if a specular exponent outside the range
10929 [0,128] is specified.")
10930
10931 (define-gl-procedures
10932 ((glMatrixMode (mode GLenum) -> void))
10933 "Specify which matrix is the current matrix.
10934
10935 MODE
10936 Specifies which matrix stack is the target for subsequent matrix
10937 operations. Three values are accepted: `GL_MODELVIEW',
10938 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
10939 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
10940 supported, `GL_COLOR' is also accepted.
10941
10942 `glMatrixMode' sets the current matrix mode. MODE can assume one of four
10943 values:
10944
10945 `GL_MODELVIEW'
10946 Applies subsequent matrix operations to the modelview matrix stack.
10947
10948 `GL_PROJECTION'
10949 Applies subsequent matrix operations to the projection matrix
10950 stack.
10951
10952 `GL_TEXTURE'
10953 Applies subsequent matrix operations to the texture matrix stack.
10954
10955 `GL_COLOR'
10956 Applies subsequent matrix operations to the color matrix stack.
10957
10958 To find out which matrix stack is currently the target of all matrix
10959 operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
10960 value is `GL_MODELVIEW'.
10961
10962 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
10963
10964 `GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
10965 between the execution of `glBegin' and the corresponding execution of
10966 `glEnd'.")
10967
10968 (define-gl-procedures
10969 ((glMinmax
10970 (target GLenum)
10971 (internalformat GLenum)
10972 (sink GLboolean)
10973 ->
10974 void))
10975 "Define minmax table.
10976
10977 TARGET
10978 The minmax table whose parameters are to be set. Must be
10979 `GL_MINMAX'.
10980
10981 INTERNALFORMAT
10982 The format of entries in the minmax table. Must be one of
10983 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
10984 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
10985 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
10986 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
10987 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
10988 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
10989 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
10990 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
10991 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
10992
10993 SINK
10994 If `GL_TRUE', pixels will be consumed by the minmax process and no
10995 drawing or texture loading will take place. If `GL_FALSE', pixels
10996 will proceed to the final conversion process after minmax.
10997
10998 When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
10999 compared to the minimum and maximum values for each component, which are
11000 stored in the two-element minmax table. (The first element stores the
11001 minima, and the second element stores the maxima.) If a pixel component
11002 is greater than the corresponding component in the maximum element, then
11003 the maximum element is updated with the pixel component value. If a
11004 pixel component is less than the corresponding component in the minimum
11005 element, then the minimum element is updated with the pixel component
11006 value. (In both cases, if the internal format of the minmax table
11007 includes luminance, then the R color component of incoming pixels is
11008 used for comparison.) The contents of the minmax table may be retrieved
11009 at a later time by calling `glGetMinmax'. The minmax operation is
11010 enabled or disabled by calling `glEnable' or `glDisable', respectively,
11011 with an argument of `GL_MINMAX'.
11012
11013 `glMinmax' redefines the current minmax table to have entries of the
11014 format specified by INTERNALFORMAT. The maximum element is initialized
11015 with the smallest possible component values, and the minimum element is
11016 initialized with the largest possible component values. The values in
11017 the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
11018 pixels are discarded after minmax; no further processing of the pixels
11019 takes place, and no drawing, texture loading, or pixel readback will
11020 result.
11021
11022
11023
11024 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
11025 values.
11026
11027 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
11028 allowable values.
11029
11030 `GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
11031 the execution of `glBegin' and the corresponding execution of `glEnd'.")
11032
11033 (define-gl-procedures
11034 ((glMultiDrawArrays
11035 (mode GLenum)
11036 (first GLint-*)
11037 (count GLsizei-*)
11038 (primcount GLsizei)
11039 ->
11040 void))
11041 "Render multiple sets of primitives from array data.
11042
11043 MODE
11044 Specifies what kind of primitives to render. Symbolic constants
11045 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11046 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11047 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11048
11049 FIRST
11050 Points to an array of starting indices in the enabled arrays.
11051
11052 COUNT
11053 Points to an array of the number of indices to be rendered.
11054
11055 PRIMCOUNT
11056 Specifies the size of the first and count
11057
11058 `glMultiDrawArrays' specifies multiple sets of geometric primitives with
11059 very few subroutine calls. Instead of calling a GL procedure to pass
11060 each individual vertex, normal, texture coordinate, edge flag, or color,
11061 you can prespecify separate arrays of vertices, normals, and colors and
11062 use them to construct a sequence of primitives with a single call to
11063 `glMultiDrawArrays'.
11064
11065 `glMultiDrawArrays' behaves identically to `glDrawArrays' except that
11066 PRIMCOUNT separate ranges of elements are specified instead.
11067
11068 When `glMultiDrawArrays' is called, it uses COUNT sequential elements
11069 from each enabled array to construct a sequence of geometric primitives,
11070 beginning with element FIRST. MODE specifies what kind of primitives are
11071 constructed, and how the array elements construct those primitives. If
11072 `GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
11073
11074 Vertex attributes that are modified by `glMultiDrawArrays' have an
11075 unspecified value after `glMultiDrawArrays' returns. For example, if
11076 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11077 after `glMultiDrawArrays' executes. Attributes that aren't modified
11078 remain well defined.
11079
11080 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11081
11082 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11083
11084 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11085 bound to an enabled array and the buffer object's data store is
11086 currently mapped.
11087
11088 `GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
11089 between the execution of `glBegin' and the corresponding `glEnd'.")
11090
11091 (define-gl-procedures
11092 ((glMultiDrawElements
11093 (mode GLenum)
11094 (count const-GLsizei-*)
11095 (type GLenum)
11096 (indices const-GLvoid-**)
11097 (primcount GLsizei)
11098 ->
11099 void))
11100 "Render multiple sets of primitives by specifying indices of array data
11101 elements.
11102
11103 MODE
11104 Specifies what kind of primitives to render. Symbolic constants
11105 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
11106 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
11107 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
11108
11109 COUNT
11110 Points to an array of the elements counts.
11111
11112 TYPE
11113 Specifies the type of the values in INDICES. Must be one of
11114 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
11115
11116 INDICES
11117 Specifies a pointer to the location where the indices are stored.
11118
11119 PRIMCOUNT
11120 Specifies the size of the COUNT array.
11121
11122 `glMultiDrawElements' specifies multiple sets of geometric primitives
11123 with very few subroutine calls. Instead of calling a GL function to pass
11124 each individual vertex, normal, texture coordinate, edge flag, or color,
11125 you can prespecify separate arrays of vertices, normals, and so on, and
11126 use them to construct a sequence of primitives with a single call to
11127 `glMultiDrawElements'.
11128
11129 `glMultiDrawElements' is identical in operation to `glDrawElements'
11130 except that PRIMCOUNT separate lists of elements are specified.
11131
11132 Vertex attributes that are modified by `glMultiDrawElements' have an
11133 unspecified value after `glMultiDrawElements' returns. For example, if
11134 `GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
11135 after `glMultiDrawElements' executes. Attributes that aren't modified
11136 maintain their previous values.
11137
11138 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11139
11140 `GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
11141
11142 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
11143 bound to an enabled array or the element array and the buffer object's
11144 data store is currently mapped.
11145
11146 `GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
11147 between the execution of `glBegin' and the corresponding `glEnd'.")
11148
11149 (define-gl-procedures
11150 ((glMultiTexCoord1i
11151 (target GLenum)
11152 (s GLint)
11153 ->
11154 void)
11155 (glMultiTexCoord1f
11156 (target GLenum)
11157 (s GLfloat)
11158 ->
11159 void)
11160 (glMultiTexCoord2i
11161 (target GLenum)
11162 (s GLint)
11163 (t GLint)
11164 ->
11165 void)
11166 (glMultiTexCoord2f
11167 (target GLenum)
11168 (s GLfloat)
11169 (t GLfloat)
11170 ->
11171 void)
11172 (glMultiTexCoord3i
11173 (target GLenum)
11174 (s GLint)
11175 (t GLint)
11176 (r GLint)
11177 ->
11178 void)
11179 (glMultiTexCoord3f
11180 (target GLenum)
11181 (s GLfloat)
11182 (t GLfloat)
11183 (r GLfloat)
11184 ->
11185 void)
11186 (glMultiTexCoord4i
11187 (target GLenum)
11188 (s GLint)
11189 (t GLint)
11190 (r GLint)
11191 (q GLint)
11192 ->
11193 void)
11194 (glMultiTexCoord4f
11195 (target GLenum)
11196 (s GLfloat)
11197 (t GLfloat)
11198 (r GLfloat)
11199 (q GLfloat)
11200 ->
11201 void))
11202 "Set the current texture coordinates.
11203
11204 TARGET
11205 Specifies the texture unit whose coordinates should be modified.
11206 The number of texture units is implementation dependent, but must
11207 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
11208 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
11209 implementation-dependent value.
11210
11211 S
11212 T
11213
11214 R
11215
11216 Q
11217
11218 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
11219 Not all parameters are present in all forms of the command.
11220
11221 `glMultiTexCoord' specifies texture coordinates in one, two, three, or
11222 four dimensions. `glMultiTexCoord1' sets the current texture coordinates
11223 to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
11224 Similarly, `glMultiTexCoord3' specifies the texture coordinates as
11225 (S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
11226 as (S,TRQ) .
11227
11228 The current texture coordinates are part of the data that is associated
11229 with each vertex and with the current raster position. Initially, the
11230 values for (S,TRQ) are (0,001) .")
11231
11232 (define-gl-procedures
11233 ((glMultMatrixf (m const-GLfloat-*) -> void))
11234 "Multiply the current matrix with the specified matrix.
11235
11236 M
11237 Points to 16 consecutive values that are used as the elements of a
11238 4×4 column-major matrix.
11239
11240 `glMultMatrix' multiplies the current matrix with the one specified
11241 using M, and replaces the current matrix with the product.
11242
11243 The current matrix is determined by the current matrix mode (see
11244 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11245 or the texture matrix.
11246
11247 `GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
11248 between the execution of `glBegin' and the corresponding execution of
11249 `glEnd'.")
11250
11251 (define-gl-procedures
11252 ((glMultTransposeMatrixf
11253 (m const-GLfloat-*)
11254 ->
11255 void))
11256 "Multiply the current matrix with the specified row-major ordered matrix.
11257
11258 M
11259 Points to 16 consecutive values that are used as the elements of a
11260 4×4 row-major matrix.
11261
11262 `glMultTransposeMatrix' multiplies the current matrix with the one
11263 specified using M, and replaces the current matrix with the product.
11264
11265 The current matrix is determined by the current matrix mode (see
11266 `glMatrixMode'). It is either the projection matrix, modelview matrix,
11267 or the texture matrix.
11268
11269 `GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
11270 executed between the execution of `glBegin' and the corresponding
11271 execution of `glEnd'.")
11272
11273 (define-gl-procedures
11274 ((glNewList (list GLuint) (mode GLenum) -> void)
11275 (glEndList -> void))
11276 "Create or replace a display list.
11277
11278 LIST
11279 Specifies the display-list name.
11280
11281 MODE
11282 Specifies the compilation mode, which can be `GL_COMPILE' or
11283 `GL_COMPILE_AND_EXECUTE'.
11284
11285 Display lists are groups of GL commands that have been stored for
11286 subsequent execution. Display lists are created with `glNewList'. All
11287 subsequent commands are placed in the display list, in the order issued,
11288 until `glEndList' is called.
11289
11290 `glNewList' has two arguments. The first argument, LIST, is a positive
11291 integer that becomes the unique name for the display list. Names can be
11292 created and reserved with `glGenLists' and tested for uniqueness with
11293 `glIsList'. The second argument, MODE, is a symbolic constant that can
11294 assume one of two values:
11295
11296 `GL_COMPILE'
11297 Commands are merely compiled.
11298
11299 `GL_COMPILE_AND_EXECUTE'
11300 Commands are executed as they are compiled into the display list.
11301
11302 Certain commands are not compiled into the display list but are executed
11303 immediately, regardless of the display-list mode. These commands are
11304 `glAreTexturesResident', `glColorPointer', `glDeleteLists',
11305 `glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
11306 `glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
11307 `glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
11308 `glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
11309 `glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
11310 `glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
11311 `glVertexPointer', and all of the `glGet' commands.
11312
11313 Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
11314 executed immediately and not compiled into the display list when their
11315 first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
11316 `GL_PROXY_TEXTURE_3D', respectively.
11317
11318 When the `ARB_imaging' extension is supported, `glHistogram' executes
11319 immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
11320 `glColorTable' executes immediately when its first argument is
11321 `GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
11322 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
11323
11324 For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
11325 extension is supported, `glClientActiveTexture' is not compiled into
11326 display lists, but executed immediately.
11327
11328 When `glEndList' is encountered, the display-list definition is
11329 completed by associating the list with the unique name LIST (specified
11330 in the `glNewList' command). If a display list with name LIST already
11331 exists, it is replaced only when `glEndList' is called.
11332
11333 `GL_INVALID_VALUE' is generated if LIST is 0.
11334
11335 `GL_INVALID_ENUM' is generated if MODE is not an accepted value.
11336
11337 `GL_INVALID_OPERATION' is generated if `glEndList' is called without a
11338 preceding `glNewList', or if `glNewList' is called while a display list
11339 is being defined.
11340
11341 `GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
11342 executed between the execution of `glBegin' and the corresponding
11343 execution of `glEnd'.
11344
11345 `GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
11346 compile the display list. If the GL version is 1.1 or greater, no change
11347 is made to the previous contents of the display list, if any, and no
11348 other change is made to the GL state. (It is as if no attempt had been
11349 made to create the new display list.)")
11350
11351 (define-gl-procedures
11352 ((glNormalPointer
11353 (type GLenum)
11354 (stride GLsizei)
11355 (pointer const-GLvoid-*)
11356 ->
11357 void))
11358 "Define an array of normals.
11359
11360 TYPE
11361 Specifies the data type of each coordinate in the array. Symbolic
11362 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
11363 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
11364
11365 STRIDE
11366 Specifies the byte offset between consecutive normals. If STRIDE is
11367 0, the normals are understood to be tightly packed in the array.
11368 The initial value is 0.
11369
11370 POINTER
11371 Specifies a pointer to the first coordinate of the first normal in
11372 the array. The initial value is 0.
11373
11374 `glNormalPointer' specifies the location and data format of an array of
11375 normals to use when rendering. TYPE specifies the data type of each
11376 normal coordinate, and STRIDE specifies the byte stride from one normal
11377 to the next, allowing vertices and attributes to be packed into a single
11378 array or stored in separate arrays. (Single-array storage may be more
11379 efficient on some implementations; see `glInterleavedArrays'.)
11380
11381 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
11382 target (see `glBindBuffer') while a normal array is specified, POINTER
11383 is treated as a byte offset into the buffer object's data store. Also,
11384 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
11385 vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
11386
11387 When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
11388 client-side state, in addition to the current vertex array buffer object
11389 binding.
11390
11391 To enable and disable the normal array, call `glEnableClientState' and
11392 `glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
11393 the normal array is used when `glDrawArrays', `glMultiDrawArrays',
11394 `glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
11395 `glArrayElement' is called.
11396
11397 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
11398
11399 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
11400
11401 (define-gl-procedures
11402 ((glNormal3f
11403 (nx GLfloat)
11404 (ny GLfloat)
11405 (nz GLfloat)
11406 ->
11407 void)
11408 (glNormal3i
11409 (nx GLint)
11410 (ny GLint)
11411 (nz GLint)
11412 ->
11413 void))
11414 "Set the current normal vector.
11415
11416 NX
11417 NY
11418
11419 NZ
11420
11421 Specify the X , Y , and Z coordinates of the new current normal.
11422 The initial value of the current normal is the unit vector, (0, 0,
11423 1).
11424
11425
11426
11427 The current normal is set to the given coordinates whenever `glNormal'
11428 is issued. Byte, short, or integer arguments are converted to
11429 floating-point format with a linear mapping that maps the most positive
11430 representable integer value to 1.0 and the most negative representable
11431 integer value to -1.0 .
11432
11433 Normals specified with `glNormal' need not have unit length. If
11434 `GL_NORMALIZE' is enabled, then normals of any length specified with
11435 `glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
11436 is enabled, normals are scaled by a scaling factor derived from the
11437 modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
11438 specified normals were of unit length, and that the modelview matrix
11439 contain only uniform scales for proper results. To enable and disable
11440 normalization, call `glEnable' and `glDisable' with either
11441 `GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
11442 disabled.")
11443
11444 (define-gl-procedures
11445 ((glOrtho
11446 (left GLdouble)
11447 (right GLdouble)
11448 (bottom GLdouble)
11449 (top GLdouble)
11450 (nearVal GLdouble)
11451 (farVal GLdouble)
11452 ->
11453 void))
11454 "Multiply the current matrix with an orthographic matrix.
11455
11456 LEFT
11457 RIGHT
11458
11459 Specify the coordinates for the left and right vertical clipping
11460 planes.
11461
11462 BOTTOM
11463 TOP
11464
11465 Specify the coordinates for the bottom and top horizontal clipping
11466 planes.
11467
11468 NEARVAL
11469 FARVAL
11470
11471 Specify the distances to the nearer and farther depth clipping
11472 planes. These values are negative if the plane is to be behind the
11473 viewer.
11474
11475 `glOrtho' describes a transformation that produces a parallel
11476 projection. The current matrix (see `glMatrixMode') is multiplied by
11477 this matrix and the result replaces the current matrix, as if
11478 `glMultMatrix' were called with the following matrix as its argument:
11479
11480 ((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
11481 -2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
11482
11483 where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
11484 T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
11485
11486 Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
11487 and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
11488 that are mapped to the lower left and upper right corners of the window,
11489 respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
11490 specifies the location of the far clipping plane. Both NEARVAL and
11491 FARVAL can be either positive or negative.
11492
11493 Use `glPushMatrix' and `glPopMatrix' to save and restore the current
11494 matrix stack.
11495
11496 `GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
11497 NEAR = FAR.
11498
11499 `GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
11500 execution of `glBegin' and the corresponding execution of `glEnd'.")
11501
11502 (define-gl-procedures
11503 ((glPassThrough (token GLfloat) -> void))
11504 "Place a marker in the feedback buffer.
11505
11506 TOKEN
11507 Specifies a marker value to be placed in the feedback buffer
11508 following a `GL_PASS_THROUGH_TOKEN'.
11509
11510
11511
11512 Feedback is a GL render mode. The mode is selected by calling
11513 `glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
11514 pixels are produced by rasterization. Instead, information about
11515 primitives that would have been rasterized is fed back to the
11516 application using the GL. See the `glFeedbackBuffer' reference page for
11517 a description of the feedback buffer and the values in it.
11518
11519 `glPassThrough' inserts a user-defined marker in the feedback buffer
11520 when it is executed in feedback mode. TOKEN is returned as if it were a
11521 primitive; it is indicated with its own unique identifying value:
11522 `GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
11523 respect to the specification of graphics primitives is maintained.
11524
11525 `GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
11526 between the execution of `glBegin' and the corresponding execution of
11527 `glEnd'.")
11528
11529 (define-gl-procedures
11530 ((glPixelStoref
11531 (pname GLenum)
11532 (param GLfloat)
11533 ->
11534 void)
11535 (glPixelStorei
11536 (pname GLenum)
11537 (param GLint)
11538 ->
11539 void))
11540 "Set pixel storage modes.
11541
11542 PNAME
11543 Specifies the symbolic name of the parameter to be set. Six values
11544 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
11545 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
11546 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
11547 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
11548 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
11549 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
11550 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
11551 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
11552
11553 PARAM
11554 Specifies the value that PNAME is set to.
11555
11556 `glPixelStore' sets pixel storage modes that affect the operation of
11557 subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
11558 polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
11559 `glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
11560 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
11561 `glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
11562 supported, pixel storage modes affect convolution filters (see
11563 `glConvolutionFilter1D', `glConvolutionFilter2D', and
11564 `glSeparableFilter2D', color table (see `glColorTable', and
11565 `glColorSubTable', and unpacking histogram (See `glHistogram'), and
11566 minmax (See `glMinmax') data.
11567
11568 PNAME is a symbolic constant indicating the parameter to be set, and
11569 PARAM is the new value. Six of the twelve storage parameters affect how
11570 pixel data is returned to client memory. They are as follows:
11571
11572 `GL_PACK_SWAP_BYTES'
11573 If true, byte ordering for multibyte color components, depth
11574 components, color indices, or stencil indices is reversed. That is,
11575 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11576 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
11577 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
11578 the memory order of components within a pixel, only on the order of
11579 bytes within components or indices. For example, the three
11580 components of a `GL_RGB' format pixel are always stored with red
11581 first, green second, and blue third, regardless of the value of
11582 `GL_PACK_SWAP_BYTES'.
11583
11584 `GL_PACK_LSB_FIRST'
11585 If true, bits are ordered within a byte from least significant to
11586 most significant; otherwise, the first bit in each byte is the most
11587 significant one. This parameter is significant for bitmap data
11588 only.
11589
11590 `GL_PACK_ROW_LENGTH'
11591 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
11592 pixels in a row. If the first pixel of a row is placed at location
11593 P in memory, then the location of the first pixel of the next row
11594 is obtained by skipping
11595
11596 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11597
11598 components or indices, where N is the number of components or
11599 indices in a pixel, L is the number of pixels in a row
11600 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11601 to the pixel routine otherwise), A is the value of
11602 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11603 component (if A<S , then it is as if A=S ). In the case of 1-bit
11604 values, the location of the next row is obtained by skipping
11605
11606 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11607
11608 components or indices.
11609
11610 The word COMPONENT in this description refers to the nonindex
11611 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11612 for example, has three components per pixel: first red, then green,
11613 and finally blue.
11614
11615 `GL_PACK_IMAGE_HEIGHT'
11616 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
11617 pixels in an image three-dimensional texture volume, where
11618 ``image'' is defined by all pixels sharing the same third dimension
11619 index. If the first pixel of a row is placed at location P in
11620 memory, then the location of the first pixel of the next row is
11621 obtained by skipping
11622
11623 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11624
11625 components or indices, where N is the number of components or
11626 indices in a pixel, L is the number of pixels in a row
11627 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11628 to `glTexImage3D' otherwise), H is the number of rows in a pixel
11629 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11630 argument to the `glTexImage3D' routine otherwise), A is the value
11631 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
11632 component (if A<S , then it is as if A=S ).
11633
11634 The word COMPONENT in this description refers to the nonindex
11635 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11636 for example, has three components per pixel: first red, then green,
11637 and finally blue.
11638
11639 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
11640 These values are provided as a convenience to the programmer; they
11641 provide no functionality that cannot be duplicated simply by
11642 incrementing the pointer passed to `glReadPixels'. Setting
11643 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
11644 pointer by I\u2062N components or indices, where N is the number of
11645 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
11646 J is equivalent to incrementing the pointer by J\u2062M components or
11647 indices, where M is the number of components or indices per row, as
11648 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
11649 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
11650 pointer by K\u2062P , where P is the number of components or indices per
11651 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
11652
11653 `GL_PACK_ALIGNMENT'
11654 Specifies the alignment requirements for the start of each pixel
11655 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11656 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11657 start on double-word boundaries).
11658
11659 The other six of the twelve storage parameters affect how pixel data is
11660 read from client memory. These values are significant for
11661 `glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11662 `glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
11663 `glPolygonStipple'.
11664
11665 Additionally, if the `ARB_imaging' extension is supported,
11666 `glColorTable', `glColorSubTable', `glConvolutionFilter1D',
11667 `glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
11668
11669 `GL_UNPACK_SWAP_BYTES'
11670 If true, byte ordering for multibyte color components, depth
11671 components, color indices, or stencil indices is reversed. That is,
11672 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
11673 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
11674 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
11675 effect on the memory order of components within a pixel, only on
11676 the order of bytes within components or indices. For example, the
11677 three components of a `GL_RGB' format pixel are always stored with
11678 red first, green second, and blue third, regardless of the value of
11679 `GL_UNPACK_SWAP_BYTES'.
11680
11681 `GL_UNPACK_LSB_FIRST'
11682 If true, bits are ordered within a byte from least significant to
11683 most significant; otherwise, the first bit in each byte is the most
11684 significant one. This is relevant only for bitmap data.
11685
11686 `GL_UNPACK_ROW_LENGTH'
11687 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
11688 pixels in a row. If the first pixel of a row is placed at location
11689 P in memory, then the location of the first pixel of the next row
11690 is obtained by skipping
11691
11692 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
11693
11694 components or indices, where N is the number of components or
11695 indices in a pixel, L is the number of pixels in a row
11696 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11697 to the pixel routine otherwise), A is the value of
11698 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11699 component (if A<S , then it is as if A=S ). In the case of 1-bit
11700 values, the location of the next row is obtained by skipping
11701
11702 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
11703
11704 components or indices.
11705
11706 The word COMPONENT in this description refers to the nonindex
11707 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11708 for example, has three components per pixel: first red, then green,
11709 and finally blue.
11710
11711 `GL_UNPACK_IMAGE_HEIGHT'
11712 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
11713 pixels in an image of a three-dimensional texture volume. Where
11714 ``image'' is defined by all pixel sharing the same third dimension
11715 index. If the first pixel of a row is placed at location P in
11716 memory, then the location of the first pixel of the next row is
11717 obtained by skipping
11718
11719 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
11720
11721 components or indices, where N is the number of components or
11722 indices in a pixel, L is the number of pixels in a row
11723 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
11724 to `glTexImage3D' otherwise), H is the number of rows in an image
11725 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
11726 argument to `glTexImage3D' otherwise), A is the value of
11727 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
11728 component (if A<S , then it is as if A=S ).
11729
11730 The word COMPONENT in this description refers to the nonindex
11731 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
11732 for example, has three components per pixel: first red, then green,
11733 and finally blue.
11734
11735 `GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
11736 These values are provided as a convenience to the programmer; they
11737 provide no functionality that cannot be duplicated by incrementing
11738 the pointer passed to `glDrawPixels', `glTexImage1D',
11739 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
11740 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
11741 equivalent to incrementing the pointer by I\u2062N components or
11742 indices, where N is the number of components or indices in each
11743 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
11744 incrementing the pointer by J\u2062K components or indices, where K is
11745 the number of components or indices per row, as just computed in
11746 the `GL_UNPACK_ROW_LENGTH' section.
11747
11748 `GL_UNPACK_ALIGNMENT'
11749 Specifies the alignment requirements for the start of each pixel
11750 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
11751 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
11752 start on double-word boundaries).
11753
11754 The following table gives the type, initial value, and range of valid
11755 values for each storage parameter that can be set with `glPixelStore'.
11756
11757
11758
11759 *PNAME*
11760 *Type*, *Initial Value*, *Valid Range*
11761
11762 `GL_PACK_SWAP_BYTES'
11763 boolean , false , true or false
11764
11765 `GL_PACK_LSB_FIRST'
11766 boolean , false , true or false
11767
11768 `GL_PACK_ROW_LENGTH'
11769 integer , 0 , [0,∞)
11770
11771 `GL_PACK_IMAGE_HEIGHT'
11772 integer , 0 , [0,∞)
11773
11774 `GL_PACK_SKIP_ROWS'
11775 integer , 0 , [0,∞)
11776
11777 `GL_PACK_SKIP_PIXELS'
11778 integer , 0 , [0,∞)
11779
11780 `GL_PACK_SKIP_IMAGES'
11781 integer , 0 , [0,∞)
11782
11783 `GL_PACK_ALIGNMENT'
11784 integer , 4 , 1, 2, 4, or 8
11785
11786 `GL_UNPACK_SWAP_BYTES'
11787 boolean , false , true or false
11788
11789 `GL_UNPACK_LSB_FIRST'
11790 boolean , false , true or false
11791
11792 `GL_UNPACK_ROW_LENGTH'
11793 integer , 0 , [0,∞)
11794
11795 `GL_UNPACK_IMAGE_HEIGHT'
11796 integer , 0 , [0,∞)
11797
11798 `GL_UNPACK_SKIP_ROWS'
11799 integer , 0 , [0,∞)
11800
11801 `GL_UNPACK_SKIP_PIXELS'
11802 integer , 0 , [0,∞)
11803
11804 `GL_UNPACK_SKIP_IMAGES'
11805 integer , 0 , [0,∞)
11806
11807 `GL_UNPACK_ALIGNMENT'
11808 integer , 4 , 1, 2, 4, or 8
11809
11810 `glPixelStoref' can be used to set any pixel store parameter. If the
11811 parameter type is boolean, then if PARAM is 0, the parameter is false;
11812 otherwise it is set to true. If PNAME is a integer type parameter, PARAM
11813 is rounded to the nearest integer.
11814
11815 Likewise, `glPixelStorei' can also be used to set any of the pixel store
11816 parameters. Boolean parameters are set to false if PARAM is 0 and true
11817 otherwise.
11818
11819 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11820
11821 `GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
11822 row skip value is specified, or if alignment is specified as other than
11823 1, 2, 4, or 8.
11824
11825 `GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
11826 between the execution of `glBegin' and the corresponding execution of
11827 `glEnd'.")
11828
11829 (define-gl-procedures
11830 ((glPixelTransferf
11831 (pname GLenum)
11832 (param GLfloat)
11833 ->
11834 void)
11835 (glPixelTransferi
11836 (pname GLenum)
11837 (param GLint)
11838 ->
11839 void))
11840 "Set pixel transfer modes.
11841
11842 PNAME
11843 Specifies the symbolic name of the pixel transfer parameter to be
11844 set. Must be one of the following: `GL_MAP_COLOR',
11845 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
11846 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
11847 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
11848 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
11849
11850 Additionally, if the `ARB_imaging' extension is supported, the
11851 following symbolic names are accepted:
11852 `GL_POST_COLOR_MATRIX_RED_SCALE',
11853 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
11854 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
11855 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
11856 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
11857 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
11858 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
11859 `GL_POST_CONVOLUTION_GREEN_SCALE',
11860 `GL_POST_CONVOLUTION_BLUE_SCALE',
11861 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
11862 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
11863 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
11864
11865 PARAM
11866 Specifies the value that PNAME is set to.
11867
11868 `glPixelTransfer' sets pixel transfer modes that affect the operation of
11869 subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
11870 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
11871 `glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
11872 `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
11873 `glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
11874 supported, the routines `glColorTable', `glColorSubTable',
11875 `glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
11876 `glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
11877 that are specified by pixel transfer modes operate on pixels after they
11878 are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
11879 `glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
11880 `glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
11881 memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
11882 `glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
11883 transfer operations happen in the same order, and in the same manner,
11884 regardless of the command that resulted in the pixel operation. Pixel
11885 storage modes (see `glPixelStore') control the unpacking of pixels being
11886 read from client memory and the packing of pixels being written back
11887 into client memory.
11888
11889 Pixel transfer operations handle four fundamental pixel types: COLOR,
11890 COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
11891 floating-point values with unspecified mantissa and exponent sizes,
11892 scaled such that 0 represents zero intensity and 1 represents full
11893 intensity. COLOR INDICES comprise a single fixed-point value, with
11894 unspecified precision to the right of the binary point. DEPTH pixels
11895 comprise a single floating-point value, with unspecified mantissa and
11896 exponent sizes, scaled such that 0.0 represents the minimum depth buffer
11897 value, and 1.0 represents the maximum depth buffer value. Finally,
11898 STENCIL pixels comprise a single fixed-point value, with unspecified
11899 precision to the right of the binary point.
11900
11901 The pixel transfer operations performed on the four basic pixel types
11902 are as follows:
11903
11904 COLOR
11905 Each of the four color components is multiplied by a scale factor,
11906 then added to a bias factor. That is, the red component is
11907 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
11908 green component is multiplied by `GL_GREEN_SCALE', then added to
11909 `GL_GREEN_BIAS'; the blue component is multiplied by
11910 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
11911 component is multiplied by `GL_ALPHA_SCALE', then added to
11912 `GL_ALPHA_BIAS'. After all four color components are scaled and
11913 biased, each is clamped to the range [0,1] . All color, scale, and
11914 bias values are specified with `glPixelTransfer'.
11915
11916 If `GL_MAP_COLOR' is true, each color component is scaled by the
11917 size of the corresponding color-to-color map, then replaced by the
11918 contents of that map indexed by the scaled component. That is, the
11919 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
11920 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
11921 itself. The green component is scaled by
11922 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
11923 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
11924 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
11925 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
11926 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
11927 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
11928 taken from the maps are then clamped to the range [0,1] .
11929 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11930 the various maps are specified with `glPixelMap'.
11931
11932 If the `ARB_imaging' extension is supported, each of the four color
11933 components may be scaled and biased after transformation by the
11934 color matrix. That is, the red component is multiplied by
11935 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
11936 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
11937 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
11938 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
11939 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
11940 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
11941 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
11942 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
11943 are scaled and biased, each is clamped to the range [0,1] .
11944
11945 Similarly, if the `ARB_imaging' extension is supported, each of the
11946 four color components may be scaled and biased after processing by
11947 the enabled convolution filter. That is, the red component is
11948 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
11949 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
11950 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
11951 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
11952 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
11953 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
11954 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
11955 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
11956 are scaled and biased, each is clamped to the range [0,1] .
11957
11958 COLOR INDEX
11959 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
11960 beyond the number of fraction bits carried by the fixed-point index
11961 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
11962 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
11963 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
11964 with `glPixelTransfer'.
11965
11966 From this point, operation diverges depending on the required
11967 format of the resulting pixels. If the resulting pixels are to be
11968 written to a color index buffer, or if they are being read back to
11969 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
11970 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
11971 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
11972 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
11973 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
11974 the index map is specified with `glPixelMap'.
11975
11976 If the resulting pixels are to be written to an RGBA color buffer,
11977 or if they are read back to client memory in a format other than
11978 `GL_COLOR_INDEX', the pixels are converted from indices to colors
11979 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
11980 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
11981 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
11982 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
11983 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
11984 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
11985 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
11986 from the maps are then clamped to the range [0,1] . The contents of
11987 the four maps is specified with `glPixelMap'.
11988
11989 DEPTH
11990 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
11991 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
11992
11993 STENCIL
11994 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
11995 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
11996 each index is masked by 2^N-1 , where N is
11997 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
11998 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
11999
12000 The following table gives the type, initial value, and range of valid
12001 values for each of the pixel transfer parameters that are set with
12002 `glPixelTransfer'.
12003
12004
12005
12006 *PNAME*
12007 *Type*, *Initial Value*, *Valid Range*
12008
12009 `GL_MAP_COLOR'
12010 boolean , false , true/false
12011
12012 `GL_MAP_STENCIL'
12013 boolean , false , true/false
12014
12015 `GL_INDEX_SHIFT'
12016 integer , 0 , (-∞,∞)
12017
12018 `GL_INDEX_OFFSET'
12019 integer , 0 , (-∞,∞)
12020
12021 `GL_RED_SCALE'
12022 float , 1 , (-∞,∞)
12023
12024 `GL_GREEN_SCALE'
12025 float , 1 , (-∞,∞)
12026
12027 `GL_BLUE_SCALE'
12028 float , 1 , (-∞,∞)
12029
12030 `GL_ALPHA_SCALE'
12031 float , 1 , (-∞,∞)
12032
12033 `GL_DEPTH_SCALE'
12034 float , 1 , (-∞,∞)
12035
12036 `GL_RED_BIAS'
12037 float , 0 , (-∞,∞)
12038
12039 `GL_GREEN_BIAS'
12040 float , 0 , (-∞,∞)
12041
12042 `GL_BLUE_BIAS'
12043 float , 0 , (-∞,∞)
12044
12045 `GL_ALPHA_BIAS'
12046 float , 0 , (-∞,∞)
12047
12048 `GL_DEPTH_BIAS'
12049 float , 0 , (-∞,∞)
12050
12051 `GL_POST_COLOR_MATRIX_RED_SCALE'
12052 float , 1 , (-∞,∞)
12053
12054 `GL_POST_COLOR_MATRIX_GREEN_SCALE'
12055 float , 1 , (-∞,∞)
12056
12057 `GL_POST_COLOR_MATRIX_BLUE_SCALE'
12058 float , 1 , (-∞,∞)
12059
12060 `GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12061 float , 1 , (-∞,∞)
12062
12063 `GL_POST_COLOR_MATRIX_RED_BIAS'
12064 float , 0 , (-∞,∞)
12065
12066 `GL_POST_COLOR_MATRIX_GREEN_BIAS'
12067 float , 0 , (-∞,∞)
12068
12069 `GL_POST_COLOR_MATRIX_BLUE_BIAS'
12070 float , 0 , (-∞,∞)
12071
12072 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12073 float , 0 , (-∞,∞)
12074
12075 `GL_POST_CONVOLUTION_RED_SCALE'
12076 float , 1 , (-∞,∞)
12077
12078 `GL_POST_CONVOLUTION_GREEN_SCALE'
12079 float , 1 , (-∞,∞)
12080
12081 `GL_POST_CONVOLUTION_BLUE_SCALE'
12082 float , 1 , (-∞,∞)
12083
12084 `GL_POST_CONVOLUTION_ALPHA_SCALE'
12085 float , 1 , (-∞,∞)
12086
12087 `GL_POST_CONVOLUTION_RED_BIAS'
12088 float , 0 , (-∞,∞)
12089
12090 `GL_POST_CONVOLUTION_GREEN_BIAS'
12091 float , 0 , (-∞,∞)
12092
12093 `GL_POST_CONVOLUTION_BLUE_BIAS'
12094 float , 0 , (-∞,∞)
12095
12096 `GL_POST_CONVOLUTION_ALPHA_BIAS'
12097 float , 0 , (-∞,∞)
12098
12099 `glPixelTransferf' can be used to set any pixel transfer parameter. If
12100 the parameter type is boolean, 0 implies false and any other value
12101 implies true. If PNAME is an integer parameter, PARAM is rounded to the
12102 nearest integer.
12103
12104 Likewise, `glPixelTransferi' can be used to set any of the pixel
12105 transfer parameters. Boolean parameters are set to false if PARAM is 0
12106 and to true otherwise. PARAM is converted to floating point before being
12107 assigned to real-valued parameters.
12108
12109 `GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
12110
12111 `GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
12112 between the execution of `glBegin' and the corresponding execution of
12113 `glEnd'.")
12114
12115 (define-gl-procedures
12116 ((glPixelZoom
12117 (xfactor GLfloat)
12118 (yfactor GLfloat)
12119 ->
12120 void))
12121 "Specify the pixel zoom factors.
12122
12123 XFACTOR
12124 YFACTOR
12125
12126 Specify the X and Y zoom factors for pixel write operations.
12127
12128 `glPixelZoom' specifies values for the X and Y zoom factors. During the
12129 execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
12130 current raster position, and a given element is in the M th row and N th
12131 column of the pixel rectangle, then pixels whose centers are in the
12132 rectangle with corners at
12133
12134 (XR+N·XFACTOR , YR+M·YFACTOR )
12135
12136 (XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
12137
12138 are candidates for replacement. Any pixel whose center lies on the
12139 bottom or left edge of this rectangular region is also modified.
12140
12141 Pixel zoom factors are not limited to positive values. Negative zoom
12142 factors reflect the resulting image about the current raster position.
12143
12144 `GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
12145 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12146
12147 (define-gl-procedures
12148 ((glPointParameterf
12149 (pname GLenum)
12150 (param GLfloat)
12151 ->
12152 void)
12153 (glPointParameteri
12154 (pname GLenum)
12155 (param GLint)
12156 ->
12157 void))
12158 "Specify point parameters.
12159
12160 PNAME
12161 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
12162 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
12163 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
12164
12165 PARAM
12166 Specifies the value that PNAME will be set to.
12167
12168 The following values are accepted for PNAME:
12169
12170 `GL_POINT_SIZE_MIN'
12171
12172
12173 PARAMS is a single floating-point value that specifies the minimum
12174 point size. The default value is 0.0.
12175
12176 `GL_POINT_SIZE_MAX'
12177
12178
12179 PARAMS is a single floating-point value that specifies the maximum
12180 point size. The default value is 1.0.
12181
12182 `GL_POINT_FADE_THRESHOLD_SIZE'
12183
12184
12185 PARAMS is a single floating-point value that specifies the
12186 threshold value to which point sizes are clamped if they exceed the
12187 specified value. The default value is 1.0.
12188
12189 `GL_POINT_DISTANCE_ATTENUATION'
12190
12191
12192 PARAMS is an array of three floating-point values that specify the
12193 coefficients used for scaling the computed point size. The default
12194 values are (1,00) .
12195
12196 `GL_POINT_SPRITE_COORD_ORIGIN'
12197
12198
12199 PARAMS is a single enum specifying the point sprite texture
12200 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
12201 default value is `GL_UPPER_LEFT'.
12202
12203 `GL_INVALID_VALUE' is generated If the value specified for
12204 `GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
12205 `GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
12206
12207 `GL_INVALID_ENUM' is generated If the value specified for
12208 `GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
12209 `GL_UPPER_LEFT'.
12210
12211 If the value for `GL_POINT_SIZE_MIN' is greater than
12212 `GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
12213 error is generated.")
12214
12215 (define-gl-procedures
12216 ((glPointSize (size GLfloat) -> void))
12217 "Specify the diameter of rasterized points.
12218
12219 SIZE
12220 Specifies the diameter of rasterized points. The initial value is
12221 1.
12222
12223 `glPointSize' specifies the rasterized diameter of both aliased and
12224 antialiased points. Using a point size other than 1 has different
12225 effects, depending on whether point antialiasing is enabled. To enable
12226 and disable point antialiasing, call `glEnable' and `glDisable' with
12227 argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
12228
12229 The specified point size is multiplied with a distance attenuation
12230 factor and clamped to the specified point size range, and further
12231 clamped to the implementation-dependent point size range to produce the
12232 derived point size using
12233
12234 POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
12235
12236 where D is the eye-coordinate distance from the eye to the vertex, and A
12237 , B , and C are the distance attenuation coefficients (see
12238 `glPointParameter').
12239
12240 If multisampling is disabled, the computed point size is used as the
12241 point's width.
12242
12243 If multisampling is enabled, the point may be faded by modifying the
12244 point alpha value (see `glSampleCoverage') instead of allowing the point
12245 width to go below a given threshold (see `glPointParameter'). In this
12246 case, the width is further modified in the following manner:
12247
12248 POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
12249 (OTHERWISE),
12250
12251 The point alpha value is modified by computing:
12252
12253 POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
12254 (OTHERWISE),
12255
12256 If point antialiasing is disabled, the actual size is determined by
12257 rounding the supplied size to the nearest integer. (If the rounding
12258 results in the value 0, it is as if the point size were 1.) If the
12259 rounded size is odd, then the center point (X , Y ) of the pixel
12260 fragment that represents the point is computed as
12261
12262 (⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
12263
12264 where W subscripts indicate window coordinates. All pixels that lie
12265 within the square grid of the rounded size centered at (X , Y ) make up
12266 the fragment. If the size is even, the center point is
12267
12268 (⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
12269
12270 and the rasterized fragment's centers are the half-integer window
12271 coordinates within the square of the rounded size centered at (X,Y) .
12272 All pixel fragments produced in rasterizing a nonantialiased point are
12273 assigned the same associated data, that of the vertex corresponding to
12274 the point.
12275
12276 If antialiasing is enabled, then point rasterization produces a fragment
12277 for each pixel square that intersects the region lying within the circle
12278 having diameter equal to the current point size and centered at the
12279 point's (X_W,Y_W) . The coverage value for each fragment is the window
12280 coordinate area of the intersection of the circular region with the
12281 corresponding pixel square. This value is saved and used in the final
12282 rasterization step. The data associated with each fragment is the data
12283 associated with the point being rasterized.
12284
12285 Not all sizes are supported when point antialiasing is enabled. If an
12286 unsupported size is requested, the nearest supported size is used. Only
12287 size 1 is guaranteed to be supported; others depend on the
12288 implementation. To query the range of supported sizes and the size
12289 difference between supported sizes within the range, call `glGet' with
12290 arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
12291 `GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
12292 supported ranges and granularity with `glGet' with arguments
12293 `GL_ALIASED_POINT_SIZE_RANGE'.
12294
12295 `GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
12296
12297 `GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
12298 the execution of `glBegin' and the corresponding execution of `glEnd'.")
12299
12300 (define-gl-procedures
12301 ((glPolygonMode
12302 (face GLenum)
12303 (mode GLenum)
12304 ->
12305 void))
12306 "Select a polygon rasterization mode.
12307
12308 FACE
12309 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
12310 front-facing polygons, `GL_BACK' for back-facing polygons, or
12311 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
12312
12313 MODE
12314 Specifies how polygons will be rasterized. Accepted values are
12315 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
12316 `GL_FILL' for both front- and back-facing polygons.
12317
12318 `glPolygonMode' controls the interpretation of polygons for
12319 rasterization. FACE describes which polygons MODE applies to:
12320 front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
12321 both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
12322 rasterization of polygons. In particular, a polygon's vertices are lit
12323 and the polygon is clipped and possibly culled before these modes are
12324 applied.
12325
12326 Three modes are defined and can be specified in MODE:
12327
12328 `GL_POINT'
12329 Polygon vertices that are marked as the start of a boundary edge
12330 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
12331 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
12332 rasterization attributes other than `GL_POLYGON_MODE' have no
12333 effect.
12334
12335 `GL_LINE'
12336 Boundary edges of the polygon are drawn as line segments. They are
12337 treated as connected line segments for line stippling; the line
12338 stipple counter and pattern are not reset between segments (see
12339 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
12340 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
12341 rasterization attributes other than `GL_POLYGON_MODE' have no
12342 effect.
12343
12344 `GL_FILL'
12345 The interior of the polygon is filled. Polygon attributes such as
12346 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
12347 rasterization of the polygon.
12348
12349 `GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
12350 value.
12351
12352 `GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
12353 between the execution of `glBegin' and the corresponding execution of
12354 `glEnd'.")
12355
12356 (define-gl-procedures
12357 ((glPolygonOffset
12358 (factor GLfloat)
12359 (units GLfloat)
12360 ->
12361 void))
12362 "Set the scale and units used to calculate depth values.
12363
12364 FACTOR
12365 Specifies a scale factor that is used to create a variable depth
12366 offset for each polygon. The initial value is 0.
12367
12368 UNITS
12369 Is multiplied by an implementation-specific value to create a
12370 constant depth offset. The initial value is 0.
12371
12372 When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
12373 `GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
12374 be offset after it is interpolated from the DEPTH values of the
12375 appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
12376 where DZ is a measurement of the change in depth relative to the screen
12377 area of the polygon, and R is the smallest value that is guaranteed to
12378 produce a resolvable offset for a given implementation. The offset is
12379 added before the depth test is performed and before the value is written
12380 into the depth buffer.
12381
12382 `glPolygonOffset' is useful for rendering hidden-line images, for
12383 applying decals to surfaces, and for rendering solids with highlighted
12384 edges.
12385
12386 `GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
12387 between the execution of `glBegin' and the corresponding execution of
12388 `glEnd'.")
12389
12390 (define-gl-procedures
12391 ((glPolygonStipple
12392 (pattern const-GLubyte-*)
12393 ->
12394 void))
12395 "Set the polygon stippling pattern.
12396
12397 PATTERN
12398 Specifies a pointer to a 32×32 stipple pattern that will be
12399 unpacked from memory in the same way that `glDrawPixels' unpacks
12400 pixels.
12401
12402 Polygon stippling, like line stippling (see `glLineStipple'), masks out
12403 certain fragments produced by rasterization, creating a pattern.
12404 Stippling is independent of polygon antialiasing.
12405
12406 PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
12407 just like the pixel data supplied to a `glDrawPixels' call with height
12408 and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
12409 type of `GL_BITMAP'. That is, the stipple pattern is represented as a
12410 32×32 array of 1-bit color indices packed in unsigned bytes.
12411 `glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
12412 `GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
12413 pattern. Pixel transfer operations (shift, offset, pixel map) are not
12414 applied to the stipple image, however.
12415
12416 If a non-zero named buffer object is bound to the
12417 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
12418 pattern is specified, PATTERN is treated as a byte offset into the
12419 buffer object's data store.
12420
12421 To enable and disable polygon stippling, call `glEnable' and `glDisable'
12422 with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
12423 disabled. If it's enabled, a rasterized polygon fragment with window
12424 coordinates X_W and Y_W is sent to the next stage of the GL if and only
12425 if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
12426 1 (one). When polygon stippling is disabled, it is as if the stipple
12427 pattern consists of all 1's.
12428
12429 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12430 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
12431 data store is currently mapped.
12432
12433 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
12434 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
12435 unpacked from the buffer object such that the memory reads required
12436 would exceed the data store size.
12437
12438 `GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
12439 between the execution of `glBegin' and the corresponding execution of
12440 `glEnd'.")
12441
12442 (define-gl-procedures
12443 ((glPrioritizeTextures
12444 (n GLsizei)
12445 (textures const-GLuint-*)
12446 (priorities const-GLclampf-*)
12447 ->
12448 void))
12449 "Set texture residence priority.
12450
12451 N
12452 Specifies the number of textures to be prioritized.
12453
12454 TEXTURES
12455 Specifies an array containing the names of the textures to be
12456 prioritized.
12457
12458 PRIORITIES
12459 Specifies an array containing the texture priorities. A priority
12460 given in an element of PRIORITIES applies to the texture named by
12461 the corresponding element of TEXTURES.
12462
12463 `glPrioritizeTextures' assigns the N texture priorities given in
12464 PRIORITIES to the N textures named in TEXTURES.
12465
12466 The GL establishes a ``working set'' of textures that are resident in
12467 texture memory. These textures may be bound to a texture target much
12468 more efficiently than textures that are not resident. By specifying a
12469 priority for each texture, `glPrioritizeTextures' allows applications to
12470 guide the GL implementation in determining which textures should be
12471 resident.
12472
12473 The priorities given in PRIORITIES are clamped to the range [0,1] before
12474 they are assigned. 0 indicates the lowest priority; textures with
12475 priority 0 are least likely to be resident. 1 indicates the highest
12476 priority; textures with priority 1 are most likely to be resident.
12477 However, textures are not guaranteed to be resident until they are used.
12478
12479 `glPrioritizeTextures' silently ignores attempts to prioritize texture 0
12480 or any texture name that does not correspond to an existing texture.
12481
12482 `glPrioritizeTextures' does not require that any of the textures named
12483 by TEXTURES be bound to a texture target. `glTexParameter' may also be
12484 used to set a texture's priority, but only if the texture is currently
12485 bound. This is the only way to set the priority of a default texture.
12486
12487 `GL_INVALID_VALUE' is generated if N is negative.
12488
12489 `GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
12490 executed between the execution of `glBegin' and the corresponding
12491 execution of `glEnd'.")
12492
12493 (define-gl-procedures
12494 ((glPushAttrib (mask GLbitfield) -> void)
12495 (glPopAttrib -> void))
12496 "Push and pop the server attribute stack.
12497
12498 MASK
12499 Specifies a mask that indicates which attributes to save. Values
12500 for MASK are listed below.
12501
12502 `glPushAttrib' takes one argument, a mask that indicates which groups of
12503 state variables to save on the attribute stack. Symbolic constants are
12504 used to set bits in the mask. MASK is typically constructed by
12505 specifying the bitwise-or of several of these constants together. The
12506 special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
12507 states.
12508
12509 The symbolic mask constants and their associated GL state are as follows
12510 (the second column lists which attributes are saved):
12511
12512
12513
12514 `GL_ACCUM_BUFFER_BIT'
12515 Accumulation buffer clear value
12516
12517 `GL_COLOR_BUFFER_BIT'
12518 `GL_ALPHA_TEST' enable bit
12519
12520
12521 Alpha test function and reference value
12522
12523
12524 `GL_BLEND' enable bit
12525
12526
12527 Blending source and destination functions
12528
12529
12530 Constant blend color
12531
12532
12533 Blending equation
12534
12535
12536 `GL_DITHER' enable bit
12537
12538
12539 `GL_DRAW_BUFFER' setting
12540
12541
12542 `GL_COLOR_LOGIC_OP' enable bit
12543
12544
12545 `GL_INDEX_LOGIC_OP' enable bit
12546
12547
12548 Logic op function
12549
12550
12551 Color mode and index mode clear values
12552
12553
12554 Color mode and index mode writemasks
12555
12556 `GL_CURRENT_BIT'
12557 Current RGBA color
12558
12559
12560 Current color index
12561
12562
12563 Current normal vector
12564
12565
12566 Current texture coordinates
12567
12568
12569 Current raster position
12570
12571
12572 `GL_CURRENT_RASTER_POSITION_VALID' flag
12573
12574
12575 RGBA color associated with current raster position
12576
12577
12578 Color index associated with current raster position
12579
12580
12581 Texture coordinates associated with current raster position
12582
12583
12584 `GL_EDGE_FLAG' flag
12585
12586 `GL_DEPTH_BUFFER_BIT'
12587 `GL_DEPTH_TEST' enable bit
12588
12589
12590 Depth buffer test function
12591
12592
12593 Depth buffer clear value
12594
12595
12596 `GL_DEPTH_WRITEMASK' enable bit
12597
12598 `GL_ENABLE_BIT'
12599 `GL_ALPHA_TEST' flag
12600
12601
12602 `GL_AUTO_NORMAL' flag
12603
12604
12605 `GL_BLEND' flag
12606
12607
12608 Enable bits for the user-definable clipping planes
12609
12610
12611 `GL_COLOR_MATERIAL'
12612
12613
12614 `GL_CULL_FACE' flag
12615
12616
12617 `GL_DEPTH_TEST' flag
12618
12619
12620 `GL_DITHER' flag
12621
12622
12623 `GL_FOG' flag
12624
12625
12626 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
12627
12628
12629 `GL_LIGHTING' flag
12630
12631
12632 `GL_LINE_SMOOTH' flag
12633
12634
12635 `GL_LINE_STIPPLE' flag
12636
12637
12638 `GL_COLOR_LOGIC_OP' flag
12639
12640
12641 `GL_INDEX_LOGIC_OP' flag
12642
12643
12644 `GL_MAP1_'X where X is a map type
12645
12646
12647 `GL_MAP2_'X where X is a map type
12648
12649
12650 `GL_MULTISAMPLE' flag
12651
12652
12653 `GL_NORMALIZE' flag
12654
12655
12656 `GL_POINT_SMOOTH' flag
12657
12658
12659 `GL_POLYGON_OFFSET_LINE' flag
12660
12661
12662 `GL_POLYGON_OFFSET_FILL' flag
12663
12664
12665 `GL_POLYGON_OFFSET_POINT' flag
12666
12667
12668 `GL_POLYGON_SMOOTH' flag
12669
12670
12671 `GL_POLYGON_STIPPLE' flag
12672
12673
12674 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12675
12676
12677 `GL_SAMPLE_ALPHA_TO_ONE' flag
12678
12679
12680 `GL_SAMPLE_COVERAGE' flag
12681
12682
12683 `GL_SCISSOR_TEST' flag
12684
12685
12686 `GL_STENCIL_TEST' flag
12687
12688
12689 `GL_TEXTURE_1D' flag
12690
12691
12692 `GL_TEXTURE_2D' flag
12693
12694
12695 `GL_TEXTURE_3D' flag
12696
12697
12698 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
12699
12700 `GL_EVAL_BIT'
12701 `GL_MAP1_'X enable bits, where X is a map type
12702
12703
12704 `GL_MAP2_'X enable bits, where X is a map type
12705
12706
12707 1D grid endpoints and divisions
12708
12709
12710 2D grid endpoints and divisions
12711
12712
12713 `GL_AUTO_NORMAL' enable bit
12714
12715 `GL_FOG_BIT'
12716 `GL_FOG' enable bit
12717
12718
12719 Fog color
12720
12721
12722 Fog density
12723
12724
12725 Linear fog start
12726
12727
12728 Linear fog end
12729
12730
12731 Fog index
12732
12733
12734 `GL_FOG_MODE' value
12735
12736 `GL_HINT_BIT'
12737 `GL_PERSPECTIVE_CORRECTION_HINT' setting
12738
12739
12740 `GL_POINT_SMOOTH_HINT' setting
12741
12742
12743 `GL_LINE_SMOOTH_HINT' setting
12744
12745
12746 `GL_POLYGON_SMOOTH_HINT' setting
12747
12748
12749 `GL_FOG_HINT' setting
12750
12751
12752 `GL_GENERATE_MIPMAP_HINT' setting
12753
12754
12755 `GL_TEXTURE_COMPRESSION_HINT' setting
12756
12757 `GL_LIGHTING_BIT'
12758 `GL_COLOR_MATERIAL' enable bit
12759
12760
12761 `GL_COLOR_MATERIAL_FACE' value
12762
12763
12764 Color material parameters that are tracking the current color
12765
12766
12767 Ambient scene color
12768
12769
12770 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
12771
12772
12773 `GL_LIGHT_MODEL_TWO_SIDE' setting
12774
12775
12776 `GL_LIGHTING' enable bit
12777
12778
12779 Enable bit for each light
12780
12781
12782 Ambient, diffuse, and specular intensity for each light
12783
12784
12785 Direction, position, exponent, and cutoff angle for each light
12786
12787
12788 Constant, linear, and quadratic attenuation factors for each light
12789
12790
12791 Ambient, diffuse, specular, and emissive color for each material
12792
12793
12794 Ambient, diffuse, and specular color indices for each material
12795
12796
12797 Specular exponent for each material
12798
12799
12800 `GL_SHADE_MODEL' setting
12801
12802 `GL_LINE_BIT'
12803 `GL_LINE_SMOOTH' flag
12804
12805
12806 `GL_LINE_STIPPLE' enable bit
12807
12808
12809 Line stipple pattern and repeat counter
12810
12811
12812 Line width
12813
12814 `GL_LIST_BIT'
12815 `GL_LIST_BASE' setting
12816
12817 `GL_MULTISAMPLE_BIT'
12818 `GL_MULTISAMPLE' flag
12819
12820
12821 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
12822
12823
12824 `GL_SAMPLE_ALPHA_TO_ONE' flag
12825
12826
12827 `GL_SAMPLE_COVERAGE' flag
12828
12829
12830 `GL_SAMPLE_COVERAGE_VALUE' value
12831
12832
12833 `GL_SAMPLE_COVERAGE_INVERT' value
12834
12835 `GL_PIXEL_MODE_BIT'
12836 `GL_RED_BIAS' and `GL_RED_SCALE' settings
12837
12838
12839 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
12840
12841
12842 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
12843
12844
12845 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
12846
12847
12848 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
12849
12850
12851 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
12852
12853
12854 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
12855
12856
12857 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
12858
12859
12860 `GL_READ_BUFFER' setting
12861
12862 `GL_POINT_BIT'
12863 `GL_POINT_SMOOTH' flag
12864
12865
12866 Point size
12867
12868 `GL_POLYGON_BIT'
12869 `GL_CULL_FACE' enable bit
12870
12871
12872 `GL_CULL_FACE_MODE' value
12873
12874
12875 `GL_FRONT_FACE' indicator
12876
12877
12878 `GL_POLYGON_MODE' setting
12879
12880
12881 `GL_POLYGON_SMOOTH' flag
12882
12883
12884 `GL_POLYGON_STIPPLE' enable bit
12885
12886
12887 `GL_POLYGON_OFFSET_FILL' flag
12888
12889
12890 `GL_POLYGON_OFFSET_LINE' flag
12891
12892
12893 `GL_POLYGON_OFFSET_POINT' flag
12894
12895
12896 `GL_POLYGON_OFFSET_FACTOR'
12897
12898
12899 `GL_POLYGON_OFFSET_UNITS'
12900
12901 `GL_POLYGON_STIPPLE_BIT'
12902 Polygon stipple image
12903
12904 `GL_SCISSOR_BIT'
12905 `GL_SCISSOR_TEST' flag
12906
12907
12908 Scissor box
12909
12910 `GL_STENCIL_BUFFER_BIT'
12911 `GL_STENCIL_TEST' enable bit
12912
12913
12914 Stencil function and reference value
12915
12916
12917 Stencil value mask
12918
12919
12920 Stencil fail, pass, and depth buffer pass actions
12921
12922
12923 Stencil buffer clear value
12924
12925
12926 Stencil buffer writemask
12927
12928 `GL_TEXTURE_BIT'
12929 Enable bits for the four texture coordinates
12930
12931
12932 Border color for each texture image
12933
12934
12935 Minification function for each texture image
12936
12937
12938 Magnification function for each texture image
12939
12940
12941 Texture coordinates and wrap mode for each texture image
12942
12943
12944 Color and mode for each texture environment
12945
12946
12947 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
12948
12949
12950 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
12951
12952
12953 `glTexGen' plane equations for S, T, R, and Q
12954
12955
12956 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
12957
12958 `GL_TRANSFORM_BIT'
12959 Coefficients of the six clipping planes
12960
12961
12962 Enable bits for the user-definable clipping planes
12963
12964
12965 `GL_MATRIX_MODE' value
12966
12967
12968 `GL_NORMALIZE' flag
12969
12970
12971 `GL_RESCALE_NORMAL' flag
12972
12973 `GL_VIEWPORT_BIT'
12974 Depth range (near and far)
12975
12976
12977 Viewport origin and extent
12978
12979 `glPopAttrib' restores the values of the state variables saved with the
12980 last `glPushAttrib' command. Those not saved are left unchanged.
12981
12982 It is an error to push attributes onto a full stack or to pop attributes
12983 off an empty stack. In either case, the error flag is set and no other
12984 change is made to GL state.
12985
12986 Initially, the attribute stack is empty.
12987
12988 `GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
12989 attribute stack is full.
12990
12991 `GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
12992 attribute stack is empty.
12993
12994 `GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
12995 is executed between the execution of `glBegin' and the corresponding
12996 execution of `glEnd'.")
12997
12998 (define-gl-procedures
12999 ((glPushClientAttrib (mask GLbitfield) -> void)
13000 (glPopClientAttrib -> void))
13001 "Push and pop the client attribute stack.
13002
13003 MASK
13004 Specifies a mask that indicates which attributes to save. Values
13005 for MASK are listed below.
13006
13007 `glPushClientAttrib' takes one argument, a mask that indicates which
13008 groups of client-state variables to save on the client attribute stack.
13009 Symbolic constants are used to set bits in the mask. MASK is typically
13010 constructed by specifying the bitwise-or of several of these constants
13011 together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
13012 save all stackable client state.
13013
13014 The symbolic mask constants and their associated GL client state are as
13015 follows (the second column lists which attributes are saved):
13016
13017 `GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
13018 `GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
13019
13020 `glPopClientAttrib' restores the values of the client-state variables
13021 saved with the last `glPushClientAttrib'. Those not saved are left
13022 unchanged.
13023
13024 It is an error to push attributes onto a full client attribute stack or
13025 to pop attributes off an empty stack. In either case, the error flag is
13026 set, and no other change is made to GL state.
13027
13028 Initially, the client attribute stack is empty.
13029
13030 `GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
13031 the attribute stack is full.
13032
13033 `GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
13034 the attribute stack is empty.")
13035
13036 (define-gl-procedures
13037 ((glPushMatrix -> void) (glPopMatrix -> void))
13038 "Push and pop the current matrix stack.
13039
13040 There is a stack of matrices for each of the matrix modes. In
13041 `GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
13042 `GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
13043 The current matrix in any mode is the matrix on the top of the stack for
13044 that mode.
13045
13046 `glPushMatrix' pushes the current matrix stack down by one, duplicating
13047 the current matrix. That is, after a `glPushMatrix' call, the matrix on
13048 top of the stack is identical to the one below it.
13049
13050 `glPopMatrix' pops the current matrix stack, replacing the current
13051 matrix with the one below it on the stack.
13052
13053 Initially, each of the stacks contains one matrix, an identity matrix.
13054
13055 It is an error to push a full matrix stack or to pop a matrix stack that
13056 contains only a single matrix. In either case, the error flag is set and
13057 no other change is made to GL state.
13058
13059 `GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
13060 current matrix stack is full.
13061
13062 `GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
13063 current matrix stack contains only a single matrix.
13064
13065 `GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
13066 is executed between the execution of `glBegin' and the corresponding
13067 execution of `glEnd'.")
13068
13069 (define-gl-procedures
13070 ((glPushName (name GLuint) -> void)
13071 (glPopName -> void))
13072 "Push and pop the name stack.
13073
13074 NAME
13075 Specifies a name that will be pushed onto the name stack.
13076
13077 The name stack is used during selection mode to allow sets of rendering
13078 commands to be uniquely identified. It consists of an ordered set of
13079 unsigned integers and is initially empty.
13080
13081 `glPushName' causes NAME to be pushed onto the name stack. `glPopName'
13082 pops one name off the top of the stack.
13083
13084 The maximum name stack depth is implementation-dependent; call
13085 `GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
13086 implementation. It is an error to push a name onto a full stack or to
13087 pop a name off an empty stack. It is also an error to manipulate the
13088 name stack between the execution of `glBegin' and the corresponding
13089 execution of `glEnd'. In any of these cases, the error flag is set and
13090 no other change is made to GL state.
13091
13092 The name stack is always empty while the render mode is not `GL_SELECT'.
13093 Calls to `glPushName' or `glPopName' while the render mode is not
13094 `GL_SELECT' are ignored.
13095
13096 `GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
13097 name stack is full.
13098
13099 `GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
13100 name stack is empty.
13101
13102 `GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
13103 executed between a call to `glBegin' and the corresponding call to
13104 `glEnd'.")
13105
13106 (define-gl-procedures
13107 ((glRasterPos2i (x GLint) (y GLint) -> void)
13108 (glRasterPos2f (x GLfloat) (y GLfloat) -> void)
13109 (glRasterPos3i
13110 (x GLint)
13111 (y GLint)
13112 (z GLint)
13113 ->
13114 void)
13115 (glRasterPos3f
13116 (x GLfloat)
13117 (y GLfloat)
13118 (z GLfloat)
13119 ->
13120 void)
13121 (glRasterPos4i
13122 (x GLint)
13123 (y GLint)
13124 (z GLint)
13125 (w GLint)
13126 ->
13127 void)
13128 (glRasterPos4f
13129 (x GLfloat)
13130 (y GLfloat)
13131 (z GLfloat)
13132 (w GLfloat)
13133 ->
13134 void))
13135 "Specify the raster position for pixel operations.
13136
13137 X
13138 Y
13139
13140 Z
13141
13142 W
13143
13144 Specify the X , Y , Z , and W object coordinates (if present) for
13145 the raster position.
13146
13147 The GL maintains a 3D position in window coordinates. This position,
13148 called the raster position, is used to position pixel and bitmap write
13149 operations. It is maintained with subpixel accuracy. See `glBitmap',
13150 `glDrawPixels', and `glCopyPixels'.
13151
13152 The current raster position consists of three window coordinates (X , Y
13153 , Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
13154 bit, and associated color data and texture coordinates. The W coordinate
13155 is a clip coordinate, because W is not projected to window coordinates.
13156 `glRasterPos4' specifies object coordinates X , Y , Z , and W
13157 explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
13158 explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
13159 argument values for X and Y while implicitly setting Z and W to 0 and 1.
13160
13161 The object coordinates presented by `glRasterPos' are treated just like
13162 those of a `glVertex' command: They are transformed by the current
13163 modelview and projection matrices and passed to the clipping stage. If
13164 the vertex is not culled, then it is projected and scaled to window
13165 coordinates, which become the new current raster position, and the
13166 `GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
13167 then the valid bit is cleared and the current raster position and
13168 associated color and texture coordinates are undefined.
13169
13170 The current raster position also includes some associated color data and
13171 texture coordinates. If lighting is enabled, then
13172 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
13173 (in color index mode) is set to the color produced by the lighting
13174 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
13175 lighting is disabled, current color (in RGBA mode, state variable
13176 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
13177 `GL_CURRENT_INDEX') is used to update the current raster color.
13178 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
13179
13180 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
13181 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
13182 generation functions (see `glTexGen'). Finally, the distance from the
13183 origin of the eye coordinate system to the vertex as transformed by only
13184 the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
13185
13186 Initially, the current raster position is (0, 0, 0, 1), the current
13187 raster distance is 0, the valid bit is set, the associated RGBA color is
13188 (1, 1, 1, 1), the associated color index is 1, and the associated
13189 texture coordinates are (0, 0, 0, 1). In RGBA mode,
13190 `GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
13191 raster RGBA color always maintains its initial value.
13192
13193 `GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
13194 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13195
13196 (define-gl-procedures
13197 ((glReadBuffer (mode GLenum) -> void))
13198 "Select a color buffer source for pixels.
13199
13200 MODE
13201 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
13202 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
13203 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
13204 0 and the value of `GL_AUX_BUFFERS' minus 1.
13205
13206 `glReadBuffer' specifies a color buffer as the source for subsequent
13207 `glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
13208 `glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
13209 `glCopyPixels' commands. MODE accepts one of twelve or more predefined
13210 values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
13211 configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
13212 the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
13213 right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
13214 buffer.
13215
13216 Nonstereo double-buffered configurations have only a front left and a
13217 back left buffer. Single-buffered configurations have a front left and a
13218 front right buffer if stereo, and only a front left buffer if nonstereo.
13219 It is an error to specify a nonexistent buffer to `glReadBuffer'.
13220
13221 MODE is initially `GL_FRONT' in single-buffered configurations and
13222 `GL_BACK' in double-buffered configurations.
13223
13224 `GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
13225 more) accepted values.
13226
13227 `GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
13228 not exist.
13229
13230 `GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
13231 between the execution of `glBegin' and the corresponding execution of
13232 `glEnd'.")
13233
13234 (define-gl-procedures
13235 ((glReadPixels
13236 (x GLint)
13237 (y GLint)
13238 (width GLsizei)
13239 (height GLsizei)
13240 (format GLenum)
13241 (type GLenum)
13242 (data GLvoid-*)
13243 ->
13244 void))
13245 "Read a block of pixels from the frame buffer.
13246
13247 X
13248 Y
13249
13250 Specify the window coordinates of the first pixel that is read from
13251 the frame buffer. This location is the lower left corner of a
13252 rectangular block of pixels.
13253
13254 WIDTH
13255 HEIGHT
13256
13257 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
13258 one correspond to a single pixel.
13259
13260 FORMAT
13261 Specifies the format of the pixel data. The following symbolic
13262 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
13263 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
13264 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
13265 `GL_LUMINANCE_ALPHA'.
13266
13267 TYPE
13268 Specifies the data type of the pixel data. Must be one of
13269 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
13270 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
13271 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13272 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
13273 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13274 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13275 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13276 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
13277
13278 DATA
13279 Returns the pixel data.
13280
13281 `glReadPixels' returns pixel data from the frame buffer, starting with
13282 the pixel whose lower left corner is at location (X, Y), into client
13283 memory starting at location DATA. Several parameters control the
13284 processing of the pixel data before it is placed into client memory.
13285 These parameters are set with three commands: `glPixelStore',
13286 `glPixelTransfer', and `glPixelMap'. This reference page describes the
13287 effects on `glReadPixels' of most, but not all of the parameters
13288 specified by these three commands.
13289
13290 If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
13291 target (see `glBindBuffer') while a block of pixels is requested, DATA
13292 is treated as a byte offset into the buffer object's data store rather
13293 than a pointer to client memory.
13294
13295 When the `ARB_imaging' extension is supported, the pixel data may be
13296 processed by additional operations including color table lookup, color
13297 matrix transformations, convolutions, histograms, and minimum and
13298 maximum pixel value computations.
13299
13300 `glReadPixels' returns values from each pixel with lower left corner at
13301 (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
13302 I th pixel in the J th row. Pixels are returned in row order from the
13303 lowest to the highest row, left to right in each row.
13304
13305 FORMAT specifies the format for the returned pixel values; accepted
13306 values are:
13307
13308 `GL_COLOR_INDEX'
13309 Color indices are read from the color buffer selected by
13310 `glReadBuffer'. Each index is converted to fixed point, shifted
13311 left or right depending on the value and sign of `GL_INDEX_SHIFT',
13312 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
13313 indices are replaced by their mappings in the table
13314 `GL_PIXEL_MAP_I_TO_I'.
13315
13316 `GL_STENCIL_INDEX'
13317 Stencil values are read from the stencil buffer. Each index is
13318 converted to fixed point, shifted left or right depending on the
13319 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
13320 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
13321 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
13322
13323 `GL_DEPTH_COMPONENT'
13324 Depth values are read from the depth buffer. Each component is
13325 converted to floating point such that the minimum depth value maps
13326 to 0 and the maximum value maps to 1. Each component is then
13327 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
13328 finally clamped to the range [0,1] .
13329
13330 `GL_RED'
13331 `GL_GREEN'
13332 `GL_BLUE'
13333 `GL_ALPHA'
13334 `GL_RGB'
13335 `GL_BGR'
13336 `GL_RGBA'
13337 `GL_BGRA'
13338 `GL_LUMINANCE'
13339 `GL_LUMINANCE_ALPHA'
13340 Processing differs depending on whether color buffers store color
13341 indices or RGBA color components. If color indices are stored, they
13342 are read from the color buffer selected by `glReadBuffer'. Each
13343 index is converted to fixed point, shifted left or right depending
13344 on the value and sign of `GL_INDEX_SHIFT', and added to
13345 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
13346 blue, and alpha values obtained by indexing the tables
13347 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
13348 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
13349 be of size 2^N , but N may be different for different tables.
13350 Before an index is used to look up a value in a table of size 2^N ,
13351 it must be masked against 2^N-1 .
13352
13353 If RGBA color components are stored in the color buffers, they are
13354 read from the color buffer selected by `glReadBuffer'. Each color
13355 component is converted to floating point such that zero intensity
13356 maps to 0.0 and full intensity maps to 1.0. Each component is then
13357 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
13358 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
13359 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
13360 the size of its corresponding table, and is then replaced by its
13361 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
13362 A.
13363
13364 Unneeded data is then discarded. For example, `GL_RED' discards the
13365 green, blue, and alpha components, while `GL_RGB' discards only the
13366 alpha component. `GL_LUMINANCE' computes a single-component value
13367 as the sum of the red, green, and blue components, and
13368 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
13369 value. The final values are clamped to the range [0,1] .
13370
13371 The shift, scale, bias, and lookup factors just described are all
13372 specified by `glPixelTransfer'. The lookup table contents themselves are
13373 specified by `glPixelMap'.
13374
13375 Finally, the indices or components are converted to the proper format,
13376 as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
13377 `GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
13378 the mask value given in the following table. If TYPE is `GL_FLOAT', then
13379 each integer index is converted to single-precision floating-point
13380 format.
13381
13382 If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
13383 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
13384 and TYPE is not `GL_FLOAT', each component is multiplied by the
13385 multiplier shown in the following table. If type is `GL_FLOAT', then
13386 each component is passed as is (or converted to the client's
13387 single-precision floating-point format if it is different from the one
13388 used by the GL).
13389
13390
13391
13392 TYPE
13393 *Index Mask*, *Component Conversion*
13394
13395 `GL_UNSIGNED_BYTE'
13396 2^8-1 , (2^8-1,)\u2062C
13397
13398 `GL_BYTE'
13399 2^7-1 , (2^8-1,)\u2062C-1,/2
13400
13401 `GL_BITMAP'
13402 1 , 1
13403
13404 `GL_UNSIGNED_SHORT'
13405 2^16-1 , (2^16-1,)\u2062C
13406
13407 `GL_SHORT'
13408 2^15-1 , (2^16-1,)\u2062C-1,/2
13409
13410 `GL_UNSIGNED_INT'
13411 2^32-1 , (2^32-1,)\u2062C
13412
13413 `GL_INT'
13414 2^31-1 , (2^32-1,)\u2062C-1,/2
13415
13416 `GL_FLOAT'
13417 none , C
13418
13419 Return values are placed in memory as follows. If FORMAT is
13420 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
13421 `GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
13422 returned and the data for the I th pixel in the J th row is placed in
13423 location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
13424 `GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
13425 returns two values for each pixel, with all values corresponding to a
13426 single pixel occupying contiguous space in DATA. Storage parameters set
13427 by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
13428 affect the way that data is written into memory. See `glPixelStore' for
13429 a description.
13430
13431 `GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
13432 value.
13433
13434 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
13435 `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
13436
13437 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13438
13439 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
13440 the color buffers store RGBA color components.
13441
13442 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
13443 there is no stencil buffer.
13444
13445 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
13446 and there is no depth buffer.
13447
13448 `GL_INVALID_OPERATION' is generated if TYPE is one of
13449 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
13450 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
13451 is not `GL_RGB'.
13452
13453 `GL_INVALID_OPERATION' is generated if TYPE is one of
13454 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
13455 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
13456 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
13457 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
13458 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
13459
13460 The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
13461 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
13462 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
13463 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
13464 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
13465 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
13466 `GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
13467 1.2 or greater.
13468
13469 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13470 bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
13471 store is currently mapped.
13472
13473 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13474 bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
13475 to the buffer object such that the memory writes required would exceed
13476 the data store size.
13477
13478 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
13479 bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
13480 divisible into the number of bytes needed to store in memory a datum
13481 indicated by TYPE.
13482
13483 `GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
13484 between the execution of `glBegin' and the corresponding execution of
13485 `glEnd'.")
13486
13487 (define-gl-procedures
13488 ((glRectf
13489 (x1 GLfloat)
13490 (y1 GLfloat)
13491 (x2 GLfloat)
13492 (y2 GLfloat)
13493 ->
13494 void)
13495 (glRecti
13496 (x1 GLint)
13497 (y1 GLint)
13498 (x2 GLint)
13499 (y2 GLint)
13500 ->
13501 void))
13502 "Draw a rectangle.
13503
13504 X1
13505 Y1
13506
13507 Specify one vertex of a rectangle.
13508
13509 X2
13510 Y2
13511
13512 Specify the opposite vertex of the rectangle.
13513
13514 `glRect' supports efficient specification of rectangles as two corner
13515 points. Each rectangle command takes four arguments, organized either as
13516 two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
13517 each containing an (X,Y) pair. The resulting rectangle is defined in the
13518 Z=0 plane.
13519
13520 `glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
13521 sequence: Note that if the second vertex is above and to the right of
13522 the first vertex, the rectangle is constructed with a counterclockwise
13523 winding.
13524
13525
13526 glBegin(`GL_POLYGON');
13527 glVertex2(X1, Y1);
13528 glVertex2(X2, Y1);
13529 glVertex2(X2, Y2);
13530 glVertex2(X1, Y2);
13531 glEnd();
13532
13533 `GL_INVALID_OPERATION' is generated if `glRect' is executed between the
13534 execution of `glBegin' and the corresponding execution of `glEnd'.")
13535
13536 (define-gl-procedures
13537 ((glRenderMode (mode GLenum) -> GLint))
13538 "Set rasterization mode.
13539
13540 MODE
13541 Specifies the rasterization mode. Three values are accepted:
13542 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
13543 `GL_RENDER'.
13544
13545 `glRenderMode' sets the rasterization mode. It takes one argument, MODE,
13546 which can assume one of three predefined values:
13547
13548 `GL_RENDER'
13549 Render mode. Primitives are rasterized, producing pixel fragments,
13550 which are written into the frame buffer. This is the normal mode
13551 and also the default mode.
13552
13553 `GL_SELECT'
13554 Selection mode. No pixel fragments are produced, and no change to
13555 the frame buffer contents is made. Instead, a record of the names
13556 of primitives that would have been drawn if the render mode had
13557 been `GL_RENDER' is returned in a select buffer, which must be
13558 created (see `glSelectBuffer') before selection mode is entered.
13559
13560 `GL_FEEDBACK'
13561 Feedback mode. No pixel fragments are produced, and no change to
13562 the frame buffer contents is made. Instead, the coordinates and
13563 attributes of vertices that would have been drawn if the render
13564 mode had been `GL_RENDER' is returned in a feedback buffer, which
13565 must be created (see `glFeedbackBuffer') before feedback mode is
13566 entered.
13567
13568 The return value of `glRenderMode' is determined by the render mode at
13569 the time `glRenderMode' is called, rather than by MODE. The values
13570 returned for the three render modes are as follows:
13571
13572 `GL_RENDER'
13573 0.
13574
13575 `GL_SELECT'
13576 The number of hit records transferred to the select buffer.
13577
13578 `GL_FEEDBACK'
13579 The number of values (not vertices) transferred to the feedback
13580 buffer.
13581
13582 See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
13583 details concerning selection and feedback operation.
13584
13585 `GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
13586 values.
13587
13588 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13589 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13590 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13591
13592 `GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
13593 while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
13594 with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
13595 once.
13596
13597 `GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
13598 between the execution of `glBegin' and the corresponding execution of
13599 `glEnd'.")
13600
13601 (define-gl-procedures
13602 ((glResetHistogram (target GLenum) -> void))
13603 "Reset histogram table entries to zero.
13604
13605 TARGET
13606 Must be `GL_HISTOGRAM'.
13607
13608 `glResetHistogram' resets all the elements of the current histogram
13609 table to zero.
13610
13611 `GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
13612
13613 `GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
13614 between the execution of `glBegin' and the corresponding execution of
13615 `glEnd'.")
13616
13617 (define-gl-procedures
13618 ((glResetMinmax (target GLenum) -> void))
13619 "Reset minmax table entries to initial values.
13620
13621 TARGET
13622 Must be `GL_MINMAX'.
13623
13624 `glResetMinmax' resets the elements of the current minmax table to their
13625 initial values: the ``maximum'' element receives the minimum possible
13626 component values, and the ``minimum'' element receives the maximum
13627 possible component values.
13628
13629 `GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
13630
13631 `GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
13632 between the execution of `glBegin' and the corresponding execution of
13633 `glEnd'.")
13634
13635 (define-gl-procedures
13636 ((glRotatef
13637 (angle GLfloat)
13638 (x GLfloat)
13639 (y GLfloat)
13640 (z GLfloat)
13641 ->
13642 void))
13643 "Multiply the current matrix by a rotation matrix.
13644
13645 ANGLE
13646 Specifies the angle of rotation, in degrees.
13647
13648 X
13649 Y
13650
13651 Z
13652
13653 Specify the X, Y, and Z coordinates of a vector, respectively.
13654
13655 `glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
13656 . The current matrix (see `glMatrixMode') is multiplied by a rotation
13657 matrix with the product replacing the current matrix, as if
13658 `glMultMatrix' were called with the following matrix as its argument:
13659
13660 ((X^2\u2061(1-C,)+C X\u2062Y\u2061(1-C,)-Z\u2062S X\u2062Z\u2061(1-C,)+Y\u2062S 0), (Y\u2062X\u2061(1-C,)+Z\u2062S
13661 Y^2\u2061(1-C,)+C Y\u2062Z\u2061(1-C,)-X\u2062S 0), (X\u2062Z\u2061(1-C,)-Y\u2062S Y\u2062Z\u2061(1-C,)+X\u2062S
13662 Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
13663
13664
13665
13666 Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
13667 will normalize this vector).
13668
13669
13670
13671
13672
13673 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13674 objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
13675 and `glPopMatrix' to save and restore the unrotated coordinate system.
13676
13677 `GL_INVALID_OPERATION' is generated if `glRotate' is executed between
13678 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13679
13680 (define-gl-procedures
13681 ((glSampleCoverage
13682 (value GLclampf)
13683 (invert GLboolean)
13684 ->
13685 void))
13686 "Specify multisample coverage parameters.
13687
13688 VALUE
13689 Specify a single floating-point sample coverage value. The value is
13690 clamped to the range [0,1] . The initial value is 1.0.
13691
13692 INVERT
13693 Specify a single boolean value representing if the coverage masks
13694 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
13695 initial value is `GL_FALSE'.
13696
13697 Multisampling samples a pixel multiple times at various
13698 implementation-dependent subpixel locations to generate antialiasing
13699 effects. Multisampling transparently antialiases points, lines,
13700 polygons, bitmaps, and images if it is enabled.
13701
13702 VALUE is used in constructing a temporary mask used in determining which
13703 samples will be used in resolving the final fragment color. This mask is
13704 bitwise-anded with the coverage mask generated from the multisampling
13705 computation. If the INVERT flag is set, the temporary mask is inverted
13706 (all bits flipped) and then the bitwise-and is computed.
13707
13708 If an implementation does not have any multisample buffers available, or
13709 multisampling is disabled, rasterization occurs with only a single
13710 sample computing a pixel's final RGB color.
13711
13712 Provided an implementation supports multisample buffers, and
13713 multisampling is enabled, then a pixel's final color is generated by
13714 combining several samples per pixel. Each sample contains color, depth,
13715 and stencil information, allowing those operations to be performed on
13716 each sample.
13717
13718 `GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
13719 between the execution of `glBegin' and the corresponding execution of
13720 `glEnd'.")
13721
13722 (define-gl-procedures
13723 ((glScalef
13724 (x GLfloat)
13725 (y GLfloat)
13726 (z GLfloat)
13727 ->
13728 void))
13729 "Multiply the current matrix by a general scaling matrix.
13730
13731 X
13732 Y
13733
13734 Z
13735
13736 Specify scale factors along the X, Y, and Z axes, respectively.
13737
13738 `glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
13739 three parameters indicate the desired scale factor along each of the
13740 three axes.
13741
13742 The current matrix (see `glMatrixMode') is multiplied by this scale
13743 matrix, and the product replaces the current matrix as if `glMultMatrix'
13744 were called with the following matrix as its argument:
13745
13746 ((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
13747
13748 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
13749 objects drawn after `glScale' is called are scaled.
13750
13751 Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
13752 coordinate system.
13753
13754 `GL_INVALID_OPERATION' is generated if `glScale' is executed between the
13755 execution of `glBegin' and the corresponding execution of `glEnd'.")
13756
13757 (define-gl-procedures
13758 ((glScissor
13759 (x GLint)
13760 (y GLint)
13761 (width GLsizei)
13762 (height GLsizei)
13763 ->
13764 void))
13765 "Define the scissor box.
13766
13767 X
13768 Y
13769
13770 Specify the lower left corner of the scissor box. Initially (0, 0).
13771
13772 WIDTH
13773 HEIGHT
13774
13775 Specify the width and height of the scissor box. When a GL context
13776 is first attached to a window, WIDTH and HEIGHT are set to the
13777 dimensions of that window.
13778
13779 `glScissor' defines a rectangle, called the scissor box, in window
13780 coordinates. The first two arguments, X and Y, specify the lower left
13781 corner of the box. WIDTH and HEIGHT specify the width and height of the
13782 box.
13783
13784 To enable and disable the scissor test, call `glEnable' and `glDisable'
13785 with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
13786 the test is enabled, only pixels that lie within the scissor box can be
13787 modified by drawing commands. Window coordinates have integer values at
13788 the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
13789 modification of only the lower left pixel in the window, and
13790 `glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
13791 window.
13792
13793 When the scissor test is disabled, it is as though the scissor box
13794 includes the entire window.
13795
13796 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
13797
13798 `GL_INVALID_OPERATION' is generated if `glScissor' is executed between
13799 the execution of `glBegin' and the corresponding execution of `glEnd'.")
13800
13801 (define-gl-procedures
13802 ((glSecondaryColorPointer
13803 (size GLint)
13804 (type GLenum)
13805 (stride GLsizei)
13806 (pointer const-GLvoid-*)
13807 ->
13808 void))
13809 "Define an array of secondary colors.
13810
13811 SIZE
13812 Specifies the number of components per color. Must be 3.
13813
13814 TYPE
13815 Specifies the data type of each color component in the array.
13816 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
13817 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
13818 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13819
13820 STRIDE
13821 Specifies the byte offset between consecutive colors. If STRIDE is
13822 0, the colors are understood to be tightly packed in the array. The
13823 initial value is 0.
13824
13825 POINTER
13826 Specifies a pointer to the first component of the first color
13827 element in the array. The initial value is 0.
13828
13829 `glSecondaryColorPointer' specifies the location and data format of an
13830 array of color components to use when rendering. SIZE specifies the
13831 number of components per color, and must be 3. TYPE specifies the data
13832 type of each color component, and STRIDE specifies the byte stride from
13833 one color to the next, allowing vertices and attributes to be packed
13834 into a single array or stored in separate arrays.
13835
13836 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13837 target (see `glBindBuffer') while a secondary color array is specified,
13838 POINTER is treated as a byte offset into the buffer object's data store.
13839 Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13840 secondary color vertex array client-side state
13841 (`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
13842
13843 When a secondary color array is specified, SIZE, TYPE, STRIDE, and
13844 POINTER are saved as client-side state, in addition to the current
13845 vertex array buffer object binding.
13846
13847 To enable and disable the secondary color array, call
13848 `glEnableClientState' and `glDisableClientState' with the argument
13849 `GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
13850 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
13851 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
13852 called.
13853
13854 `GL_INVALID_VALUE' is generated if SIZE is not 3.
13855
13856 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13857
13858 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
13859
13860 (define-gl-procedures
13861 ((glSecondaryColor3i
13862 (red GLint)
13863 (green GLint)
13864 (blue GLint)
13865 ->
13866 void)
13867 (glSecondaryColor3f
13868 (red GLfloat)
13869 (green GLfloat)
13870 (blue GLfloat)
13871 ->
13872 void)
13873 (glSecondaryColor3ui
13874 (red GLuint)
13875 (green GLuint)
13876 (blue GLuint)
13877 ->
13878 void))
13879 "Set the current secondary color.
13880
13881 RED
13882 GREEN
13883
13884 BLUE
13885
13886 Specify new red, green, and blue values for the current secondary
13887 color.
13888
13889 The GL stores both a primary four-valued RGBA color and a secondary
13890 four-valued RGBA color (where alpha is always set to 0.0) that is
13891 associated with every vertex.
13892
13893 The secondary color is interpolated and applied to each fragment during
13894 rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
13895 and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
13896 secondary color is assigned the value computed from the specular term of
13897 the lighting computation. Both the primary and secondary current colors
13898 are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
13899 under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
13900 the value returned from querying the current secondary color is
13901 undefined.
13902
13903 `glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
13904 take three signed byte, short, or long integers as arguments. When *v*
13905 is appended to the name, the color commands can take a pointer to an
13906 array of such values.
13907
13908 Color values are stored in floating-point format, with unspecified
13909 mantissa and exponent sizes. Unsigned integer color components, when
13910 specified, are linearly mapped to floating-point values such that the
13911 largest representable value maps to 1.0 (full intensity), and 0 maps to
13912 0.0 (zero intensity). Signed integer color components, when specified,
13913 are linearly mapped to floating-point values such that the most positive
13914 representable value maps to 1.0, and the most negative representable
13915 value maps to -1.0 . (Note that this mapping does not convert 0
13916 precisely to 0.0). Floating-point values are mapped directly.
13917
13918 Neither floating-point nor signed integer values are clamped to the
13919 range [0,1] before the current color is updated. However, color
13920 components are clamped to this range before they are interpolated or
13921 written into a color buffer.")
13922
13923 (define-gl-procedures
13924 ((glSelectBuffer
13925 (size GLsizei)
13926 (buffer GLuint-*)
13927 ->
13928 void))
13929 "Establish a buffer for selection mode values.
13930
13931 SIZE
13932 Specifies the size of BUFFER.
13933
13934 BUFFER
13935 Returns the selection data.
13936
13937 `glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
13938 unsigned integers, and SIZE indicates the size of the array. BUFFER
13939 returns values from the name stack (see `glInitNames', `glLoadName',
13940 `glPushName') when the rendering mode is `GL_SELECT' (see
13941 `glRenderMode'). `glSelectBuffer' must be issued before selection mode
13942 is enabled, and it must not be issued while the rendering mode is
13943 `GL_SELECT'.
13944
13945 A programmer can use selection to determine which primitives are drawn
13946 into some region of a window. The region is defined by the current
13947 modelview and perspective matrices.
13948
13949 In selection mode, no pixel fragments are produced from rasterization.
13950 Instead, if a primitive or a raster position intersects the clipping
13951 volume defined by the viewing frustum and the user-defined clipping
13952 planes, this primitive causes a selection hit. (With polygons, no hit
13953 occurs if the polygon is culled.) When a change is made to the name
13954 stack, or when `glRenderMode' is called, a hit record is copied to
13955 BUFFER if any hits have occurred since the last such event (name stack
13956 change or `glRenderMode' call). The hit record consists of the number of
13957 names in the name stack at the time of the event, followed by the
13958 minimum and maximum depth values of all vertices that hit since the
13959 previous event, followed by the name stack contents, bottom name first.
13960
13961 Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
13962 before being placed in the hit record.
13963
13964 An internal index into BUFFER is reset to 0 whenever selection mode is
13965 entered. Each time a hit record is copied into BUFFER, the index is
13966 incremented to point to the cell just past the end of the block of
13967 names\\(emthat is, to the next available cell If the hit record is larger
13968 than the number of remaining locations in BUFFER, as much data as can
13969 fit is copied, and the overflow flag is set. If the name stack is empty
13970 when a hit record is copied, that record consists of 0 followed by the
13971 minimum and maximum depth values.
13972
13973 To exit selection mode, call `glRenderMode' with an argument other than
13974 `GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
13975 `GL_SELECT', it returns the number of hit records copied to BUFFER,
13976 resets the overflow flag and the selection buffer pointer, and
13977 initializes the name stack to be empty. If the overflow bit was set when
13978 `glRenderMode' was called, a negative hit record count is returned.
13979
13980 `GL_INVALID_VALUE' is generated if SIZE is negative.
13981
13982 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
13983 the render mode is `GL_SELECT', or if `glRenderMode' is called with
13984 argument `GL_SELECT' before `glSelectBuffer' is called at least once.
13985
13986 `GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
13987 between the execution of `glBegin' and the corresponding execution of
13988 `glEnd'.")
13989
13990 (define-gl-procedures
13991 ((glSeparableFilter2D
13992 (target GLenum)
13993 (internalformat GLenum)
13994 (width GLsizei)
13995 (height GLsizei)
13996 (format GLenum)
13997 (type GLenum)
13998 (row const-GLvoid-*)
13999 (column const-GLvoid-*)
14000 ->
14001 void))
14002 "Define a separable two-dimensional convolution filter.
14003
14004 TARGET
14005 Must be `GL_SEPARABLE_2D'.
14006
14007 INTERNALFORMAT
14008 The internal format of the convolution filter kernel. The allowable
14009 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
14010 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
14011 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
14012 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
14013 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
14014 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
14015 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
14016 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
14017 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
14018 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
14019 `GL_RGBA12', or `GL_RGBA16'.
14020
14021 WIDTH
14022 The number of elements in the pixel array referenced by ROW. (This
14023 is the width of the separable filter kernel.)
14024
14025 HEIGHT
14026 The number of elements in the pixel array referenced by COLUMN.
14027 (This is the height of the separable filter kernel.)
14028
14029 FORMAT
14030 The format of the pixel data in ROW and COLUMN. The allowable
14031 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
14032 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
14033 `GL_LUMINANCE_ALPHA'.
14034
14035 TYPE
14036 The type of the pixel data in ROW and COLUMN. Symbolic constants
14037 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
14038 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
14039 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14040 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
14041 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14042 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14043 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14044 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
14045 are accepted.
14046
14047 ROW
14048 Pointer to a one-dimensional array of pixel data that is processed
14049 to build the row filter kernel.
14050
14051 COLUMN
14052 Pointer to a one-dimensional array of pixel data that is processed
14053 to build the column filter kernel.
14054
14055 `glSeparableFilter2D' builds a two-dimensional separable convolution
14056 filter kernel from two arrays of pixels.
14057
14058 The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
14059 FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
14060 `glDrawPixels', but processing stops after the final expansion to RGBA
14061 is completed.
14062
14063 If a non-zero named buffer object is bound to the
14064 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
14065 filter is specified, ROW and COLUMN are treated as byte offsets into the
14066 buffer object's data store.
14067
14068 Next, the R, G, B, and A components of all pixels in both arrays are
14069 scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
14070 and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
14071 parameters. (The scale and bias parameters are set by
14072 `glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
14073 names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
14074 The parameters themselves are vectors of four values that are applied to
14075 red, green, blue, and alpha, in that order.) The R, G, B, and A values
14076 are not clamped to [0,1] at any time during this process.
14077
14078 Each pixel is then converted to the internal format specified by
14079 INTERNALFORMAT. This conversion simply maps the component values of the
14080 pixel (R, G, B, and A) to the values included in the internal format
14081 (red, green, blue, alpha, luminance, and intensity). The mapping is as
14082 follows:
14083
14084 *Internal Format*
14085 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
14086
14087 `GL_LUMINANCE'
14088 , , , , R ,
14089
14090 `GL_LUMINANCE_ALPHA'
14091 , , , A , R ,
14092
14093 `GL_INTENSITY'
14094 , , , , , R
14095
14096 `GL_RGB'
14097 R , G , B , , ,
14098
14099 `GL_RGBA'
14100 R , G , B , A , ,
14101
14102 The red, green, blue, alpha, luminance, and/or intensity components of
14103 the resulting pixels are stored in floating-point rather than integer
14104 format. They form two one-dimensional filter kernel images. The row
14105 image is indexed by coordinate I starting at zero and increasing from
14106 left to right. Each location in the row image is derived from element I
14107 of ROW. The column image is indexed by coordinate J starting at zero and
14108 increasing from bottom to top. Each location in the column image is
14109 derived from element J of COLUMN.
14110
14111 Note that after a convolution is performed, the resulting color
14112 components are also scaled by their corresponding
14113 `GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
14114 corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
14115 the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
14116 set by `glPixelTransfer'.
14117
14118 `GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
14119
14120 `GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
14121 allowable values.
14122
14123 `GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
14124 values.
14125
14126 `GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
14127 values.
14128
14129 `GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
14130 than the maximum supported value. This value may be queried with
14131 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14132 `GL_MAX_CONVOLUTION_WIDTH'.
14133
14134 `GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
14135 than the maximum supported value. This value may be queried with
14136 `glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
14137 `GL_MAX_CONVOLUTION_HEIGHT'.
14138
14139 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14140 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
14141 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
14142 is not `GL_RGB'.
14143
14144 `GL_INVALID_OPERATION' is generated if HEIGHT is one of
14145 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
14146 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
14147 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
14148 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
14149 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
14150
14151 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14152 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
14153 data store is currently mapped.
14154
14155 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14156 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
14157 unpacked from the buffer object such that the memory reads required
14158 would exceed the data store size.
14159
14160 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
14161 bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
14162 evenly divisible into the number of bytes needed to store in memory a
14163 datum indicated by TYPE.
14164
14165 `GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
14166 between the execution of `glBegin' and the corresponding execution of
14167 `glEnd'.")
14168
14169 (define-gl-procedures
14170 ((glShadeModel (mode GLenum) -> void))
14171 "Select flat or smooth shading.
14172
14173 MODE
14174 Specifies a symbolic value representing a shading technique.
14175 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
14176 `GL_SMOOTH'.
14177
14178 GL primitives can have either flat or smooth shading. Smooth shading,
14179 the default, causes the computed colors of vertices to be interpolated
14180 as the primitive is rasterized, typically assigning different colors to
14181 each resulting pixel fragment. Flat shading selects the computed color
14182 of just one vertex and assigns it to all the pixel fragments generated
14183 by rasterizing a single primitive. In either case, the computed color of
14184 a vertex is the result of lighting if lighting is enabled, or it is the
14185 current color at the time the vertex was specified if lighting is
14186 disabled.
14187
14188 Flat and smooth shading are indistinguishable for points. Starting when
14189 `glBegin' is issued and counting vertices and primitives from 1, the GL
14190 gives each flat-shaded line segment I the computed color of vertex I+1 ,
14191 its second vertex. Counting similarly from 1, the GL gives each
14192 flat-shaded polygon the computed color of the vertex listed in the
14193 following table. This is the last vertex to specify the polygon in all
14194 cases except single polygons, where the first vertex specifies the
14195 flat-shaded color.
14196
14197
14198
14199 * Primitive Type of Polygon I *
14200 *Vertex*
14201
14202 Single polygon (I==1 )
14203 1
14204
14205 Triangle strip
14206 I+2
14207
14208 Triangle fan
14209 I+2
14210
14211 Independent triangle
14212 3\u2062I
14213
14214 Quad strip
14215 2\u2062I+2
14216
14217 Independent quad
14218 4\u2062I
14219
14220 Flat and smooth shading are specified by `glShadeModel' with MODE set to
14221 `GL_FLAT' and `GL_SMOOTH', respectively.
14222
14223 `GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
14224 or `GL_SMOOTH'.
14225
14226 `GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
14227 between the execution of `glBegin' and the corresponding execution of
14228 `glEnd'.")
14229
14230 (define-gl-procedures
14231 ((glShaderSource
14232 (shader GLuint)
14233 (count GLsizei)
14234 (string const-GLchar-**)
14235 (length const-GLint-*)
14236 ->
14237 void))
14238 "Replaces the source code in a shader object.
14239
14240 SHADER
14241 Specifies the handle of the shader object whose source code is to
14242 be replaced.
14243
14244 COUNT
14245 Specifies the number of elements in the STRING and LENGTH arrays.
14246
14247 STRING
14248 Specifies an array of pointers to strings containing the source
14249 code to be loaded into the shader.
14250
14251 LENGTH
14252 Specifies an array of string lengths.
14253
14254 `glShaderSource' sets the source code in SHADER to the source code in
14255 the array of strings specified by STRING. Any source code previously
14256 stored in the shader object is completely replaced. The number of
14257 strings in the array is specified by COUNT. If LENGTH is `NULL', each
14258 string is assumed to be null terminated. If LENGTH is a value other than
14259 `NULL', it points to an array containing a string length for each of the
14260 corresponding elements of STRING. Each element in the LENGTH array may
14261 contain the length of the corresponding string (the null character is
14262 not counted as part of the string length) or a value less than 0 to
14263 indicate that the string is null terminated. The source code strings are
14264 not scanned or parsed at this time; they are simply copied into the
14265 specified shader object.
14266
14267 `GL_INVALID_VALUE' is generated if SHADER is not a value generated by
14268 OpenGL.
14269
14270 `GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
14271
14272 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
14273
14274 `GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
14275 between the execution of `glBegin' and the corresponding execution of
14276 `glEnd'.")
14277
14278 (define-gl-procedures
14279 ((glStencilFuncSeparate
14280 (face GLenum)
14281 (func GLenum)
14282 (ref GLint)
14283 (mask GLuint)
14284 ->
14285 void))
14286 "Set front and/or back function and reference value for stencil testing.
14287
14288 FACE
14289 Specifies whether front and/or back stencil state is updated. Three
14290 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14291 `GL_FRONT_AND_BACK'.
14292
14293 FUNC
14294 Specifies the test function. Eight symbolic constants are valid:
14295 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14296 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14297 `GL_ALWAYS'.
14298
14299 REF
14300 Specifies the reference value for the stencil test. REF is clamped
14301 to the range [0,2^N-1] , where N is the number of bitplanes in the
14302 stencil buffer. The initial value is 0.
14303
14304 MASK
14305 Specifies a mask that is ANDed with both the reference value and
14306 the stored stencil value when the test is done. The initial value
14307 is all 1's.
14308
14309 Stenciling, like depth-buffering, enables and disables drawing on a
14310 per-pixel basis. You draw into the stencil planes using GL drawing
14311 primitives, then render geometry and images, using the stencil planes to
14312 mask out portions of the screen. Stenciling is typically used in
14313 multipass rendering algorithms to achieve special effects, such as
14314 decals, outlining, and constructive solid geometry rendering.
14315
14316 The stencil test conditionally eliminates a pixel based on the outcome
14317 of a comparison between the reference value and the value in the stencil
14318 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14319 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14320 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14321
14322 There can be two separate sets of FUNC, REF, and MASK parameters; one
14323 affects back-facing polygons, and the other affects front-facing
14324 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14325 both front and back stencil state to the same values, as if
14326 `glStencilFuncSeparate' were called with FACE set to
14327 `GL_FRONT_AND_BACK'.
14328
14329 FUNC is a symbolic constant that determines the stencil comparison
14330 function. It accepts one of eight values, shown in the following list.
14331 REF is an integer reference value that is used in the stencil
14332 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14333 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14334 reference value and the stored stencil value, with the ANDed values
14335 participating in the comparison.
14336
14337 If STENCIL represents the value stored in the corresponding stencil
14338 buffer location, the following list shows the effect of each comparison
14339 function that can be specified by FUNC. Only if the comparison succeeds
14340 is the pixel passed through to the next stage in the rasterization
14341 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14342 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14343 the stencil buffer.
14344
14345 The following values are accepted by FUNC:
14346
14347 `GL_NEVER'
14348 Always fails.
14349
14350 `GL_LESS'
14351 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14352
14353 `GL_LEQUAL'
14354 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14355
14356 `GL_GREATER'
14357 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14358
14359 `GL_GEQUAL'
14360 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14361
14362 `GL_EQUAL'
14363 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14364
14365 `GL_NOTEQUAL'
14366 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14367
14368 `GL_ALWAYS'
14369 Always passes.
14370
14371 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14372 values.
14373
14374 `GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
14375 executed between the execution of `glBegin' and the corresponding
14376 execution of `glEnd'.")
14377
14378 (define-gl-procedures
14379 ((glStencilFunc
14380 (func GLenum)
14381 (ref GLint)
14382 (mask GLuint)
14383 ->
14384 void))
14385 "Set front and back function and reference value for stencil testing.
14386
14387 FUNC
14388 Specifies the test function. Eight symbolic constants are valid:
14389 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
14390 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
14391 `GL_ALWAYS'.
14392
14393 REF
14394 Specifies the reference value for the stencil test. REF is clamped
14395 to the range [0,2^N-1] , where N is the number of bitplanes in the
14396 stencil buffer. The initial value is 0.
14397
14398 MASK
14399 Specifies a mask that is ANDed with both the reference value and
14400 the stored stencil value when the test is done. The initial value
14401 is all 1's.
14402
14403 Stenciling, like depth-buffering, enables and disables drawing on a
14404 per-pixel basis. Stencil planes are first drawn into using GL drawing
14405 primitives, then geometry and images are rendered using the stencil
14406 planes to mask out portions of the screen. Stenciling is typically used
14407 in multipass rendering algorithms to achieve special effects, such as
14408 decals, outlining, and constructive solid geometry rendering.
14409
14410 The stencil test conditionally eliminates a pixel based on the outcome
14411 of a comparison between the reference value and the value in the stencil
14412 buffer. To enable and disable the test, call `glEnable' and `glDisable'
14413 with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
14414 of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
14415
14416 There can be two separate sets of FUNC, REF, and MASK parameters; one
14417 affects back-facing polygons, and the other affects front-facing
14418 polygons as well as other non-polygon primitives. `glStencilFunc' sets
14419 both front and back stencil state to the same values. Use
14420 `glStencilFuncSeparate' to set front and back stencil state to different
14421 values.
14422
14423 FUNC is a symbolic constant that determines the stencil comparison
14424 function. It accepts one of eight values, shown in the following list.
14425 REF is an integer reference value that is used in the stencil
14426 comparison. It is clamped to the range [0,2^N-1] , where N is the number
14427 of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
14428 reference value and the stored stencil value, with the ANDed values
14429 participating in the comparison.
14430
14431 If STENCIL represents the value stored in the corresponding stencil
14432 buffer location, the following list shows the effect of each comparison
14433 function that can be specified by FUNC. Only if the comparison succeeds
14434 is the pixel passed through to the next stage in the rasterization
14435 process (see `glStencilOp'). All tests treat STENCIL values as unsigned
14436 integers in the range [0,2^N-1] , where N is the number of bitplanes in
14437 the stencil buffer.
14438
14439 The following values are accepted by FUNC:
14440
14441 `GL_NEVER'
14442 Always fails.
14443
14444 `GL_LESS'
14445 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
14446
14447 `GL_LEQUAL'
14448 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
14449
14450 `GL_GREATER'
14451 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
14452
14453 `GL_GEQUAL'
14454 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
14455
14456 `GL_EQUAL'
14457 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
14458
14459 `GL_NOTEQUAL'
14460 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
14461
14462 `GL_ALWAYS'
14463 Always passes.
14464
14465 `GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
14466 values.
14467
14468 `GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
14469 between the execution of `glBegin' and the corresponding execution of
14470 `glEnd'.")
14471
14472 (define-gl-procedures
14473 ((glStencilMaskSeparate
14474 (face GLenum)
14475 (mask GLuint)
14476 ->
14477 void))
14478 "Control the front and/or back writing of individual bits in the stencil
14479 planes.
14480
14481 FACE
14482 Specifies whether the front and/or back stencil writemask is
14483 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
14484 and `GL_FRONT_AND_BACK'.
14485
14486 MASK
14487 Specifies a bit mask to enable and disable writing of individual
14488 bits in the stencil planes. Initially, the mask is all 1's.
14489
14490 `glStencilMaskSeparate' controls the writing of individual bits in the
14491 stencil planes. The least significant N bits of MASK, where N is the
14492 number of bits in the stencil buffer, specify a mask. Where a 1 appears
14493 in the mask, it's possible to write to the corresponding bit in the
14494 stencil buffer. Where a 0 appears, the corresponding bit is
14495 write-protected. Initially, all bits are enabled for writing.
14496
14497 There can be two separate MASK writemasks; one affects back-facing
14498 polygons, and the other affects front-facing polygons as well as other
14499 non-polygon primitives. `glStencilMask' sets both front and back stencil
14500 writemasks to the same values, as if `glStencilMaskSeparate' were called
14501 with FACE set to `GL_FRONT_AND_BACK'.
14502
14503 `GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
14504 executed between the execution of `glBegin' and the corresponding
14505 execution of `glEnd'.")
14506
14507 (define-gl-procedures
14508 ((glStencilMask (mask GLuint) -> void))
14509 "Control the front and back writing of individual bits in the stencil
14510 planes.
14511
14512 MASK
14513 Specifies a bit mask to enable and disable writing of individual
14514 bits in the stencil planes. Initially, the mask is all 1's.
14515
14516 `glStencilMask' controls the writing of individual bits in the stencil
14517 planes. The least significant N bits of MASK, where N is the number of
14518 bits in the stencil buffer, specify a mask. Where a 1 appears in the
14519 mask, it's possible to write to the corresponding bit in the stencil
14520 buffer. Where a 0 appears, the corresponding bit is write-protected.
14521 Initially, all bits are enabled for writing.
14522
14523 There can be two separate MASK writemasks; one affects back-facing
14524 polygons, and the other affects front-facing polygons as well as other
14525 non-polygon primitives. `glStencilMask' sets both front and back stencil
14526 writemasks to the same values. Use `glStencilMaskSeparate' to set front
14527 and back stencil writemasks to different values.
14528
14529 `GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
14530 between the execution of `glBegin' and the corresponding execution of
14531 `glEnd'.")
14532
14533 (define-gl-procedures
14534 ((glStencilOpSeparate
14535 (face GLenum)
14536 (sfail GLenum)
14537 (dpfail GLenum)
14538 (dppass GLenum)
14539 ->
14540 void))
14541 "Set front and/or back stencil test actions.
14542
14543 FACE
14544 Specifies whether front and/or back stencil state is updated. Three
14545 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
14546 `GL_FRONT_AND_BACK'.
14547
14548 SFAIL
14549 Specifies the action to take when the stencil test fails. Eight
14550 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14551 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14552 and `GL_INVERT'. The initial value is `GL_KEEP'.
14553
14554 DPFAIL
14555 Specifies the stencil action when the stencil test passes, but the
14556 depth test fails. DPFAIL accepts the same symbolic constants as
14557 SFAIL. The initial value is `GL_KEEP'.
14558
14559 DPPASS
14560 Specifies the stencil action when both the stencil test and the
14561 depth test pass, or when the stencil test passes and either there
14562 is no depth buffer or depth testing is not enabled. DPPASS accepts
14563 the same symbolic constants as SFAIL. The initial value is
14564 `GL_KEEP'.
14565
14566 Stenciling, like depth-buffering, enables and disables drawing on a
14567 per-pixel basis. You draw into the stencil planes using GL drawing
14568 primitives, then render geometry and images, using the stencil planes to
14569 mask out portions of the screen. Stenciling is typically used in
14570 multipass rendering algorithms to achieve special effects, such as
14571 decals, outlining, and constructive solid geometry rendering.
14572
14573 The stencil test conditionally eliminates a pixel based on the outcome
14574 of a comparison between the value in the stencil buffer and a reference
14575 value. To enable and disable the test, call `glEnable' and `glDisable'
14576 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14577 `glStencilFuncSeparate'.
14578
14579 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14580 one affects back-facing polygons, and the other affects front-facing
14581 polygons as well as other non-polygon primitives. `glStencilOp' sets
14582 both front and back stencil state to the same values, as if
14583 `glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
14584
14585 `glStencilOpSeparate' takes three arguments that indicate what happens
14586 to the stored stencil value while stenciling is enabled. If the stencil
14587 test fails, no change is made to the pixel's color or depth buffers, and
14588 SFAIL specifies what happens to the stencil buffer contents. The
14589 following eight actions are possible.
14590
14591 `GL_KEEP'
14592 Keeps the current value.
14593
14594 `GL_ZERO'
14595 Sets the stencil buffer value to 0.
14596
14597 `GL_REPLACE'
14598 Sets the stencil buffer value to REF, as specified by
14599 `glStencilFunc'.
14600
14601 `GL_INCR'
14602 Increments the current stencil buffer value. Clamps to the maximum
14603 representable unsigned value.
14604
14605 `GL_INCR_WRAP'
14606 Increments the current stencil buffer value. Wraps stencil buffer
14607 value to zero when incrementing the maximum representable unsigned
14608 value.
14609
14610 `GL_DECR'
14611 Decrements the current stencil buffer value. Clamps to 0.
14612
14613 `GL_DECR_WRAP'
14614 Decrements the current stencil buffer value. Wraps stencil buffer
14615 value to the maximum representable unsigned value when decrementing
14616 a stencil buffer value of zero.
14617
14618 `GL_INVERT'
14619 Bitwise inverts the current stencil buffer value.
14620
14621 Stencil buffer values are treated as unsigned integers. When incremented
14622 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14623 value returned by querying `GL_STENCIL_BITS'.
14624
14625 The other two arguments to `glStencilOpSeparate' specify stencil buffer
14626 actions that depend on whether subsequent depth buffer tests succeed
14627 (DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
14628 using the same eight symbolic constants as SFAIL. Note that DPFAIL is
14629 ignored when there is no depth buffer, or when the depth buffer is not
14630 enabled. In these cases, SFAIL and DPPASS specify stencil action when
14631 the stencil test fails and passes, respectively.
14632
14633 `GL_INVALID_ENUM' is generated if FACE is any value other than
14634 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
14635
14636 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14637 other than the eight defined constant values.
14638
14639 `GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
14640 between the execution of `glBegin' and the corresponding execution of
14641 `glEnd'.")
14642
14643 (define-gl-procedures
14644 ((glStencilOp
14645 (sfail GLenum)
14646 (dpfail GLenum)
14647 (dppass GLenum)
14648 ->
14649 void))
14650 "Set front and back stencil test actions.
14651
14652 SFAIL
14653 Specifies the action to take when the stencil test fails. Eight
14654 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
14655 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
14656 and `GL_INVERT'. The initial value is `GL_KEEP'.
14657
14658 DPFAIL
14659 Specifies the stencil action when the stencil test passes, but the
14660 depth test fails. DPFAIL accepts the same symbolic constants as
14661 SFAIL. The initial value is `GL_KEEP'.
14662
14663 DPPASS
14664 Specifies the stencil action when both the stencil test and the
14665 depth test pass, or when the stencil test passes and either there
14666 is no depth buffer or depth testing is not enabled. DPPASS accepts
14667 the same symbolic constants as SFAIL. The initial value is
14668 `GL_KEEP'.
14669
14670 Stenciling, like depth-buffering, enables and disables drawing on a
14671 per-pixel basis. You draw into the stencil planes using GL drawing
14672 primitives, then render geometry and images, using the stencil planes to
14673 mask out portions of the screen. Stenciling is typically used in
14674 multipass rendering algorithms to achieve special effects, such as
14675 decals, outlining, and constructive solid geometry rendering.
14676
14677 The stencil test conditionally eliminates a pixel based on the outcome
14678 of a comparison between the value in the stencil buffer and a reference
14679 value. To enable and disable the test, call `glEnable' and `glDisable'
14680 with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
14681 `glStencilFuncSeparate'.
14682
14683 There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
14684 one affects back-facing polygons, and the other affects front-facing
14685 polygons as well as other non-polygon primitives. `glStencilOp' sets
14686 both front and back stencil state to the same values. Use
14687 `glStencilOpSeparate' to set front and back stencil state to different
14688 values.
14689
14690 `glStencilOp' takes three arguments that indicate what happens to the
14691 stored stencil value while stenciling is enabled. If the stencil test
14692 fails, no change is made to the pixel's color or depth buffers, and
14693 SFAIL specifies what happens to the stencil buffer contents. The
14694 following eight actions are possible.
14695
14696 `GL_KEEP'
14697 Keeps the current value.
14698
14699 `GL_ZERO'
14700 Sets the stencil buffer value to 0.
14701
14702 `GL_REPLACE'
14703 Sets the stencil buffer value to REF, as specified by
14704 `glStencilFunc'.
14705
14706 `GL_INCR'
14707 Increments the current stencil buffer value. Clamps to the maximum
14708 representable unsigned value.
14709
14710 `GL_INCR_WRAP'
14711 Increments the current stencil buffer value. Wraps stencil buffer
14712 value to zero when incrementing the maximum representable unsigned
14713 value.
14714
14715 `GL_DECR'
14716 Decrements the current stencil buffer value. Clamps to 0.
14717
14718 `GL_DECR_WRAP'
14719 Decrements the current stencil buffer value. Wraps stencil buffer
14720 value to the maximum representable unsigned value when decrementing
14721 a stencil buffer value of zero.
14722
14723 `GL_INVERT'
14724 Bitwise inverts the current stencil buffer value.
14725
14726 Stencil buffer values are treated as unsigned integers. When incremented
14727 and decremented, values are clamped to 0 and 2^N-1 , where N is the
14728 value returned by querying `GL_STENCIL_BITS'.
14729
14730 The other two arguments to `glStencilOp' specify stencil buffer actions
14731 that depend on whether subsequent depth buffer tests succeed (DPPASS) or
14732 fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
14733 same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
14734 there is no depth buffer, or when the depth buffer is not enabled. In
14735 these cases, SFAIL and DPPASS specify stencil action when the stencil
14736 test fails and passes, respectively.
14737
14738 `GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
14739 other than the eight defined constant values.
14740
14741 `GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
14742 the execution of `glBegin' and the corresponding execution of `glEnd'.")
14743
14744 (define-gl-procedures
14745 ((glTexCoordPointer
14746 (size GLint)
14747 (type GLenum)
14748 (stride GLsizei)
14749 (pointer const-GLvoid-*)
14750 ->
14751 void))
14752 "Define an array of texture coordinates.
14753
14754 SIZE
14755 Specifies the number of coordinates per array element. Must be 1,
14756 2, 3, or 4. The initial value is 4.
14757
14758 TYPE
14759 Specifies the data type of each texture coordinate. Symbolic
14760 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
14761 accepted. The initial value is `GL_FLOAT'.
14762
14763 STRIDE
14764 Specifies the byte offset between consecutive texture coordinate
14765 sets. If STRIDE is 0, the array elements are understood to be
14766 tightly packed. The initial value is 0.
14767
14768 POINTER
14769 Specifies a pointer to the first coordinate of the first texture
14770 coordinate set in the array. The initial value is 0.
14771
14772 `glTexCoordPointer' specifies the location and data format of an array
14773 of texture coordinates to use when rendering. SIZE specifies the number
14774 of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
14775 TYPE specifies the data type of each texture coordinate, and STRIDE
14776 specifies the byte stride from one texture coordinate set to the next,
14777 allowing vertices and attributes to be packed into a single array or
14778 stored in separate arrays. (Single-array storage may be more efficient
14779 on some implementations; see `glInterleavedArrays'.)
14780
14781 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
14782 target (see `glBindBuffer') while a texture coordinate array is
14783 specified, POINTER is treated as a byte offset into the buffer object's
14784 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
14785 is saved as texture coordinate vertex array client-side state
14786 (`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
14787
14788 When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
14789 POINTER are saved as client-side state, in addition to the current
14790 vertex array buffer object binding.
14791
14792 To enable and disable a texture coordinate array, call
14793 `glEnableClientState' and `glDisableClientState' with the argument
14794 `GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
14795 used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
14796 `glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
14797 called.
14798
14799 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
14800
14801 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
14802
14803 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
14804
14805 (define-gl-procedures
14806 ((glTexCoord1i (s GLint) -> void)
14807 (glTexCoord1f (s GLfloat) -> void)
14808 (glTexCoord2i (s GLint) (t GLint) -> void)
14809 (glTexCoord2f (s GLfloat) (t GLfloat) -> void)
14810 (glTexCoord3i
14811 (s GLint)
14812 (t GLint)
14813 (r GLint)
14814 ->
14815 void)
14816 (glTexCoord3f
14817 (s GLfloat)
14818 (t GLfloat)
14819 (r GLfloat)
14820 ->
14821 void)
14822 (glTexCoord4i
14823 (s GLint)
14824 (t GLint)
14825 (r GLint)
14826 (q GLint)
14827 ->
14828 void)
14829 (glTexCoord4f
14830 (s GLfloat)
14831 (t GLfloat)
14832 (r GLfloat)
14833 (q GLfloat)
14834 ->
14835 void))
14836 "Set the current texture coordinates.
14837
14838 S
14839 T
14840
14841 R
14842
14843 Q
14844
14845 Specify S, T, R, and Q texture coordinates. Not all parameters are
14846 present in all forms of the command.
14847
14848 `glTexCoord' specifies texture coordinates in one, two, three, or four
14849 dimensions. `glTexCoord1' sets the current texture coordinates to
14850 (S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
14851 `glTexCoord3' specifies the texture coordinates as (S,TR1) , and
14852 `glTexCoord4' defines all four components explicitly as (S,TRQ) .
14853
14854 The current texture coordinates are part of the data that is associated
14855 with each vertex and with the current raster position. Initially, the
14856 values for S, T, R, and Q are (0, 0, 0, 1).")
14857
14858 (define-gl-procedures
14859 ((glTexEnvf
14860 (target GLenum)
14861 (pname GLenum)
14862 (param GLfloat)
14863 ->
14864 void)
14865 (glTexEnvi
14866 (target GLenum)
14867 (pname GLenum)
14868 (param GLint)
14869 ->
14870 void))
14871 "Set texture environment parameters.
14872
14873 TARGET
14874 Specifies a texture environment. May be `GL_TEXTURE_ENV',
14875 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
14876
14877 PNAME
14878 Specifies the symbolic name of a single-valued texture environment
14879 parameter. May be either `GL_TEXTURE_ENV_MODE',
14880 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
14881 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14882 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
14883 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
14884 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
14885 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
14886
14887 PARAM
14888 Specifies a single symbolic constant, one of `GL_ADD',
14889 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
14890 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
14891 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
14892 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
14893 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
14894 sprite texture coordinate replacement, a single floating-point
14895 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
14896 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
14897
14898 A texture environment specifies how texture values are interpreted when
14899 a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
14900 PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
14901 PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
14902 `GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
14903 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14904 `GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
14905
14906 If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
14907 symbolic name of a texture function. Six texture functions may be
14908 specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
14909 `GL_REPLACE', or `GL_COMBINE'.
14910
14911 The following table shows the correspondence of filtered texture values
14912 R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
14913 A_S are used by the texture functions described below.
14914
14915
14916
14917 Texture Base Internal Format
14918 `C'_S , `A'_S
14919
14920 `GL_ALPHA'
14921 (0, 0, 0) , A_T
14922
14923 `GL_LUMINANCE'
14924 ( L_T , L_T , L_T ) , 1
14925
14926 `GL_LUMINANCE_ALPHA'
14927 ( L_T , L_T , L_T ) , A_T
14928
14929 `GL_INTENSITY'
14930 ( I_T , I_T , I_T ) , I_T
14931
14932 `GL_RGB'
14933 ( R_T , G_T , B_T ) , 1
14934
14935 `GL_RGBA'
14936 ( R_T , G_T , B_T ) , A_T
14937
14938 A texture function acts on the fragment to be textured using the texture
14939 image value that applies to the fragment (see `glTexParameter') and
14940 produces an RGBA color for that fragment. The following table shows how
14941 the RGBA color is produced for each of the first five texture functions
14942 that can be chosen. C is a triple of color values (RGB) and A is the
14943 associated alpha value. RGBA values extracted from a texture image are
14944 in the range [0,1]. The subscript P refers to the color computed from
14945 the previous texture stage (or the incoming fragment if processing
14946 texture stage 0), the subscript S to the texture source color, the
14947 subscript C to the texture environment color, and the subscript V
14948 indicates a value produced by the texture function.
14949
14950
14951
14952 Texture Base Internal Format
14953 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
14954 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
14955
14956 `GL_ALPHA'
14957 C_V= , C_P , C_P , undefined , C_P , C_P
14958
14959
14960 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
14961
14962 `GL_LUMINANCE'
14963 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14964
14965 (or 1)
14966 A_V= , A_P , A_P , , A_P , A_P
14967
14968 `GL_LUMINANCE_ALPHA'
14969 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14970
14971 (or 2)
14972 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
14973
14974 `GL_INTENSITY'
14975 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14976
14977
14978 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
14979
14980 `GL_RGB'
14981 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
14982
14983 (or 3)
14984 A_V= , A_P , A_P , A_P , A_P , A_P
14985
14986 `GL_RGBA'
14987 C_V= , C_S , C_P\u2062C_S , C_P\u2062(1-A_S,)+C_S\u2062A_S , C_P\u2062(1-C_S,)+C_C\u2062C_S
14988 , C_P+C_S
14989
14990 (or 4)
14991 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
14992
14993 If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
14994 of the texture function depends on the values of `GL_COMBINE_RGB' and
14995 `GL_COMBINE_ALPHA'.
14996
14997 The following describes how the texture sources, as specified by
14998 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
14999 `GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
15000 texture color. In the following tables, `GL_SRC0_c' is represented by
15001 ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
15002 represented by ARG2 .
15003
15004 `GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
15005 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
15006 `GL_DOT3_RGBA'.
15007
15008
15009
15010 *`GL_COMBINE_RGB'*
15011 *Texture Function*
15012
15013 `GL_REPLACE'
15014 ARG0
15015
15016 `GL_MODULATE'
15017 ARG0×ARG1
15018
15019 `GL_ADD'
15020 ARG0+ARG1
15021
15022 `GL_ADD_SIGNED'
15023 ARG0+ARG1-0.5
15024
15025 `GL_INTERPOLATE'
15026 ARG0×ARG2+ARG1×(1-ARG2,)
15027
15028 `GL_SUBTRACT'
15029 ARG0-ARG1
15030
15031 `GL_DOT3_RGB' or `GL_DOT3_RGBA'
15032 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
15033 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
15034
15035 The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
15036 each of the 3 (RGB) or 4 (RGBA) components on output.
15037
15038 Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
15039 `GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
15040 following table describes how alpha values are combined:
15041
15042
15043
15044 *`GL_COMBINE_ALPHA'*
15045 *Texture Function*
15046
15047 `GL_REPLACE'
15048 ARG0
15049
15050 `GL_MODULATE'
15051 ARG0×ARG1
15052
15053 `GL_ADD'
15054 ARG0+ARG1
15055
15056 `GL_ADD_SIGNED'
15057 ARG0+ARG1-0.5
15058
15059 `GL_INTERPOLATE'
15060 ARG0×ARG2+ARG1×(1-ARG2,)
15061
15062 `GL_SUBTRACT'
15063 ARG0-ARG1
15064
15065 In the following tables, the value C_S represents the color sampled from
15066 the currently bound texture, C_C represents the constant
15067 texture-environment color, C_F represents the primary color of the
15068 incoming fragment, and C_P represents the color computed from the
15069 previous texture stage or C_F if processing texture stage 0. Likewise,
15070 A_S , A_C , A_F , and A_P represent the respective alpha values.
15071
15072 The following table describes the values assigned to ARG0 , ARG1 , and
15073 ARG2 based upon the RGB sources and operands:
15074
15075
15076
15077 *`GL_SRCn_RGB'*
15078 *`GL_OPERANDn_RGB'*, *Argument Value*
15079
15080 `GL_TEXTURE'
15081 `GL_SRC_COLOR', C_S,
15082
15083
15084 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15085
15086
15087 `GL_SRC_ALPHA', A_S,
15088
15089
15090 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15091
15092 `GL_TEXTUREn'
15093 `GL_SRC_COLOR', C_S,
15094
15095
15096 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
15097
15098
15099 `GL_SRC_ALPHA', A_S,
15100
15101
15102 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15103
15104 `GL_CONSTANT'
15105 `GL_SRC_COLOR', C_C,
15106
15107
15108 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
15109
15110
15111 `GL_SRC_ALPHA', A_C,
15112
15113
15114 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15115
15116 `GL_PRIMARY_COLOR'
15117 `GL_SRC_COLOR', C_F,
15118
15119
15120 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
15121
15122
15123 `GL_SRC_ALPHA', A_F,
15124
15125
15126 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15127
15128 `GL_PREVIOUS'
15129 `GL_SRC_COLOR', C_P,
15130
15131
15132 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
15133
15134
15135 `GL_SRC_ALPHA', A_P,
15136
15137
15138 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15139
15140 For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
15141 respectively, produced from texture stage N .
15142
15143 The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
15144 based upon the alpha sources and operands:
15145
15146
15147
15148 *`GL_SRCn_ALPHA'*
15149 *`GL_OPERANDn_ALPHA'*, *Argument Value*
15150
15151 `GL_TEXTURE'
15152 `GL_SRC_ALPHA', A_S,
15153
15154
15155 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15156
15157 `GL_TEXTUREn'
15158 `GL_SRC_ALPHA', A_S,
15159
15160
15161 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
15162
15163 `GL_CONSTANT'
15164 `GL_SRC_ALPHA', A_C,
15165
15166
15167 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
15168
15169 `GL_PRIMARY_COLOR'
15170 `GL_SRC_ALPHA', A_F,
15171
15172
15173 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
15174
15175 `GL_PREVIOUS'
15176 `GL_SRC_ALPHA', A_P,
15177
15178
15179 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
15180
15181 The RGB and alpha results of the texture function are multipled by the
15182 values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
15183 to the range [0,1] .
15184
15185 If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
15186 holds an RGBA color consisting of four values. Integer color components
15187 are interpreted linearly such that the most positive integer maps to
15188 1.0, and the most negative integer maps to -1.0. The values are clamped
15189 to the range [0,1] when they are specified. C_C takes these four values.
15190
15191 If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
15192 texture level-of-detail parameter, that selects which mipmap, or mipmaps
15193 depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
15194
15195 `GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
15196 `GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
15197
15198 If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
15199 boolean value specified is used to either enable or disable point sprite
15200 texture coordinate replacement. The default value is `GL_FALSE'.
15201
15202 `GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
15203 accepted defined values, or when PARAMS should have a defined constant
15204 value (based on the value of PNAME) and does not.
15205
15206 `GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
15207 or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
15208
15209 `GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
15210 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15211
15212 (define-gl-procedures
15213 ((glTexGeni
15214 (coord GLenum)
15215 (pname GLenum)
15216 (param GLint)
15217 ->
15218 void)
15219 (glTexGenf
15220 (coord GLenum)
15221 (pname GLenum)
15222 (param GLfloat)
15223 ->
15224 void))
15225 "Control the generation of texture coordinates.
15226
15227 COORD
15228 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
15229 `GL_R', or `GL_Q'.
15230
15231 PNAME
15232 Specifies the symbolic name of the texture-coordinate generation
15233 function. Must be `GL_TEXTURE_GEN_MODE'.
15234
15235 PARAM
15236 Specifies a single-valued texture generation parameter, one of
15237 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
15238 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
15239
15240 `glTexGen' selects a texture-coordinate generation function or supplies
15241 coefficients for one of the functions. COORD names one of the (S, T, R,
15242 Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
15243 `GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
15244 `GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
15245 `GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
15246 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
15247 or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
15248 `GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
15249 texture generation function.
15250
15251 If the texture generation function is `GL_OBJECT_LINEAR', the function
15252
15253 G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
15254
15255 is used, where G is the value computed for the coordinate named in
15256 COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
15257 and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
15258 This function can be used, for example, to texture-map terrain using sea
15259 level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
15260 altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
15261 coordinate generation function as its distance from sea level; that
15262 altitude can then be used to index the texture image to map white snow
15263 onto peaks and green grass onto foothills.
15264
15265 If the texture generation function is `GL_EYE_LINEAR', the function
15266
15267 G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
15268
15269 is used, where
15270
15271 (P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
15272
15273 and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
15274 , P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
15275 modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
15276 or singular, texture coordinates generated by the resulting function may
15277 be inaccurate or undefined.
15278
15279 Note that the values in PARAMS define a reference plane in eye
15280 coordinates. The modelview matrix that is applied to them may not be the
15281 same one in effect when the polygon vertices are transformed. This
15282 function establishes a field of texture coordinates that can produce
15283 dynamic contour lines on moving objects.
15284
15285 If the texture generation function is `GL_SPHERE_MAP' and COORD is
15286 either `GL_S' or `GL_T', S and T texture coordinates are generated as
15287 follows. Let U be the unit vector pointing from the origin to the
15288 polygon vertex (in eye coordinates). Let N sup prime be the current
15289 normal, after transformation to eye coordinates. Let
15290
15291 F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
15292
15293 F=U-2\u2062N^″\u2062N^″,^T\u2062U
15294
15295 Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
15296 to the S and T texture coordinates are
15297
15298 S=F_X/M+1/2
15299
15300 T=F_Y/M+1/2
15301
15302 To enable or disable a texture-coordinate generation function, call
15303 `glEnable' or `glDisable' with one of the symbolic texture-coordinate
15304 names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
15305 `GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
15306 coordinate is computed according to the generating function associated
15307 with that coordinate. When disabled, subsequent vertices take the
15308 specified texture coordinate from the current set of texture
15309 coordinates. Initially, all texture generation functions are set to
15310 `GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
15311 0), both T plane equations are (0, 1, 0, 0), and all R and Q plane
15312 equations are (0, 0, 0, 0).
15313
15314 When the `ARB_multitexture' extension is supported, `glTexGen' sets the
15315 texture generation parameters for the currently active texture unit,
15316 selected with `glActiveTexture'.
15317
15318 `GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
15319 defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
15320 an accepted defined value.
15321
15322 `GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
15323 PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
15324
15325 `GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
15326 the execution of `glBegin' and the corresponding execution of `glEnd'.")
15327
15328 (define-gl-procedures
15329 ((glTexImage1D
15330 (target GLenum)
15331 (level GLint)
15332 (internalFormat GLint)
15333 (width GLsizei)
15334 (border GLint)
15335 (format GLenum)
15336 (type GLenum)
15337 (data const-GLvoid-*)
15338 ->
15339 void))
15340 "Specify a one-dimensional texture image.
15341
15342 TARGET
15343 Specifies the target texture. Must be `GL_TEXTURE_1D' or
15344 `GL_PROXY_TEXTURE_1D'.
15345
15346 LEVEL
15347 Specifies the level-of-detail number. Level 0 is the base image
15348 level. Level N is the Nth mipmap reduction image.
15349
15350 INTERNALFORMAT
15351 Specifies the number of color components in the texture. Must be 1,
15352 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15353 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15354 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15355 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15356 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15357 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15358 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15359 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15360 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15361 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15362 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15363 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15364 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15365 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15366 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15367 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15368 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15369 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15370 `GL_SRGB8_ALPHA8'.
15371
15372 WIDTH
15373 Specifies the width of the texture image including the border if
15374 any. If the GL version does not support non-power-of-two sizes,
15375 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15376 implementations support texture images that are at least 64 texels
15377 wide. The height of the 1D texture image is 1.
15378
15379 BORDER
15380 Specifies the width of the border. Must be either 0 or 1.
15381
15382 FORMAT
15383 Specifies the format of the pixel data. The following symbolic
15384 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15385 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15386 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15387
15388 TYPE
15389 Specifies the data type of the pixel data. The following symbolic
15390 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15391 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15392 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15393 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15394 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15395 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15396 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15397 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15398
15399 DATA
15400 Specifies a pointer to the image data in memory.
15401
15402 Texturing maps a portion of a specified texture image onto each
15403 graphical primitive for which texturing is enabled. To enable and
15404 disable one-dimensional texturing, call `glEnable' and `glDisable' with
15405 argument `GL_TEXTURE_1D'.
15406
15407 Texture images are defined with `glTexImage1D'. The arguments describe
15408 the parameters of the texture image, such as width, width of the border,
15409 level-of-detail number (see `glTexParameter'), and the internal
15410 resolution and format used to store the image. The last three arguments
15411 describe how the image is represented in memory; they are identical to
15412 the pixel formats used for `glDrawPixels'.
15413
15414 If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
15415 of the texture image state is recalculated, checked for consistency, and
15416 checked against the implementation's capabilities. If the implementation
15417 cannot handle a texture of the requested texture size, it sets all of
15418 the image state to 0, but does not generate an error (see `glGetError').
15419 To query for an entire mipmap array, use an image array level greater
15420 than or equal to 1.
15421
15422 If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
15423 signed or unsigned bytes, shorts, or longs, or single-precision
15424 floating-point values, depending on TYPE. These values are grouped into
15425 sets of one, two, three, or four values, depending on FORMAT, to form
15426 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
15427 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
15428 treated as eight 1-bit elements, with bit ordering determined by
15429 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
15430
15431 If a non-zero named buffer object is bound to the
15432 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15433 image is specified, DATA is treated as a byte offset into the buffer
15434 object's data store.
15435
15436 The first element corresponds to the left end of the texture array.
15437 Subsequent elements progress left-to-right through the remaining texels
15438 in the texture array. The final element corresponds to the right end of
15439 the texture array.
15440
15441 FORMAT determines the composition of each element in DATA. It can assume
15442 one of these symbolic values:
15443
15444 `GL_COLOR_INDEX'
15445 Each element is a single value, a color index. The GL converts it
15446 to fixed point (with an unspecified number of zero bits to the
15447 right of the binary point), shifted left or right depending on the
15448 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15449 (see `glPixelTransfer'). The resulting index is converted to a set
15450 of color components using the `GL_PIXEL_MAP_I_TO_R',
15451 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15452 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15453
15454 `GL_RED'
15455 Each element is a single red component. The GL converts it to
15456 floating point and assembles it into an RGBA element by attaching 0
15457 for green and blue, and 1 for alpha. Each component is then
15458 multiplied by the signed scale factor `GL_c_SCALE', added to the
15459 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15460 `glPixelTransfer').
15461
15462 `GL_GREEN'
15463 Each element is a single green component. The GL converts it to
15464 floating point and assembles it into an RGBA element by attaching 0
15465 for red and blue, and 1 for alpha. Each component is then
15466 multiplied by the signed scale factor `GL_c_SCALE', added to the
15467 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15468 `glPixelTransfer').
15469
15470 `GL_BLUE'
15471 Each element is a single blue component. The GL converts it to
15472 floating point and assembles it into an RGBA element by attaching 0
15473 for red and green, and 1 for alpha. Each component is then
15474 multiplied by the signed scale factor `GL_c_SCALE', added to the
15475 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15476 `glPixelTransfer').
15477
15478 `GL_ALPHA'
15479 Each element is a single alpha component. The GL converts it to
15480 floating point and assembles it into an RGBA element by attaching 0
15481 for red, green, and blue. Each component is then multiplied by the
15482 signed scale factor `GL_c_SCALE', added to the signed bias
15483 `GL_c_BIAS', and clamped to the range [0,1] (see
15484 `glPixelTransfer').
15485
15486 `GL_INTENSITY'
15487 Each element is a single intensity value. The GL converts it to
15488 floating point, then assembles it into an RGBA element by
15489 replicating the intensity value three times for red, green, blue,
15490 and alpha. Each component is then multiplied by the signed scale
15491 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15492 clamped to the range [0,1] (see `glPixelTransfer').
15493
15494 `GL_RGB'
15495 `GL_BGR'
15496 Each element is an RGB triple. The GL converts it to floating point
15497 and assembles it into an RGBA element by attaching 1 for alpha.
15498 Each component is then multiplied by the signed scale factor
15499 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15500 the range [0,1] (see `glPixelTransfer').
15501
15502 `GL_RGBA'
15503 `GL_BGRA'
15504 Each element contains all four components. Each component is
15505 multiplied by the signed scale factor `GL_c_SCALE', added to the
15506 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15507 `glPixelTransfer').
15508
15509 `GL_LUMINANCE'
15510 Each element is a single luminance value. The GL converts it to
15511 floating point, then assembles it into an RGBA element by
15512 replicating the luminance value three times for red, green, and
15513 blue and attaching 1 for alpha. Each component is then multiplied
15514 by the signed scale factor `GL_c_SCALE', added to the signed bias
15515 `GL_c_BIAS', and clamped to the range [0,1] (see
15516 `glPixelTransfer').
15517
15518 `GL_LUMINANCE_ALPHA'
15519 Each element is a luminance/alpha pair. The GL converts it to
15520 floating point, then assembles it into an RGBA element by
15521 replicating the luminance value three times for red, green, and
15522 blue. Each component is then multiplied by the signed scale factor
15523 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15524 the range [0,1] (see `glPixelTransfer').
15525
15526 `GL_DEPTH_COMPONENT'
15527 Each element is a single depth value. The GL converts it to
15528 floating point, multiplies by the signed scale factor
15529 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15530 to the range [0,1] (see `glPixelTransfer').
15531
15532 Refer to the `glDrawPixels' reference page for a description of the
15533 acceptable values for the TYPE parameter.
15534
15535 If an application wants to store the texture at a certain resolution or
15536 in a certain format, it can request the resolution and format with
15537 INTERNALFORMAT. The GL will choose an internal representation that
15538 closely approximates that requested by INTERNALFORMAT, but it may not
15539 match exactly. (The representations specified by `GL_LUMINANCE',
15540 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15541 numeric values 1, 2, 3, and 4 may also be used to specify the above
15542 representations.)
15543
15544 If the INTERNALFORMAT parameter is one of the generic compressed
15545 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15546 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15547 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15548 internal format with the symbolic constant for a specific internal
15549 format and compress the texture before storage. If no corresponding
15550 internal format is available, or the GL can not compress that image for
15551 any reason, the internal format is instead replaced with a corresponding
15552 base internal format.
15553
15554 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15555 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15556 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15557 treated as if the red, green, blue, or luminance components are encoded
15558 in the sRGB color space. Any alpha component is left unchanged. The
15559 conversion from the sRGB encoded component C_S to a linear component C_L
15560 is:
15561
15562 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15563 C_S>0.04045)
15564
15565 Assume C_S is the sRGB component in the range [0,1].
15566
15567 Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
15568 The implementation will update and recompute its best match for the
15569 requested storage resolution and format. To then query this state, call
15570 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
15571 state is set to 0.
15572
15573 A one-component texture image uses only the red component of the RGBA
15574 color from DATA. A two-component image uses the R and A values. A
15575 three-component image uses the R, G, and B values. A four-component
15576 image uses all of the RGBA components.
15577
15578 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15579 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15580 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15581 generate a boolean result. See `glTexParameter' for details on texture
15582 comparison.
15583
15584 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
15585 `GL_PROXY_TEXTURE_1D'.
15586
15587 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
15588 constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
15589
15590 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15591
15592 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15593 `GL_COLOR_INDEX'.
15594
15595 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15596
15597 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15598 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15599
15600 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15601 one of the accepted resolution and format symbolic constants.
15602
15603 `GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
15604 2 + `GL_MAX_TEXTURE_SIZE'.
15605
15606 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15607 supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
15608 some integer value of N.
15609
15610 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15611
15612 `GL_INVALID_OPERATION' is generated if TYPE is one of
15613 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15614 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15615 is not `GL_RGB'.
15616
15617 `GL_INVALID_OPERATION' is generated if TYPE is one of
15618 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15619 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15620 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15621 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15622 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15623
15624 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15625 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15626 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15627
15628 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15629 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15630 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15631
15632 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15633 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15634 data store is currently mapped.
15635
15636 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15637 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15638 unpacked from the buffer object such that the memory reads required
15639 would exceed the data store size.
15640
15641 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15642 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15643 divisible into the number of bytes needed to store in memory a datum
15644 indicated by TYPE.
15645
15646 `GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
15647 between the execution of `glBegin' and the corresponding execution of
15648 `glEnd'.")
15649
15650 (define-gl-procedures
15651 ((glTexImage2D
15652 (target GLenum)
15653 (level GLint)
15654 (internalFormat GLint)
15655 (width GLsizei)
15656 (height GLsizei)
15657 (border GLint)
15658 (format GLenum)
15659 (type GLenum)
15660 (data const-GLvoid-*)
15661 ->
15662 void))
15663 "Specify a two-dimensional texture image.
15664
15665 TARGET
15666 Specifies the target texture. Must be `GL_TEXTURE_2D',
15667 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
15668 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
15669 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
15670 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
15671
15672 LEVEL
15673 Specifies the level-of-detail number. Level 0 is the base image
15674 level. Level N is the Nth mipmap reduction image.
15675
15676 INTERNALFORMAT
15677 Specifies the number of color components in the texture. Must be 1,
15678 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
15679 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15680 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
15681 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
15682 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
15683 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
15684 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
15685 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
15686 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15687 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15688 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15689 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
15690 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
15691 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
15692 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
15693 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
15694 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
15695 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
15696 `GL_SRGB8_ALPHA8'.
15697
15698 WIDTH
15699 Specifies the width of the texture image including the border if
15700 any. If the GL version does not support non-power-of-two sizes,
15701 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
15702 implementations support texture images that are at least 64 texels
15703 wide.
15704
15705 HEIGHT
15706 Specifies the height of the texture image including the border if
15707 any. If the GL version does not support non-power-of-two sizes,
15708 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
15709 implementations support texture images that are at least 64 texels
15710 high.
15711
15712 BORDER
15713 Specifies the width of the border. Must be either 0 or 1.
15714
15715 FORMAT
15716 Specifies the format of the pixel data. The following symbolic
15717 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
15718 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
15719 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
15720
15721 TYPE
15722 Specifies the data type of the pixel data. The following symbolic
15723 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
15724 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
15725 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15726 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
15727 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15728 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15729 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15730 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
15731
15732 DATA
15733 Specifies a pointer to the image data in memory.
15734
15735 Texturing maps a portion of a specified texture image onto each
15736 graphical primitive for which texturing is enabled. To enable and
15737 disable two-dimensional texturing, call `glEnable' and `glDisable' with
15738 argument `GL_TEXTURE_2D'. To enable and disable texturing using
15739 cube-mapped texture, call `glEnable' and `glDisable' with argument
15740 `GL_TEXTURE_CUBE_MAP'.
15741
15742 To define texture images, call `glTexImage2D'. The arguments describe
15743 the parameters of the texture image, such as height, width, width of the
15744 border, level-of-detail number (see `glTexParameter'), and number of
15745 color components provided. The last three arguments describe how the
15746 image is represented in memory; they are identical to the pixel formats
15747 used for `glDrawPixels'.
15748
15749 If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
15750 data is read from DATA, but all of the texture image state is
15751 recalculated, checked for consistency, and checked against the
15752 implementation's capabilities. If the implementation cannot handle a
15753 texture of the requested texture size, it sets all of the image state to
15754 0, but does not generate an error (see `glGetError'). To query for an
15755 entire mipmap array, use an image array level greater than or equal to
15756 1.
15757
15758 If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
15759 targets, data is read from DATA as a sequence of signed or unsigned
15760 bytes, shorts, or longs, or single-precision floating-point values,
15761 depending on TYPE. These values are grouped into sets of one, two,
15762 three, or four values, depending on FORMAT, to form elements. If TYPE is
15763 `GL_BITMAP', the data is considered as a string of unsigned bytes (and
15764 FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
15765 1-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
15766 (see `glPixelStore').
15767
15768 If a non-zero named buffer object is bound to the
15769 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
15770 image is specified, DATA is treated as a byte offset into the buffer
15771 object's data store.
15772
15773 The first element corresponds to the lower left corner of the texture
15774 image. Subsequent elements progress left-to-right through the remaining
15775 texels in the lowest row of the texture image, and then in successively
15776 higher rows of the texture image. The final element corresponds to the
15777 upper right corner of the texture image.
15778
15779 FORMAT determines the composition of each element in DATA. It can assume
15780 one of these symbolic values:
15781
15782 `GL_COLOR_INDEX'
15783 Each element is a single value, a color index. The GL converts it
15784 to fixed point (with an unspecified number of zero bits to the
15785 right of the binary point), shifted left or right depending on the
15786 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
15787 (see `glPixelTransfer'). The resulting index is converted to a set
15788 of color components using the `GL_PIXEL_MAP_I_TO_R',
15789 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
15790 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
15791
15792 `GL_RED'
15793 Each element is a single red component. The GL converts it to
15794 floating point and assembles it into an RGBA element by attaching 0
15795 for green and blue, and 1 for alpha. Each component is then
15796 multiplied by the signed scale factor `GL_c_SCALE', added to the
15797 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15798 `glPixelTransfer').
15799
15800 `GL_GREEN'
15801 Each element is a single green component. The GL converts it to
15802 floating point and assembles it into an RGBA element by attaching 0
15803 for red and blue, and 1 for alpha. Each component is then
15804 multiplied by the signed scale factor `GL_c_SCALE', added to the
15805 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15806 `glPixelTransfer').
15807
15808 `GL_BLUE'
15809 Each element is a single blue component. The GL converts it to
15810 floating point and assembles it into an RGBA element by attaching 0
15811 for red and green, and 1 for alpha. Each component is then
15812 multiplied by the signed scale factor `GL_c_SCALE', added to the
15813 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15814 `glPixelTransfer').
15815
15816 `GL_ALPHA'
15817 Each element is a single alpha component. The GL converts it to
15818 floating point and assembles it into an RGBA element by attaching 0
15819 for red, green, and blue. Each component is then multiplied by the
15820 signed scale factor `GL_c_SCALE', added to the signed bias
15821 `GL_c_BIAS', and clamped to the range [0,1] (see
15822 `glPixelTransfer').
15823
15824 `GL_INTENSITY'
15825 Each element is a single intensity value. The GL converts it to
15826 floating point, then assembles it into an RGBA element by
15827 replicating the intensity value three times for red, green, blue,
15828 and alpha. Each component is then multiplied by the signed scale
15829 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
15830 clamped to the range [0,1] (see `glPixelTransfer').
15831
15832 `GL_RGB'
15833 `GL_BGR'
15834 Each element is an RGB triple. The GL converts it to floating point
15835 and assembles it into an RGBA element by attaching 1 for alpha.
15836 Each component is then multiplied by the signed scale factor
15837 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15838 the range [0,1] (see `glPixelTransfer').
15839
15840 `GL_RGBA'
15841 `GL_BGRA'
15842 Each element contains all four components. Each component is
15843 multiplied by the signed scale factor `GL_c_SCALE', added to the
15844 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
15845 `glPixelTransfer').
15846
15847 `GL_LUMINANCE'
15848 Each element is a single luminance value. The GL converts it to
15849 floating point, then assembles it into an RGBA element by
15850 replicating the luminance value three times for red, green, and
15851 blue and attaching 1 for alpha. Each component is then multiplied
15852 by the signed scale factor `GL_c_SCALE', added to the signed bias
15853 `GL_c_BIAS', and clamped to the range [0,1] (see
15854 `glPixelTransfer').
15855
15856 `GL_LUMINANCE_ALPHA'
15857 Each element is a luminance/alpha pair. The GL converts it to
15858 floating point, then assembles it into an RGBA element by
15859 replicating the luminance value three times for red, green, and
15860 blue. Each component is then multiplied by the signed scale factor
15861 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
15862 the range [0,1] (see `glPixelTransfer').
15863
15864 `GL_DEPTH_COMPONENT'
15865 Each element is a single depth value. The GL converts it to
15866 floating point, multiplies by the signed scale factor
15867 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
15868 to the range [0,1] (see `glPixelTransfer').
15869
15870 Refer to the `glDrawPixels' reference page for a description of the
15871 acceptable values for the TYPE parameter.
15872
15873 If an application wants to store the texture at a certain resolution or
15874 in a certain format, it can request the resolution and format with
15875 INTERNALFORMAT. The GL will choose an internal representation that
15876 closely approximates that requested by INTERNALFORMAT, but it may not
15877 match exactly. (The representations specified by `GL_LUMINANCE',
15878 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
15879 numeric values 1, 2, 3, and 4 may also be used to specify the above
15880 representations.)
15881
15882 If the INTERNALFORMAT parameter is one of the generic compressed
15883 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
15884 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
15885 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
15886 internal format with the symbolic constant for a specific internal
15887 format and compress the texture before storage. If no corresponding
15888 internal format is available, or the GL can not compress that image for
15889 any reason, the internal format is instead replaced with a corresponding
15890 base internal format.
15891
15892 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
15893 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
15894 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
15895 treated as if the red, green, blue, or luminance components are encoded
15896 in the sRGB color space. Any alpha component is left unchanged. The
15897 conversion from the sRGB encoded component C_S to a linear component C_L
15898 is:
15899
15900 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
15901 C_S>0.04045)
15902
15903 Assume C_S is the sRGB component in the range [0,1].
15904
15905 Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
15906 try out a resolution and format. The implementation will update and
15907 recompute its best match for the requested storage resolution and
15908 format. To then query this state, call `glGetTexLevelParameter'. If the
15909 texture cannot be accommodated, texture state is set to 0.
15910
15911 A one-component texture image uses only the red component of the RGBA
15912 color extracted from DATA. A two-component image uses the R and A
15913 values. A three-component image uses the R, G, and B values. A
15914 four-component image uses all of the RGBA components.
15915
15916 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
15917 during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
15918 \xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
15919 generate a boolean result. See `glTexParameter' for details on texture
15920 comparison.
15921
15922 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
15923 `GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
15924 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
15925 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
15926 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
15927
15928 `GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
15929 image targets and the width and height parameters are not equal.
15930
15931 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
15932
15933 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
15934 `GL_COLOR_INDEX'.
15935
15936 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15937 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15938
15939 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
15940
15941 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
15942 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
15943
15944 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
15945 one of the accepted resolution and format symbolic constants.
15946
15947 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
15948 greater than 2 + `GL_MAX_TEXTURE_SIZE'.
15949
15950 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
15951 supported and the WIDTH or HEIGHT cannot be represented as
15952 2^K+2\u2061(BORDER,) for some integer value of K.
15953
15954 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
15955
15956 `GL_INVALID_OPERATION' is generated if TYPE is one of
15957 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
15958 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
15959 is not `GL_RGB'.
15960
15961 `GL_INVALID_OPERATION' is generated if TYPE is one of
15962 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
15963 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
15964 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
15965 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
15966 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
15967
15968 `GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
15969 `GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
15970 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15971 `GL_DEPTH_COMPONENT32'.
15972
15973 `GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
15974 and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
15975 `GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
15976
15977 `GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
15978 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
15979 `GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
15980
15981 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15982 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
15983 data store is currently mapped.
15984
15985 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15986 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
15987 unpacked from the buffer object such that the memory reads required
15988 would exceed the data store size.
15989
15990 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15991 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
15992 divisible into the number of bytes needed to store in memory a datum
15993 indicated by TYPE.
15994
15995 `GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
15996 between the execution of `glBegin' and the corresponding execution of
15997 `glEnd'.")
15998
15999 (define-gl-procedures
16000 ((glTexImage3D
16001 (target GLenum)
16002 (level GLint)
16003 (internalFormat GLint)
16004 (width GLsizei)
16005 (height GLsizei)
16006 (depth GLsizei)
16007 (border GLint)
16008 (format GLenum)
16009 (type GLenum)
16010 (data const-GLvoid-*)
16011 ->
16012 void))
16013 "Specify a three-dimensional texture image.
16014
16015 TARGET
16016 Specifies the target texture. Must be `GL_TEXTURE_3D' or
16017 `GL_PROXY_TEXTURE_3D'.
16018
16019 LEVEL
16020 Specifies the level-of-detail number. Level 0 is the base image
16021 level. Level N is the N^TH mipmap reduction image.
16022
16023 INTERNALFORMAT
16024 Specifies the number of color components in the texture. Must be 1,
16025 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
16026 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
16027 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
16028 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
16029 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
16030 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
16031 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
16032 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
16033 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
16034 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
16035 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
16036 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
16037 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
16038 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
16039 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
16040 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
16041 `GL_SRGB8_ALPHA8'.
16042
16043 WIDTH
16044 Specifies the width of the texture image including the border if
16045 any. If the GL version does not support non-power-of-two sizes,
16046 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
16047 implementations support 3D texture images that are at least 16
16048 texels wide.
16049
16050 HEIGHT
16051 Specifies the height of the texture image including the border if
16052 any. If the GL version does not support non-power-of-two sizes,
16053 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
16054 implementations support 3D texture images that are at least 16
16055 texels high.
16056
16057 DEPTH
16058 Specifies the depth of the texture image including the border if
16059 any. If the GL version does not support non-power-of-two sizes,
16060 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
16061 implementations support 3D texture images that are at least 16
16062 texels deep.
16063
16064 BORDER
16065 Specifies the width of the border. Must be either 0 or 1.
16066
16067 FORMAT
16068 Specifies the format of the pixel data. The following symbolic
16069 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16070 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16071 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16072
16073 TYPE
16074 Specifies the data type of the pixel data. The following symbolic
16075 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16076 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16077 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16078 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16079 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16080 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16081 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16082 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16083
16084 DATA
16085 Specifies a pointer to the image data in memory.
16086
16087 Texturing maps a portion of a specified texture image onto each
16088 graphical primitive for which texturing is enabled. To enable and
16089 disable three-dimensional texturing, call `glEnable' and `glDisable'
16090 with argument `GL_TEXTURE_3D'.
16091
16092 To define texture images, call `glTexImage3D'. The arguments describe
16093 the parameters of the texture image, such as height, width, depth, width
16094 of the border, level-of-detail number (see `glTexParameter'), and number
16095 of color components provided. The last three arguments describe how the
16096 image is represented in memory; they are identical to the pixel formats
16097 used for `glDrawPixels'.
16098
16099 If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
16100 of the texture image state is recalculated, checked for consistency, and
16101 checked against the implementation's capabilities. If the implementation
16102 cannot handle a texture of the requested texture size, it sets all of
16103 the image state to 0, but does not generate an error (see `glGetError').
16104 To query for an entire mipmap array, use an image array level greater
16105 than or equal to 1.
16106
16107 If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
16108 signed or unsigned bytes, shorts, or longs, or single-precision
16109 floating-point values, depending on TYPE. These values are grouped into
16110 sets of one, two, three, or four values, depending on FORMAT, to form
16111 elements. If TYPE is `GL_BITMAP', the data is considered as a string of
16112 unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
16113 treated as eight 1-bit elements, with bit ordering determined by
16114 `GL_UNPACK_LSB_FIRST' (see `glPixelStore').
16115
16116 If a non-zero named buffer object is bound to the
16117 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16118 image is specified, DATA is treated as a byte offset into the buffer
16119 object's data store.
16120
16121 The first element corresponds to the lower left corner of the texture
16122 image. Subsequent elements progress left-to-right through the remaining
16123 texels in the lowest row of the texture image, and then in successively
16124 higher rows of the texture image. The final element corresponds to the
16125 upper right corner of the texture image.
16126
16127 FORMAT determines the composition of each element in DATA. It can assume
16128 one of these symbolic values:
16129
16130 `GL_COLOR_INDEX'
16131 Each element is a single value, a color index. The GL converts it
16132 to fixed point (with an unspecified number of zero bits to the
16133 right of the binary point), shifted left or right depending on the
16134 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
16135 (see `glPixelTransfer'). The resulting index is converted to a set
16136 of color components using the `GL_PIXEL_MAP_I_TO_R',
16137 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16138 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
16139
16140 `GL_RED'
16141 Each element is a single red component. The GL converts it to
16142 floating point and assembles it into an RGBA element by attaching 0
16143 for green and blue, and 1 for alpha. Each component is then
16144 multiplied by the signed scale factor `GL_c_SCALE', added to the
16145 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16146 `glPixelTransfer').
16147
16148 `GL_GREEN'
16149 Each element is a single green component. The GL converts it to
16150 floating point and assembles it into an RGBA element by attaching 0
16151 for red and blue, and 1 for alpha. Each component is then
16152 multiplied by the signed scale factor `GL_c_SCALE', added to the
16153 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16154 `glPixelTransfer').
16155
16156 `GL_BLUE'
16157 Each element is a single blue component. The GL converts it to
16158 floating point and assembles it into an RGBA element by attaching 0
16159 for red and green, and 1 for alpha. Each component is then
16160 multiplied by the signed scale factor `GL_c_SCALE', added to the
16161 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16162 `glPixelTransfer').
16163
16164 `GL_ALPHA'
16165 Each element is a single alpha component. The GL converts it to
16166 floating point and assembles it into an RGBA element by attaching 0
16167 for red, green, and blue. Each component is then multiplied by the
16168 signed scale factor `GL_c_SCALE', added to the signed bias
16169 `GL_c_BIAS', and clamped to the range [0,1] (see
16170 `glPixelTransfer').
16171
16172 `GL_INTENSITY'
16173 Each element is a single intensity value. The GL converts it to
16174 floating point, then assembles it into an RGBA element by
16175 replicating the intensity value three times for red, green, blue,
16176 and alpha. Each component is then multiplied by the signed scale
16177 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
16178 clamped to the range [0,1] (see `glPixelTransfer').
16179
16180 `GL_RGB'
16181 `GL_BGR'
16182 Each element is an RGB triple. The GL converts it to floating point
16183 and assembles it into an RGBA element by attaching 1 for alpha.
16184 Each component is then multiplied by the signed scale factor
16185 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16186 the range [0,1] (see `glPixelTransfer').
16187
16188 `GL_RGBA'
16189 `GL_BGRA'
16190 Each element contains all four components. Each component is
16191 multiplied by the signed scale factor `GL_c_SCALE', added to the
16192 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
16193 `glPixelTransfer').
16194
16195 `GL_LUMINANCE'
16196 Each element is a single luminance value. The GL converts it to
16197 floating point, then assembles it into an RGBA element by
16198 replicating the luminance value three times for red, green, and
16199 blue and attaching 1 for alpha. Each component is then multiplied
16200 by the signed scale factor `GL_c_SCALE', added to the signed bias
16201 `GL_c_BIAS', and clamped to the range [0,1] (see
16202 `glPixelTransfer').
16203
16204 `GL_LUMINANCE_ALPHA'
16205 Each element is a luminance/alpha pair. The GL converts it to
16206 floating point, then assembles it into an RGBA element by
16207 replicating the luminance value three times for red, green, and
16208 blue. Each component is then multiplied by the signed scale factor
16209 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
16210 the range [0,1] (see `glPixelTransfer').
16211
16212 Refer to the `glDrawPixels' reference page for a description of the
16213 acceptable values for the TYPE parameter.
16214
16215 If an application wants to store the texture at a certain resolution or
16216 in a certain format, it can request the resolution and format with
16217 INTERNALFORMAT. The GL will choose an internal representation that
16218 closely approximates that requested by INTERNALFORMAT, but it may not
16219 match exactly. (The representations specified by `GL_LUMINANCE',
16220 `GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
16221 numeric values 1, 2, 3, and 4 may also be used to specify the above
16222 representations.)
16223
16224 If the INTERNALFORMAT parameter is one of the generic compressed
16225 formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
16226 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
16227 `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
16228 internal format with the symbolic constant for a specific internal
16229 format and compress the texture before storage. If no corresponding
16230 internal format is available, or the GL can not compress that image for
16231 any reason, the internal format is instead replaced with a corresponding
16232 base internal format.
16233
16234 If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
16235 `GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
16236 `GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
16237 treated as if the red, green, blue, or luminance components are encoded
16238 in the sRGB color space. Any alpha component is left unchanged. The
16239 conversion from the sRGB encoded component C_S to a linear component C_L
16240 is:
16241
16242 C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
16243 C_S>0.04045)
16244
16245 Assume C_S is the sRGB component in the range [0,1].
16246
16247 Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
16248 The implementation will update and recompute its best match for the
16249 requested storage resolution and format. To then query this state, call
16250 `glGetTexLevelParameter'. If the texture cannot be accommodated, texture
16251 state is set to 0.
16252
16253 A one-component texture image uses only the red component of the RGBA
16254 color extracted from DATA. A two-component image uses the R and A
16255 values. A three-component image uses the R, G, and B values. A
16256 four-component image uses all of the RGBA components.
16257
16258 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
16259 `GL_PROXY_TEXTURE_3D'.
16260
16261 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16262 constant. Format constants other than `GL_STENCIL_INDEX' and
16263 `GL_DEPTH_COMPONENT' are accepted.
16264
16265 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16266
16267 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16268 `GL_COLOR_INDEX'.
16269
16270 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16271
16272 `GL_INVALID_VALUE' may be generated if LEVEL is greater than
16273 LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16274
16275 `GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
16276 one of the accepted resolution and format symbolic constants.
16277
16278 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16279 0 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
16280
16281 `GL_INVALID_VALUE' is generated if non-power-of-two textures are not
16282 supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
16283 2^K+2\u2061(BORDER,) for some integer value of K.
16284
16285 `GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
16286
16287 `GL_INVALID_OPERATION' is generated if TYPE is one of
16288 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16289 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16290 is not `GL_RGB'.
16291
16292 `GL_INVALID_OPERATION' is generated if TYPE is one of
16293 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16294 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16295 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16296 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16297 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16298
16299 `GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
16300 `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
16301 `GL_DEPTH_COMPONENT32'.
16302
16303 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16304 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16305 data store is currently mapped.
16306
16307 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16308 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16309 unpacked from the buffer object such that the memory reads required
16310 would exceed the data store size.
16311
16312 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16313 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16314 divisible into the number of bytes needed to store in memory a datum
16315 indicated by TYPE.
16316
16317 `GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
16318 between the execution of `glBegin' and the corresponding execution of
16319 `glEnd'.")
16320
16321 (define-gl-procedures
16322 ((glTexParameterf
16323 (target GLenum)
16324 (pname GLenum)
16325 (param GLfloat)
16326 ->
16327 void)
16328 (glTexParameteri
16329 (target GLenum)
16330 (pname GLenum)
16331 (param GLint)
16332 ->
16333 void))
16334 "Set texture parameters.
16335
16336 TARGET
16337 Specifies the target texture, which must be either `GL_TEXTURE_1D',
16338 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
16339
16340 PNAME
16341 Specifies the symbolic name of a single-valued texture parameter.
16342 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
16343 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
16344 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
16345 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
16346 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
16347 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
16348 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
16349
16350 PARAM
16351 Specifies the value of PNAME.
16352
16353 Texture mapping is a technique that applies an image onto an object's
16354 surface as if the image were a decal or cellophane shrink-wrap. The
16355 image is created in texture space, with an (S , T ) coordinate system. A
16356 texture is a one- or two-dimensional image and a set of parameters that
16357 determine how samples are derived from the image.
16358
16359 `glTexParameter' assigns the value or values in PARAMS to the texture
16360 parameter specified as PNAME. TARGET defines the target texture, either
16361 `GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
16362 symbols are accepted in PNAME:
16363
16364 `GL_TEXTURE_MIN_FILTER'
16365 The texture minifying function is used whenever the pixel being
16366 textured maps to an area greater than one texture element. There
16367 are six defined minifying functions. Two of them use the nearest
16368 one or nearest four texture elements to compute the texture value.
16369 The other four use mipmaps.
16370
16371 A mipmap is an ordered set of arrays representing the same image at
16372 progressively lower resolutions. If the texture has dimensions
16373 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
16374 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
16375 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
16376 the previous mipmap, until either K=0 or L=0 . At that point,
16377 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
16378 final mipmap, which has dimension 1×1 . To define the mipmaps, call
16379 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
16380 or `glCopyTexImage2D' with the LEVEL argument indicating the order
16381 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
16382 the final 1×1 mipmap.
16383
16384 PARAMS supplies a function for minifying the texture as one of the
16385 following:
16386
16387 As more texture elements are sampled in the minification process,
16388 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
16389 and `GL_LINEAR' minification functions can be faster than the other
16390 four, they sample only one or four texture elements to determine
16391 the texture value of the pixel being rendered and can produce moire
16392 patterns or ragged transitions. The initial value of
16393 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
16394
16395 `GL_TEXTURE_MAG_FILTER'
16396 The texture magnification function is used when the pixel being
16397 textured maps to an area less than or equal to one texture element.
16398 It sets the texture magnification function to either `GL_NEAREST'
16399 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
16400 `GL_LINEAR', but it can produce textured images with sharper edges
16401 because the transition between texture elements is not as smooth.
16402 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
16403
16404 `GL_NEAREST'
16405 Returns the value of the texture element that is nearest (in
16406 Manhattan distance) to the center of the pixel being textured.
16407
16408 `GL_LINEAR'
16409 Returns the weighted average of the four texture elements that are
16410 closest to the center of the pixel being textured. These can
16411 include border texture elements, depending on the values of
16412 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16413 mapping.
16414
16415 `GL_NEAREST_MIPMAP_NEAREST'
16416 Chooses the mipmap that most closely matches the size of the pixel
16417 being textured and uses the `GL_NEAREST' criterion (the texture
16418 element nearest to the center of the pixel) to produce a texture
16419 value.
16420
16421 `GL_LINEAR_MIPMAP_NEAREST'
16422 Chooses the mipmap that most closely matches the size of the pixel
16423 being textured and uses the `GL_LINEAR' criterion (a weighted
16424 average of the four texture elements that are closest to the center
16425 of the pixel) to produce a texture value.
16426
16427 `GL_NEAREST_MIPMAP_LINEAR'
16428 Chooses the two mipmaps that most closely match the size of the
16429 pixel being textured and uses the `GL_NEAREST' criterion (the
16430 texture element nearest to the center of the pixel) to produce a
16431 texture value from each mipmap. The final texture value is a
16432 weighted average of those two values.
16433
16434 `GL_LINEAR_MIPMAP_LINEAR'
16435 Chooses the two mipmaps that most closely match the size of the
16436 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
16437 average of the four texture elements that are closest to the center
16438 of the pixel) to produce a texture value from each mipmap. The
16439 final texture value is a weighted average of those two values.
16440
16441 `GL_NEAREST'
16442 Returns the value of the texture element that is nearest (in
16443 Manhattan distance) to the center of the pixel being textured.
16444
16445 `GL_LINEAR'
16446 Returns the weighted average of the four texture elements that are
16447 closest to the center of the pixel being textured. These can
16448 include border texture elements, depending on the values of
16449 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
16450 mapping.
16451
16452
16453
16454 `GL_TEXTURE_MIN_LOD'
16455 Sets the minimum level-of-detail parameter. This floating-point
16456 value limits the selection of highest resolution mipmap (lowest
16457 mipmap level). The initial value is -1000.
16458
16459
16460
16461 `GL_TEXTURE_MAX_LOD'
16462 Sets the maximum level-of-detail parameter. This floating-point
16463 value limits the selection of the lowest resolution mipmap (highest
16464 mipmap level). The initial value is 1000.
16465
16466
16467
16468 `GL_TEXTURE_BASE_LEVEL'
16469 Specifies the index of the lowest defined mipmap level. This is an
16470 integer value. The initial value is 0.
16471
16472
16473
16474 `GL_TEXTURE_MAX_LEVEL'
16475 Sets the index of the highest defined mipmap level. This is an
16476 integer value. The initial value is 1000.
16477
16478
16479
16480 `GL_TEXTURE_WRAP_S'
16481 Sets the wrap parameter for texture coordinate S to either
16482 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16483 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
16484 coordinates to be clamped to the range [0,1] and is useful for
16485 preventing wrapping artifacts when mapping a single image onto an
16486 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
16487 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
16488 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
16489 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
16490 the size of the texture in the direction of clamping. `GL_REPEAT'
16491 causes the integer part of the S coordinate to be ignored; the GL
16492 uses only the fractional part, thereby creating a repeating
16493 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
16494 the fractional part of the texture coordinate if the integer part
16495 of S is even; if the integer part of S is odd, then the S texture
16496 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
16497 fractional part of S . Border texture elements are accessed only if
16498 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
16499 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
16500
16501
16502
16503 `GL_TEXTURE_WRAP_T'
16504 Sets the wrap parameter for texture coordinate T to either
16505 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16506 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16507 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
16508 `GL_REPEAT'.
16509
16510 `GL_TEXTURE_WRAP_R'
16511 Sets the wrap parameter for texture coordinate R to either
16512 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
16513 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
16514 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
16515 `GL_REPEAT'.
16516
16517 `GL_TEXTURE_BORDER_COLOR'
16518 Sets a border color. PARAMS contains four values that comprise the
16519 RGBA color of the texture border. Integer color components are
16520 interpreted linearly such that the most positive integer maps to
16521 1.0, and the most negative integer maps to -1.0. The values are
16522 clamped to the range [0,1] when they are specified. Initially, the
16523 border color is (0, 0, 0, 0).
16524
16525 `GL_TEXTURE_PRIORITY'
16526 Specifies the texture residence priority of the currently bound
16527 texture. Permissible values are in the range [0,1] . See
16528 `glPrioritizeTextures' and `glBindTexture' for more information.
16529
16530 `GL_TEXTURE_COMPARE_MODE'
16531 Specifies the texture comparison mode for currently bound depth
16532 textures. That is, a texture whose internal format is
16533 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
16534
16535 `GL_TEXTURE_COMPARE_FUNC'
16536 Specifies the comparison operator used when
16537 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
16538 Permissible values are: where R is the current interpolated texture
16539 coordinate, and D_T is the depth texture value sampled from the
16540 currently bound depth texture. RESULT is assigned to the either the
16541 luminance, intensity, or alpha (as specified by
16542 `GL_DEPTH_TEXTURE_MODE'.)
16543
16544 `GL_DEPTH_TEXTURE_MODE'
16545 Specifies a single symbolic constant indicating how depth values
16546 should be treated during filtering and texture application.
16547 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
16548 The initial value is `GL_LUMINANCE'.
16549
16550 `GL_GENERATE_MIPMAP'
16551 Specifies a boolean value that indicates if all levels of a mipmap
16552 array should be automatically updated when any modification to the
16553 base level mipmap is done. The initial value is `GL_FALSE'.
16554
16555 `GL_COMPARE_R_TO_TEXTURE'
16556 Specifies that the interpolated and clamped R texture coordinate
16557 should be compared to the value in the currently bound depth
16558 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
16559 details of how the comparison is evaluated. The result of the
16560 comparison is assigned to luminance, intensity, or alpha (as
16561 specified by `GL_DEPTH_TEXTURE_MODE').
16562
16563 `GL_NONE'
16564 Specifies that the luminance, intensity, or alpha (as specified by
16565 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
16566 from the currently bound depth texture.
16567
16568 *Texture Comparison Function*
16569 *Computed result*
16570
16571 `GL_LEQUAL'
16572 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
16573
16574 `GL_GEQUAL'
16575 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
16576
16577 `GL_LESS'
16578 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
16579
16580 `GL_GREATER'
16581 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
16582
16583 `GL_EQUAL'
16584 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
16585
16586 `GL_NOTEQUAL'
16587 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
16588
16589 `GL_ALWAYS'
16590 RESULT=`1.0'
16591
16592 `GL_NEVER'
16593 RESULT=`0.0'
16594
16595 `GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
16596 accepted defined values.
16597
16598 `GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
16599 value (based on the value of PNAME) and does not.
16600
16601 `GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
16602 between the execution of `glBegin' and the corresponding execution of
16603 `glEnd'.")
16604
16605 (define-gl-procedures
16606 ((glTexSubImage1D
16607 (target GLenum)
16608 (level GLint)
16609 (xoffset GLint)
16610 (width GLsizei)
16611 (format GLenum)
16612 (type GLenum)
16613 (data const-GLvoid-*)
16614 ->
16615 void))
16616 "Specify a one-dimensional texture subimage.
16617
16618 TARGET
16619 Specifies the target texture. Must be `GL_TEXTURE_1D'.
16620
16621 LEVEL
16622 Specifies the level-of-detail number. Level 0 is the base image
16623 level. Level N is the Nth mipmap reduction image.
16624
16625 XOFFSET
16626 Specifies a texel offset in the x direction within the texture
16627 array.
16628
16629 WIDTH
16630 Specifies the width of the texture subimage.
16631
16632 FORMAT
16633 Specifies the format of the pixel data. The following symbolic
16634 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16635 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16636 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16637
16638 TYPE
16639 Specifies the data type of the pixel data. The following symbolic
16640 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16641 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16642 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16643 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16644 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16645 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16646 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16647 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16648
16649 DATA
16650 Specifies a pointer to the image data in memory.
16651
16652 Texturing maps a portion of a specified texture image onto each
16653 graphical primitive for which texturing is enabled. To enable or disable
16654 one-dimensional texturing, call `glEnable' and `glDisable' with argument
16655 `GL_TEXTURE_1D'.
16656
16657 `glTexSubImage1D' redefines a contiguous subregion of an existing
16658 one-dimensional texture image. The texels referenced by DATA replace the
16659 portion of the existing texture array with x indices XOFFSET and
16660 XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
16661 outside the range of the texture array as it was originally specified.
16662 It is not an error to specify a subtexture with width of 0, but such a
16663 specification has no effect.
16664
16665 If a non-zero named buffer object is bound to the
16666 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16667 image is specified, DATA is treated as a byte offset into the buffer
16668 object's data store.
16669
16670 `GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
16671 values.
16672
16673 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16674 constant.
16675
16676 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16677
16678 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16679 `GL_COLOR_INDEX'.
16680
16681 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16682
16683 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16684 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16685
16686 `GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
16687 (XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
16688 the width of the `GL_TEXTURE_BORDER' of the texture image being
16689 modified. Note that W includes twice the border width.
16690
16691 `GL_INVALID_VALUE' is generated if WIDTH is less than 0.
16692
16693 `GL_INVALID_OPERATION' is generated if the texture array has not been
16694 defined by a previous `glTexImage1D' operation.
16695
16696 `GL_INVALID_OPERATION' is generated if TYPE is one of
16697 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16698 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16699 is not `GL_RGB'.
16700
16701 `GL_INVALID_OPERATION' is generated if TYPE is one of
16702 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16703 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16704 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16705 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16706 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16707
16708 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16709 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16710 data store is currently mapped.
16711
16712 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16713 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16714 unpacked from the buffer object such that the memory reads required
16715 would exceed the data store size.
16716
16717 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16718 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16719 divisible into the number of bytes needed to store in memory a datum
16720 indicated by TYPE.
16721
16722 `GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
16723 between the execution of `glBegin' and the corresponding execution of
16724 `glEnd'.")
16725
16726 (define-gl-procedures
16727 ((glTexSubImage2D
16728 (target GLenum)
16729 (level GLint)
16730 (xoffset GLint)
16731 (yoffset GLint)
16732 (width GLsizei)
16733 (height GLsizei)
16734 (format GLenum)
16735 (type GLenum)
16736 (data const-GLvoid-*)
16737 ->
16738 void))
16739 "Specify a two-dimensional texture subimage.
16740
16741 TARGET
16742 Specifies the target texture. Must be `GL_TEXTURE_2D',
16743 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16744 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16745 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
16746 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16747
16748 LEVEL
16749 Specifies the level-of-detail number. Level 0 is the base image
16750 level. Level N is the Nth mipmap reduction image.
16751
16752 XOFFSET
16753 Specifies a texel offset in the x direction within the texture
16754 array.
16755
16756 YOFFSET
16757 Specifies a texel offset in the y direction within the texture
16758 array.
16759
16760 WIDTH
16761 Specifies the width of the texture subimage.
16762
16763 HEIGHT
16764 Specifies the height of the texture subimage.
16765
16766 FORMAT
16767 Specifies the format of the pixel data. The following symbolic
16768 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16769 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16770 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16771
16772 TYPE
16773 Specifies the data type of the pixel data. The following symbolic
16774 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16775 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16776 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16777 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16778 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16779 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16780 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16781 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16782
16783 DATA
16784 Specifies a pointer to the image data in memory.
16785
16786 Texturing maps a portion of a specified texture image onto each
16787 graphical primitive for which texturing is enabled. To enable and
16788 disable two-dimensional texturing, call `glEnable' and `glDisable' with
16789 argument `GL_TEXTURE_2D'.
16790
16791 `glTexSubImage2D' redefines a contiguous subregion of an existing
16792 two-dimensional texture image. The texels referenced by DATA replace the
16793 portion of the existing texture array with x indices XOFFSET and
16794 XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
16795 , inclusive. This region may not include any texels outside the range of
16796 the texture array as it was originally specified. It is not an error to
16797 specify a subtexture with zero width or height, but such a specification
16798 has no effect.
16799
16800 If a non-zero named buffer object is bound to the
16801 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16802 image is specified, DATA is treated as a byte offset into the buffer
16803 object's data store.
16804
16805 `GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
16806 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
16807 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
16808 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
16809
16810 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16811 constant.
16812
16813 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16814
16815 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16816 `GL_COLOR_INDEX'.
16817
16818 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16819
16820 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16821 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16822
16823 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16824 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
16825 `GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
16826 width of the texture image being modified. Note that W and H include
16827 twice the border width.
16828
16829 `GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
16830
16831 `GL_INVALID_OPERATION' is generated if the texture array has not been
16832 defined by a previous `glTexImage2D' operation.
16833
16834 `GL_INVALID_OPERATION' is generated if TYPE is one of
16835 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16836 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16837 is not `GL_RGB'.
16838
16839 `GL_INVALID_OPERATION' is generated if TYPE is one of
16840 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16841 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16842 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16843 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16844 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16845
16846 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16847 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16848 data store is currently mapped.
16849
16850 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16851 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16852 unpacked from the buffer object such that the memory reads required
16853 would exceed the data store size.
16854
16855 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16856 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
16857 divisible into the number of bytes needed to store in memory a datum
16858 indicated by TYPE.
16859
16860 `GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
16861 between the execution of `glBegin' and the corresponding execution of
16862 `glEnd'.")
16863
16864 (define-gl-procedures
16865 ((glTexSubImage3D
16866 (target GLenum)
16867 (level GLint)
16868 (xoffset GLint)
16869 (yoffset GLint)
16870 (zoffset GLint)
16871 (width GLsizei)
16872 (height GLsizei)
16873 (depth GLsizei)
16874 (format GLenum)
16875 (type GLenum)
16876 (data const-GLvoid-*)
16877 ->
16878 void))
16879 "Specify a three-dimensional texture subimage.
16880
16881 TARGET
16882 Specifies the target texture. Must be `GL_TEXTURE_3D'.
16883
16884 LEVEL
16885 Specifies the level-of-detail number. Level 0 is the base image
16886 level. Level N is the Nth mipmap reduction image.
16887
16888 XOFFSET
16889 Specifies a texel offset in the x direction within the texture
16890 array.
16891
16892 YOFFSET
16893 Specifies a texel offset in the y direction within the texture
16894 array.
16895
16896 ZOFFSET
16897 Specifies a texel offset in the z direction within the texture
16898 array.
16899
16900 WIDTH
16901 Specifies the width of the texture subimage.
16902
16903 HEIGHT
16904 Specifies the height of the texture subimage.
16905
16906 DEPTH
16907 Specifies the depth of the texture subimage.
16908
16909 FORMAT
16910 Specifies the format of the pixel data. The following symbolic
16911 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
16912 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
16913 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
16914
16915 TYPE
16916 Specifies the data type of the pixel data. The following symbolic
16917 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
16918 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
16919 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16920 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
16921 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16922 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16923 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16924 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
16925
16926 DATA
16927 Specifies a pointer to the image data in memory.
16928
16929 Texturing maps a portion of a specified texture image onto each
16930 graphical primitive for which texturing is enabled. To enable and
16931 disable three-dimensional texturing, call `glEnable' and `glDisable'
16932 with argument `GL_TEXTURE_3D'.
16933
16934 `glTexSubImage3D' redefines a contiguous subregion of an existing
16935 three-dimensional texture image. The texels referenced by DATA replace
16936 the portion of the existing texture array with x indices XOFFSET and
16937 XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
16938 inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
16939 region may not include any texels outside the range of the texture array
16940 as it was originally specified. It is not an error to specify a
16941 subtexture with zero width, height, or depth but such a specification
16942 has no effect.
16943
16944 If a non-zero named buffer object is bound to the
16945 `GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
16946 image is specified, DATA is treated as a byte offset into the buffer
16947 object's data store.
16948
16949 `GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
16950
16951 `GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
16952 constant.
16953
16954 `GL_INVALID_ENUM' is generated if TYPE is not a type constant.
16955
16956 `GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
16957 `GL_COLOR_INDEX'.
16958
16959 `GL_INVALID_VALUE' is generated if LEVEL is less than 0.
16960
16961 `GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
16962 where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
16963
16964 `GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
16965 , YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
16966 (ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
16967 `GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
16968 width of the texture image being modified. Note that W , H , and D
16969 include twice the border width.
16970
16971 `GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
16972 0.
16973
16974 `GL_INVALID_OPERATION' is generated if the texture array has not been
16975 defined by a previous `glTexImage3D' operation.
16976
16977 `GL_INVALID_OPERATION' is generated if TYPE is one of
16978 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
16979 `GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
16980 is not `GL_RGB'.
16981
16982 `GL_INVALID_OPERATION' is generated if TYPE is one of
16983 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
16984 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
16985 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
16986 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
16987 FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
16988
16989 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16990 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16991 data store is currently mapped.
16992
16993 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16994 bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16995 unpacked from the buffer object such that the memory reads required
16996 would exceed the data store size.
16997
16998 `GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16999 bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
17000 divisible into the number of bytes needed to store in memory a datum
17001 indicated by TYPE.
17002
17003 `GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
17004 between the execution of `glBegin' and the corresponding execution of
17005 `glEnd'.")
17006
17007 (define-gl-procedures
17008 ((glTranslatef
17009 (x GLfloat)
17010 (y GLfloat)
17011 (z GLfloat)
17012 ->
17013 void))
17014 "Multiply the current matrix by a translation matrix.
17015
17016 X
17017 Y
17018
17019 Z
17020
17021 Specify the X, Y, and Z coordinates of a translation vector.
17022
17023 `glTranslate' produces a translation by (X,YZ) . The current matrix (see
17024 `glMatrixMode') is multiplied by this translation matrix, with the
17025 product replacing the current matrix, as if `glMultMatrix' were called
17026 with the following matrix for its argument:
17027
17028 ((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
17029
17030
17031
17032 If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
17033 objects drawn after a call to `glTranslate' are translated.
17034
17035 Use `glPushMatrix' and `glPopMatrix' to save and restore the
17036 untranslated coordinate system.
17037
17038 `GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
17039 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17040
17041 (define-gl-procedures
17042 ((glUniform1f
17043 (location GLint)
17044 (v0 GLfloat)
17045 ->
17046 void)
17047 (glUniform2f
17048 (location GLint)
17049 (v0 GLfloat)
17050 (v1 GLfloat)
17051 ->
17052 void)
17053 (glUniform3f
17054 (location GLint)
17055 (v0 GLfloat)
17056 (v1 GLfloat)
17057 (v2 GLfloat)
17058 ->
17059 void)
17060 (glUniform4f
17061 (location GLint)
17062 (v0 GLfloat)
17063 (v1 GLfloat)
17064 (v2 GLfloat)
17065 (v3 GLfloat)
17066 ->
17067 void)
17068 (glUniform1i (location GLint) (v0 GLint) -> void)
17069 (glUniform2i
17070 (location GLint)
17071 (v0 GLint)
17072 (v1 GLint)
17073 ->
17074 void)
17075 (glUniform3i
17076 (location GLint)
17077 (v0 GLint)
17078 (v1 GLint)
17079 (v2 GLint)
17080 ->
17081 void)
17082 (glUniform4i
17083 (location GLint)
17084 (v0 GLint)
17085 (v1 GLint)
17086 (v2 GLint)
17087 (v3 GLint)
17088 ->
17089 void))
17090 "Specify the value of a uniform variable for the current program object.
17091
17092 LOCATION
17093 Specifies the location of the uniform variable to be modified.
17094
17095 V0, V1, V2, V3
17096 Specifies the new values to be used for the specified uniform
17097 variable.
17098
17099 `glUniform' modifies the value of a uniform variable or a uniform
17100 variable array. The location of the uniform variable to be modified is
17101 specified by LOCATION, which should be a value returned by
17102 `glGetUniformLocation'. `glUniform' operates on the program object that
17103 was made part of current state by calling `glUseProgram'.
17104
17105 The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
17106 the uniform variable specified by LOCATION using the values passed as
17107 arguments. The number specified in the command should match the number
17108 of components in the data type of the specified uniform variable (e.g.,
17109 `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
17110 `f' indicates that floating-point values are being passed; the suffix
17111 `i' indicates that integer values are being passed, and this type should
17112 also match the data type of the specified uniform variable. The `i'
17113 variants of this function should be used to provide values for uniform
17114 variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
17115 `f' variants should be used to provide values for uniform variables of
17116 type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
17117 `f' variants may be used to provide values for uniform variables of type
17118 bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
17119 be set to false if the input value is 0 or 0.0f, and it will be set to
17120 true otherwise.
17121
17122 All active uniform variables defined in a program object are initialized
17123 to 0 when the program object is linked successfully. They retain the
17124 values assigned to them by a call to `glUniform ' until the next
17125 successful link operation occurs on the program object, when they are
17126 once again initialized to 0.
17127
17128 The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
17129 uniform variable or a uniform variable array. These commands pass a
17130 count and a pointer to the values to be loaded into a uniform variable
17131 or a uniform variable array. A count of 1 should be used if modifying
17132 the value of a single uniform variable, and a count of 1 or greater can
17133 be used to modify an entire array or part of an array. When loading N
17134 elements starting at an arbitrary position M in a uniform variable
17135 array, elements M + N - 1 in the array will be replaced with the new
17136 values. If M + N - 1 is larger than the size of the uniform variable
17137 array, values for all array elements beyond the end of the array will be
17138 ignored. The number specified in the name of the command indicates the
17139 number of components for each element in VALUE, and it should match the
17140 number of components in the data type of the specified uniform variable
17141 (e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
17142 data type specified in the name of the command must match the data type
17143 for the specified uniform variable as described previously for
17144 `glUniform{1|2|3|4}{f|i}'.
17145
17146 For uniform variable arrays, each element of the array is considered to
17147 be of the type indicated in the name of the command (e.g., `glUniform3f'
17148 or `glUniform3fv' can be used to load a uniform variable array of type
17149 vec3). The number of elements of the uniform variable array to be
17150 modified is specified by COUNT
17151
17152 The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
17153 to modify a matrix or an array of matrices. The numbers in the command
17154 name are interpreted as the dimensionality of the matrix. The number `2'
17155 indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
17156 × 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
17157 (i.e., 16 values). Non-square matrix dimensionality is explicit, with
17158 the first number representing the number of columns and the second
17159 number representing the number of rows. For example, `2x4' indicates a 2
17160 × 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
17161 `GL_FALSE', each matrix is assumed to be supplied in column major order.
17162 If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
17163 major order. The COUNT argument indicates the number of matrices to be
17164 passed. A count of 1 should be used if modifying the value of a single
17165 matrix, and a count greater than 1 can be used to modify an array of
17166 matrices.
17167
17168 `GL_INVALID_OPERATION' is generated if there is no current program
17169 object.
17170
17171 `GL_INVALID_OPERATION' is generated if the size of the uniform variable
17172 declared in the shader does not match the size indicated by the
17173 `glUniform' command.
17174
17175 `GL_INVALID_OPERATION' is generated if one of the integer variants of
17176 this function is used to load a uniform variable of type float, vec2,
17177 vec3, vec4, or an array of these, or if one of the floating-point
17178 variants of this function is used to load a uniform variable of type
17179 int, ivec2, ivec3, or ivec4, or an array of these.
17180
17181 `GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
17182 location for the current program object and LOCATION is not equal to -1.
17183
17184 `GL_INVALID_VALUE' is generated if COUNT is less than 0.
17185
17186 `GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
17187 indicated uniform variable is not an array variable.
17188
17189 `GL_INVALID_OPERATION' is generated if a sampler is loaded using a
17190 command other than `glUniform1i' and `glUniform1iv'.
17191
17192 `GL_INVALID_OPERATION' is generated if `glUniform' is executed between
17193 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17194
17195 (define-gl-procedures
17196 ((glUseProgram (program GLuint) -> void))
17197 "Installs a program object as part of current rendering state.
17198
17199 PROGRAM
17200 Specifies the handle of the program object whose executables are to
17201 be used as part of current rendering state.
17202
17203 `glUseProgram' installs the program object specified by PROGRAM as part
17204 of current rendering state. One or more executables are created in a
17205 program object by successfully attaching shader objects to it with
17206 `glAttachShader', successfully compiling the shader objects with
17207 `glCompileShader', and successfully linking the program object with
17208 `glLinkProgram'.
17209
17210 A program object will contain an executable that will run on the vertex
17211 processor if it contains one or more shader objects of type
17212 `GL_VERTEX_SHADER' that have been successfully compiled and linked.
17213 Similarly, a program object will contain an executable that will run on
17214 the fragment processor if it contains one or more shader objects of type
17215 `GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
17216
17217 Successfully installing an executable on a programmable processor will
17218 cause the corresponding fixed functionality of OpenGL to be disabled.
17219 Specifically, if an executable is installed on the vertex processor, the
17220 OpenGL fixed functionality will be disabled as follows.
17221
17222 * The projection matrix is not applied to vertex coordinates.
17223
17224 * The texture matrices are not applied to texture coordinates.
17225
17226 * Normals are not transformed to eye coordinates.
17227
17228 * Normals are not rescaled or normalized.
17229
17230 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
17231 performed.
17232
17233 * Texture coordinates are not generated automatically.
17234
17235 * Per-vertex lighting is not performed.
17236
17237 * Color material computations are not performed.
17238
17239 * Color index lighting is not performed.
17240
17241 * This list also applies when setting the current raster position.
17242
17243 The executable that is installed on the vertex processor is expected to
17244 implement any or all of the desired functionality from the preceding
17245 list. Similarly, if an executable is installed on the fragment
17246 processor, the OpenGL fixed functionality will be disabled as follows.
17247
17248 * Texture application is not applied.
17249
17250 * Color sum is not applied.
17251
17252 * Fog is not applied.
17253
17254 Again, the fragment shader that is installed is expected to implement
17255 any or all of the desired functionality from the preceding list.
17256
17257 While a program object is in use, applications are free to modify
17258 attached shader objects, compile attached shader objects, attach
17259 additional shader objects, and detach or delete shader objects. None of
17260 these operations will affect the executables that are part of the
17261 current state. However, relinking the program object that is currently
17262 in use will install the program object as part of the current rendering
17263 state if the link operation was successful (see `glLinkProgram' ). If
17264 the program object currently in use is relinked unsuccessfully, its link
17265 status will be set to `GL_FALSE', but the executables and associated
17266 state will remain part of the current state until a subsequent call to
17267 `glUseProgram' removes it from use. After it is removed from use, it
17268 cannot be made part of current state until it has been successfully
17269 relinked.
17270
17271 If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
17272 does not contain shader objects of type `GL_FRAGMENT_SHADER', an
17273 executable will be installed on the vertex processor, but fixed
17274 functionality will be used for fragment processing. Similarly, if
17275 PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
17276 not contain shader objects of type `GL_VERTEX_SHADER', an executable
17277 will be installed on the fragment processor, but fixed functionality
17278 will be used for vertex processing. If PROGRAM is 0, the programmable
17279 processors will be disabled, and fixed functionality will be used for
17280 both vertex and fragment processing.
17281
17282 `GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
17283 generated by OpenGL.
17284
17285 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17286
17287 `GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
17288 current state.
17289
17290 `GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
17291 between the execution of `glBegin' and the corresponding execution of
17292 `glEnd'.")
17293
17294 (define-gl-procedures
17295 ((glValidateProgram (program GLuint) -> void))
17296 "Validates a program object.
17297
17298 PROGRAM
17299 Specifies the handle of the program object to be validated.
17300
17301 `glValidateProgram' checks to see whether the executables contained in
17302 PROGRAM can execute given the current OpenGL state. The information
17303 generated by the validation process will be stored in PROGRAM's
17304 information log. The validation information may consist of an empty
17305 string, or it may be a string containing information about how the
17306 current program object interacts with the rest of current OpenGL state.
17307 This provides a way for OpenGL implementers to convey more information
17308 about why the current program is inefficient, suboptimal, failing to
17309 execute, and so on.
17310
17311 The status of the validation operation will be stored as part of the
17312 program object's state. This value will be set to `GL_TRUE' if the
17313 validation succeeded, and `GL_FALSE' otherwise. It can be queried by
17314 calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
17315 If validation is successful, PROGRAM is guaranteed to execute given the
17316 current state. Otherwise, PROGRAM is guaranteed to not execute.
17317
17318 This function is typically useful only during application development.
17319 The informational string stored in the information log is completely
17320 implementation dependent; therefore, an application should not expect
17321 different OpenGL implementations to produce identical information
17322 strings.
17323
17324 `GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
17325 OpenGL.
17326
17327 `GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
17328
17329 `GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
17330 between the execution of `glBegin' and the corresponding execution of
17331 `glEnd'.")
17332
17333 (define-gl-procedures
17334 ((glVertexAttribPointer
17335 (index GLuint)
17336 (size GLint)
17337 (type GLenum)
17338 (normalized GLboolean)
17339 (stride GLsizei)
17340 (pointer const-GLvoid-*)
17341 ->
17342 void))
17343 "Define an array of generic vertex attribute data.
17344
17345 INDEX
17346 Specifies the index of the generic vertex attribute to be modified.
17347
17348 SIZE
17349 Specifies the number of components per generic vertex attribute.
17350 Must be 1, 2, 3, or 4. The initial value is 4.
17351
17352 TYPE
17353 Specifies the data type of each component in the array. Symbolic
17354 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
17355 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
17356 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
17357
17358 NORMALIZED
17359 Specifies whether fixed-point data values should be normalized
17360 (`GL_TRUE') or converted directly as fixed-point values
17361 (`GL_FALSE') when they are accessed.
17362
17363 STRIDE
17364 Specifies the byte offset between consecutive generic vertex
17365 attributes. If STRIDE is 0, the generic vertex attributes are
17366 understood to be tightly packed in the array. The initial value is
17367 0.
17368
17369 POINTER
17370 Specifies a pointer to the first component of the first generic
17371 vertex attribute in the array. The initial value is 0.
17372
17373 `glVertexAttribPointer' specifies the location and data format of the
17374 array of generic vertex attributes at index INDEX to use when rendering.
17375 SIZE specifies the number of components per attribute and must be 1, 2,
17376 3, or 4. TYPE specifies the data type of each component, and STRIDE
17377 specifies the byte stride from one attribute to the next, allowing
17378 vertices and attributes to be packed into a single array or stored in
17379 separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
17380 stored in an integer format are to be mapped to the range [-1,1] (for
17381 signed values) or [0,1] (for unsigned values) when they are accessed and
17382 converted to floating point. Otherwise, values will be converted to
17383 floats directly without normalization.
17384
17385 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17386 target (see `glBindBuffer') while a generic vertex attribute array is
17387 specified, POINTER is treated as a byte offset into the buffer object's
17388 data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
17389 is saved as generic vertex attribute array client-side state
17390 (`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
17391
17392 When a generic vertex attribute array is specified, SIZE, TYPE,
17393 NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
17394 addition to the current vertex array buffer object binding.
17395
17396 To enable and disable a generic vertex attribute array, call
17397 `glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
17398 If enabled, the generic vertex attribute array is used when
17399 `glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
17400 `glMultiDrawElements', or `glDrawRangeElements' is called.
17401
17402 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17403 `GL_MAX_VERTEX_ATTRIBS'.
17404
17405 `GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
17406
17407 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17408
17409 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17410
17411 (define-gl-procedures
17412 ((glVertexAttrib1f
17413 (index GLuint)
17414 (v0 GLfloat)
17415 ->
17416 void)
17417 (glVertexAttrib1s
17418 (index GLuint)
17419 (v0 GLshort)
17420 ->
17421 void)
17422 (glVertexAttrib2f
17423 (index GLuint)
17424 (v0 GLfloat)
17425 (v1 GLfloat)
17426 ->
17427 void)
17428 (glVertexAttrib2s
17429 (index GLuint)
17430 (v0 GLshort)
17431 (v1 GLshort)
17432 ->
17433 void)
17434 (glVertexAttrib3f
17435 (index GLuint)
17436 (v0 GLfloat)
17437 (v1 GLfloat)
17438 (v2 GLfloat)
17439 ->
17440 void)
17441 (glVertexAttrib3s
17442 (index GLuint)
17443 (v0 GLshort)
17444 (v1 GLshort)
17445 (v2 GLshort)
17446 ->
17447 void)
17448 (glVertexAttrib4f
17449 (index GLuint)
17450 (v0 GLfloat)
17451 (v1 GLfloat)
17452 (v2 GLfloat)
17453 (v3 GLfloat)
17454 ->
17455 void)
17456 (glVertexAttrib4s
17457 (index GLuint)
17458 (v0 GLshort)
17459 (v1 GLshort)
17460 (v2 GLshort)
17461 (v3 GLshort)
17462 ->
17463 void)
17464 (glVertexAttrib4Nub
17465 (index GLuint)
17466 (v0 GLubyte)
17467 (v1 GLubyte)
17468 (v2 GLubyte)
17469 (v3 GLubyte)
17470 ->
17471 void))
17472 "Specifies the value of a generic vertex attribute.
17473
17474 INDEX
17475 Specifies the index of the generic vertex attribute to be modified.
17476
17477 V0, V1, V2, V3
17478 Specifies the new values to be used for the specified vertex
17479 attribute.
17480
17481 OpenGL defines a number of standard vertex attributes that applications
17482 can modify with standard API entry points (color, normal, texture
17483 coordinates, etc.). The `glVertexAttrib' family of entry points allows
17484 an application to pass generic vertex attributes in numbered locations.
17485
17486 Generic attributes are defined as four-component values that are
17487 organized into an array. The first entry of this array is numbered 0,
17488 and the size of the array is specified by the implementation-dependent
17489 constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
17490 be modified with a `glVertexAttrib' call that specifies the index of the
17491 element to be modified and a value for that element.
17492
17493 These commands can be used to specify one, two, three, or all four
17494 components of the generic vertex attribute specified by INDEX. A `1' in
17495 the name of the command indicates that only one value is passed, and it
17496 will be used to modify the first component of the generic vertex
17497 attribute. The second and third components will be set to 0, and the
17498 fourth component will be set to 1. Similarly, a `2' in the name of the
17499 command indicates that values are provided for the first two components,
17500 the third component will be set to 0, and the fourth component will be
17501 set to 1. A `3' in the name of the command indicates that values are
17502 provided for the first three components and the fourth component will be
17503 set to 1, whereas a `4' in the name indicates that values are provided
17504 for all four components.
17505
17506 The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
17507 the arguments are of type short, float, int, double, unsigned byte,
17508 unsigned short, or unsigned int. When `v' is appended to the name, the
17509 commands can take a pointer to an array of such values. The commands
17510 containing `N' indicate that the arguments will be passed as fixed-point
17511 values that are scaled to a normalized range according to the component
17512 conversion rules defined by the OpenGL specification. Signed values are
17513 understood to represent fixed-point values in the range [-1,1], and
17514 unsigned values are understood to represent fixed-point values in the
17515 range [0,1].
17516
17517 OpenGL Shading Language attribute variables are allowed to be of type
17518 mat2, mat3, or mat4. Attributes of these types may be loaded using the
17519 `glVertexAttrib' entry points. Matrices must be loaded into successive
17520 generic attribute slots in column major order, with one column of the
17521 matrix in each generic attribute slot.
17522
17523 A user-defined attribute variable declared in a vertex shader can be
17524 bound to a generic attribute index by calling `glBindAttribLocation'.
17525 This allows an application to use more descriptive variable names in a
17526 vertex shader. A subsequent change to the specified generic vertex
17527 attribute will be immediately reflected as a change to the corresponding
17528 attribute variable in the vertex shader.
17529
17530 The binding between a generic vertex attribute index and a user-defined
17531 attribute variable in a vertex shader is part of the state of a program
17532 object, but the current value of the generic vertex attribute is not.
17533 The value of each generic vertex attribute is part of current state,
17534 just like standard vertex attributes, and it is maintained even if a
17535 different program object is used.
17536
17537 An application may freely modify generic vertex attributes that are not
17538 bound to a named vertex shader attribute variable. These values are
17539 simply maintained as part of current state and will not be accessed by
17540 the vertex shader. If a generic vertex attribute bound to an attribute
17541 variable in a vertex shader is not updated while the vertex shader is
17542 executing, the vertex shader will repeatedly use the current value for
17543 the generic vertex attribute.
17544
17545 The generic vertex attribute with index 0 is the same as the vertex
17546 position attribute previously defined by OpenGL. A `glVertex2',
17547 `glVertex3', or `glVertex4' command is completely equivalent to the
17548 corresponding `glVertexAttrib' command with an index argument of 0. A
17549 vertex shader can access generic vertex attribute 0 by using the
17550 built-in attribute variable GL_VERTEX. There are no current values for
17551 generic vertex attribute 0. This is the only generic vertex attribute
17552 with this property; calls to set other standard vertex attributes can be
17553 freely mixed with calls to set any of the other generic vertex
17554 attributes.
17555
17556 `GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
17557 `GL_MAX_VERTEX_ATTRIBS'.")
17558
17559 (define-gl-procedures
17560 ((glVertexPointer
17561 (size GLint)
17562 (type GLenum)
17563 (stride GLsizei)
17564 (pointer const-GLvoid-*)
17565 ->
17566 void))
17567 "Define an array of vertex data.
17568
17569 SIZE
17570 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
17571 The initial value is 4.
17572
17573 TYPE
17574 Specifies the data type of each coordinate in the array. Symbolic
17575 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
17576 accepted. The initial value is `GL_FLOAT'.
17577
17578 STRIDE
17579 Specifies the byte offset between consecutive vertices. If STRIDE
17580 is 0, the vertices are understood to be tightly packed in the
17581 array. The initial value is 0.
17582
17583 POINTER
17584 Specifies a pointer to the first coordinate of the first vertex in
17585 the array. The initial value is 0.
17586
17587 `glVertexPointer' specifies the location and data format of an array of
17588 vertex coordinates to use when rendering. SIZE specifies the number of
17589 coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
17590 type of each coordinate, and STRIDE specifies the byte stride from one
17591 vertex to the next, allowing vertices and attributes to be packed into a
17592 single array or stored in separate arrays. (Single-array storage may be
17593 more efficient on some implementations; see `glInterleavedArrays'.)
17594
17595 If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
17596 target (see `glBindBuffer') while a vertex array is specified, POINTER
17597 is treated as a byte offset into the buffer object's data store. Also,
17598 the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
17599 array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
17600
17601 When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
17602 saved as client-side state, in addition to the current vertex array
17603 buffer object binding.
17604
17605 To enable and disable the vertex array, call `glEnableClientState' and
17606 `glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
17607 the vertex array is used when `glArrayElement', `glDrawArrays',
17608 `glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
17609 `glDrawRangeElements' is called.
17610
17611 `GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
17612
17613 `GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
17614
17615 `GL_INVALID_VALUE' is generated if STRIDE is negative.")
17616
17617 (define-gl-procedures
17618 ((glVertex2i (x GLint) (y GLint) -> void)
17619 (glVertex2f (x GLfloat) (y GLfloat) -> void)
17620 (glVertex3i
17621 (x GLint)
17622 (y GLint)
17623 (z GLint)
17624 ->
17625 void)
17626 (glVertex3f
17627 (x GLfloat)
17628 (y GLfloat)
17629 (z GLfloat)
17630 ->
17631 void)
17632 (glVertex4i
17633 (x GLint)
17634 (y GLint)
17635 (z GLint)
17636 (w GLint)
17637 ->
17638 void)
17639 (glVertex4f
17640 (x GLfloat)
17641 (y GLfloat)
17642 (z GLfloat)
17643 (w GLfloat)
17644 ->
17645 void))
17646 "Specify a vertex.
17647
17648 X
17649 Y
17650
17651 Z
17652
17653 W
17654
17655 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
17656 are present in all forms of the command.
17657
17658 `glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
17659 point, line, and polygon vertices. The current color, normal, texture
17660 coordinates, and fog coordinate are associated with the vertex when
17661 `glVertex' is called.
17662
17663 When only X and Y are specified, Z defaults to 0 and W defaults to 1.
17664 When X , Y , and Z are specified, W defaults to 1.")
17665
17666 (define-gl-procedures
17667 ((glViewport
17668 (x GLint)
17669 (y GLint)
17670 (width GLsizei)
17671 (height GLsizei)
17672 ->
17673 void))
17674 "Set the viewport.
17675
17676 X
17677 Y
17678
17679 Specify the lower left corner of the viewport rectangle, in pixels.
17680 The initial value is (0,0).
17681
17682 WIDTH
17683 HEIGHT
17684
17685 Specify the width and height of the viewport. When a GL context is
17686 first attached to a window, WIDTH and HEIGHT are set to the
17687 dimensions of that window.
17688
17689 `glViewport' specifies the affine transformation of X and Y from
17690 normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
17691 normalized device coordinates. Then the window coordinates (X_W,Y_W) are
17692 computed as follows:
17693
17694 X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
17695
17696 Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
17697
17698 Viewport width and height are silently clamped to a range that depends
17699 on the implementation. To query this range, call `glGet' with argument
17700 `GL_MAX_VIEWPORT_DIMS'.
17701
17702 `GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
17703
17704 `GL_INVALID_OPERATION' is generated if `glViewport' is executed between
17705 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17706
17707 (define-gl-procedures
17708 ((glWindowPos2i (x GLint) (y GLint) -> void)
17709 (glWindowPos2f (x GLfloat) (y GLfloat) -> void)
17710 (glWindowPos3i
17711 (x GLint)
17712 (y GLint)
17713 (z GLint)
17714 ->
17715 void)
17716 (glWindowPos3f
17717 (x GLfloat)
17718 (y GLfloat)
17719 (z GLfloat)
17720 ->
17721 void))
17722 "Specify the raster position in window coordinates for pixel operations.
17723
17724 X
17725 Y
17726
17727 Z
17728
17729 Specify the X , Y , Z coordinates for the raster position.
17730
17731 The GL maintains a 3D position in window coordinates. This position,
17732 called the raster position, is used to position pixel and bitmap write
17733 operations. It is maintained with subpixel accuracy. See `glBitmap',
17734 `glDrawPixels', and `glCopyPixels'.
17735
17736 `glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
17737 set to 0. `glWindowPos3' specifies all three coordinates. The W
17738 coordinate of the current raster position is always set to 1.0.
17739
17740 `glWindowPos' directly updates the X and Y coordinates of the current
17741 raster position with the values specified. That is, the values are
17742 neither transformed by the current modelview and projection matrices,
17743 nor by the viewport-to-window transform. The Z coordinate of the current
17744 raster position is updated in the following manner:
17745
17746 Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
17747
17748
17749
17750 where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
17751 far value. See `glDepthRange'.
17752
17753 The specified coordinates are not clip-tested, causing the raster
17754 position to always be valid.
17755
17756 The current raster position also includes some associated color data and
17757 texture coordinates. If lighting is enabled, then
17758 `GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
17759 (in color index mode) is set to the color produced by the lighting
17760 calculation (see `glLight', `glLightModel', and `glShadeModel'). If
17761 lighting is disabled, current color (in RGBA mode, state variable
17762 `GL_CURRENT_COLOR') or color index (in color index mode, state variable
17763 `GL_CURRENT_INDEX') is used to update the current raster color.
17764 `GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
17765
17766 Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
17767 `GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
17768 generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
17769 is set to the `GL_CURRENT_FOG_COORD'.
17770
17771
17772
17773 `GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
17774 the execution of `glBegin' and the corresponding execution of `glEnd'.")
17775