first attempt at parse-prototype
[clinton/guile-figl.git] / figl / low-level / gl.scm
CommitLineData
8925f36f
AW
1;;; figl -*- mode: scheme; coding: utf-8 -*-
2;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
3;;;
4;;; Figl is free software: you can redistribute it and/or modify it
5;;; under the terms of the GNU Lesser General Public License as
6;;; published by the Free Software Foundation, either version 3 of the
7;;; License, or (at your option) any later version.
8;;;
9;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12;;; Public License for more details.
13;;;
14;;; You should have received a copy of the GNU Lesser General Public
15;;; License along with this program. If not, see
16;;; <http://www.gnu.org/licenses/>.
17;;;
18;;; Derived from upstream OpenGL documentation.
19;;;
8925f36f
AW
20;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
21;;; under the SGI Free Software B License. For details, see
22;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
23;;;
8925f36f
AW
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;;;
8925f36f
AW
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;;;
8925f36f
AW
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 low-level gl)
45 #:use-module
46 (figl low-level support)
47 #:export
48 (glAccum
49 glActiveTexture
50 glAlphaFunc
51 glAreTexturesResident
52 glArrayElement
53 glAttachShader
54 glBeginQuery
55 glBegin
56 glBindAttribLocation
57 glBindBuffer
58 glBindTexture
59 glBitmap
60 glBlendColor
61 glBlendEquationSeparate
62 glBlendEquation
63 glBlendFuncSeparate
64 glBlendFunc
65 glBufferData
66 glBufferSubData
67 glCallLists
68 glCallList
69 glClearAccum
70 glClearColor
71 glClearDepth
72 glClearIndex
73 glClearStencil
74 glClear
75 glClientActiveTexture
76 glClipPlane
77 glColorMask
78 glColorMaterial
79 glColorPointer
80 glColorSubTable
81 glColorTableParameter
82 glColorTable
83 glColor
84 glCompileShader
85 glCompressedTexImage1D
86 glCompressedTexImage2D
87 glCompressedTexImage3D
88 glCompressedTexSubImage1D
89 glCompressedTexSubImage2D
90 glCompressedTexSubImage3D
91 glConvolutionFilter1D
92 glConvolutionFilter2D
93 glConvolutionParameter
94 glCopyColorSubTable
95 glCopyColorTable
96 glCopyConvolutionFilter1D
97 glCopyConvolutionFilter2D
98 glCopyPixels
99 glCopyTexImage1D
100 glCopyTexImage2D
101 glCopyTexSubImage1D
102 glCopyTexSubImage2D
103 glCopyTexSubImage3D
104 glCreateProgram
105 glCreateShader
106 glCullFace
107 glDeleteBuffers
108 glDeleteLists
109 glDeleteProgram
110 glDeleteQueries
111 glDeleteShader
112 glDeleteTextures
113 glDepthFunc
114 glDepthMask
115 glDepthRange
116 glDetachShader
117 glDrawArrays
118 glDrawBuffers
119 glDrawBuffer
120 glDrawElements
121 glDrawPixels
122 glDrawRangeElements
123 glEdgeFlagPointer
124 glEdgeFlag
125 glEnableClientState
126 glEnableVertexAttribArray
127 glEnable
128 glEvalCoord
129 glEvalMesh
130 glEvalPoint
131 glFeedbackBuffer
132 glFinish
133 glFlush
134 glFogCoordPointer
135 glFogCoord
136 glFog
137 glFrontFace
138 glFrustum
139 glGenBuffers
140 glGenLists
141 glGenQueries
142 glGenTextures
143 glGetActiveAttrib
144 glGetActiveUniform
145 glGetAttachedShaders
146 glGetAttribLocation
147 glGetBufferParameteriv
148 glGetBufferPointerv
149 glGetBufferSubData
150 glGetClipPlane
151 glGetColorTableParameter
152 glGetColorTable
153 glGetCompressedTexImage
154 glGetConvolutionFilter
155 glGetConvolutionParameter
156 glGetError
157 glGetHistogramParameter
158 glGetHistogram
159 glGetLight
160 glGetMap
161 glGetMaterial
162 glGetMinmaxParameter
163 glGetMinmax
164 glGetPixelMap
165 glGetPointerv
166 glGetPolygonStipple
167 glGetProgramInfoLog
168 glGetProgramiv
169 glGetQueryiv
170 glGetQueryObject
171 glGetSeparableFilter
172 glGetShaderInfoLog
173 glGetShaderSource
174 glGetShaderiv
175 glGetString
176 glGetTexEnv
177 glGetTexGen
178 glGetTexImage
179 glGetTexLevelParameter
180 glGetTexParameter
181 glGetUniformLocation
182 glGetUniformfv
183 glGetVertexAttribPointerv
184 glGetVertexAttribdv
185 glGet
186 glHint
187 glHistogram
188 glIndexMask
189 glIndexPointer
190 glIndex
191 glInitNames
192 glInterleavedArrays
193 glIsBuffer
194 glIsEnabled
195 glIsList
196 glIsProgram
197 glIsQuery
198 glIsShader
199 glIsTexture
200 glLightModel
201 glLight
202 glLineStipple
203 glLineWidth
204 glLinkProgram
205 glListBase
206 glLoadIdentity
207 glLoadMatrix
208 glLoadName
209 glLoadTransposeMatrix
210 glLogicOp
211 glMap1
212 glMap2
213 glMapBuffer
214 glMapGrid
215 glMaterial
216 glMatrixMode
217 glMinmax
218 glMultiDrawArrays
219 glMultiDrawElements
220 glMultiTexCoord
221 glMultMatrix
222 glMultTransposeMatrix
223 glNewList
224 glNormalPointer
225 glNormal
226 glOrtho
227 glPassThrough
228 glPixelMap
229 glPixelStore
230 glPixelTransfer
231 glPixelZoom
232 glPointParameter
233 glPointSize
234 glPolygonMode
235 glPolygonOffset
236 glPolygonStipple
237 glPrioritizeTextures
238 glPushAttrib
239 glPushClientAttrib
240 glPushMatrix
241 glPushName
242 glRasterPos
243 glReadBuffer
244 glReadPixels
245 glRect
246 glRenderMode
247 glResetHistogram
248 glResetMinmax
249 glRotate
250 glSampleCoverage
251 glScale
252 glScissor
253 glSecondaryColorPointer
254 glSecondaryColor
255 glSelectBuffer
256 glSeparableFilter2D
257 glShadeModel
258 glShaderSource
259 glStencilFuncSeparate
260 glStencilFunc
261 glStencilMaskSeparate
262 glStencilMask
263 glStencilOpSeparate
264 glStencilOp
265 glTexCoordPointer
266 glTexCoord
267 glTexEnv
268 glTexGen
269 glTexImage1D
270 glTexImage2D
271 glTexImage3D
272 glTexParameter
273 glTexSubImage1D
274 glTexSubImage2D
275 glTexSubImage3D
276 glTranslate
277 glUniform1f
278 glUseProgram
279 glValidateProgram
280 glVertexAttribPointer
281 glVertexAttrib
282 glVertexPointer
283 glVertex
284 glViewport
285 glWindowPos))
286
287(define-gl-procedure
288 glAccum
289 "glAccum"
290 (funcsynopsis
291 (funcprototype
292 (funcdef "void " (function "glAccum"))
293 (paramdef "GLenum " (parameter "op"))
294 (paramdef "GLfloat " (parameter "value"))))
3c9b6116
AW
295 "Operate on the accumulation buffer.
296
297OP
298 Specifies the accumulation buffer operation. Symbolic constants
299 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
300 accepted.
301
302VALUE
303 Specifies a floating-point value used in the accumulation buffer
304 operation. OP determines how VALUE is used.
305
306The accumulation buffer is an extended-range color buffer. Images are
307not rendered into it. Rather, images rendered into one of the color
308buffers are added to the contents of the accumulation buffer after
309rendering. Effects such as antialiasing (of points, lines, and
310polygons), motion blur, and depth of field can be created by
311accumulating images generated with different transformation matrices.
312
313Each pixel in the accumulation buffer consists of red, green, blue, and
314alpha values. The number of bits per component in the accumulation
315buffer depends on the implementation. You can examine this number by
316calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
317`GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
318Regardless of the number of bits per component, the range of values
319stored by each component is [-1,1] . The accumulation buffer pixels are
320mapped one-to-one with frame buffer pixels.
321
322`glAccum' operates on the accumulation buffer. The first argument, OP,
323is a symbolic constant that selects an accumulation buffer operation.
324The second argument, VALUE, is a floating-point value to be used in that
325operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
326`GL_ADD', `GL_MULT', and `GL_RETURN'.
327
328All accumulation buffer operations are limited to the area of the
329current scissor box and applied identically to the red, green, blue, and
330alpha components of each pixel. If a `glAccum' operation results in a
331value outside the range [-1,1] , the contents of an accumulation buffer
332pixel component are undefined.
333
334The operations are as follows:
335
336`GL_ACCUM'
337 Obtains R, G, B, and A values from the buffer currently selected
338 for reading (see `glReadBuffer'). Each component value is divided
339 by 2^N-1 , where N is the number of bits allocated to each color
340 component in the currently selected buffer. The result is a
341 floating-point value in the range [0,1] , which is multiplied by
342 VALUE and added to the corresponding pixel component in the
343 accumulation buffer, thereby updating the accumulation buffer.
344
345`GL_LOAD'
346 Similar to `GL_ACCUM', except that the current value in the
347 accumulation buffer is not used in the calculation of the new
348 value. That is, the R, G, B, and A values from the currently
349 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
350 then stored in the corresponding accumulation buffer cell,
351 overwriting the current value.
352
353`GL_ADD'
354 Adds VALUE to each R, G, B, and A in the accumulation buffer.
355
356`GL_MULT'
357 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
358 and returns the scaled component to its corresponding accumulation
359 buffer location.
360
361`GL_RETURN'
362 Transfers accumulation buffer values to the color buffer or buffers
363 currently selected for writing. Each R, G, B, and A component is
364 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
365 range [0,2^N-1] , and stored in the corresponding display buffer
366 cell. The only fragment operations that are applied to this
367 transfer are pixel ownership, scissor, dithering, and color
368 writemasks.
369
370To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
371A values to set it to, then call `glClear' with the accumulation buffer
372enabled.
373
374`GL_INVALID_ENUM' is generated if OP is not an accepted value.
375
376`GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
377
378`GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
379execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
380
381(define-gl-procedure
382 glActiveTexture
383 "glActiveTexture"
384 (funcsynopsis
385 (funcprototype
386 (funcdef "void " (function "glActiveTexture"))
387 (paramdef "GLenum " (parameter "texture"))))
3c9b6116
AW
388 "Select active texture unit.
389
390TEXTURE
391 Specifies which texture unit to make active. The number of texture
392 units is implementation dependent, but must be at least two.
393 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
394 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
395 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
396 `GL_TEXTURE0'.
397
398`glActiveTexture' selects which texture unit subsequent texture state
399calls will affect. The number of texture units an implementation
400supports is implementation dependent, but must be at least 2.
401
402Vertex arrays are client-side GL resources, which are selected by the
403`glClientActiveTexture' routine.
404
405`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
406where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
407(`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
8925f36f
AW
408
409(define-gl-procedure
410 glAlphaFunc
411 "glAlphaFunc"
412 (funcsynopsis
413 (funcprototype
414 (funcdef "void " (function "glAlphaFunc"))
415 (paramdef "GLenum " (parameter "func"))
416 (paramdef "GLclampf " (parameter "ref"))))
3c9b6116
AW
417 "Specify the alpha test function.
418
419FUNC
420 Specifies the alpha comparison function. Symbolic constants
421 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
422 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
423 initial value is `GL_ALWAYS'.
424
425REF
426 Specifies the reference value that incoming alpha values are
427 compared to. This value is clamped to the range [0,1] , where 0
428 represents the lowest possible alpha value and 1 the highest
429 possible value. The initial reference value is 0.
430
431The alpha test discards fragments depending on the outcome of a
432comparison between an incoming fragment's alpha value and a constant
433reference value. `glAlphaFunc' specifies the reference value and the
434comparison function. The comparison is performed only if alpha testing
435is enabled. By default, it is not enabled. (See `glEnable' and
436`glDisable' of `GL_ALPHA_TEST'.)
437
438FUNC and REF specify the conditions under which the pixel is drawn. The
439incoming alpha value is compared to REF using the function specified by
440FUNC. If the value passes the comparison, the incoming fragment is drawn
441if it also passes subsequent stencil and depth buffer tests. If the
442value fails the comparison, no change is made to the frame buffer at
443that pixel location. The comparison functions are as follows:
444
445`GL_NEVER'
446 Never passes.
447
448`GL_LESS'
449 Passes if the incoming alpha value is less than the reference
450 value.
451
452`GL_EQUAL'
453 Passes if the incoming alpha value is equal to the reference value.
454
455`GL_LEQUAL'
456 Passes if the incoming alpha value is less than or equal to the
457 reference value.
458
459`GL_GREATER'
460 Passes if the incoming alpha value is greater than the reference
461 value.
462
463`GL_NOTEQUAL'
464 Passes if the incoming alpha value is not equal to the reference
465 value.
466
467`GL_GEQUAL'
468 Passes if the incoming alpha value is greater than or equal to the
469 reference value.
470
471`GL_ALWAYS'
472 Always passes (initial value).
473
474`glAlphaFunc' operates on all pixel write operations, including those
475resulting from the scan conversion of points, lines, polygons, and
476bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
477affect screen clear operations.
478
479`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
480
481`GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
482the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
483
484(define-gl-procedure
485 glAreTexturesResident
486 "glAreTexturesResident"
487 (funcsynopsis
488 (funcprototype
489 (funcdef
490 "GLboolean "
491 (function "glAreTexturesResident"))
492 (paramdef "GLsizei " (parameter "n"))
493 (paramdef
494 "const GLuint * "
495 (parameter "textures"))
496 (paramdef
497 "GLboolean * "
498 (parameter "residences"))))
3c9b6116
AW
499 "Determine if textures are loaded in texture memory.
500
501N
502 Specifies the number of textures to be queried.
503
504TEXTURES
505 Specifies an array containing the names of the textures to be
506 queried.
507
508RESIDENCES
509 Specifies an array in which the texture residence status is
510 returned. The residence status of a texture named by an element of
511 TEXTURES is returned in the corresponding element of RESIDENCES.
512
513GL establishes a ``working set'' of textures that are resident in
514texture memory. These textures can be bound to a texture target much
515more efficiently than textures that are not resident.
516
517`glAreTexturesResident' queries the texture residence status of the N
518textures named by the elements of TEXTURES. If all the named textures
519are resident, `glAreTexturesResident' returns `GL_TRUE', and the
520contents of RESIDENCES are undisturbed. If not all the named textures
521are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
522status is returned in the N elements of RESIDENCES. If an element of
523RESIDENCES is `GL_TRUE', then the texture named by the corresponding
524element of TEXTURES is resident.
525
526The residence status of a single bound texture may also be queried by
527calling `glGetTexParameter' with the TARGET argument set to the target
528to which the texture is bound, and the PNAME argument set to
529`GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
530a default texture can be queried.
531
532`GL_INVALID_VALUE' is generated if N is negative.
533
534`GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
535not name a texture. In that case, the function returns `GL_FALSE' and
536the contents of RESIDENCES is indeterminate.
537
538`GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
539executed between the execution of `glBegin' and the corresponding
540execution of `glEnd'.")
8925f36f
AW
541
542(define-gl-procedure
543 glArrayElement
544 "glArrayElement"
545 (funcsynopsis
546 (funcprototype
547 (funcdef "void " (function "glArrayElement"))
548 (paramdef "GLint " (parameter "i"))))
3c9b6116
AW
549 "Render a vertex using the specified vertex array element.
550
551I
552 Specifies an index into the enabled vertex data arrays.
553
554`glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
555specify vertex and attribute data for point, line, and polygon
556primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
557called, a single vertex is drawn, using vertex and attribute data taken
558from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
559enabled, no drawing occurs but the attributes corresponding to the
560enabled arrays are modified.
561
562Use `glArrayElement' to construct primitives by indexing vertex data,
563rather than by streaming through arrays of data in first-to-last order.
564Because each call specifies only a single vertex, it is possible to
565explicitly specify per-primitive attributes such as a single normal for
566each triangle.
567
568Changes made to array data between the execution of `glBegin' and the
569corresponding execution of `glEnd' may affect calls to `glArrayElement'
570that are made within the same `glBegin'/`glEnd' period in nonsequential
571ways. That is, a call to `glArrayElement' that precedes a change to
572array data may access the changed data, and a call that follows a change
573to array data may access original data.
574
575`GL_INVALID_VALUE' may be generated if I is negative.
576
577`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
578bound to an enabled array and the buffer object's data store is
579currently mapped.")
8925f36f
AW
580
581(define-gl-procedure
582 glAttachShader
583 "glAttachShader"
584 (funcsynopsis
585 (funcprototype
586 (funcdef "void " (function "glAttachShader"))
587 (paramdef "GLuint " (parameter "program"))
588 (paramdef "GLuint " (parameter "shader"))))
3c9b6116
AW
589 "Attaches a shader object to a program object.
590
591PROGRAM
592 Specifies the program object to which a shader object will be
593 attached.
594
595SHADER
596 Specifies the shader object that is to be attached.
597
598In order to create an executable, there must be a way to specify the
599list of things that will be linked together. Program objects provide
600this mechanism. Shaders that are to be linked together in a program
601object must first be attached to that program object. `glAttachShader'
602attaches the shader object specified by SHADER to the program object
603specified by PROGRAM. This indicates that SHADER will be included in
604link operations that will be performed on PROGRAM.
605
606All operations that can be performed on a shader object are valid
607whether or not the shader object is attached to a program object. It is
608permissible to attach a shader object to a program object before source
609code has been loaded into the shader object or before the shader object
610has been compiled. It is permissible to attach multiple shader objects
611of the same type because each may contain a portion of the complete
612shader. It is also permissible to attach a shader object to more than
613one program object. If a shader object is deleted while it is attached
614to a program object, it will be flagged for deletion, and deletion will
615not occur until `glDetachShader' is called to detach it from all program
616objects to which it is attached.
617
618`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
619value generated by OpenGL.
620
621`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
622
623`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
624
625`GL_INVALID_OPERATION' is generated if SHADER is already attached to
626PROGRAM.
627
628`GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
629between the execution of `glBegin' and the corresponding execution of
630`glEnd'.")
8925f36f
AW
631
632(define-gl-procedure
633 glBeginQuery
634 "glBeginQuery"
635 (funcsynopsis
636 (funcprototype
637 (funcdef "void " (function "glBeginQuery"))
638 (paramdef "GLenum " (parameter "target"))
639 (paramdef "GLuint " (parameter "id"))))
3c9b6116
AW
640 "Delimit the boundaries of a query object.
641
642TARGET
643 Specifies the target type of query object established between
644 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
645 constant must be `GL_SAMPLES_PASSED'.
646
647ID
648 Specifies the name of a query object.
649
650`glBeginQuery' and `glEndQuery' delimit the boundaries of a query
651object. If a query object with name ID does not yet exist it is created.
652
653When `glBeginQuery' is executed, the query object's samples-passed
654counter is reset to 0. Subsequent rendering will increment the counter
655once for every sample that passes the depth test. When `glEndQuery' is
656executed, the samples-passed counter is assigned to the query object's
657result value. This value can be queried by calling `glGetQueryObject'
658with PNAME`GL_QUERY_RESULT'.
659
660Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
661the rendering delimited by the query object has completed and the result
662is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
663the result is immediately available or if the rendering is not yet
664complete.
665
666`GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
667
668`GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
669a query object of the same TARGET is already active.
670
671`GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
672query object of the same TARGET is not active.
673
674`GL_INVALID_OPERATION' is generated if ID is 0.
675
676`GL_INVALID_OPERATION' is generated if ID is the name of an already
677active query object.
678
679`GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
680executed between the execution of `glBegin' and the corresponding
681execution of `glEnd'.")
8925f36f
AW
682
683(define-gl-procedure
684 glBegin
685 "glBegin"
686 (funcsynopsis
687 (funcprototype
688 (funcdef "void " (function "glBegin"))
689 (paramdef "GLenum " (parameter "mode"))))
3c9b6116
AW
690 "Delimit the vertices of a primitive or a group of like primitives.
691
692MODE
693 Specifies the primitive or primitives that will be created from
694 vertices presented between `glBegin' and the subsequent `glEnd'.
695 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
696 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
697 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
698 `GL_QUAD_STRIP', and `GL_POLYGON'.
699
700`glBegin' and `glEnd' delimit the vertices that define a primitive or a
701group of like primitives. `glBegin' accepts a single argument that
702specifies in which of ten ways the vertices are interpreted. Taking N as
703an integer count starting at one, and N as the total number of vertices
704specified, the interpretations are as follows:
705
706`GL_POINTS'
707 Treats each vertex as a single point. Vertex N defines point N . N
708 points are drawn.
709
710`GL_LINES'
711 Treats each pair of vertices as an independent line segment.
712 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
713
714`GL_LINE_STRIP'
715 Draws a connected group of line segments from the first vertex to
716 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
717
718`GL_LINE_LOOP'
719 Draws a connected group of line segments from the first vertex to
720 the last, then back to the first. Vertices N and N+1 define line N
721 . The last line, however, is defined by vertices N and 1 . N lines
722 are drawn.
723
724`GL_TRIANGLES'
725 Treats each triplet of vertices as an independent triangle.
726 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
727 are drawn.
728
729`GL_TRIANGLE_STRIP'
730 Draws a connected group of triangles. One triangle is defined for
731 each vertex presented after the first two vertices. For odd N ,
732 vertices N , N+1 , and N+2 define triangle N . For even N ,
733 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
734 drawn.
735
736`GL_TRIANGLE_FAN'
737 Draws a connected group of triangles. One triangle is defined for
738 each vertex presented after the first two vertices. Vertices 1 ,
739 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
740
741`GL_QUADS'
742 Treats each group of four vertices as an independent quadrilateral.
743 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
744 N/4 quadrilaterals are drawn.
745
746`GL_QUAD_STRIP'
747 Draws a connected group of quadrilaterals. One quadrilateral is
748 defined for each pair of vertices presented after the first pair.
749 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
750 N/2-1 quadrilaterals are drawn. Note that the order in which
751 vertices are used to construct a quadrilateral from strip data is
752 different from that used with independent data.
753
754`GL_POLYGON'
755 Draws a single, convex polygon. Vertices 1 through N define this
756 polygon.
757
758Only a subset of GL commands can be used between `glBegin' and `glEnd'.
759The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
760`glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
761`glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
762`glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
763`glCallList' or `glCallLists' to execute display lists that include only
764the preceding commands. If any other GL command is executed between
765`glBegin' and `glEnd', the error flag is set and the command is ignored.
766
767Regardless of the value chosen for MODE, there is no limit to the number
768of vertices that can be defined between `glBegin' and `glEnd'. Lines,
769triangles, quadrilaterals, and polygons that are incompletely specified
770are not drawn. Incomplete specification results when either too few
771vertices are provided to specify even a single primitive or when an
772incorrect multiple of vertices is specified. The incomplete primitive is
773ignored; the rest are drawn.
774
775The minimum specification of vertices for each primitive is as follows:
7761 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
777and 3 for a polygon. Modes that require a certain multiple of vertices
778are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
779`GL_QUAD_STRIP' (2).
780
781`GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
782
783`GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
784`glBegin' and the corresponding execution of `glEnd'.
785
786`GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
787preceded by a `glBegin'.
788
789`GL_INVALID_OPERATION' is generated if a command other than `glVertex',
790`glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
791`glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
792`glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
793`glCallList', or `glCallLists' is executed between the execution of
794`glBegin' and the corresponding execution `glEnd'.
795
796Execution of `glEnableClientState', `glDisableClientState',
797`glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
798`glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
799`glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
800`glInterleavedArrays', or `glPixelStore' is not allowed after a call to
801`glBegin' and before the corresponding call to `glEnd', but an error may
802or may not be generated.")
8925f36f
AW
803
804(define-gl-procedure
805 glBindAttribLocation
806 "glBindAttribLocation"
807 (funcsynopsis
808 (funcprototype
809 (funcdef
810 "void "
811 (function "glBindAttribLocation"))
812 (paramdef "GLuint " (parameter "program"))
813 (paramdef "GLuint " (parameter "index"))
814 (paramdef "const GLchar *" (parameter "name"))))
3c9b6116
AW
815 "Associates a generic vertex attribute index with a named attribute
816variable.
817
818PROGRAM
819 Specifies the handle of the program object in which the association
820 is to be made.
821
822INDEX
823 Specifies the index of the generic vertex attribute to be bound.
824
825NAME
826 Specifies a null terminated string containing the name of the
827 vertex shader attribute variable to which INDEX is to be bound.
828
829`glBindAttribLocation' is used to associate a user-defined attribute
830variable in the program object specified by PROGRAM with a generic
831vertex attribute index. The name of the user-defined attribute variable
832is passed as a null terminated string in NAME. The generic vertex
833attribute index to be bound to this variable is specified by INDEX. When
834PROGRAM is made part of current state, values provided via the generic
835vertex attribute INDEX will modify the value of the user-defined
836attribute variable specified by NAME.
837
838If NAME refers to a matrix attribute variable, INDEX refers to the first
839column of the matrix. Other matrix columns are then automatically bound
840to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
841a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
842type mat4.
843
844This command makes it possible for vertex shaders to use descriptive
845names for attribute variables rather than generic variables that are
846numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
847generic attribute index are part of current state, just like standard
848vertex attributes such as color, normal, and vertex position. If a
849different program object is made current by calling `glUseProgram', the
850generic vertex attributes are tracked in such a way that the same values
851will be observed by attributes in the new program object that are also
852bound to INDEX.
853
854Attribute variable name-to-generic attribute index bindings for a
855program object can be explicitly assigned at any time by calling
856`glBindAttribLocation'. Attribute bindings do not go into effect until
857`glLinkProgram' is called. After a program object has been linked
858successfully, the index values for generic attributes remain fixed (and
859their values can be queried) until the next link command occurs.
860
861Applications are not allowed to bind any of the standard OpenGL vertex
862attributes using this command, as they are bound automatically when
863needed. Any attribute binding that occurs after the program object has
864been linked will not take effect until the next time the program object
865is linked.
866
867`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
868`GL_MAX_VERTEX_ATTRIBS'.
869
870`GL_INVALID_OPERATION' is generated if NAME starts with the reserved
871prefix \"gl_\".
872
873`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
874OpenGL.
875
876`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
877
878`GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
879executed between the execution of `glBegin' and the corresponding
880execution of `glEnd'.")
8925f36f
AW
881
882(define-gl-procedure
883 glBindBuffer
884 "glBindBuffer"
885 (funcsynopsis
886 (funcprototype
887 (funcdef "void " (function "glBindBuffer"))
888 (paramdef "GLenum " (parameter "target"))
889 (paramdef "GLuint " (parameter "buffer"))))
3c9b6116
AW
890 "Bind a named buffer object.
891
892TARGET
893 Specifies the target to which the buffer object is bound. The
894 symbolic constant must be `GL_ARRAY_BUFFER',
895 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
896 `GL_PIXEL_UNPACK_BUFFER'.
897
898BUFFER
899 Specifies the name of a buffer object.
900
901`glBindBuffer' lets you create or use a named buffer object. Calling
902`glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
903`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
904`GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
905object binds the buffer object name to the target. When a buffer object
906is bound to a target, the previous binding for that target is
907automatically broken.
908
909Buffer object names are unsigned integers. The value zero is reserved,
910but there is no default buffer object for each buffer object target.
911Instead, BUFFER set to zero effectively unbinds any buffer object
912previously bound, and restores client memory usage for that buffer
913object target. Buffer object names and the corresponding buffer object
914contents are local to the shared display-list space (see
915`glXCreateContext') of the current GL rendering context; two rendering
916contexts share buffer object names only if they also share display
917lists.
918
919You may use `glGenBuffers' to generate a set of new buffer object names.
920
921The state of a buffer object immediately after it is first bound is an
922unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
923`GL_STATIC_DRAW' usage.
924
925While a non-zero buffer object name is bound, GL operations on the
926target to which it is bound affect the bound buffer object, and queries
927of the target to which it is bound return state from the bound buffer
928object. While buffer object name zero is bound, as in the initial state,
929attempts to modify or query state on the target to which it is bound
930generates an `GL_INVALID_OPERATION' error.
931
932When vertex array pointer state is changed, for example by a call to
933`glNormalPointer', the current buffer object binding
934(`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
935state for the vertex array type being changed, for example
936`GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
937bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
938parameter that is traditionally interpreted as a pointer to client-side
939memory is instead interpreted as an offset within the buffer object
940measured in basic machine units.
941
942While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
943target, the indices parameter of `glDrawElements',
944`glDrawRangeElements', or `glMultiDrawElements' that is traditionally
945interpreted as a pointer to client-side memory is instead interpreted as
946an offset within the buffer object measured in basic machine units.
947
948While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
949target, the following commands are affected: `glGetCompressedTexImage',
950`glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
951`glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
952`glGetTexImage', and `glReadPixels'. The pointer parameter that is
953traditionally interpreted as a pointer to client-side memory where the
954pixels are to be packed is instead interpreted as an offset within the
955buffer object measured in basic machine units.
956
957While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
958target, the following commands are affected: `glBitmap',
959`glColorSubTable', `glColorTable', `glCompressedTexImage1D',
960`glCompressedTexImage2D', `glCompressedTexImage3D',
961`glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
962`glCompressedTexSubImage3D', `glConvolutionFilter1D',
963`glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
964`glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
965`glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
966and `glTexSubImage3D'. The pointer parameter that is traditionally
967interpreted as a pointer to client-side memory from which the pixels are
968to be unpacked is instead interpreted as an offset within the buffer
969object measured in basic machine units.
970
971A buffer object binding created with `glBindBuffer' remains active until
972a different buffer object name is bound to the same target, or until the
973bound buffer object is deleted with `glDeleteBuffers'.
974
975Once created, a named buffer object may be re-bound to any target as
976often as needed. However, the GL implementation may make choices about
977how to optimize the storage of a buffer object based on its initial
978binding target.
979
980`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
981values.
982
983`GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
984between the execution of `glBegin' and the corresponding execution of
985`glEnd'.")
8925f36f
AW
986
987(define-gl-procedure
988 glBindTexture
989 "glBindTexture"
990 (funcsynopsis
991 (funcprototype
992 (funcdef "void " (function "glBindTexture"))
993 (paramdef "GLenum " (parameter "target"))
994 (paramdef "GLuint " (parameter "texture"))))
3c9b6116
AW
995 "Bind a named texture to a texturing target.
996
997TARGET
998 Specifies the target to which the texture is bound. Must be either
999 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1000 `GL_TEXTURE_CUBE_MAP'.
1001
1002TEXTURE
1003 Specifies the name of a texture.
1004
1005`glBindTexture' lets you create or use a named texture. Calling
1006`glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1007`GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1008the new texture binds the texture name to the target. When a texture is
1009bound to a target, the previous binding for that target is automatically
1010broken.
1011
8925f36f 1012Texture names are unsigned integers. The value zero is reserved to
3c9b6116
AW
1013represent the default texture for each texture target. Texture names and
1014the corresponding texture contents are local to the shared display-list
1015space (see `glXCreateContext') of the current GL rendering context; two
1016rendering contexts share texture names only if they also share display
1017lists.
1018
1019You may use `glGenTextures' to generate a set of new texture names.
1020
1021When a texture is first bound, it assumes the specified target: A
1022texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1023a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1024texture, a texture first bound to `GL_TEXTURE_3D' becomes
1025three-dimensional texture, and a texture first bound to
1026`GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1027one-dimensional texture immediately after it is first bound is
1028equivalent to the state of the default `GL_TEXTURE_1D' at GL
1029initialization, and similarly for two- and three-dimensional textures
1030and cube-mapped textures.
1031
8925f36f 1032While a texture is bound, GL operations on the target to which it is
3c9b6116
AW
1033bound affect the bound texture, and queries of the target to which it is
1034bound return state from the bound texture. If texture mapping is active
1035on the target to which a texture is bound, the bound texture is used. In
1036effect, the texture targets become aliases for the textures currently
1037bound to them, and the texture name zero refers to the default textures
1038that were bound to them at initialization.
1039
1040A texture binding created with `glBindTexture' remains active until a
1041different texture is bound to the same target, or until the bound
1042texture is deleted with `glDeleteTextures'.
1043
1044Once created, a named texture may be re-bound to its same original
1045target as often as needed. It is usually much faster to use
1046`glBindTexture' to bind an existing named texture to one of the texture
1047targets than it is to reload the texture image using `glTexImage1D',
1048`glTexImage2D', or `glTexImage3D'. For additional control over
1049performance, use `glPrioritizeTextures'.
1050
1051`glBindTexture' is included in display lists.
1052
1053`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1054values.
1055
1056`GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1057with a target that doesn't match that of TARGET.
1058
1059`GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1060between the execution of `glBegin' and the corresponding execution of
1061`glEnd'.")
8925f36f
AW
1062
1063(define-gl-procedure
1064 glBitmap
1065 "glBitmap"
1066 (funcsynopsis
1067 (funcprototype
1068 (funcdef "void " (function "glBitmap"))
1069 (paramdef "GLsizei " (parameter "width"))
1070 (paramdef "GLsizei " (parameter "height"))
1071 (paramdef "GLfloat " (parameter "xorig"))
1072 (paramdef "GLfloat " (parameter "yorig"))
1073 (paramdef "GLfloat " (parameter "xmove"))
1074 (paramdef "GLfloat " (parameter "ymove"))
1075 (paramdef
1076 "const GLubyte * "
1077 (parameter "bitmap"))))
3c9b6116
AW
1078 "Draw a bitmap.
1079
1080WIDTH
1081 HEIGHT
1082
1083 Specify the pixel width and height of the bitmap image.
1084
1085XORIG
1086 YORIG
1087
1088 Specify the location of the origin in the bitmap image. The origin
1089 is measured from the lower left corner of the bitmap, with right
1090 and up being the positive axes.
1091
1092XMOVE
1093 YMOVE
1094
1095 Specify the X and Y offsets to be added to the current raster
1096 position after the bitmap is drawn.
1097
1098BITMAP
1099 Specifies the address of the bitmap image.
1100
1101A bitmap is a binary image. When drawn, the bitmap is positioned
1102relative to the current raster position, and frame buffer pixels
1103corresponding to 1's in the bitmap are written using the current raster
1104color or index. Frame buffer pixels corresponding to 0's in the bitmap
1105are not modified.
1106
1107`glBitmap' takes seven arguments. The first pair specifies the width and
1108height of the bitmap image. The second pair specifies the location of
1109the bitmap origin relative to the lower left corner of the bitmap image.
1110The third pair of arguments specifies X and Y offsets to be added to the
1111current raster position after the bitmap has been drawn. The final
1112argument is a pointer to the bitmap image itself.
1113
1114If a non-zero named buffer object is bound to the
1115`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1116image is specified, BITMAP is treated as a byte offset into the buffer
1117object's data store.
1118
1119The bitmap image is interpreted like image data for the `glDrawPixels'
1120command, with WIDTH and HEIGHT corresponding to the width and height
1121arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1122set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1123interpretation of bitmap image data; modes specified using
1124`glPixelTransfer' do not.
1125
1126If the current raster position is invalid, `glBitmap' is ignored.
1127Otherwise, the lower left corner of the bitmap image is positioned at
1128the window coordinates
1129
1130X_W=⌊X_R-X_O,⌋
1131
1132Y_W=⌊Y_R-Y_O,⌋
1133
1134where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1135origin. Fragments are then generated for each pixel corresponding to a 1
1136(one) in the bitmap image. These fragments are generated using the
1137current raster Z coordinate, color or color index, and current raster
1138texture coordinates. They are then treated just as if they had been
1139generated by a point, line, or polygon, including texture mapping,
1140fogging, and all per-fragment operations such as alpha and depth
1141testing.
1142
1143After the bitmap has been drawn, the X and Y coordinates of the current
1144raster position are offset by XMOVE and YMOVE. No change is made to the
1145Z coordinate of the current raster position, or to the current raster
1146color, texture coordinates, or index.
1147
1148`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1149
1150`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1151bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1152data store is currently mapped.
1153
1154`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1155bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1156unpacked from the buffer object such that the memory reads required
1157would exceed the data store size.
1158
1159`GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1160the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
1161
1162(define-gl-procedure
1163 glBlendColor
1164 "glBlendColor"
1165 (funcsynopsis
1166 (funcprototype
1167 (funcdef "void " (function "glBlendColor"))
1168 (paramdef "GLclampf " (parameter "red"))
1169 (paramdef "GLclampf " (parameter "green"))
1170 (paramdef "GLclampf " (parameter "blue"))
1171 (paramdef "GLclampf " (parameter "alpha"))))
3c9b6116
AW
1172 "Set the blend color.
1173
1174RED
1175 GREEN
1176
1177 BLUE
1178
1179 ALPHA
1180
1181 specify the components of `GL_BLEND_COLOR'
1182
1183The `GL_BLEND_COLOR' may be used to calculate the source and destination
1184blending factors. The color components are clamped to the range [0,1]
1185before being stored. See `glBlendFunc' for a complete description of the
1186blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
11870).
1188
1189`GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1190between the execution of `glBegin' and the corresponding execution of
1191`glEnd'.")
8925f36f
AW
1192
1193(define-gl-procedure
1194 glBlendEquationSeparate
1195 "glBlendEquationSeparate"
1196 (funcsynopsis
1197 (funcprototype
1198 (funcdef
1199 "void "
1200 (function "glBlendEquationSeparate"))
1201 (paramdef "GLenum " (parameter "modeRGB"))
1202 (paramdef "GLenum " (parameter "modeAlpha"))))
3c9b6116
AW
1203 "Set the RGB blend equation and the alpha blend equation separately.
1204
1205MODERGB
1206 specifies the RGB blend equation, how the red, green, and blue
1207 components of the source and destination colors are combined. It
1208 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1209 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1210
1211MODEALPHA
1212 specifies the alpha blend equation, how the alpha component of the
1213 source and destination colors are combined. It must be
1214 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1215 `GL_MIN', `GL_MAX'.
1216
1217The blend equations determines how a new pixel (the ''source'' color) is
1218combined with a pixel already in the framebuffer (the ''destination''
1219color). This function specifies one blend equation for the RGB-color
1220components and one blend equation for the alpha component.
1221
8925f36f 1222The blend equations use the source and destination blend factors
3c9b6116
AW
1223specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1224`glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1225blend factors.
1226
1227In the equations that follow, source and destination color components
1228are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1229The result color is referred to as (R_R,G_RB_RA_R) . The source and
1230destination blend factors are denoted (S_R,S_GS_BS_A) and
1231(D_R,D_GD_BD_A) , respectively. For these equations all color components
1232are understood to have values in the range [0,1] .
1233
1234*Mode*
1235 *RGB Components*, *Alpha Component*
1236
1237`GL_FUNC_ADD'
1238 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 ,
1239 AR=A_S\u2062S_A+A_D\u2062D_A
1240
1241`GL_FUNC_SUBTRACT'
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_REVERSE_SUBTRACT'
1246 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 ,
1247 AR=A_D\u2062D_A-A_S\u2062S_A
1248
1249`GL_MIN'
1250 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1251 AR=MIN\u2061(A_S,A_D)
1252
1253`GL_MAX'
1254 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1255 AR=MAX\u2061(A_S,A_D)
1256
1257The results of these equations are clamped to the range [0,1] .
1258
1259The `GL_MIN' and `GL_MAX' equations are useful for applications that
1260analyze image data (image thresholding against a constant color, for
1261example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1262transparency, among other things.
1263
1264Initially, both the RGB blend equation and the alpha blend equation are
1265set to `GL_FUNC_ADD'.
1266
1267
1268
1269`GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1270of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1271`GL_MAX', or `GL_MIN'.
1272
1273`GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1274executed between the execution of `glBegin' and the corresponding
1275execution of `glEnd'.")
8925f36f
AW
1276
1277(define-gl-procedure
1278 glBlendEquation
1279 "glBlendEquation"
1280 (funcsynopsis
1281 (funcprototype
1282 (funcdef "void " (function "glBlendEquation"))
1283 (paramdef "GLenum " (parameter "mode"))))
3c9b6116
AW
1284 "Specify the equation used for both the RGB blend equation and the Alpha
1285blend equation.
1286
1287MODE
1288 specifies how source and destination colors are combined. It must
1289 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1290 `GL_MIN', `GL_MAX'.
1291
1292The blend equations determine how a new pixel (the ''source'' color) is
1293combined with a pixel already in the framebuffer (the ''destination''
1294color). This function sets both the RGB blend equation and the alpha
1295blend equation to a single equation.
1296
1297These equations use the source and destination blend factors specified
1298by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1299`glBlendFuncSeparate' for a description of the various blend factors.
1300
1301In the equations that follow, source and destination color components
1302are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1303The result color is referred to as (R_R,G_RB_RA_R) . The source and
1304destination blend factors are denoted (S_R,S_GS_BS_A) and
1305(D_R,D_GD_BD_A) , respectively. For these equations all color components
1306are understood to have values in the range [0,1] .
1307
1308*Mode*
1309 *RGB Components*, *Alpha Component*
1310
1311`GL_FUNC_ADD'
1312 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 ,
1313 AR=A_S\u2062S_A+A_D\u2062D_A
1314
1315`GL_FUNC_SUBTRACT'
1316 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 ,
1317 AR=A_S\u2062S_A-A_D\u2062D_A
1318
1319`GL_FUNC_REVERSE_SUBTRACT'
1320 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 ,
1321 AR=A_D\u2062D_A-A_S\u2062S_A
1322
1323`GL_MIN'
1324 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1325 AR=MIN\u2061(A_S,A_D)
1326
1327`GL_MAX'
1328 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1329 AR=MAX\u2061(A_S,A_D)
1330
1331The results of these equations are clamped to the range [0,1] .
1332
1333The `GL_MIN' and `GL_MAX' equations are useful for applications that
1334analyze image data (image thresholding against a constant color, for
1335example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1336transparency, among other things.
1337
1338Initially, both the RGB blend equation and the alpha blend equation are
1339set to `GL_FUNC_ADD'.
1340
1341
1342
1343`GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1344`GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1345
1346`GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1347between the execution of `glBegin' and the corresponding execution of
1348`glEnd'.")
8925f36f
AW
1349
1350(define-gl-procedure
1351 glBlendFuncSeparate
1352 "glBlendFuncSeparate"
1353 (funcsynopsis
1354 (funcprototype
1355 (funcdef
1356 "void "
1357 (function "glBlendFuncSeparate"))
1358 (paramdef "GLenum " (parameter "srcRGB"))
1359 (paramdef "GLenum " (parameter "dstRGB"))
1360 (paramdef "GLenum " (parameter "srcAlpha"))
1361 (paramdef "GLenum " (parameter "dstAlpha"))))
3c9b6116
AW
1362 "Specify pixel arithmetic for RGB and alpha components separately.
1363
1364SRCRGB
1365 Specifies how the red, green, and blue blending factors are
1366 computed. The following symbolic constants are accepted: `GL_ZERO',
1367 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1368 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1369 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1370 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1371 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1372 initial value is `GL_ONE'.
1373
1374DSTRGB
1375 Specifies how the red, green, and blue destination blending factors
1376 are computed. The following symbolic constants are accepted:
1377 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1378 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1379 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1380 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1381 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1382 value is `GL_ZERO'.
1383
1384SRCALPHA
1385 Specified how the alpha source blending factor is computed. The
1386 same symbolic constants are accepted as for SRCRGB. The initial
1387 value is `GL_ONE'.
1388
1389DSTALPHA
1390 Specified how the alpha destination blending factor is computed.
1391 The same symbolic constants are accepted as for DSTRGB. The initial
1392 value is `GL_ZERO'.
1393
1394In RGBA mode, pixels can be drawn using a function that blends the
1395incoming (source) RGBA values with the RGBA values that are already in
1396the frame buffer (the destination values). Blending is initially
1397disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1398enable and disable blending.
1399
1400`glBlendFuncSeparate' defines the operation of blending when it is
1401enabled. SRCRGB specifies which method is used to scale the source
1402RGB-color components. DSTRGB specifies which method is used to scale the
1403destination RGB-color components. Likewise, SRCALPHA specifies which
1404method is used to scale the source alpha color component, and DSTALPHA
1405specifies which method is used to scale the destination alpha component.
1406The possible methods are described in the following table. Each method
1407defines four scale factors, one each for red, green, blue, and alpha.
1408
1409In the table and in subsequent equations, source and destination color
1410components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1411color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1412They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1413, where
1414
1415K_C=2^M_C,-1
1416
1417and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1418bitplanes.
1419
1420Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1421and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1422
1423
1424
1425*Parameter*
1426 *RGB Factor*, *Alpha Factor*
1427
1428`GL_ZERO'
1429 (0,00) , 0
1430
1431`GL_ONE'
1432 (1,11) , 1
1433
1434`GL_SRC_COLOR'
1435 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1436
1437`GL_ONE_MINUS_SRC_COLOR'
1438 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1439
1440`GL_DST_COLOR'
1441 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1442
1443`GL_ONE_MINUS_DST_COLOR'
1444 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1445
1446`GL_SRC_ALPHA'
1447 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1448
1449`GL_ONE_MINUS_SRC_ALPHA'
1450 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1451
1452`GL_DST_ALPHA'
1453 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1454
1455`GL_ONE_MINUS_DST_ALPHA'
1456 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1457
1458`GL_CONSTANT_COLOR'
1459 (R_C,G_CB_C) , A_C
1460
1461`GL_ONE_MINUS_CONSTANT_COLOR'
1462 (1,11)-(R_C,G_CB_C) , 1-A_C
1463
1464`GL_CONSTANT_ALPHA'
1465 (A_C,A_CA_C) , A_C
1466
1467`GL_ONE_MINUS_CONSTANT_ALPHA'
1468 (1,11)-(A_C,A_CA_C) , 1-A_C
1469
1470`GL_SRC_ALPHA_SATURATE'
1471 (I,II) , 1
1472
1473In the table,
1474
1475I=MIN\u2061(A_S,1-A_D,)
1476
1477To determine the blended RGBA values of a pixel when drawing in RGBA
1478mode, the system uses the following equations:
1479
1480R_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)
1481B_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)
1482
1483Despite the apparent precision of the above equations, blending
1484arithmetic is not exactly specified, because blending operates with
1485imprecise integer color values. However, a blend factor that should be
1486equal to 1 is guaranteed not to modify its multiplicand, and a blend
1487factor equal to 0 reduces its multiplicand to 0. For example, when
1488SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1489equal to K_A , the equations reduce to simple replacement:
1490
1491R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1492
1493
1494
1495`GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1496accepted value.
1497
1498`GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1499between the execution of `glBegin' and the corresponding execution of
1500`glEnd'.")
8925f36f
AW
1501
1502(define-gl-procedure
1503 glBlendFunc
1504 "glBlendFunc"
1505 (funcsynopsis
1506 (funcprototype
1507 (funcdef "void " (function "glBlendFunc"))
1508 (paramdef "GLenum " (parameter "sfactor"))
1509 (paramdef "GLenum " (parameter "dfactor"))))
3c9b6116 1510 "Specify pixel arithmetic.
8925f36f 1511
3c9b6116
AW
1512SFACTOR
1513 Specifies how the red, green, blue, and alpha source blending
1514 factors are computed. The following symbolic constants are
1515 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1516 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1517 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1518 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1519 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1520 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1521 initial value is `GL_ONE'.
8925f36f 1522
3c9b6116
AW
1523DFACTOR
1524 Specifies how the red, green, blue, and alpha destination blending
1525 factors are computed. The following symbolic constants are
1526 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1527 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1528 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1529 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1530 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1531 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
8925f36f 1532
3c9b6116
AW
1533In RGBA mode, pixels can be drawn using a function that blends the
1534incoming (source) RGBA values with the RGBA values that are already in
1535the frame buffer (the destination values). Blending is initially
1536disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1537enable and disable blending.
1538
1539`glBlendFunc' defines the operation of blending when it is enabled.
1540SFACTOR specifies which method is used to scale the source color
1541components. DFACTOR specifies which method is used to scale the
1542destination color components. The possible methods are described in the
1543following table. Each method defines four scale factors, one each for
1544red, green, blue, and alpha. In the table and in subsequent equations,
1545source and destination color components are referred to as
1546(R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1547`glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1548to have integer values between 0 and (K_R,K_GK_BK_A) , where
1549
1550K_C=2^M_C,-1
1551
1552and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1553bitplanes.
1554
1555Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1556and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1557(F_R,F_GF_BF_A) , represent either source or destination factors. All
1558scale factors have range [0,1] .
1559
1560
1561
1562*Parameter*
1563 * (F_R,F_GF_BF_A) *
1564
1565`GL_ZERO'
1566 (0,000)
1567
1568`GL_ONE'
1569 (1,111)
1570
1571`GL_SRC_COLOR'
1572 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1573
1574`GL_ONE_MINUS_SRC_COLOR'
1575 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1576
1577`GL_DST_COLOR'
1578 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1579
1580`GL_ONE_MINUS_DST_COLOR'
1581 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1582
1583`GL_SRC_ALPHA'
1584 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1585
1586`GL_ONE_MINUS_SRC_ALPHA'
1587 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1588
1589`GL_DST_ALPHA'
1590 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1591
1592`GL_ONE_MINUS_DST_ALPHA'
1593 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1594
1595`GL_CONSTANT_COLOR'
1596 (R_C,G_CB_CA_C)
1597
1598`GL_ONE_MINUS_CONSTANT_COLOR'
1599 (1,111)-(R_C,G_CB_CA_C)
1600
1601`GL_CONSTANT_ALPHA'
1602 (A_C,A_CA_CA_C)
1603
1604`GL_ONE_MINUS_CONSTANT_ALPHA'
1605 (1,111)-(A_C,A_CA_CA_C)
1606
1607`GL_SRC_ALPHA_SATURATE'
1608 (I,II1)
1609
1610In the table,
1611
1612I=MIN\u2061(A_S,K_A-A_D)/K_A
1613
1614To determine the blended RGBA values of a pixel when drawing in RGBA
1615mode, the system uses the following equations:
1616
1617R_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)
1618B_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)
1619
1620Despite the apparent precision of the above equations, blending
1621arithmetic is not exactly specified, because blending operates with
1622imprecise integer color values. However, a blend factor that should be
1623equal to 1 is guaranteed not to modify its multiplicand, and a blend
1624factor equal to 0 reduces its multiplicand to 0. For example, when
1625SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1626is equal to K_A , the equations reduce to simple replacement:
1627
1628R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1629
1630
1631
1632`GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1633accepted value.
1634
1635`GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1636the execution of `glBegin' and the corresponding execution of `glEnd'.")
1637
1638(define-gl-procedure
1639 glBufferData
1640 "glBufferData"
1641 (funcsynopsis
1642 (funcprototype
1643 (funcdef "void " (function "glBufferData"))
1644 (paramdef "GLenum " (parameter "target"))
1645 (paramdef "GLsizeiptr " (parameter "size"))
1646 (paramdef "const GLvoid * " (parameter "data"))
1647 (paramdef "GLenum " (parameter "usage"))))
1648 "Creates and initializes a buffer object's data store.
1649
1650TARGET
1651 Specifies the target buffer object. The symbolic constant must be
1652 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1653 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1654
1655SIZE
1656 Specifies the size in bytes of the buffer object's new data store.
1657
1658DATA
1659 Specifies a pointer to data that will be copied into the data store
1660 for initialization, or `NULL' if no data is to be copied.
1661
1662USAGE
1663 Specifies the expected usage pattern of the data store. The
1664 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1665 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1666 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1667 `GL_DYNAMIC_COPY'.
1668
1669`glBufferData' creates a new data store for the buffer object currently
1670bound to TARGET. Any pre-existing data store is deleted. The new data
1671store is created with the specified SIZE in bytes and USAGE. If DATA is
1672not `NULL', the data store is initialized with data from this pointer.
1673In its initial state, the new data store is not mapped, it has a `NULL'
1674mapped pointer, and its mapped access is `GL_READ_WRITE'.
1675
1676USAGE is a hint to the GL implementation as to how a buffer object's
1677data store will be accessed. This enables the GL implementation to make
1678more intelligent decisions that may significantly impact buffer object
1679performance. It does not, however, constrain the actual usage of the
1680data store. USAGE can be broken down into two parts: first, the
1681frequency of access (modification and usage), and second, the nature of
1682that access. The frequency of access may be one of these:
1683
1684STREAM
1685 The data store contents will be modified once and used at most a
1686 few times.
1687
1688STATIC
1689 The data store contents will be modified once and used many times.
1690
1691DYNAMIC
1692 The data store contents will be modified repeatedly and used many
1693 times.
1694
1695The nature of access may be one of these:
1696
1697DRAW
1698 The data store contents are modified by the application, and used
1699 as the source for GL drawing and image specification commands.
1700
1701READ
1702 The data store contents are modified by reading data from the GL,
1703 and used to return that data when queried by the application.
1704
1705COPY
1706 The data store contents are modified by reading data from the GL,
1707 and used as the source for GL drawing and image specification
1708 commands.
1709
1710`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1711`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1712`GL_PIXEL_UNPACK_BUFFER'.
1713
1714`GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1715`GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1716`GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1717`GL_DYNAMIC_COPY'.
1718
1719`GL_INVALID_VALUE' is generated if SIZE is negative.
1720
1721`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1722is bound to TARGET.
1723
1724`GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1725store with the specified SIZE.
1726
1727`GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1728between the execution of `glBegin' and the corresponding execution of
1729`glEnd'.")
1730
1731(define-gl-procedure
1732 glBufferSubData
1733 "glBufferSubData"
1734 (funcsynopsis
1735 (funcprototype
1736 (funcdef "void " (function "glBufferSubData"))
1737 (paramdef "GLenum " (parameter "target"))
1738 (paramdef "GLintptr " (parameter "offset"))
1739 (paramdef "GLsizeiptr " (parameter "size"))
1740 (paramdef "const GLvoid * " (parameter "data"))))
1741 "Updates a subset of a buffer object's data store.
1742
1743TARGET
1744 Specifies the target buffer object. The symbolic constant must be
1745 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1746 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1747
1748OFFSET
1749 Specifies the offset into the buffer object's data store where data
1750 replacement will begin, measured in bytes.
1751
1752SIZE
1753 Specifies the size in bytes of the data store region being
1754 replaced.
1755
1756DATA
1757 Specifies a pointer to the new data that will be copied into the
1758 data store.
1759
1760`glBufferSubData' redefines some or all of the data store for the buffer
1761object currently bound to TARGET. Data starting at byte offset OFFSET
1762and extending for SIZE bytes is copied to the data store from the memory
1763pointed to by DATA. An error is thrown if OFFSET and SIZE together
1764define a range beyond the bounds of the buffer object's data store.
1765
1766`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1767`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1768`GL_PIXEL_UNPACK_BUFFER'.
1769
1770`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1771together they define a region of memory that extends beyond the buffer
1772object's allocated data store.
1773
1774`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1775is bound to TARGET.
1776
1777`GL_INVALID_OPERATION' is generated if the buffer object being updated
1778is mapped.
1779
1780`GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1781between the execution of `glBegin' and the corresponding execution of
1782`glEnd'.")
1783
1784(define-gl-procedure
1785 glCallLists
8925f36f
AW
1786 "glCallLists"
1787 (funcsynopsis
1788 (funcprototype
1789 (funcdef "void " (function "glCallLists"))
1790 (paramdef "GLsizei " (parameter "n"))
1791 (paramdef "GLenum " (parameter "type"))
1792 (paramdef "const GLvoid * " (parameter "lists"))))
3c9b6116
AW
1793 "Execute a list of display lists.
1794
1795N
1796 Specifies the number of display lists to be executed.
1797
1798TYPE
1799 Specifies the type of values in LISTS. Symbolic constants
1800 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1801 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1802 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1803
1804LISTS
1805 Specifies the address of an array of name offsets in the display
1806 list. The pointer type is void because the offsets can be bytes,
1807 shorts, ints, or floats, depending on the value of TYPE.
1808
1809`glCallLists' causes each display list in the list of names passed as
1810LISTS to be executed. As a result, the commands saved in each display
1811list are executed in order, just as if they were called without using a
1812display list. Names of display lists that have not been defined are
1813ignored.
1814
1815`glCallLists' provides an efficient means for executing more than one
1816display list. TYPE allows lists with various name formats to be
1817accepted. The formats are as follows:
1818
1819`GL_BYTE'
1820 LISTS is treated as an array of signed bytes, each in the range
1821 -128 through 127.
1822
1823`GL_UNSIGNED_BYTE'
1824 LISTS is treated as an array of unsigned bytes, each in the range 0
1825 through 255.
1826
1827`GL_SHORT'
1828 LISTS is treated as an array of signed two-byte integers, each in
1829 the range -32768 through 32767.
1830
1831`GL_UNSIGNED_SHORT'
1832 LISTS is treated as an array of unsigned two-byte integers, each in
1833 the range 0 through 65535.
1834
1835`GL_INT'
1836 LISTS is treated as an array of signed four-byte integers.
1837
1838`GL_UNSIGNED_INT'
1839 LISTS is treated as an array of unsigned four-byte integers.
1840
1841`GL_FLOAT'
1842 LISTS is treated as an array of four-byte floating-point values.
1843
1844`GL_2_BYTES'
1845 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1846 specifies a single display-list name. The value of the pair is
1847 computed as 256 times the unsigned value of the first byte plus the
1848 unsigned value of the second byte.
1849
1850`GL_3_BYTES'
1851 LISTS is treated as an array of unsigned bytes. Each triplet of
1852 bytes specifies a single display-list name. The value of the
1853 triplet is computed as 65536 times the unsigned value of the first
1854 byte, plus 256 times the unsigned value of the second byte, plus
1855 the unsigned value of the third byte.
1856
1857`GL_4_BYTES'
1858 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1859 bytes specifies a single display-list name. The value of the
1860 quadruplet is computed as 16777216 times the unsigned value of the
1861 first byte, plus 65536 times the unsigned value of the second byte,
1862 plus 256 times the unsigned value of the third byte, plus the
1863 unsigned value of the fourth byte.
1864
1865The list of display-list names is not null-terminated. Rather, N
1866specifies how many names are to be taken from LISTS.
1867
1868An additional level of indirection is made available with the
1869`glListBase' command, which specifies an unsigned offset that is added
1870to each display-list name specified in LISTS before that display list is
1871executed.
1872
1873`glCallLists' can appear inside a display list. To avoid the possibility
1874of infinite recursion resulting from display lists calling one another,
1875a limit is placed on the nesting level of display lists during
1876display-list execution. This limit must be at least 64, and it depends
1877on the implementation.
1878
1879GL state is not saved and restored across a call to `glCallLists'. Thus,
1880changes made to GL state during the execution of the display lists
1881remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1882`glPushMatrix', and `glPopMatrix' to preserve GL state across
1883`glCallLists' calls.
1884
1885`GL_INVALID_VALUE' is generated if N is negative.
1886
1887`GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1888`GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1889`GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
8925f36f
AW
1890
1891(define-gl-procedure
1892 glCallList
1893 "glCallList"
1894 (funcsynopsis
1895 (funcprototype
1896 (funcdef "void " (function "glCallList"))
1897 (paramdef "GLuint " (parameter "list"))))
3c9b6116
AW
1898 "Execute a display list.
1899
1900LIST
1901 Specifies the integer name of the display list to be executed.
1902
1903`glCallList' causes the named display list to be executed. The commands
1904saved in the display list are executed in order, just as if they were
1905called without using a display list. If LIST has not been defined as a
1906display list, `glCallList' is ignored.
1907
1908`glCallList' can appear inside a display list. To avoid the possibility
1909of infinite recursion resulting from display lists calling one another,
1910a limit is placed on the nesting level of display lists during
1911display-list execution. This limit is at least 64, and it depends on the
1912implementation.
1913
1914GL state is not saved and restored across a call to `glCallList'. Thus,
1915changes made to GL state during the execution of a display list remain
1916after execution of the display list is completed. Use `glPushAttrib',
1917`glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1918across `glCallList' calls.")
8925f36f
AW
1919
1920(define-gl-procedure
1921 glClearAccum
1922 "glClearAccum"
1923 (funcsynopsis
1924 (funcprototype
1925 (funcdef "void " (function "glClearAccum"))
1926 (paramdef "GLfloat " (parameter "red"))
1927 (paramdef "GLfloat " (parameter "green"))
1928 (paramdef "GLfloat " (parameter "blue"))
1929 (paramdef "GLfloat " (parameter "alpha"))))
3c9b6116
AW
1930 "Specify clear values for the accumulation buffer.
1931
1932RED
1933 GREEN
1934
1935 BLUE
1936
1937 ALPHA
1938
1939 Specify the red, green, blue, and alpha values used when the
1940 accumulation buffer is cleared. The initial values are all 0.
1941
1942`glClearAccum' specifies the red, green, blue, and alpha values used by
1943`glClear' to clear the accumulation buffer.
1944
1945Values specified by `glClearAccum' are clamped to the range [-1,1] .
1946
1947`GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1948between the execution of `glBegin' and the corresponding execution of
1949`glEnd'.")
8925f36f
AW
1950
1951(define-gl-procedure
1952 glClearColor
1953 "glClearColor"
1954 (funcsynopsis
1955 (funcprototype
1956 (funcdef "void " (function "glClearColor"))
1957 (paramdef "GLclampf " (parameter "red"))
1958 (paramdef "GLclampf " (parameter "green"))
1959 (paramdef "GLclampf " (parameter "blue"))
1960 (paramdef "GLclampf " (parameter "alpha"))))
3c9b6116
AW
1961 "Specify clear values for the color buffers.
1962
1963RED
1964 GREEN
1965
1966 BLUE
1967
1968 ALPHA
1969
1970 Specify the red, green, blue, and alpha values used when the color
1971 buffers are cleared. The initial values are all 0.
1972
1973`glClearColor' specifies the red, green, blue, and alpha values used by
1974`glClear' to clear the color buffers. Values specified by `glClearColor'
1975are clamped to the range [0,1] .
1976
1977`GL_INVALID_OPERATION' is generated if `glClearColor' is executed
1978between the execution of `glBegin' and the corresponding execution of
1979`glEnd'.")
8925f36f
AW
1980
1981(define-gl-procedure
1982 glClearDepth
1983 "glClearDepth"
1984 (funcsynopsis
1985 (funcprototype
1986 (funcdef "void " (function "glClearDepth"))
1987 (paramdef "GLclampd " (parameter "depth"))))
3c9b6116
AW
1988 "Specify the clear value for the depth buffer.
1989
1990DEPTH
1991 Specifies the depth value used when the depth buffer is cleared.
1992 The initial value is 1.
1993
1994`glClearDepth' specifies the depth value used by `glClear' to clear the
1995depth buffer. Values specified by `glClearDepth' are clamped to the
1996range [0,1] .
1997
1998`GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
1999between the execution of `glBegin' and the corresponding execution of
2000`glEnd'.")
8925f36f
AW
2001
2002(define-gl-procedure
2003 glClearIndex
2004 "glClearIndex"
2005 (funcsynopsis
2006 (funcprototype
2007 (funcdef "void " (function "glClearIndex"))
2008 (paramdef "GLfloat " (parameter "c"))))
3c9b6116
AW
2009 "Specify the clear value for the color index buffers.
2010
2011C
2012 Specifies the index used when the color index buffers are cleared.
2013 The initial value is 0.
2014
2015`glClearIndex' specifies the index used by `glClear' to clear the color
2016index buffers. C is not clamped. Rather, C is converted to a fixed-point
2017value with unspecified precision to the right of the binary point. The
2018integer part of this value is then masked with 2^M-1 , where M is the
2019number of bits in a color index stored in the frame buffer.
2020
2021`GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
2022between the execution of `glBegin' and the corresponding execution of
2023`glEnd'.")
8925f36f
AW
2024
2025(define-gl-procedure
2026 glClearStencil
2027 "glClearStencil"
2028 (funcsynopsis
2029 (funcprototype
2030 (funcdef "void " (function "glClearStencil"))
2031 (paramdef "GLint " (parameter "s"))))
3c9b6116
AW
2032 "Specify the clear value for the stencil buffer.
2033
2034S
2035 Specifies the index used when the stencil buffer is cleared. The
2036 initial value is 0.
2037
2038`glClearStencil' specifies the index used by `glClear' to clear the
2039stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2040in the stencil buffer.
2041
2042`GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2043between the execution of `glBegin' and the corresponding execution of
2044`glEnd'.")
8925f36f
AW
2045
2046(define-gl-procedure
2047 glClear
2048 "glClear"
2049 (funcsynopsis
2050 (funcprototype
2051 (funcdef "void " (function "glClear"))
2052 (paramdef "GLbitfield " (parameter "mask"))))
3c9b6116
AW
2053 "Clear buffers to preset values.
2054
2055MASK
2056 Bitwise OR of masks that indicate the buffers to be cleared. The
2057 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2058 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2059
2060`glClear' sets the bitplane area of the window to values previously
2061selected by `glClearColor', `glClearIndex', `glClearDepth',
2062`glClearStencil', and `glClearAccum'. Multiple color buffers can be
2063cleared simultaneously by selecting more than one buffer at a time using
2064`glDrawBuffer'.
2065
2066The pixel ownership test, the scissor test, dithering, and the buffer
2067writemasks affect the operation of `glClear'. The scissor box bounds the
2068cleared region. Alpha function, blend function, logical operation,
2069stenciling, texture mapping, and depth-buffering are ignored by
2070`glClear'.
2071
2072`glClear' takes a single argument that is the bitwise OR of several
2073values indicating which buffer is to be cleared.
2074
2075The values are as follows:
2076
2077`GL_COLOR_BUFFER_BIT'
2078 Indicates the buffers currently enabled for color writing.
2079
2080`GL_DEPTH_BUFFER_BIT'
2081 Indicates the depth buffer.
2082
2083`GL_ACCUM_BUFFER_BIT'
2084 Indicates the accumulation buffer.
2085
2086`GL_STENCIL_BUFFER_BIT'
2087 Indicates the stencil buffer.
2088
8925f36f 2089The value to which each buffer is cleared depends on the setting of the
3c9b6116
AW
2090clear value for that buffer.
2091
2092`GL_INVALID_VALUE' is generated if any bit other than the four defined
2093bits is set in MASK.
2094
2095`GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2096execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
2097
2098(define-gl-procedure
2099 glClientActiveTexture
2100 "glClientActiveTexture"
2101 (funcsynopsis
2102 (funcprototype
2103 (funcdef
2104 "void "
2105 (function "glClientActiveTexture"))
2106 (paramdef "GLenum " (parameter "texture"))))
3c9b6116
AW
2107 "Select active texture unit.
2108
2109TEXTURE
2110 Specifies which texture unit to make active. The number of texture
2111 units is implementation dependent, but must be at least two.
2112 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2113 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2114 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2115
2116`glClientActiveTexture' selects the vertex array client state parameters
2117to be modified by `glTexCoordPointer', and enabled or disabled with
2118`glEnableClientState' or `glDisableClientState', respectively, when
2119called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2120
2121`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2122where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
8925f36f
AW
2123
2124(define-gl-procedure
2125 glClipPlane
2126 "glClipPlane"
2127 (funcsynopsis
2128 (funcprototype
2129 (funcdef "void " (function "glClipPlane"))
2130 (paramdef "GLenum " (parameter "plane"))
2131 (paramdef
2132 "const GLdouble * "
2133 (parameter "equation"))))
3c9b6116
AW
2134 "Specify a plane against which all geometry is clipped.
2135
2136PLANE
2137 Specifies which clipping plane is being positioned. Symbolic names
2138 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2139 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2140
2141EQUATION
2142 Specifies the address of an array of four double-precision
2143 floating-point values. These values are interpreted as a plane
2144 equation.
2145
8925f36f 2146Geometry is always clipped against the boundaries of a six-plane frustum
3c9b6116
AW
2147in X, Y, and Z. `glClipPlane' allows the specification of additional
2148planes, not necessarily perpendicular to the X, Y, or Z axis, against
2149which all geometry is clipped. To determine the maximum number of
2150additional clipping planes, call `glGetIntegerv' with argument
2151`GL_MAX_CLIP_PLANES'. All implementations support at least six such
2152clipping planes. Because the resulting clipping region is the
2153intersection of the defined half-spaces, it is always convex.
2154
2155`glClipPlane' specifies a half-space using a four-component plane
2156equation. When `glClipPlane' is called, EQUATION is transformed by the
2157inverse of the modelview matrix and stored in the resulting eye
2158coordinates. Subsequent changes to the modelview matrix have no effect
2159on the stored plane-equation components. If the dot product of the eye
2160coordinates of a vertex with the stored plane equation components is
2161positive or zero, the vertex is IN with respect to that clipping plane.
2162Otherwise, it is OUT.
2163
2164To enable and disable clipping planes, call `glEnable' and `glDisable'
2165with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2166
2167All clipping planes are initially defined as (0, 0, 0, 0) in eye
2168coordinates and are disabled.
2169
2170`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2171
2172`GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2173the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
2174
2175(define-gl-procedure
2176 glColorMask
2177 "glColorMask"
2178 (funcsynopsis
2179 (funcprototype
2180 (funcdef "void " (function "glColorMask"))
2181 (paramdef "GLboolean " (parameter "red"))
2182 (paramdef "GLboolean " (parameter "green"))
2183 (paramdef "GLboolean " (parameter "blue"))
2184 (paramdef "GLboolean " (parameter "alpha"))))
3c9b6116
AW
2185 "Enable and disable writing of frame buffer color components.
2186
2187RED
2188 GREEN
2189
2190 BLUE
2191
2192 ALPHA
2193
2194 Specify whether red, green, blue, and alpha can or cannot be
2195 written into the frame buffer. The initial values are all
2196 `GL_TRUE', indicating that the color components can be written.
2197
2198`glColorMask' specifies whether the individual color components in the
2199frame buffer can or cannot be written. If RED is `GL_FALSE', for
2200example, no change is made to the red component of any pixel in any of
2201the color buffers, regardless of the drawing operation attempted.
2202
2203Changes to individual bits of components cannot be controlled. Rather,
2204changes are either enabled or disabled for entire color components.
2205
2206`GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2207the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
2208
2209(define-gl-procedure
2210 glColorMaterial
2211 "glColorMaterial"
2212 (funcsynopsis
2213 (funcprototype
2214 (funcdef "void " (function "glColorMaterial"))
2215 (paramdef "GLenum " (parameter "face"))
2216 (paramdef "GLenum " (parameter "mode"))))
3c9b6116
AW
2217 "Cause a material color to track the current color.
2218
2219FACE
2220 Specifies whether front, back, or both front and back material
2221 parameters should track the current color. Accepted values are
2222 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2223 is `GL_FRONT_AND_BACK'.
2224
2225MODE
2226 Specifies which of several material parameters track the current
2227 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2228 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2229 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2230
2231`glColorMaterial' specifies which material parameters track the current
2232color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2233parameters specified by MODE, of the material or materials specified by
2234FACE, track the current color at all times.
2235
2236To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2237`glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2238initially disabled.
2239
2240`GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2241
2242`GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2243between the execution of `glBegin' and the corresponding execution of
2244`glEnd'.")
8925f36f
AW
2245
2246(define-gl-procedure
2247 glColorPointer
2248 "glColorPointer"
2249 (funcsynopsis
2250 (funcprototype
2251 (funcdef "void " (function "glColorPointer"))
2252 (paramdef "GLint " (parameter "size"))
2253 (paramdef "GLenum " (parameter "type"))
2254 (paramdef "GLsizei " (parameter "stride"))
2255 (paramdef
2256 "const GLvoid * "
2257 (parameter "pointer"))))
3c9b6116
AW
2258 "Define an array of colors.
2259
2260SIZE
2261 Specifies the number of components per color. Must be 3 or 4. The
2262 initial value is 4.
2263
2264TYPE
2265 Specifies the data type of each color component in the array.
2266 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2267 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2268 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2269
2270STRIDE
2271 Specifies the byte offset between consecutive colors. If STRIDE is
2272 0, the colors are understood to be tightly packed in the array. The
2273 initial value is 0.
2274
2275POINTER
2276 Specifies a pointer to the first component of the first color
2277 element in the array. The initial value is 0.
2278
2279`glColorPointer' specifies the location and data format of an array of
2280color components to use when rendering. SIZE specifies the number of
2281components per color, and must be 3 or 4. TYPE specifies the data type
2282of each color component, and STRIDE specifies the byte stride from one
2283color to the next, allowing vertices and attributes to be packed into a
2284single array or stored in separate arrays. (Single-array storage may be
2285more efficient on some implementations; see `glInterleavedArrays'.)
2286
2287If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2288target (see `glBindBuffer') while a color array is specified, POINTER is
2289treated as a byte offset into the buffer object's data store. Also, the
2290buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2291vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2292
2293When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2294saved as client-side state, in addition to the current vertex array
2295buffer object binding.
2296
2297To enable and disable the color array, call `glEnableClientState' and
2298`glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2299the color array is used when `glDrawArrays', `glMultiDrawArrays',
2300`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2301`glArrayElement' is called.
2302
2303`GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2304
2305`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2306
2307`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f
AW
2308
2309(define-gl-procedure
2310 glColorSubTable
2311 "glColorSubTable"
2312 (funcsynopsis
2313 (funcprototype
2314 (funcdef "void " (function "glColorSubTable"))
2315 (paramdef "GLenum " (parameter "target"))
2316 (paramdef "GLsizei " (parameter "start"))
2317 (paramdef "GLsizei " (parameter "count"))
2318 (paramdef "GLenum " (parameter "format"))
2319 (paramdef "GLenum " (parameter "type"))
2320 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
2321 "Respecify a portion of a color table.
2322
2323TARGET
2324 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2325 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2326
2327START
2328 The starting index of the portion of the color table to be
2329 replaced.
2330
2331COUNT
2332 The number of table entries to replace.
2333
2334FORMAT
2335 The format of the pixel data in DATA. The allowable values are
2336 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2337 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2338
2339TYPE
2340 The type of the pixel data in DATA. The allowable values are
2341 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2342 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2343 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2344 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2345 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2346 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2347 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2348 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2349
2350DATA
2351 Pointer to a one-dimensional array of pixel data that is processed
2352 to replace the specified region of the color table.
2353
2354`glColorSubTable' is used to respecify a contiguous portion of a color
2355table previously defined using `glColorTable'. The pixels referenced by
2356DATA replace the portion of the existing table from indices START to
2357START+COUNT-1 , inclusive. This region may not include any entries
2358outside the range of the color table as it was originally specified. It
2359is not an error to specify a subtexture with width of 0, but such a
2360specification has no effect.
2361
2362If a non-zero named buffer object is bound to the
2363`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2364a color table is respecified, DATA is treated as a byte offset into the
2365buffer object's data store.
2366
2367`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2368values.
2369
2370`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2371values.
2372
2373`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2374values.
2375
2376`GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2377
2378`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2379bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2380data store is currently mapped.
2381
2382`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2383bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2384unpacked from the buffer object such that the memory reads required
2385would exceed the data store size.
2386
2387`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2388bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2389divisible into the number of bytes needed to store in memory a datum
2390indicated by TYPE.
2391
2392`GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2393between the execution of `glBegin' and the corresponding execution of
2394`glEnd'.")
8925f36f
AW
2395
2396(define-gl-procedure
2397 glColorTableParameter
2398 "glColorTableParameter"
2399 (funcsynopsis
2400 (funcprototype
2401 (funcdef
2402 "void "
2403 (function "glColorTableParameterfv"))
2404 (paramdef "GLenum " (parameter "target"))
2405 (paramdef "GLenum " (parameter "pname"))
2406 (paramdef
2407 "const GLfloat * "
2408 (parameter "params"))))
3c9b6116
AW
2409 "Set color lookup table parameters.
2410
2411TARGET
2412 The target color table. Must be `GL_COLOR_TABLE',
2413 `GL_POST_CONVOLUTION_COLOR_TABLE', or
2414 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2415
2416PNAME
2417 The symbolic name of a texture color lookup table parameter. Must
2418 be one of `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS'.
2419
2420PARAMS
2421 A pointer to an array where the values of the parameters are
2422 stored.
2423
2424`glColorTableParameter' is used to specify the scale factors and bias
2425terms applied to color components when they are loaded into a color
2426table. TARGET indicates which color table the scale and bias terms apply
2427to; it must be set to `GL_COLOR_TABLE',
2428`GL_POST_CONVOLUTION_COLOR_TABLE', or
2429`GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2430
2431PNAME must be `GL_COLOR_TABLE_SCALE' to set the scale factors. In this
2432case, PARAMS points to an array of four values, which are the scale
2433factors for red, green, blue, and alpha, in that order.
2434
2435PNAME must be `GL_COLOR_TABLE_BIAS' to set the bias terms. In this case,
2436PARAMS points to an array of four values, which are the bias terms for
2437red, green, blue, and alpha, in that order.
2438
2439The color tables themselves are specified by calling `glColorTable'.
2440
2441`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
2442value.
2443
2444`GL_INVALID_OPERATION' is generated if `glColorTableParameter' is
2445executed between the execution of `glBegin' and the corresponding
2446execution of `glEnd'.")
8925f36f
AW
2447
2448(define-gl-procedure
2449 glColorTable
2450 "glColorTable"
2451 (funcsynopsis
2452 (funcprototype
2453 (funcdef "void " (function "glColorTable"))
2454 (paramdef "GLenum " (parameter "target"))
2455 (paramdef "GLenum " (parameter "internalformat"))
2456 (paramdef "GLsizei " (parameter "width"))
2457 (paramdef "GLenum " (parameter "format"))
2458 (paramdef "GLenum " (parameter "type"))
2459 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116 2460 "Define a color lookup table.
8925f36f 2461
3c9b6116
AW
2462TARGET
2463 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2464 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2465 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2466 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8925f36f 2467
3c9b6116
AW
2468INTERNALFORMAT
2469 The internal format of the color table. The allowable values are
2470 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2471 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2472 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2473 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2474 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2475 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2476 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2477 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2478 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2479 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
8925f36f 2480
3c9b6116
AW
2481WIDTH
2482 The number of entries in the color lookup table specified by DATA.
8925f36f 2483
3c9b6116
AW
2484FORMAT
2485 The format of the pixel data in DATA. The allowable values are
2486 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2487 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8925f36f 2488
3c9b6116
AW
2489TYPE
2490 The type of the pixel data in DATA. The allowable values are
2491 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2492 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2493 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2494 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2495 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2496 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2497 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2498 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2499
2500DATA
2501 Pointer to a one-dimensional array of pixel data that is processed
2502 to build the color table.
2503
2504`glColorTable' may be used in two ways: to test the actual size and
2505color resolution of a lookup table given a particular set of parameters,
2506or to load the contents of a color lookup table. Use the targets
2507`GL_PROXY_*' for the first case and the other targets for the second
2508case.
2509
2510If a non-zero named buffer object is bound to the
2511`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2512is specified, DATA is treated as a byte offset into the buffer object's
2513data store.
2514
2515If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2516`GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2517table from an array of pixels. The pixel array specified by WIDTH,
2518FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2519`glDrawPixels' were called, but processing stops after the final
2520expansion to RGBA is completed.
2521
2522The four scale parameters and the four bias parameters that are defined
2523for the table are then used to scale and bias the R, G, B, and A
2524components of each pixel. (Use `glColorTableParameter' to set these
2525scale and bias parameters.)
2526
2527Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2528pixel is then converted to the internal format specified by
2529INTERNALFORMAT. This conversion simply maps the component values of the
2530pixel (R, G, B, and A) to the values included in the internal format
2531(red, green, blue, alpha, luminance, and intensity). The mapping is as
2532follows:
2533
2534
2535
2536*Internal Format*
2537 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2538
2539`GL_ALPHA'
2540 , , , A , ,
2541
2542`GL_LUMINANCE'
2543 , , , , R ,
2544
2545`GL_LUMINANCE_ALPHA'
2546 , , , A , R ,
2547
2548`GL_INTENSITY'
2549 , , , , , R
2550
2551`GL_RGB'
2552 R , G , B , , ,
2553
2554`GL_RGBA'
2555 R , G , B , A , ,
2556
2557Finally, the red, green, blue, alpha, luminance, and/or intensity
2558components of the resulting pixels are stored in the color table. They
2559form a one-dimensional table with indices in the range [0,WIDTH-1] .
2560
2561If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2562values of the proxy color table's state variables
2563`GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2564`GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2565`GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2566`GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2567There is no effect on the image or state of any actual color table. If
2568the specified color table is too large to be supported, then all the
2569proxy state variables listed above are set to zero. Otherwise, the color
2570table could be supported by `glColorTable' using the corresponding
2571non-proxy target, and the proxy state variables are set as if that
2572target were being defined.
2573
2574The proxy state variables can be retrieved by calling
2575`glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2576the application to decide if a particular `glColorTable' command would
2577succeed, and to determine what the resulting color table attributes
2578would be.
2579
2580If a color table is enabled, and its width is non-zero, then its
2581contents are used to replace a subset of the components of each RGBA
2582pixel group, based on the internal format of the table.
2583
2584Each pixel group has color components (R, G, B, A) that are in the range
2585[0.0,1.0] . The color components are rescaled to the size of the color
2586lookup table to form an index. Then a subset of the components based on
2587the internal format of the table are replaced by the table entry
2588selected by that index. If the color components and contents of the
2589table are represented as follows:
2590
2591
2592
2593*Representation*
2594 *Meaning*
2595
2596`r'
2597 Table index computed from `R'
2598
2599`g'
2600 Table index computed from `G'
2601
2602`b'
2603 Table index computed from `B'
2604
2605`a'
2606 Table index computed from `A'
2607
2608`L[i]'
2609 Luminance value at table index `i'
2610
2611`I[i]'
2612 Intensity value at table index `i'
2613
2614`R[i]'
2615 Red value at table index `i'
2616
2617`G[i]'
2618 Green value at table index `i'
2619
2620`B[i]'
2621 Blue value at table index `i'
2622
2623`A[i]'
2624 Alpha value at table index `i'
2625
2626then the result of color table lookup is as follows:
2627
2628
2629
2630**
2631 *Resulting Texture Components*
2632
2633*Table Internal Format*
2634 *R*, *G*, *B*, *A*
2635
2636`GL_ALPHA'
2637 `R', `G', `B', `A[a]'
2638
2639`GL_LUMINANCE'
2640 `L[r]', `L[g]', `L[b]', `At'
2641
2642`GL_LUMINANCE_ALPHA'
2643 `L[r]', `L[g]', `L[b]', `A[a]'
2644
2645`GL_INTENSITY'
2646 `I[r]', `I[g]', `I[b]', `I[a]'
2647
2648`GL_RGB'
2649 `R[r]', `G[g]', `B[b]', `A'
2650
2651`GL_RGBA'
2652 `R[r]', `G[g]', `B[b]', `A[a]'
2653
2654When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2655map operation (if it is enabled) are mapped by the color lookup table
2656before being passed to the convolution operation. The colors resulting
2657from the convolution operation are modified by the post convolution
2658color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2659These modified colors are then sent to the color matrix operation.
2660Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2661resulting from the color matrix operation are mapped by the post color
2662matrix color lookup table before being used by the histogram operation.
2663
2664
2665
2666`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2667values.
2668
2669`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2670allowable values.
2671
2672`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2673values.
2674
2675`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2676values.
2677
2678`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2679
2680`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2681large to be supported by the implementation, and TARGET is not a
2682`GL_PROXY_*' target.
2683
2684`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2685bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2686data store is currently mapped.
2687
2688`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2689bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2690unpacked from the buffer object such that the memory reads required
2691would exceed the data store size.
2692
2693`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2694bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2695divisible into the number of bytes needed to store in memory a datum
2696indicated by TYPE.
2697
2698`GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2699between the execution of `glBegin' and the corresponding execution of
2700`glEnd'.")
2701
2702(define-gl-procedure
2703 glColor
2704 "glColor"
2705 (funcsynopsis
2706 (funcprototype
2707 (funcdef "void " (function "glColor3b"))
2708 (paramdef "GLbyte " (parameter "red"))
2709 (paramdef "GLbyte " (parameter "green"))
2710 (paramdef "GLbyte " (parameter "blue"))))
2711 "Set the current color.
2712
2713RED
2714 GREEN
2715
2716 BLUE
2717
2718 Specify new red, green, and blue values for the current color.
2719
2720ALPHA
2721 Specifies a new alpha value for the current color. Included only in
2722 the four-argument `glColor4' commands.
2723
2724The GL stores both a current single-valued color index and a current
2725four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2726`glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2727variants specify new red, green, and blue values explicitly and set the
2728current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2729variants specify all four color components explicitly.
2730
2731`glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2732`glColor4i' take three or four signed byte, short, or long integers as
2733arguments. When *v* is appended to the name, the color commands can take
2734a pointer to an array of such values.
2735
2736Current color values are stored in floating-point format, with
2737unspecified mantissa and exponent sizes. Unsigned integer color
2738components, when specified, are linearly mapped to floating-point values
2739such that the largest representable value maps to 1.0 (full intensity),
2740and 0 maps to 0.0 (zero intensity). Signed integer color components,
2741when specified, are linearly mapped to floating-point values such that
2742the most positive representable value maps to 1.0, and the most negative
2743representable value maps to -1.0 . (Note that this mapping does not
2744convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2745
2746Neither floating-point nor signed integer values are clamped to the
2747range [0,1] before the current color is updated. However, color
2748components are clamped to this range before they are interpolated or
2749written into a color buffer.")
2750
2751(define-gl-procedure
2752 glCompileShader
2753 "glCompileShader"
2754 (funcsynopsis
2755 (funcprototype
2756 (funcdef "void " (function "glCompileShader"))
2757 (paramdef "GLuint " (parameter "shader"))))
2758 "Compiles a shader object.
2759
2760SHADER
2761 Specifies the shader object to be compiled.
2762
2763`glCompileShader' compiles the source code strings that have been stored
2764in the shader object specified by SHADER.
2765
2766The compilation status will be stored as part of the shader object's
2767state. This value will be set to `GL_TRUE' if the shader was compiled
2768without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2769queried by calling `glGetShader' with arguments SHADER and
2770`GL_COMPILE_STATUS'.
2771
2772Compilation of a shader can fail for a number of reasons as specified by
2773the OpenGL Shading Language Specification. Whether or not the
2774compilation was successful, information about the compilation can be
2775obtained from the shader object's information log by calling
2776`glGetShaderInfoLog'.
2777
2778`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2779OpenGL.
2780
2781`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2782
2783`GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2784between the execution of `glBegin' and the corresponding execution of
2785`glEnd'.")
2786
2787(define-gl-procedure
2788 glCompressedTexImage1D
2789 "glCompressedTexImage1D"
2790 (funcsynopsis
2791 (funcprototype
2792 (funcdef
2793 "void "
2794 (function "glCompressedTexImage1D"))
2795 (paramdef "GLenum " (parameter "target"))
2796 (paramdef "GLint " (parameter "level"))
2797 (paramdef "GLenum " (parameter "internalformat"))
2798 (paramdef "GLsizei " (parameter "width"))
2799 (paramdef "GLint " (parameter "border"))
2800 (paramdef "GLsizei " (parameter "imageSize"))
2801 (paramdef "const GLvoid * " (parameter "data"))))
2802 "Specify a one-dimensional texture image in a compressed format.
2803
2804TARGET
2805 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2806 `GL_PROXY_TEXTURE_1D'.
2807
2808LEVEL
2809 Specifies the level-of-detail number. Level 0 is the base image
2810 level. Level N is the Nth mipmap reduction image.
2811
2812INTERNALFORMAT
2813 Specifies the format of the compressed image data stored at address
2814 DATA.
2815
2816WIDTH
2817 Specifies the width of the texture image including the border if
2818 any. If the GL version does not support non-power-of-two sizes,
2819 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2820 implementations support texture images that are at least 64 texels
2821 wide. The height of the 1D texture image is 1.
2822
2823BORDER
2824 Specifies the width of the border. Must be either 0 or 1.
2825
2826IMAGESIZE
2827 Specifies the number of unsigned bytes of image data starting at
2828 the address specified by DATA.
2829
2830DATA
2831 Specifies a pointer to the compressed image data in memory.
2832
2833Texturing maps a portion of a specified texture image onto each
2834graphical primitive for which texturing is enabled. To enable and
2835disable one-dimensional texturing, call `glEnable' and `glDisable' with
2836argument `GL_TEXTURE_1D'.
2837
2838`glCompressedTexImage1D' loads a previously defined, and retrieved,
2839compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2840(see `glTexImage1D').
2841
2842If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2843of the texture image state is recalculated, checked for consistency, and
2844checked against the implementation's capabilities. If the implementation
2845cannot handle a texture of the requested texture size, it sets all of
2846the image state to 0, but does not generate an error (see `glGetError').
2847To query for an entire mipmap array, use an image array level greater
2848than or equal to 1.
2849
2850INTERNALFORMAT must be extension-specified compressed-texture format.
2851When a texture is loaded with `glTexImage1D' using a generic compressed
2852texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2853its extensions supporting compressed textures. In order to load the
2854compressed texture image using `glCompressedTexImage1D', query the
2855compressed texture image's size and format using
2856`glGetTexLevelParameter'.
2857
2858If a non-zero named buffer object is bound to the
2859`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2860image is specified, DATA is treated as a byte offset into the buffer
2861object's data store.
2862
2863`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2864compressed internal formats: `GL_COMPRESSED_ALPHA',
2865`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2866`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2867
2868`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2869format, dimensions, and contents of the specified compressed image data.
2870
2871`GL_INVALID_OPERATION' is generated if parameter combinations are not
2872supported by the specific compressed internal format as specified in the
2873specific texture compression extension.
2874
2875`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2876bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2877data store is currently mapped.
2878
2879`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2880bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2881unpacked from the buffer object such that the memory reads required
2882would exceed the data store size.
2883
2884`GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2885executed between the execution of `glBegin' and the corresponding
2886execution of `glEnd'.
2887
2888Undefined results, including abnormal program termination, are generated
2889if DATA is not encoded in a manner consistent with the extension
2890specification defining the internal compression format.")
2891
2892(define-gl-procedure
2893 glCompressedTexImage2D
2894 "glCompressedTexImage2D"
2895 (funcsynopsis
2896 (funcprototype
2897 (funcdef
2898 "void "
2899 (function "glCompressedTexImage2D"))
2900 (paramdef "GLenum " (parameter "target"))
2901 (paramdef "GLint " (parameter "level"))
2902 (paramdef "GLenum " (parameter "internalformat"))
2903 (paramdef "GLsizei " (parameter "width"))
2904 (paramdef "GLsizei " (parameter "height"))
2905 (paramdef "GLint " (parameter "border"))
2906 (paramdef "GLsizei " (parameter "imageSize"))
2907 (paramdef "const GLvoid * " (parameter "data"))))
2908 "Specify a two-dimensional texture image in a compressed format.
2909
2910TARGET
2911 Specifies the target texture. Must be `GL_TEXTURE_2D',
2912 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2913 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2914 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2915 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2916
2917LEVEL
2918 Specifies the level-of-detail number. Level 0 is the base image
2919 level. Level N is the Nth mipmap reduction image.
2920
2921INTERNALFORMAT
2922 Specifies the format of the compressed image data stored at address
2923 DATA.
2924
2925WIDTH
2926 Specifies the width of the texture image including the border if
2927 any. If the GL version does not support non-power-of-two sizes,
2928 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2929 implementations support 2D texture images that are at least 64
2930 texels wide and cube-mapped texture images that are at least 16
2931 texels wide.
2932
2933HEIGHT
2934 Specifies the height of the texture image including the border if
2935 any. If the GL version does not support non-power-of-two sizes,
2936 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2937 implementations support 2D texture images that are at least 64
2938 texels high and cube-mapped texture images that are at least 16
2939 texels high.
2940
2941BORDER
2942 Specifies the width of the border. Must be either 0 or 1.
2943
2944IMAGESIZE
2945 Specifies the number of unsigned bytes of image data starting at
2946 the address specified by DATA.
2947
2948DATA
2949 Specifies a pointer to the compressed image data in memory.
2950
2951Texturing maps a portion of a specified texture image onto each
2952graphical primitive for which texturing is enabled. To enable and
2953disable two-dimensional texturing, call `glEnable' and `glDisable' with
2954argument `GL_TEXTURE_2D'. To enable and disable texturing using
2955cube-mapped textures, call `glEnable' and `glDisable' with argument
2956`GL_TEXTURE_CUBE_MAP'.
2957
2958`glCompressedTexImage2D' loads a previously defined, and retrieved,
2959compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2960(see `glTexImage2D').
2961
2962If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2963of the texture image state is recalculated, checked for consistency, and
2964checked against the implementation's capabilities. If the implementation
2965cannot handle a texture of the requested texture size, it sets all of
2966the image state to 0, but does not generate an error (see `glGetError').
2967To query for an entire mipmap array, use an image array level greater
2968than or equal to 1.
2969
2970INTERNALFORMAT must be an extension-specified compressed-texture format.
2971When a texture is loaded with `glTexImage2D' using a generic compressed
2972texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2973its extensions supporting compressed textures. In order to load the
2974compressed texture image using `glCompressedTexImage2D', query the
2975compressed texture image's size and format using
2976`glGetTexLevelParameter'.
2977
2978If a non-zero named buffer object is bound to the
2979`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2980image is specified, DATA is treated as a byte offset into the buffer
2981object's data store.
2982
2983`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2984compressed internal formats: `GL_COMPRESSED_ALPHA',
2985`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2986`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2987
2988`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2989format, dimensions, and contents of the specified compressed image data.
2990
2991`GL_INVALID_OPERATION' is generated if parameter combinations are not
2992supported by the specific compressed internal format as specified in the
2993specific texture compression extension.
2994
2995`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2996bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2997data store is currently mapped.
2998
2999`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3000bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3001unpacked from the buffer object such that the memory reads required
3002would exceed the data store size.
3003
3004`GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
3005executed between the execution of `glBegin' and the corresponding
3006execution of `glEnd'.
3007
3008Undefined results, including abnormal program termination, are generated
3009if DATA is not encoded in a manner consistent with the extension
3010specification defining the internal compression format.")
3011
3012(define-gl-procedure
8925f36f
AW
3013 glCompressedTexImage3D
3014 "glCompressedTexImage3D"
3015 (funcsynopsis
3016 (funcprototype
3017 (funcdef
3018 "void "
3019 (function "glCompressedTexImage3D"))
3020 (paramdef "GLenum " (parameter "target"))
3021 (paramdef "GLint " (parameter "level"))
3022 (paramdef "GLenum " (parameter "internalformat"))
3023 (paramdef "GLsizei " (parameter "width"))
3024 (paramdef "GLsizei " (parameter "height"))
3025 (paramdef "GLsizei " (parameter "depth"))
3026 (paramdef "GLint " (parameter "border"))
3027 (paramdef "GLsizei " (parameter "imageSize"))
3028 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
3029 "Specify a three-dimensional texture image in a compressed format.
3030
3031TARGET
3032 Specifies the target texture. Must be `GL_TEXTURE_3D' or
3033 `GL_PROXY_TEXTURE_3D'.
3034
3035LEVEL
3036 Specifies the level-of-detail number. Level 0 is the base image
3037 level. Level N is the Nth mipmap reduction image.
3038
3039INTERNALFORMAT
3040 Specifies the format of the compressed image data stored at address
3041 DATA.
3042
3043WIDTH
3044 Specifies the width of the texture image including the border if
3045 any. If the GL version does not support non-power-of-two sizes,
3046 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3047 implementations support 3D texture images that are at least 16
3048 texels wide.
3049
3050HEIGHT
3051 Specifies the height of the texture image including the border if
3052 any. If the GL version does not support non-power-of-two sizes,
3053 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3054 implementations support 3D texture images that are at least 16
3055 texels high.
3056
3057DEPTH
3058 Specifies the depth of the texture image including the border if
3059 any. If the GL version does not support non-power-of-two sizes,
3060 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3061 implementations support 3D texture images that are at least 16
3062 texels deep.
3063
3064BORDER
3065 Specifies the width of the border. Must be either 0 or 1.
3066
3067IMAGESIZE
3068 Specifies the number of unsigned bytes of image data starting at
3069 the address specified by DATA.
3070
3071DATA
3072 Specifies a pointer to the compressed image data in memory.
3073
3074Texturing maps a portion of a specified texture image onto each
3075graphical primitive for which texturing is enabled. To enable and
3076disable three-dimensional texturing, call `glEnable' and `glDisable'
3077with argument `GL_TEXTURE_3D'.
3078
3079`glCompressedTexImage3D' loads a previously defined, and retrieved,
3080compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
3081(see `glTexImage3D').
3082
3083If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
3084of the texture image state is recalculated, checked for consistency, and
3085checked against the implementation's capabilities. If the implementation
3086cannot handle a texture of the requested texture size, it sets all of
3087the image state to 0, but does not generate an error (see `glGetError').
3088To query for an entire mipmap array, use an image array level greater
3089than or equal to 1.
3090
3091INTERNALFORMAT must be an extension-specified compressed-texture format.
3092When a texture is loaded with `glTexImage2D' using a generic compressed
3093texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
3094its extensions supporting compressed textures. In order to load the
3095compressed texture image using `glCompressedTexImage3D', query the
3096compressed texture image's size and format using
3097`glGetTexLevelParameter'.
3098
3099If a non-zero named buffer object is bound to the
3100`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3101image is specified, DATA is treated as a byte offset into the buffer
3102object's data store.
3103
3104`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3105compressed internal formats: `GL_COMPRESSED_ALPHA',
3106`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3107`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3108
3109`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3110format, dimensions, and contents of the specified compressed image data.
3111
3112`GL_INVALID_OPERATION' is generated if parameter combinations are not
3113supported by the specific compressed internal format as specified in the
3114specific texture compression extension.
3115
3116`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3117bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3118data store is currently mapped.
3119
3120`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3121bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3122unpacked from the buffer object such that the memory reads required
3123would exceed the data store size.
3124
3125`GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3126executed between the execution of `glBegin' and the corresponding
3127execution of `glEnd'.
3128
3129Undefined results, including abnormal program termination, are generated
3130if DATA is not encoded in a manner consistent with the extension
3131specification defining the internal compression format.")
8925f36f
AW
3132
3133(define-gl-procedure
3134 glCompressedTexSubImage1D
3135 "glCompressedTexSubImage1D"
3136 (funcsynopsis
3137 (funcprototype
3138 (funcdef
3139 "void "
3140 (function "glCompressedTexSubImage1D"))
3141 (paramdef "GLenum " (parameter "target"))
3142 (paramdef "GLint " (parameter "level"))
3143 (paramdef "GLint " (parameter "xoffset"))
3144 (paramdef "GLsizei " (parameter "width"))
3145 (paramdef "GLenum " (parameter "format"))
3146 (paramdef "GLsizei " (parameter "imageSize"))
3147 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
3148 "Specify a one-dimensional texture subimage in a compressed format.
3149
3150TARGET
3151 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3152
3153LEVEL
3154 Specifies the level-of-detail number. Level 0 is the base image
3155 level. Level N is the Nth mipmap reduction image.
3156
3157XOFFSET
3158 Specifies a texel offset in the x direction within the texture
3159 array.
3160
3161WIDTH
3162 Specifies the width of the texture subimage.
3163
3164FORMAT
3165 Specifies the format of the compressed image data stored at address
3166 DATA.
3167
3168IMAGESIZE
3169 Specifies the number of unsigned bytes of image data starting at
3170 the address specified by DATA.
3171
3172DATA
3173 Specifies a pointer to the compressed image data in memory.
3174
3175Texturing maps a portion of a specified texture image onto each
3176graphical primitive for which texturing is enabled. To enable and
3177disable one-dimensional texturing, call `glEnable' and `glDisable' with
3178argument `GL_TEXTURE_1D'.
3179
3180`glCompressedTexSubImage1D' redefines a contiguous subregion of an
3181existing one-dimensional texture image. The texels referenced by DATA
3182replace the portion of the existing texture array with x indices XOFFSET
3183and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3184outside the range of the texture array as it was originally specified.
3185It is not an error to specify a subtexture with width of 0, but such a
3186specification has no effect.
3187
3188FORMAT must be an extension-specified compressed-texture format. The
3189FORMAT of the compressed texture image is selected by the GL
3190implementation that compressed it (see `glTexImage1D'), and should be
3191queried at the time the texture was compressed with
3192`glGetTexLevelParameter'.
3193
3194If a non-zero named buffer object is bound to the
3195`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3196image is specified, DATA is treated as a byte offset into the buffer
3197object's data store.
3198
3199`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3200compressed internal formats: `GL_COMPRESSED_ALPHA',
3201`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3202`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3203`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3204`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3205`GL_COMPRESSED_SRGB_ALPHA'.
3206
3207`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3208format, dimensions, and contents of the specified compressed image data.
3209
3210`GL_INVALID_OPERATION' is generated if parameter combinations are not
3211supported by the specific compressed internal format as specified in the
3212specific texture compression extension.
3213
3214`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3215bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3216data store is currently mapped.
3217
3218`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3219bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3220unpacked from the buffer object such that the memory reads required
3221would exceed the data store size.
3222
3223`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3224executed between the execution of `glBegin' and the corresponding
3225execution of `glEnd'.
3226
3227Undefined results, including abnormal program termination, are generated
3228if DATA is not encoded in a manner consistent with the extension
3229specification defining the internal compression format.")
8925f36f
AW
3230
3231(define-gl-procedure
3232 glCompressedTexSubImage2D
3233 "glCompressedTexSubImage2D"
3234 (funcsynopsis
3235 (funcprototype
3236 (funcdef
3237 "void "
3238 (function "glCompressedTexSubImage2D"))
3239 (paramdef "GLenum " (parameter "target"))
3240 (paramdef "GLint " (parameter "level"))
3241 (paramdef "GLint " (parameter "xoffset"))
3242 (paramdef "GLint " (parameter "yoffset"))
3243 (paramdef "GLsizei " (parameter "width"))
3244 (paramdef "GLsizei " (parameter "height"))
3245 (paramdef "GLenum " (parameter "format"))
3246 (paramdef "GLsizei " (parameter "imageSize"))
3247 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
3248 "Specify a two-dimensional texture subimage in a compressed format.
3249
3250TARGET
3251 Specifies the target texture. Must be `GL_TEXTURE_2D',
3252 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3253 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3254 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3255 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3256
3257LEVEL
3258 Specifies the level-of-detail number. Level 0 is the base image
3259 level. Level N is the Nth mipmap reduction image.
3260
3261XOFFSET
3262 Specifies a texel offset in the x direction within the texture
3263 array.
3264
3265YOFFSET
3266 Specifies a texel offset in the y direction within the texture
3267 array.
3268
3269WIDTH
3270 Specifies the width of the texture subimage.
3271
3272HEIGHT
3273 Specifies the height of the texture subimage.
3274
3275FORMAT
3276 Specifies the format of the compressed image data stored at address
3277 DATA.
3278
3279IMAGESIZE
3280 Specifies the number of unsigned bytes of image data starting at
3281 the address specified by DATA.
3282
3283DATA
3284 Specifies a pointer to the compressed image data in memory.
3285
3286Texturing maps a portion of a specified texture image onto each
3287graphical primitive for which texturing is enabled. To enable and
3288disable two-dimensional texturing, call `glEnable' and `glDisable' with
3289argument `GL_TEXTURE_2D'. To enable and disable texturing using
3290cube-mapped texture, call `glEnable' and `glDisable' with argument
3291`GL_TEXTURE_CUBE_MAP'.
3292
3293`glCompressedTexSubImage2D' redefines a contiguous subregion of an
3294existing two-dimensional texture image. The texels referenced by DATA
3295replace the portion of the existing texture array with x indices XOFFSET
3296and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3297inclusive. This region may not include any texels outside the range of
3298the texture array as it was originally specified. It is not an error to
3299specify a subtexture with width of 0, but such a specification has no
3300effect.
3301
3302FORMAT must be an extension-specified compressed-texture format. The
3303FORMAT of the compressed texture image is selected by the GL
3304implementation that compressed it (see `glTexImage2D') and should be
3305queried at the time the texture was compressed with
3306`glGetTexLevelParameter'.
3307
3308If a non-zero named buffer object is bound to the
3309`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3310image is specified, DATA is treated as a byte offset into the buffer
3311object's data store.
3312
3313`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3314compressed internal formats: `GL_COMPRESSED_ALPHA',
3315`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3316`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3317`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3318`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3319`GL_COMPRESSED_SRGB_ALPHA'.
3320
3321`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3322format, dimensions, and contents of the specified compressed image data.
3323
3324`GL_INVALID_OPERATION' is generated if parameter combinations are not
3325supported by the specific compressed internal format as specified in the
3326specific texture compression extension.
3327
3328`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3329bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3330data store is currently mapped.
3331
3332`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3333bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3334unpacked from the buffer object such that the memory reads required
3335would exceed the data store size.
3336
3337`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3338executed between the execution of `glBegin' and the corresponding
3339execution of `glEnd'.
3340
3341Undefined results, including abnormal program termination, are generated
3342if DATA is not encoded in a manner consistent with the extension
3343specification defining the internal compression format.")
8925f36f
AW
3344
3345(define-gl-procedure
3346 glCompressedTexSubImage3D
3347 "glCompressedTexSubImage3D"
3348 (funcsynopsis
3349 (funcprototype
3350 (funcdef
3351 "void "
3352 (function "glCompressedTexSubImage3D"))
3353 (paramdef "GLenum " (parameter "target"))
3354 (paramdef "GLint " (parameter "level"))
3355 (paramdef "GLint " (parameter "xoffset"))
3356 (paramdef "GLint " (parameter "yoffset"))
3357 (paramdef "GLint " (parameter "zoffset"))
3358 (paramdef "GLsizei " (parameter "width"))
3359 (paramdef "GLsizei " (parameter "height"))
3360 (paramdef "GLsizei " (parameter "depth"))
3361 (paramdef "GLenum " (parameter "format"))
3362 (paramdef "GLsizei " (parameter "imageSize"))
3363 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
3364 "Specify a three-dimensional texture subimage in a compressed format.
3365
3366TARGET
3367 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3368
3369LEVEL
3370 Specifies the level-of-detail number. Level 0 is the base image
3371 level. Level N is the Nth mipmap reduction image.
3372
3373XOFFSET
3374 Specifies a texel offset in the x direction within the texture
3375 array.
3376
3377YOFFSET
3378 Specifies a texel offset in the y direction within the texture
3379 array.
3380
3381WIDTH
3382 Specifies the width of the texture subimage.
3383
3384HEIGHT
3385 Specifies the height of the texture subimage.
3386
3387DEPTH
3388 Specifies the depth of the texture subimage.
3389
3390FORMAT
3391 Specifies the format of the compressed image data stored at address
3392 DATA.
3393
3394IMAGESIZE
3395 Specifies the number of unsigned bytes of image data starting at
3396 the address specified by DATA.
3397
3398DATA
3399 Specifies a pointer to the compressed image data in memory.
3400
3401Texturing maps a portion of a specified texture image onto each
3402graphical primitive for which texturing is enabled. To enable and
3403disable three-dimensional texturing, call `glEnable' and `glDisable'
3404with argument `GL_TEXTURE_3D'.
3405
3406`glCompressedTexSubImage3D' redefines a contiguous subregion of an
3407existing three-dimensional texture image. The texels referenced by DATA
3408replace the portion of the existing texture array with x indices XOFFSET
3409and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3410and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3411may not include any texels outside the range of the texture array as it
3412was originally specified. It is not an error to specify a subtexture
3413with width of 0, but such a specification has no effect.
3414
3415FORMAT must be an extension-specified compressed-texture format. The
3416FORMAT of the compressed texture image is selected by the GL
3417implementation that compressed it (see `glTexImage3D') and should be
3418queried at the time the texture was compressed with
3419`glGetTexLevelParameter'.
3420
3421If a non-zero named buffer object is bound to the
3422`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3423image is specified, DATA is treated as a byte offset into the buffer
3424object's data store.
3425
3426`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3427compressed internal formats: `GL_COMPRESSED_ALPHA',
3428`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3429`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3430`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3431`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3432`GL_COMPRESSED_SRGB_ALPHA'.
3433
3434`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3435format, dimensions, and contents of the specified compressed image data.
3436
3437`GL_INVALID_OPERATION' is generated if parameter combinations are not
3438supported by the specific compressed internal format as specified in the
3439specific texture compression extension.
3440
3441`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3442bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3443data store is currently mapped.
3444
3445`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3446bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3447unpacked from the buffer object such that the memory reads required
3448would exceed the data store size.
3449
3450`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3451executed between the execution of `glBegin' and the corresponding
3452execution of `glEnd'.
3453
3454Undefined results, including abnormal program termination, are generated
3455if DATA is not encoded in a manner consistent with the extension
3456specification defining the internal compression format.")
8925f36f
AW
3457
3458(define-gl-procedure
3459 glConvolutionFilter1D
3460 "glConvolutionFilter1D"
3461 (funcsynopsis
3462 (funcprototype
3463 (funcdef
3464 "void "
3465 (function "glConvolutionFilter1D"))
3466 (paramdef "GLenum " (parameter "target"))
3467 (paramdef "GLenum " (parameter "internalformat"))
3468 (paramdef "GLsizei " (parameter "width"))
3469 (paramdef "GLenum " (parameter "format"))
3470 (paramdef "GLenum " (parameter "type"))
3471 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116 3472 "Define a one-dimensional convolution filter.
8925f36f 3473
3c9b6116
AW
3474TARGET
3475 Must be `GL_CONVOLUTION_1D'.
3476
3477INTERNALFORMAT
3478 The internal format of the convolution filter kernel. The allowable
3479 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3480 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3481 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3482 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3483 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3484 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3485 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3486 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3487 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3488 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3489 `GL_RGBA12', or `GL_RGBA16'.
3490
3491WIDTH
3492 The width of the pixel array referenced by DATA.
3493
3494FORMAT
3495 The format of the pixel data in DATA. The allowable values are
3496 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3497 `GL_RGB', and `GL_RGBA'.
3498
3499TYPE
3500 The type of the pixel data in DATA. Symbolic constants
3501 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3502 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3503 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3504 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3505 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3506 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3507 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3508 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3509 are accepted.
3510
3511DATA
3512 Pointer to a one-dimensional array of pixel data that is processed
3513 to build the convolution filter kernel.
3514
3515`glConvolutionFilter1D' builds a one-dimensional convolution filter
3516kernel from an array of pixels.
3517
3518The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3519from memory and processed just as if `glDrawPixels' were called, but
3520processing stops after the final expansion to RGBA is completed.
3521
3522If a non-zero named buffer object is bound to the
3523`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3524filter is specified, DATA is treated as a byte offset into the buffer
3525object's data store.
3526
3527The R, G, B, and A components of each pixel are next scaled by the four
35281D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3529`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3530are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3531and the names `GL_CONVOLUTION_FILTER_SCALE' and
3532`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3533four values that are applied to red, green, blue, and alpha, in that
3534order.) The R, G, B, and A values are not clamped to [0,1] at any time
3535during this process.
3536
3537Each pixel is then converted to the internal format specified by
3538INTERNALFORMAT. This conversion simply maps the component values of the
3539pixel (R, G, B, and A) to the values included in the internal format
3540(red, green, blue, alpha, luminance, and intensity). The mapping is as
3541follows:
3542
3543
3544
3545*Internal Format*
3546 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3547
3548`GL_ALPHA'
3549 , , , A , ,
3550
3551`GL_LUMINANCE'
3552 , , , , R ,
3553
3554`GL_LUMINANCE_ALPHA'
3555 , , , A , R ,
3556
3557`GL_INTENSITY'
3558 , , , , , R
3559
3560`GL_RGB'
3561 R , G , B , , ,
3562
3563`GL_RGBA'
3564 R , G , B , A , ,
3565
3566The red, green, blue, alpha, luminance, and/or intensity components of
3567the resulting pixels are stored in floating-point rather than integer
3568format. They form a one-dimensional filter kernel image indexed with
3569coordinate I such that I starts at 0 and increases from left to right.
3570Kernel location I is derived from the Ith pixel, counting from 0.
3571
3572Note that after a convolution is performed, the resulting color
3573components are also scaled by their corresponding
3574`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3575corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3576the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3577set by `glPixelTransfer'.
3578
3579`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3580
3581`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3582allowable values.
3583
3584`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3585values.
3586
3587`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3588values.
3589
3590`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3591than the maximum supported value. This value may be queried with
3592`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3593`GL_MAX_CONVOLUTION_WIDTH'.
3594
3595`GL_INVALID_OPERATION' is generated if FORMAT is one of
3596`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3597`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3598not `GL_RGB'.
3599
3600`GL_INVALID_OPERATION' is generated if FORMAT is one of
3601`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3602`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3603`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3604`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3605TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3606
3607`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3608bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3609data store is currently mapped.
3610
3611`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3612bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3613unpacked from the buffer object such that the memory reads required
3614would exceed the data store size.
3615
3616`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3617bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3618divisible into the number of bytes needed to store in memory a datum
3619indicated by TYPE.
3620
3621`GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3622executed between the execution of `glBegin' and the corresponding
3623execution of `glEnd'.")
3624
3625(define-gl-procedure
3626 glConvolutionFilter2D
3627 "glConvolutionFilter2D"
3628 (funcsynopsis
3629 (funcprototype
3630 (funcdef
3631 "void "
8925f36f
AW
3632 (function "glConvolutionFilter2D"))
3633 (paramdef "GLenum " (parameter "target"))
3634 (paramdef "GLenum " (parameter "internalformat"))
3635 (paramdef "GLsizei " (parameter "width"))
3636 (paramdef "GLsizei " (parameter "height"))
3637 (paramdef "GLenum " (parameter "format"))
3638 (paramdef "GLenum " (parameter "type"))
3639 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
3640 "Define a two-dimensional convolution filter.
3641
3642TARGET
3643 Must be `GL_CONVOLUTION_2D'.
3644
3645INTERNALFORMAT
3646 The internal format of the convolution filter kernel. The allowable
3647 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3648 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3649 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3650 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3651 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3652 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3653 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3654 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3655 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3656 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3657 `GL_RGBA12', or `GL_RGBA16'.
3658
3659WIDTH
3660 The width of the pixel array referenced by DATA.
3661
3662HEIGHT
3663 The height of the pixel array referenced by DATA.
3664
3665FORMAT
3666 The format of the pixel data in DATA. The allowable values are
3667 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3668 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3669
3670TYPE
3671 The type of the pixel data in DATA. Symbolic constants
3672 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3673 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3674 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3675 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3676 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3677 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3678 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3679 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3680 are accepted.
3681
3682DATA
3683 Pointer to a two-dimensional array of pixel data that is processed
3684 to build the convolution filter kernel.
3685
3686`glConvolutionFilter2D' builds a two-dimensional convolution filter
3687kernel from an array of pixels.
3688
3689The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3690extracted from memory and processed just as if `glDrawPixels' were
3691called, but processing stops after the final expansion to RGBA is
3692completed.
3693
3694If a non-zero named buffer object is bound to the
3695`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3696filter is specified, DATA is treated as a byte offset into the buffer
3697object's data store.
3698
8925f36f 3699The R, G, B, and A components of each pixel are next scaled by the four
3c9b6116
AW
37002D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3701`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3702are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3703and the names `GL_CONVOLUTION_FILTER_SCALE' and
3704`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3705four values that are applied to red, green, blue, and alpha, in that
3706order.) The R, G, B, and A values are not clamped to [0,1] at any time
3707during this process.
3708
3709Each pixel is then converted to the internal format specified by
3710INTERNALFORMAT. This conversion simply maps the component values of the
3711pixel (R, G, B, and A) to the values included in the internal format
3712(red, green, blue, alpha, luminance, and intensity). The mapping is as
3713follows:
3714
3715
3716
3717*Internal Format*
3718 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3719
3720`GL_ALPHA'
3721 , , , A , ,
3722
3723`GL_LUMINANCE'
3724 , , , , R ,
3725
3726`GL_LUMINANCE_ALPHA'
3727 , , , A , R ,
3728
3729`GL_INTENSITY'
3730 , , , , , R
3731
3732`GL_RGB'
3733 R , G , B , , ,
3734
3735`GL_RGBA'
3736 R , G , B , A , ,
3737
8925f36f 3738The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
3739the resulting pixels are stored in floating-point rather than integer
3740format. They form a two-dimensional filter kernel image indexed with
3741coordinates I and J such that I starts at zero and increases from left
3742to right, and J starts at zero and increases from bottom to top. Kernel
3743location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3744
8925f36f 3745Note that after a convolution is performed, the resulting color
3c9b6116
AW
3746components are also scaled by their corresponding
3747`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3748corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3749the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3750set by `glPixelTransfer'.
3751
3752`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3753
3754`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3755allowable values.
3756
3757`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3758values.
3759
3760`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3761values.
3762
3763`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3764than the maximum supported value. This value may be queried with
3765`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3766`GL_MAX_CONVOLUTION_WIDTH'.
3767
3768`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3769than the maximum supported value. This value may be queried with
3770`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3771`GL_MAX_CONVOLUTION_HEIGHT'.
3772
3773`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3774`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3775`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3776is not `GL_RGB'.
3777
3778`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3779`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3780`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3781`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3782`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3783FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3784
3785`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3786bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3787data store is currently mapped.
3788
3789`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3790bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3791unpacked from the buffer object such that the memory reads required
3792would exceed the data store size.
3793
3794`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3795bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3796divisible into the number of bytes needed to store in memory a datum
3797indicated by TYPE.
3798
3799`GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3800executed between the execution of `glBegin' and the corresponding
3801execution of `glEnd'.")
8925f36f
AW
3802
3803(define-gl-procedure
3804 glConvolutionParameter
3805 "glConvolutionParameter"
3806 (funcsynopsis
3807 (funcprototype
3808 (funcdef
3809 "void "
3810 (function "glConvolutionParameterf"))
3811 (paramdef "GLenum " (parameter "target"))
3812 (paramdef "GLenum " (parameter "pname"))
3813 (paramdef "GLfloat " (parameter "params"))))
3c9b6116
AW
3814 "Set convolution parameters.
3815
3816TARGET
3817 The target for the convolution parameter. Must be one of
3818 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3819
3820PNAME
3821 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3822
3823PARAMS
3824 The parameter value. Must be one of `GL_REDUCE',
3825 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3826
3827
3828
3829`glConvolutionParameter' sets the value of a convolution parameter.
3830
3831TARGET selects the convolution filter to be affected:
3832`GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
38331D, 2D, or separable 2D filter, respectively.
3834
3835PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3836and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3837convolution filter kernel; see `glConvolutionFilter1D',
3838`glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3839cases, PARAMSv is an array of four values to be applied to red, green,
3840blue, and alpha values, respectively. The initial value for
3841`GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3842`GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3843
3844A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3845border mode. The accepted modes are:
3846
3847`GL_REDUCE'
3848 The image resulting from convolution is smaller than the source
3849 image. If the filter width is WF and height is HF , and the source
3850 image width is WS and height is HS , then the convolved image width
3851 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3852 would generate an image with zero or negative width and/or height,
3853 the output is simply null, with no error generated.) The
3854 coordinates of the image resulting from convolution are zero
3855 through WS-WF in width and zero through HS-HF in height.
3856
3857`GL_CONSTANT_BORDER'
3858 The image resulting from convolution is the same size as the source
3859 image, and processed as if the source image were surrounded by
3860 pixels with their color specified by the
3861 `GL_CONVOLUTION_BORDER_COLOR'.
3862
3863`GL_REPLICATE_BORDER'
3864 The image resulting from convolution is the same size as the source
3865 image, and processed as if the outermost pixel on the border of the
3866 source image were replicated.
3867
3868`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3869values.
3870
3871`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3872values.
3873
3874`GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3875and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3876`GL_REPLICATE_BORDER'.
3877
3878`GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3879executed between the execution of `glBegin' and the corresponding
3880execution of `glEnd'.")
8925f36f
AW
3881
3882(define-gl-procedure
3883 glCopyColorSubTable
3884 "glCopyColorSubTable"
3885 (funcsynopsis
3886 (funcprototype
3887 (funcdef
3888 "void "
3889 (function "glCopyColorSubTable"))
3890 (paramdef "GLenum " (parameter "target"))
3891 (paramdef "GLsizei " (parameter "start"))
3892 (paramdef "GLint " (parameter "x"))
3893 (paramdef "GLint " (parameter "y"))
3894 (paramdef "GLsizei " (parameter "width"))))
3c9b6116
AW
3895 "Respecify a portion of a color table.
3896
3897TARGET
3898 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3899 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3900
3901START
3902 The starting index of the portion of the color table to be
3903 replaced.
3904
3905X
3906 Y
3907
3908 The window coordinates of the left corner of the row of pixels to
3909 be copied.
3910
3911WIDTH
3912 The number of table entries to replace.
3913
3914`glCopyColorSubTable' is used to respecify a contiguous portion of a
3915color table previously defined using `glColorTable'. The pixels copied
3916from the framebuffer replace the portion of the existing table from
3917indices START to START+X-1 , inclusive. This region may not include any
3918entries outside the range of the color table, as was originally
3919specified. It is not an error to specify a subtexture with width of 0,
3920but such a specification has no effect.
3921
3922`GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3923color table.
3924
3925`GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3926values.
3927
3928`GL_INVALID_VALUE' is generated if START+X>WIDTH .
3929
3930`GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3931between the execution of `glBegin' and the corresponding execution of
3932`glEnd'.")
8925f36f
AW
3933
3934(define-gl-procedure
3935 glCopyColorTable
3936 "glCopyColorTable"
3937 (funcsynopsis
3938 (funcprototype
3939 (funcdef "void " (function "glCopyColorTable"))
3940 (paramdef "GLenum " (parameter "target"))
3941 (paramdef "GLenum " (parameter "internalformat"))
3942 (paramdef "GLint " (parameter "x"))
3943 (paramdef "GLint " (parameter "y"))
3944 (paramdef "GLsizei " (parameter "width"))))
3c9b6116
AW
3945 "Copy pixels into a color table.
3946
3947TARGET
3948 The color table target. Must be `GL_COLOR_TABLE',
3949 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3950 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3951
3952INTERNALFORMAT
3953 The internal storage format of the texture image. Must be one of
3954 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3955 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3956 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3957 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3958 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3959 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3960 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3961 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3962 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3963 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3964 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3965
3966X
3967 The x coordinate of the lower-left corner of the pixel rectangle to
3968 be transferred to the color table.
3969
3970Y
3971 The y coordinate of the lower-left corner of the pixel rectangle to
3972 be transferred to the color table.
3973
3974WIDTH
3975 The width of the pixel rectangle.
3976
3977`glCopyColorTable' loads a color table with pixels from the current
3978`GL_READ_BUFFER' (rather than from main memory, as is the case for
3979`glColorTable').
3980
3981The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3982having width WIDTH and height 1 is loaded into the color table. If any
3983pixels within this region are outside the window that is associated with
3984the GL context, the values obtained for those pixels are undefined.
3985
3986The pixels in the rectangle are processed just as if `glReadPixels' were
3987called, with INTERNALFORMAT set to RGBA, but processing stops after the
3988final conversion to RGBA.
3989
8925f36f 3990The four scale parameters and the four bias parameters that are defined
3c9b6116
AW
3991for the table are then used to scale and bias the R, G, B, and A
3992components of each pixel. The scale and bias parameters are set by
3993calling `glColorTableParameter'.
3994
3995Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3996pixel is then converted to the internal format specified by
3997INTERNALFORMAT. This conversion simply maps the component values of the
3998pixel (R, G, B, and A) to the values included in the internal format
3999(red, green, blue, alpha, luminance, and intensity). The mapping is as
4000follows:
4001
4002
4003
4004*Internal Format*
4005 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4006
4007`GL_ALPHA'
4008 , , , A , ,
4009
4010`GL_LUMINANCE'
4011 , , , , R ,
4012
4013`GL_LUMINANCE_ALPHA'
4014 , , , A , R ,
4015
4016`GL_INTENSITY'
4017 , , , , , R
4018
4019`GL_RGB'
4020 R , G , B , , ,
4021
4022`GL_RGBA'
4023 R , G , B , A , ,
4024
4025Finally, the red, green, blue, alpha, luminance, and/or intensity
4026components of the resulting pixels are stored in the color table. They
4027form a one-dimensional table with indices in the range [0,WIDTH-1] .
4028
4029
4030
4031`GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
4032values.
4033
4034`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
4035
4036`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
4037allowable values.
4038
4039`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
4040large to be supported by the implementation.
4041
4042`GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
4043between the execution of `glBegin' and the corresponding execution of
4044`glEnd'.")
8925f36f
AW
4045
4046(define-gl-procedure
4047 glCopyConvolutionFilter1D
4048 "glCopyConvolutionFilter1D"
4049 (funcsynopsis
4050 (funcprototype
4051 (funcdef
4052 "void "
4053 (function "glCopyConvolutionFilter1D"))
4054 (paramdef "GLenum " (parameter "target"))
4055 (paramdef "GLenum " (parameter "internalformat"))
4056 (paramdef "GLint " (parameter "x"))
4057 (paramdef "GLint " (parameter "y"))
4058 (paramdef "GLsizei " (parameter "width"))))
3c9b6116
AW
4059 "Copy pixels into a one-dimensional convolution filter.
4060
4061TARGET
4062 Must be `GL_CONVOLUTION_1D'.
4063
4064INTERNALFORMAT
4065 The internal format of the convolution filter kernel. The allowable
4066 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4067 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4068 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4069 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4070 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4071 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4072 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4073 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4074 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4075 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4076 `GL_RGBA12', or `GL_RGBA16'.
4077
4078X
4079 Y
4080
4081 The window space coordinates of the lower-left coordinate of the
4082 pixel array to copy.
4083
4084WIDTH
4085 The width of the pixel array to copy.
4086
4087`glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
4088kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4089main memory, as is the case for `glConvolutionFilter1D').
4090
4091The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4092width WIDTH and height 1 is used to define the convolution filter. If
4093any pixels within this region are outside the window that is associated
4094with the GL context, the values obtained for those pixels are undefined.
4095
4096The pixels in the rectangle are processed exactly as if `glReadPixels'
4097had been called with FORMAT set to RGBA, but the process stops just
4098before final conversion. The R, G, B, and A components of each pixel are
4099next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4100biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4101scale and bias parameters are set by `glConvolutionParameter' using the
4102`GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4103and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4104of four values that are applied to red, green, blue, and alpha, in that
4105order.) The R, G, B, and A values are not clamped to [0,1] at any time
4106during this process.
4107
4108Each pixel is then converted to the internal format specified by
4109INTERNALFORMAT. This conversion simply maps the component values of the
4110pixel (R, G, B, and A) to the values included in the internal format
4111(red, green, blue, alpha, luminance, and intensity). The mapping is as
4112follows:
4113
4114
4115
4116*Internal Format*
4117 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4118
4119`GL_ALPHA'
4120 , , , A , ,
4121
4122`GL_LUMINANCE'
4123 , , , , R ,
4124
4125`GL_LUMINANCE_ALPHA'
4126 , , , A , R ,
4127
4128`GL_INTENSITY'
4129 , , , , , R
4130
4131`GL_RGB'
4132 R , G , B , , ,
4133
4134`GL_RGBA'
4135 R , G , B , A , ,
4136
8925f36f 4137The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4138the resulting pixels are stored in floating-point rather than integer
4139format.
4140
8925f36f 4141Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4142lower I filter image coordinates.
4143
8925f36f 4144Note that after a convolution is performed, the resulting color
3c9b6116
AW
4145components are also scaled by their corresponding
4146`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4147corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4148the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4149set by `glPixelTransfer'.
4150
4151`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4152
4153`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4154allowable values.
4155
4156`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4157than the maximum supported value. This value may be queried with
4158`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4159`GL_MAX_CONVOLUTION_WIDTH'.
4160
4161`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4162executed between the execution of `glBegin' and the corresponding
4163execution of `glEnd'.")
8925f36f
AW
4164
4165(define-gl-procedure
4166 glCopyConvolutionFilter2D
4167 "glCopyConvolutionFilter2D"
4168 (funcsynopsis
4169 (funcprototype
4170 (funcdef
4171 "void "
4172 (function "glCopyConvolutionFilter2D"))
4173 (paramdef "GLenum " (parameter "target"))
4174 (paramdef "GLenum " (parameter "internalformat"))
4175 (paramdef "GLint " (parameter "x"))
4176 (paramdef "GLint " (parameter "y"))
4177 (paramdef "GLsizei " (parameter "width"))
4178 (paramdef "GLsizei " (parameter "height"))))
3c9b6116
AW
4179 "Copy pixels into a two-dimensional convolution filter.
4180
4181TARGET
4182 Must be `GL_CONVOLUTION_2D'.
4183
4184INTERNALFORMAT
4185 The internal format of the convolution filter kernel. The allowable
4186 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4187 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4188 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4189 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4190 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4191 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4192 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4193 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4194 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4195 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4196 `GL_RGBA12', or `GL_RGBA16'.
4197
4198X
4199 Y
4200
4201 The window space coordinates of the lower-left coordinate of the
4202 pixel array to copy.
4203
4204WIDTH
4205 The width of the pixel array to copy.
4206
4207HEIGHT
4208 The height of the pixel array to copy.
4209
4210`glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4211kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4212main memory, as is the case for `glConvolutionFilter2D').
4213
4214The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4215width WIDTH and height HEIGHT is used to define the convolution filter.
4216If any pixels within this region are outside the window that is
4217associated with the GL context, the values obtained for those pixels are
4218undefined.
4219
4220The pixels in the rectangle are processed exactly as if `glReadPixels'
4221had been called with FORMAT set to RGBA, but the process stops just
4222before final conversion. The R, G, B, and A components of each pixel are
4223next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4224biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4225scale and bias parameters are set by `glConvolutionParameter' using the
4226`GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4227and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4228of four values that are applied to red, green, blue, and alpha, in that
4229order.) The R, G, B, and A values are not clamped to [0,1] at any time
4230during this process.
4231
4232Each pixel is then converted to the internal format specified by
4233INTERNALFORMAT. This conversion simply maps the component values of the
4234pixel (R, G, B, and A) to the values included in the internal format
4235(red, green, blue, alpha, luminance, and intensity). The mapping is as
4236follows:
4237
4238
4239
4240*Internal Format*
4241 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4242
4243`GL_ALPHA'
4244 , , , A , ,
4245
4246`GL_LUMINANCE'
4247 , , , , R ,
4248
4249`GL_LUMINANCE_ALPHA'
4250 , , , A , R ,
4251
4252`GL_INTENSITY'
4253 , , , , , R
4254
4255`GL_RGB'
4256 R , G , B , , ,
4257
4258`GL_RGBA'
4259 R , G , B , A , ,
4260
8925f36f 4261The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4262the resulting pixels are stored in floating-point rather than integer
4263format.
4264
8925f36f 4265Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4266lower I filter image coordinates, and lower y screen coordinates
4267correspond to lower J filter image coordinates.
4268
8925f36f 4269Note that after a convolution is performed, the resulting color
3c9b6116
AW
4270components are also scaled by their corresponding
4271`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4272corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4273the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4274set by `glPixelTransfer'.
4275
4276`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4277
4278`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4279allowable values.
4280
4281`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4282than the maximum supported value. This value may be queried with
4283`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4284`GL_MAX_CONVOLUTION_WIDTH'.
4285
4286`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4287than the maximum supported value. This value may be queried with
4288`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4289`GL_MAX_CONVOLUTION_HEIGHT'.
4290
4291`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4292executed between the execution of `glBegin' and the corresponding
4293execution of `glEnd'.")
8925f36f
AW
4294
4295(define-gl-procedure
4296 glCopyPixels
4297 "glCopyPixels"
4298 (funcsynopsis
4299 (funcprototype
4300 (funcdef "void " (function "glCopyPixels"))
4301 (paramdef "GLint " (parameter "x"))
4302 (paramdef "GLint " (parameter "y"))
4303 (paramdef "GLsizei " (parameter "width"))
4304 (paramdef "GLsizei " (parameter "height"))
4305 (paramdef "GLenum " (parameter "type"))))
3c9b6116
AW
4306 "Copy pixels in the frame buffer.
4307
4308X
4309 Y
4310
4311 Specify the window coordinates of the lower left corner of the
4312 rectangular region of pixels to be copied.
4313
4314WIDTH
4315 HEIGHT
4316
4317 Specify the dimensions of the rectangular region of pixels to be
4318 copied. Both must be nonnegative.
4319
4320TYPE
4321 Specifies whether color values, depth values, or stencil values are
4322 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4323 `GL_STENCIL' are accepted.
4324
4325`glCopyPixels' copies a screen-aligned rectangle of pixels from the
4326specified frame buffer location to a region relative to the current
4327raster position. Its operation is well defined only if the entire pixel
4328source region is within the exposed portion of the window. Results of
4329copies from outside the window, or from regions of the window that are
4330not exposed, are hardware dependent and undefined.
4331
4332X and Y specify the window coordinates of the lower left corner of the
4333rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4334of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4335be negative.
4336
4337Several parameters control the processing of the pixel data while it is
4338being copied. These parameters are set with three commands:
4339`glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4340describes the effects on `glCopyPixels' of most, but not all, of the
4341parameters specified by these three commands.
4342
4343`glCopyPixels' copies values from each pixel with the lower left-hand
4344corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4345to be the I th pixel in the J th row. Pixels are copied in row order
4346from the lowest to the highest row, left to right in each row.
4347
4348TYPE specifies whether color, depth, or stencil data is to be copied.
4349The details of the transfer for each data type are as follows:
4350
4351`GL_COLOR'
4352 Indices or RGBA colors are read from the buffer currently specified
4353 as the read source buffer (see `glReadBuffer'). If the GL is in
4354 color index mode, each index that is read from this buffer is
4355 converted to a fixed-point format with an unspecified number of
4356 bits to the right of the binary point. Each index is then shifted
4357 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4358 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4359 case, zero bits fill otherwise unspecified bit locations in the
4360 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4361 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4362 Whether the lookup replacement of the index is done or not, the
4363 integer part of the index is then ANDed with 2^B-1 , where B is the
4364 number of bits in a color index buffer.
4365
4366 If the GL is in RGBA mode, the red, green, blue, and alpha
4367 components of each pixel that is read are converted to an internal
4368 floating-point format with unspecified precision. The conversion
4369 maps the largest representable component value to 1.0, and
4370 component value 0 to 0.0. The resulting floating-point color values
4371 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4372 C is RED, GREEN, BLUE, and ALPHA for the respective color
4373 components. The results are clamped to the range [0,1]. If
4374 `GL_MAP_COLOR' is true, each color component is scaled by the size
4375 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4376 that it references in that table. C is R, G, B, or A.
4377
4378 If the `ARB_imaging' extension is supported, the color values may
4379 be additionally processed by color-table lookups, color-matrix
4380 transformations, and convolution filters.
4381
4382 The GL then converts the resulting indices or RGBA colors to
4383 fragments by attaching the current raster position Z coordinate and
4384 texture coordinates to each pixel, then assigning window
4385 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4386 position, and the pixel was the I th pixel in the J th row. These
4387 pixel fragments are then treated just like the fragments generated
4388 by rasterizing points, lines, or polygons. Texture mapping, fog,
4389 and all the fragment operations are applied before the fragments
4390 are written to the frame buffer.
4391
4392`GL_DEPTH'
4393 Depth values are read from the depth buffer and converted directly
4394 to an internal floating-point format with unspecified precision.
4395 The resulting floating-point depth value is then multiplied by
4396 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4397 clamped to the range [0,1].
4398
4399 The GL then converts the resulting depth components to fragments by
4400 attaching the current raster position color or color index and
4401 texture coordinates to each pixel, then assigning window
4402 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4403 position, and the pixel was the I th pixel in the J th row. These
4404 pixel fragments are then treated just like the fragments generated
4405 by rasterizing points, lines, or polygons. Texture mapping, fog,
4406 and all the fragment operations are applied before the fragments
4407 are written to the frame buffer.
4408
4409`GL_STENCIL'
4410 Stencil indices are read from the stencil buffer and converted to
4411 an internal fixed-point format with an unspecified number of bits
4412 to the right of the binary point. Each fixed-point index is then
4413 shifted left by `GL_INDEX_SHIFT' bits, and added to
4414 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4415 the right. In either case, zero bits fill otherwise unspecified bit
4416 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4417 replaced with the value that it references in lookup table
4418 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4419 is done or not, the integer part of the index is then ANDed with
4420 2^B-1 , where B is the number of bits in the stencil buffer. The
4421 resulting stencil indices are then written to the stencil buffer
4422 such that the index read from the I th location of the J th row is
4423 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4424 raster position. Only the pixel ownership test, the scissor test,
4425 and the stencil writemask affect these write operations.
4426
8925f36f 4427The rasterization described thus far assumes pixel zoom factors of 1.0.
3c9b6116
AW
4428If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4429pixels are converted to fragments as follows. If (X_R,Y_R) is the
4430current raster position, and a given pixel is in the I th location in
4431the J th row of the source pixel rectangle, then fragments are generated
4432for pixels whose centers are in the rectangle with corners at
4433
4434(X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4435
4436and
4437
4438(X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4439
4440where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4441`GL_ZOOM_Y'.
4442
4443`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4444
4445`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4446
4447`GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4448no depth buffer.
4449
4450`GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4451no stencil buffer.
4452
4453`GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4454between the execution of `glBegin' and the corresponding execution of
4455`glEnd'.")
8925f36f
AW
4456
4457(define-gl-procedure
4458 glCopyTexImage1D
4459 "glCopyTexImage1D"
4460 (funcsynopsis
4461 (funcprototype
4462 (funcdef "void " (function "glCopyTexImage1D"))
4463 (paramdef "GLenum " (parameter "target"))
4464 (paramdef "GLint " (parameter "level"))
4465 (paramdef "GLenum " (parameter "internalformat"))
4466 (paramdef "GLint " (parameter "x"))
4467 (paramdef "GLint " (parameter "y"))
4468 (paramdef "GLsizei " (parameter "width"))
4469 (paramdef "GLint " (parameter "border"))))
3c9b6116
AW
4470 "Copy pixels into a 1D texture image.
4471
4472TARGET
4473 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4474
4475LEVEL
4476 Specifies the level-of-detail number. Level 0 is the base image
4477 level. Level N is the Nth mipmap reduction image.
4478
4479INTERNALFORMAT
4480 Specifies the internal format of the texture. Must be one of the
4481 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4482 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4483 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4484 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4485 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4486 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4487 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4488 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4489 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4490 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4491 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4492 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4493 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4494 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4495 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4496 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4497 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4498 `GL_SRGB8_ALPHA8'.
4499
4500X
4501 Y
4502
4503 Specify the window coordinates of the left corner of the row of
4504 pixels to be copied.
4505
4506WIDTH
4507 Specifies the width of the texture image. Must be 0 or
4508 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4509 image is 1.
4510
4511BORDER
4512 Specifies the width of the border. Must be either 0 or 1.
4513
4514`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4515from the current `GL_READ_BUFFER'.
4516
4517The screen-aligned pixel row with left corner at (X,Y) and with a length
4518of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4519specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4520texture array.
4521
4522The pixels in the row are processed exactly as if `glCopyPixels' had
4523been called, but the process stops just before final conversion. At this
4524point all pixel component values are clamped to the range [0,1] and then
4525converted to the texture's internal format for storage in the texel
4526array.
4527
4528Pixel ordering is such that lower X screen coordinates correspond to
4529lower texture coordinates.
4530
4531If any of the pixels within the specified row of the current
4532`GL_READ_BUFFER' are outside the window associated with the current
4533rendering context, then the values obtained for those pixels are
4534undefined.
4535
4536`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4537from the current `GL_READ_BUFFER'.
4538
4539When INTERNALFORMAT is one of the sRGB types, the GL does not
4540automatically convert the source pixels to the sRGB color space. In this
4541case, the `glPixelMap' function can be used to accomplish the
4542conversion.
4543
4544`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4545values.
4546
4547`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4548
4549`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4550where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4551
4552`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4553value.
4554
4555`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
45562 + `GL_MAX_TEXTURE_SIZE'.
4557
4558`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4559supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4560some integer value of N.
4561
4562`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4563
4564`GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4565between the execution of `glBegin' and the corresponding execution of
4566`glEnd'.
4567
4568`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4569`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4570`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f
AW
4571
4572(define-gl-procedure
4573 glCopyTexImage2D
4574 "glCopyTexImage2D"
4575 (funcsynopsis
4576 (funcprototype
4577 (funcdef "void " (function "glCopyTexImage2D"))
4578 (paramdef "GLenum " (parameter "target"))
4579 (paramdef "GLint " (parameter "level"))
4580 (paramdef "GLenum " (parameter "internalformat"))
4581 (paramdef "GLint " (parameter "x"))
4582 (paramdef "GLint " (parameter "y"))
4583 (paramdef "GLsizei " (parameter "width"))
4584 (paramdef "GLsizei " (parameter "height"))
4585 (paramdef "GLint " (parameter "border"))))
3c9b6116
AW
4586 "Copy pixels into a 2D texture image.
4587
4588TARGET
4589 Specifies the target texture. Must be `GL_TEXTURE_2D',
4590 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4591 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4592 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4593 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4594
4595LEVEL
4596 Specifies the level-of-detail number. Level 0 is the base image
4597 level. Level N is the Nth mipmap reduction image.
4598
4599INTERNALFORMAT
4600 Specifies the internal format of the texture. Must be one of the
4601 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4602 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4603 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4604 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4605 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4606 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4607 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4608 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4609 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4610 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4611 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4612 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4613 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4614 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4615 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4616 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4617 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4618 `GL_SRGB8_ALPHA8'.
4619
4620X
4621 Y
4622
4623 Specify the window coordinates of the lower left corner of the
4624 rectangular region of pixels to be copied.
4625
4626WIDTH
4627 Specifies the width of the texture image. Must be 0 or
4628 2^N+2\u2061(BORDER,) for some integer N .
4629
4630HEIGHT
4631 Specifies the height of the texture image. Must be 0 or
4632 2^M+2\u2061(BORDER,) for some integer M .
4633
4634BORDER
4635 Specifies the width of the border. Must be either 0 or 1.
4636
4637`glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4638texture image with pixels from the current `GL_READ_BUFFER'.
4639
4640The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4641with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4642defines the texture array at the mipmap level specified by LEVEL.
4643INTERNALFORMAT specifies the internal format of the texture array.
4644
4645The pixels in the rectangle are processed exactly as if `glCopyPixels'
4646had been called, but the process stops just before final conversion. At
4647this point all pixel component values are clamped to the range [0,1] and
4648then converted to the texture's internal format for storage in the texel
4649array.
4650
4651Pixel ordering is such that lower X and Y screen coordinates correspond
4652to lower S and T texture coordinates.
4653
4654If any of the pixels within the specified rectangle of the current
4655`GL_READ_BUFFER' are outside the window associated with the current
4656rendering context, then the values obtained for those pixels are
4657undefined.
4658
4659When INTERNALFORMAT is one of the sRGB types, the GL does not
4660automatically convert the source pixels to the sRGB color space. In this
4661case, the `glPixelMap' function can be used to accomplish the
4662conversion.
4663
4664`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4665`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4666`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4667`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4668
4669`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4670
4671`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4672where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4673
4674`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
46752 + `GL_MAX_TEXTURE_SIZE'.
4676
4677`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4678supported and the WIDTH or DEPTH cannot be represented as
46792^K+2\u2061(BORDER,) for some integer K .
4680
4681`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4682
4683`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4684format.
4685
4686`GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4687between the execution of `glBegin' and the corresponding execution of
4688`glEnd'.
4689
4690`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4691`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4692`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f
AW
4693
4694(define-gl-procedure
4695 glCopyTexSubImage1D
4696 "glCopyTexSubImage1D"
4697 (funcsynopsis
4698 (funcprototype
4699 (funcdef
4700 "void "
4701 (function "glCopyTexSubImage1D"))
4702 (paramdef "GLenum " (parameter "target"))
4703 (paramdef "GLint " (parameter "level"))
4704 (paramdef "GLint " (parameter "xoffset"))
4705 (paramdef "GLint " (parameter "x"))
4706 (paramdef "GLint " (parameter "y"))
4707 (paramdef "GLsizei " (parameter "width"))))
3c9b6116
AW
4708 "Copy a one-dimensional texture subimage.
4709
4710TARGET
4711 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4712
4713LEVEL
4714 Specifies the level-of-detail number. Level 0 is the base image
4715 level. Level N is the Nth mipmap reduction image.
4716
4717XOFFSET
4718 Specifies the texel offset within the texture array.
4719
4720X
4721 Y
4722
4723 Specify the window coordinates of the left corner of the row of
4724 pixels to be copied.
4725
4726WIDTH
4727 Specifies the width of the texture subimage.
4728
4729`glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4730image with pixels from the current `GL_READ_BUFFER' (rather than from
4731main memory, as is the case for `glTexSubImage1D').
4732
4733The screen-aligned pixel row with left corner at (X,\\ Y), and with
4734length WIDTH replaces the portion of the texture array with x indices
4735XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4736texture array may not include any texels outside the texture array as it
4737was originally specified.
4738
4739The pixels in the row are processed exactly as if `glCopyPixels' had
4740been called, but the process stops just before final conversion. At this
4741point, all pixel component values are clamped to the range [0,1] and
4742then converted to the texture's internal format for storage in the texel
4743array.
4744
4745It is not an error to specify a subtexture with zero width, but such a
4746specification has no effect. If any of the pixels within the specified
4747row of the current `GL_READ_BUFFER' are outside the read window
4748associated with the current rendering context, then the values obtained
4749for those pixels are undefined.
4750
4751No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4752the specified texture array or to texel values outside the specified
4753subregion.
4754
4755`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4756
4757`GL_INVALID_OPERATION' is generated if the texture array has not been
4758defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4759
4760`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4761
4762`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4763the returned value of `GL_MAX_TEXTURE_SIZE'.
4764
4765`GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4766(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4767`GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4768includes twice the border width.")
8925f36f
AW
4769
4770(define-gl-procedure
4771 glCopyTexSubImage2D
4772 "glCopyTexSubImage2D"
4773 (funcsynopsis
4774 (funcprototype
4775 (funcdef
4776 "void "
4777 (function "glCopyTexSubImage2D"))
4778 (paramdef "GLenum " (parameter "target"))
4779 (paramdef "GLint " (parameter "level"))
4780 (paramdef "GLint " (parameter "xoffset"))
4781 (paramdef "GLint " (parameter "yoffset"))
4782 (paramdef "GLint " (parameter "x"))
4783 (paramdef "GLint " (parameter "y"))
4784 (paramdef "GLsizei " (parameter "width"))
4785 (paramdef "GLsizei " (parameter "height"))))
3c9b6116
AW
4786 "Copy a two-dimensional texture subimage.
4787
4788TARGET
4789 Specifies the target texture. Must be `GL_TEXTURE_2D',
4790 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4791 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4792 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4793 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4794
4795LEVEL
4796 Specifies the level-of-detail number. Level 0 is the base image
4797 level. Level N is the Nth mipmap reduction image.
4798
4799XOFFSET
4800 Specifies a texel offset in the x direction within the texture
4801 array.
4802
4803YOFFSET
4804 Specifies a texel offset in the y direction within the texture
4805 array.
4806
4807X
4808 Y
4809
4810 Specify the window coordinates of the lower left corner of the
4811 rectangular region of pixels to be copied.
4812
4813WIDTH
4814 Specifies the width of the texture subimage.
4815
4816HEIGHT
4817 Specifies the height of the texture subimage.
4818
4819`glCopyTexSubImage2D' replaces a rectangular portion of a
4820two-dimensional texture image or cube-map texture image with pixels from
4821the current `GL_READ_BUFFER' (rather than from main memory, as is the
4822case for `glTexSubImage2D').
4823
4824The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4825with width WIDTH and height HEIGHT replaces the portion of the texture
4826array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4827indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4828level specified by LEVEL.
4829
4830The pixels in the rectangle are processed exactly as if `glCopyPixels'
4831had been called, but the process stops just before final conversion. At
4832this point, all pixel component values are clamped to the range [0,1]
4833and then converted to the texture's internal format for storage in the
4834texel array.
4835
4836The destination rectangle in the texture array may not include any
4837texels outside the texture array as it was originally specified. It is
4838not an error to specify a subtexture with zero width or height, but such
4839a specification has no effect.
4840
4841If any of the pixels within the specified rectangle of the current
4842`GL_READ_BUFFER' are outside the read window associated with the current
4843rendering context, then the values obtained for those pixels are
4844undefined.
4845
4846No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4847parameters of the specified texture array or to texel values outside the
4848specified subregion.
4849
4850`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4851`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4852`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4853`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4854
4855`GL_INVALID_OPERATION' is generated if the texture array has not been
4856defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4857
4858`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4859
4860`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4861the returned value of `GL_MAX_TEXTURE_SIZE'.
4862
4863`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4864, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4865`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4866`GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4867H include twice the border width.
4868
4869`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4870between the execution of `glBegin' and the corresponding execution of
4871`glEnd'.")
8925f36f
AW
4872
4873(define-gl-procedure
4874 glCopyTexSubImage3D
4875 "glCopyTexSubImage3D"
4876 (funcsynopsis
4877 (funcprototype
4878 (funcdef
4879 "void "
4880 (function "glCopyTexSubImage3D"))
4881 (paramdef "GLenum " (parameter "target"))
4882 (paramdef "GLint " (parameter "level"))
4883 (paramdef "GLint " (parameter "xoffset"))
4884 (paramdef "GLint " (parameter "yoffset"))
4885 (paramdef "GLint " (parameter "zoffset"))
4886 (paramdef "GLint " (parameter "x"))
4887 (paramdef "GLint " (parameter "y"))
4888 (paramdef "GLsizei " (parameter "width"))
4889 (paramdef "GLsizei " (parameter "height"))))
3c9b6116
AW
4890 "Copy a three-dimensional texture subimage.
4891
4892TARGET
4893 Specifies the target texture. Must be `GL_TEXTURE_3D'
4894
4895LEVEL
4896 Specifies the level-of-detail number. Level 0 is the base image
4897 level. Level N is the Nth mipmap reduction image.
4898
4899XOFFSET
4900 Specifies a texel offset in the x direction within the texture
4901 array.
4902
4903YOFFSET
4904 Specifies a texel offset in the y direction within the texture
4905 array.
4906
4907ZOFFSET
4908 Specifies a texel offset in the z direction within the texture
4909 array.
4910
4911X
4912 Y
4913
4914 Specify the window coordinates of the lower left corner of the
4915 rectangular region of pixels to be copied.
4916
4917WIDTH
4918 Specifies the width of the texture subimage.
4919
4920HEIGHT
4921 Specifies the height of the texture subimage.
4922
4923`glCopyTexSubImage3D' replaces a rectangular portion of a
4924three-dimensional texture image with pixels from the current
4925`GL_READ_BUFFER' (rather than from main memory, as is the case for
4926`glTexSubImage3D').
4927
4928The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4929with width WIDTH and height HEIGHT replaces the portion of the texture
4930array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4931indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4932and at the mipmap level specified by LEVEL.
4933
4934The pixels in the rectangle are processed exactly as if `glCopyPixels'
4935had been called, but the process stops just before final conversion. At
4936this point, all pixel component values are clamped to the range [0,1]
4937and then converted to the texture's internal format for storage in the
4938texel array.
4939
4940The destination rectangle in the texture array may not include any
4941texels outside the texture array as it was originally specified. It is
4942not an error to specify a subtexture with zero width or height, but such
4943a specification has no effect.
4944
4945If any of the pixels within the specified rectangle of the current
4946`GL_READ_BUFFER' are outside the read window associated with the current
4947rendering context, then the values obtained for those pixels are
4948undefined.
4949
4950No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4951parameters of the specified texture array or to texel values outside the
4952specified subregion.
4953
4954`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4955
4956`GL_INVALID_OPERATION' is generated if the texture array has not been
4957defined by a previous `glTexImage3D' operation.
4958
4959`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4960
4961`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4962the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4963
4964`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4965, YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4966(ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4967`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4968`GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4969, and D include twice the border width.
4970
4971`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4972between the execution of `glBegin' and the corresponding execution of
4973`glEnd'.")
8925f36f
AW
4974
4975(define-gl-procedure
4976 glCreateProgram
4977 "glCreateProgram"
4978 (funcsynopsis
4979 (funcprototype
4980 (funcdef "GLuint " (function "glCreateProgram"))
4981 (paramdef (parameter "void"))))
3c9b6116
AW
4982 "Creates a program object.
4983
4984`glCreateProgram' creates an empty program object and returns a non-zero
4985value by which it can be referenced. A program object is an object to
4986which shader objects can be attached. This provides a mechanism to
4987specify the shader objects that will be linked to create a program. It
4988also provides a means for checking the compatibility of the shaders that
4989will be used to create a program (for instance, checking the
4990compatibility between a vertex shader and a fragment shader). When no
4991longer needed as part of a program object, shader objects can be
4992detached.
4993
4994One or more executables are created in a program object by successfully
4995attaching shader objects to it with `glAttachShader', successfully
4996compiling the shader objects with `glCompileShader', and successfully
4997linking the program object with `glLinkProgram'. These executables are
4998made part of current state when `glUseProgram' is called. Program
4999objects can be deleted by calling `glDeleteProgram'. The memory
5000associated with the program object will be deleted when it is no longer
5001part of current rendering state for any context.
5002
5003This function returns 0 if an error occurs creating the program object.
5004
5005`GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
5006between the execution of `glBegin' and the corresponding execution of
5007`glEnd'.")
8925f36f
AW
5008
5009(define-gl-procedure
5010 glCreateShader
5011 "glCreateShader"
5012 (funcsynopsis
5013 (funcprototype
5014 (funcdef "GLuint " (function "glCreateShader"))
5015 (paramdef "GLenum " (parameter "shaderType"))))
3c9b6116
AW
5016 "Creates a shader object.
5017
5018SHADERTYPE
5019 Specifies the type of shader to be created. Must be either
5020 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
5021
5022`glCreateShader' creates an empty shader object and returns a non-zero
5023value by which it can be referenced. A shader object is used to maintain
5024the source code strings that define a shader. SHADERTYPE indicates the
5025type of shader to be created. Two types of shaders are supported. A
5026shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
5027the programmable vertex processor and replace the fixed functionality
5028vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
5029shader that is intended to run on the programmable fragment processor
5030and replace the fixed functionality fragment processing in OpenGL.
5031
5032When created, a shader object's `GL_SHADER_TYPE' parameter is set to
5033either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
5034value of SHADERTYPE.
5035
5036This function returns 0 if an error occurs creating the shader object.
5037
5038`GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
5039
5040`GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
5041between the execution of `glBegin' and the corresponding execution of
5042`glEnd'.")
8925f36f
AW
5043
5044(define-gl-procedure
5045 glCullFace
5046 "glCullFace"
5047 (funcsynopsis
5048 (funcprototype
5049 (funcdef "void " (function "glCullFace"))
5050 (paramdef "GLenum " (parameter "mode"))))
3c9b6116
AW
5051 "Specify whether front- or back-facing facets can be culled.
5052
5053MODE
5054 Specifies whether front- or back-facing facets are candidates for
5055 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
5056 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
5057
5058`glCullFace' specifies whether front- or back-facing facets are culled
5059(as specified by MODE) when facet culling is enabled. Facet culling is
5060initially disabled. To enable and disable facet culling, call the
5061`glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
5062Facets include triangles, quadrilaterals, polygons, and rectangles.
5063
5064`glFrontFace' specifies which of the clockwise and counterclockwise
5065facets are front-facing and back-facing. See `glFrontFace'.
5066
5067`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5068
5069`GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
5070the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
5071
5072(define-gl-procedure
5073 glDeleteBuffers
5074 "glDeleteBuffers"
5075 (funcsynopsis
5076 (funcprototype
5077 (funcdef "void " (function "glDeleteBuffers"))
5078 (paramdef "GLsizei " (parameter "n"))
5079 (paramdef
5080 "const GLuint * "
5081 (parameter "buffers"))))
3c9b6116
AW
5082 "Delete named buffer objects.
5083
5084N
5085 Specifies the number of buffer objects to be deleted.
5086
5087BUFFERS
5088 Specifies an array of buffer objects to be deleted.
5089
5090`glDeleteBuffers' deletes N buffer objects named by the elements of the
5091array BUFFERS. After a buffer object is deleted, it has no contents, and
5092its name is free for reuse (for example by `glGenBuffers'). If a buffer
5093object that is currently bound is deleted, the binding reverts to 0 (the
5094absence of any buffer object, which reverts to client memory usage).
5095
5096`glDeleteBuffers' silently ignores 0's and names that do not correspond
5097to existing buffer objects.
5098
5099`GL_INVALID_VALUE' is generated if N is negative.
5100
5101`GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
5102between the execution of `glBegin' and the corresponding execution of
5103`glEnd'.")
8925f36f
AW
5104
5105(define-gl-procedure
5106 glDeleteLists
5107 "glDeleteLists"
5108 (funcsynopsis
5109 (funcprototype
5110 (funcdef "void " (function "glDeleteLists"))
5111 (paramdef "GLuint " (parameter "list"))
5112 (paramdef "GLsizei " (parameter "range"))))
3c9b6116
AW
5113 "Delete a contiguous group of display lists.
5114
5115LIST
5116 Specifies the integer name of the first display list to delete.
5117
5118RANGE
5119 Specifies the number of display lists to delete.
5120
5121`glDeleteLists' causes a contiguous group of display lists to be
5122deleted. LIST is the name of the first display list to be deleted, and
5123RANGE is the number of display lists to delete. All display lists D with
5124LIST<=D<=LIST+RANGE-1 are deleted.
5125
5126All storage locations allocated to the specified display lists are
5127freed, and the names are available for reuse at a later time. Names
5128within the range that do not have an associated display list are
5129ignored. If RANGE is 0, nothing happens.
5130
5131`GL_INVALID_VALUE' is generated if RANGE is negative.
5132
5133`GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
5134between the execution of `glBegin' and the corresponding execution of
5135`glEnd'.")
8925f36f
AW
5136
5137(define-gl-procedure
5138 glDeleteProgram
5139 "glDeleteProgram"
5140 (funcsynopsis
5141 (funcprototype
5142 (funcdef "void " (function "glDeleteProgram"))
5143 (paramdef "GLuint " (parameter "program"))))
3c9b6116
AW
5144 "Deletes a program object.
5145
5146PROGRAM
5147 Specifies the program object to be deleted.
5148
5149`glDeleteProgram' frees the memory and invalidates the name associated
5150with the program object specified by PROGRAM. This command effectively
5151undoes the effects of a call to `glCreateProgram'.
5152
5153If a program object is in use as part of current rendering state, it
5154will be flagged for deletion, but it will not be deleted until it is no
5155longer part of current state for any rendering context. If a program
5156object to be deleted has shader objects attached to it, those shader
5157objects will be automatically detached but not deleted unless they have
5158already been flagged for deletion by a previous call to
5159`glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
5160
5161To determine whether a program object has been flagged for deletion,
5162call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
5163
5164`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
5165OpenGL.
5166
5167`GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
5168between the execution of `glBegin' and the corresponding execution of
5169`glEnd'.")
8925f36f
AW
5170
5171(define-gl-procedure
5172 glDeleteQueries
5173 "glDeleteQueries"
5174 (funcsynopsis
5175 (funcprototype
5176 (funcdef "void " (function "glDeleteQueries"))
5177 (paramdef "GLsizei " (parameter "n"))
5178 (paramdef "const GLuint * " (parameter "ids"))))
3c9b6116
AW
5179 "Delete named query objects.
5180
5181N
5182 Specifies the number of query objects to be deleted.
5183
5184IDS
5185 Specifies an array of query objects to be deleted.
5186
5187`glDeleteQueries' deletes N query objects named by the elements of the
5188array IDS. After a query object is deleted, it has no contents, and its
5189name is free for reuse (for example by `glGenQueries').
5190
5191`glDeleteQueries' silently ignores 0's and names that do not correspond
5192to existing query objects.
5193
5194`GL_INVALID_VALUE' is generated if N is negative.
5195
5196`GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5197between the execution of `glBegin' and the corresponding execution of
5198`glEnd'.")
8925f36f
AW
5199
5200(define-gl-procedure
5201 glDeleteShader
5202 "glDeleteShader"
5203 (funcsynopsis
5204 (funcprototype
5205 (funcdef "void " (function "glDeleteShader"))
5206 (paramdef "GLuint " (parameter "shader"))))
3c9b6116
AW
5207 "Deletes a shader object.
5208
5209SHADER
5210 Specifies the shader object to be deleted.
5211
5212`glDeleteShader' frees the memory and invalidates the name associated
5213with the shader object specified by SHADER. This command effectively
5214undoes the effects of a call to `glCreateShader'.
5215
5216If a shader object to be deleted is attached to a program object, it
5217will be flagged for deletion, but it will not be deleted until it is no
5218longer attached to any program object, for any rendering context (i.e.,
5219it must be detached from wherever it was attached before it will be
5220deleted). A value of 0 for SHADER will be silently ignored.
5221
5222To determine whether an object has been flagged for deletion, call
5223`glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5224
5225`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5226OpenGL.
5227
5228`GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5229between the execution of `glBegin' and the corresponding execution of
5230`glEnd'.")
8925f36f
AW
5231
5232(define-gl-procedure
5233 glDeleteTextures
5234 "glDeleteTextures"
5235 (funcsynopsis
5236 (funcprototype
5237 (funcdef "void " (function "glDeleteTextures"))
5238 (paramdef "GLsizei " (parameter "n"))
5239 (paramdef
5240 "const GLuint * "
5241 (parameter "textures"))))
3c9b6116
AW
5242 "Delete named textures.
5243
5244N
5245 Specifies the number of textures to be deleted.
5246
5247TEXTURES
5248 Specifies an array of textures to be deleted.
5249
5250`glDeleteTextures' deletes N textures named by the elements of the array
5251TEXTURES. After a texture is deleted, it has no contents or
5252dimensionality, and its name is free for reuse (for example by
5253`glGenTextures'). If a texture that is currently bound is deleted, the
5254binding reverts to 0 (the default texture).
5255
5256`glDeleteTextures' silently ignores 0's and names that do not correspond
5257to existing textures.
5258
5259`GL_INVALID_VALUE' is generated if N is negative.
5260
5261`GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5262between the execution of `glBegin' and the corresponding execution of
5263`glEnd'.")
8925f36f
AW
5264
5265(define-gl-procedure
5266 glDepthFunc
5267 "glDepthFunc"
5268 (funcsynopsis
5269 (funcprototype
5270 (funcdef "void " (function "glDepthFunc"))
5271 (paramdef "GLenum " (parameter "func"))))
3c9b6116
AW
5272 "Specify the value used for depth buffer comparisons.
5273
5274FUNC
5275 Specifies the depth comparison function. Symbolic constants
5276 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5277 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5278 initial value is `GL_LESS'.
5279
5280`glDepthFunc' specifies the function used to compare each incoming pixel
5281depth value with the depth value present in the depth buffer. The
5282comparison is performed only if depth testing is enabled. (See
5283`glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5284
5285FUNC specifies the conditions under which the pixel will be drawn. The
5286comparison functions are as follows:
5287
5288`GL_NEVER'
5289 Never passes.
5290
5291`GL_LESS'
5292 Passes if the incoming depth value is less than the stored depth
5293 value.
5294
5295`GL_EQUAL'
5296 Passes if the incoming depth value is equal to the stored depth
5297 value.
5298
5299`GL_LEQUAL'
5300 Passes if the incoming depth value is less than or equal to the
5301 stored depth value.
5302
5303`GL_GREATER'
5304 Passes if the incoming depth value is greater than the stored depth
5305 value.
5306
5307`GL_NOTEQUAL'
5308 Passes if the incoming depth value is not equal to the stored depth
5309 value.
5310
5311`GL_GEQUAL'
5312 Passes if the incoming depth value is greater than or equal to the
5313 stored depth value.
5314
5315`GL_ALWAYS'
5316 Always passes.
5317
5318The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5319disabled. If depth testing is disabled or if no depth buffer exists, it
5320is as if the depth test always passes.
5321
5322`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5323
5324`GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5325the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
5326
5327(define-gl-procedure
5328 glDepthMask
5329 "glDepthMask"
5330 (funcsynopsis
5331 (funcprototype
5332 (funcdef "void " (function "glDepthMask"))
5333 (paramdef "GLboolean " (parameter "flag"))))
3c9b6116
AW
5334 "Enable or disable writing into the depth buffer.
5335
5336FLAG
5337 Specifies whether the depth buffer is enabled for writing. If FLAG
5338 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5339 enabled. Initially, depth buffer writing is enabled.
5340
5341`glDepthMask' specifies whether the depth buffer is enabled for writing.
5342If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5343is enabled. Initially, depth buffer writing is enabled.
5344
5345`GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5346the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
5347
5348(define-gl-procedure
5349 glDepthRange
5350 "glDepthRange"
5351 (funcsynopsis
5352 (funcprototype
5353 (funcdef "void " (function "glDepthRange"))
5354 (paramdef "GLclampd " (parameter "nearVal"))
5355 (paramdef "GLclampd " (parameter "farVal"))))
3c9b6116
AW
5356 "Specify mapping of depth values from normalized device coordinates to
5357window coordinates.
5358
5359NEARVAL
5360 Specifies the mapping of the near clipping plane to window
5361 coordinates. The initial value is 0.
5362
5363FARVAL
5364 Specifies the mapping of the far clipping plane to window
5365 coordinates. The initial value is 1.
5366
5367After clipping and division by W, depth coordinates range from -1 to 1,
5368corresponding to the near and far clipping planes. `glDepthRange'
5369specifies a linear mapping of the normalized depth coordinates in this
5370range to window depth coordinates. Regardless of the actual depth buffer
5371implementation, window coordinate depth values are treated as though
5372they range from 0 through 1 (like color components). Thus, the values
5373accepted by `glDepthRange' are both clamped to this range before they
5374are accepted.
5375
5376The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5377With this mapping, the depth buffer range is fully utilized.
5378
5379`GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5380between the execution of `glBegin' and the corresponding execution of
5381`glEnd'.")
8925f36f
AW
5382
5383(define-gl-procedure
5384 glDetachShader
5385 "glDetachShader"
5386 (funcsynopsis
5387 (funcprototype
5388 (funcdef "void " (function "glDetachShader"))
5389 (paramdef "GLuint " (parameter "program"))
5390 (paramdef "GLuint " (parameter "shader"))))
3c9b6116
AW
5391 "Detaches a shader object from a program object to which it is attached.
5392
5393PROGRAM
5394 Specifies the program object from which to detach the shader
5395 object.
5396
5397SHADER
5398 Specifies the shader object to be detached.
5399
5400`glDetachShader' detaches the shader object specified by SHADER from the
5401program object specified by PROGRAM. This command can be used to undo
5402the effect of the command `glAttachShader'.
5403
5404If SHADER has already been flagged for deletion by a call to
5405`glDeleteShader' and it is not attached to any other program object, it
5406will be deleted after it has been detached.
5407
5408`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5409that was not generated by OpenGL.
5410
5411`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5412
5413`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5414
5415`GL_INVALID_OPERATION' is generated if SHADER is not attached to
5416PROGRAM.
5417
5418`GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5419between the execution of `glBegin' and the corresponding execution of
5420`glEnd'.")
8925f36f
AW
5421
5422(define-gl-procedure
5423 glDrawArrays
5424 "glDrawArrays"
5425 (funcsynopsis
5426 (funcprototype
5427 (funcdef "void " (function "glDrawArrays"))
5428 (paramdef "GLenum " (parameter "mode"))
5429 (paramdef "GLint " (parameter "first"))
5430 (paramdef "GLsizei " (parameter "count"))))
3c9b6116
AW
5431 "Render primitives from array data.
5432
5433MODE
5434 Specifies what kind of primitives to render. Symbolic constants
5435 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5436 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5437 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5438
5439FIRST
5440 Specifies the starting index in the enabled arrays.
5441
5442COUNT
5443 Specifies the number of indices to be rendered.
5444
5445`glDrawArrays' specifies multiple geometric primitives with very few
5446subroutine calls. Instead of calling a GL procedure to pass each
5447individual vertex, normal, texture coordinate, edge flag, or color, you
5448can prespecify separate arrays of vertices, normals, and colors and use
5449them to construct a sequence of primitives with a single call to
5450`glDrawArrays'.
5451
5452When `glDrawArrays' is called, it uses COUNT sequential elements from
5453each enabled array to construct a sequence of geometric primitives,
5454beginning with element FIRST. MODE specifies what kind of primitives are
5455constructed and how the array elements construct those primitives. If
5456`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5457
5458Vertex attributes that are modified by `glDrawArrays' have an
5459unspecified value after `glDrawArrays' returns. For example, if
5460`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5461after `glDrawArrays' executes. Attributes that aren't modified remain
5462well defined.
5463
5464`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5465
5466`GL_INVALID_VALUE' is generated if COUNT is negative.
5467
5468`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5469bound to an enabled array and the buffer object's data store is
5470currently mapped.
5471
5472`GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5473between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f
AW
5474
5475(define-gl-procedure
5476 glDrawBuffers
5477 "glDrawBuffers"
5478 (funcsynopsis
5479 (funcprototype
5480 (funcdef "void " (function "glDrawBuffers"))
5481 (paramdef "GLsizei " (parameter "n"))
5482 (paramdef "const GLenum *" (parameter "bufs"))))
3c9b6116
AW
5483 "Specifies a list of color buffers to be drawn into.
5484
5485N
5486 Specifies the number of buffers in BUFS.
5487
5488BUFS
5489 Points to an array of symbolic constants specifying the buffers
5490 into which fragment colors or data values will be written.
5491
5492`glDrawBuffers' defines an array of buffers into which fragment color
5493values or fragment data will be written. If no fragment shader is
5494active, rendering operations will generate only one fragment color per
5495fragment and it will be written into each of the buffers specified by
5496BUFS. If a fragment shader is active and it writes a value to the output
5497variable `gl_FragColor', then that value will be written into each of
5498the buffers specified by BUFS. If a fragment shader is active and it
5499writes a value to one or more elements of the output array variable
5500`gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5501into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5502will be written into the second buffer specified by BUFS, and so on up
5503to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5504beyond is implicitly set to be `GL_NONE'.
5505
5506The symbolic constants contained in BUFS may be any of the following:
5507
5508`GL_NONE'
5509 The fragment color/data value is not written into any color buffer.
5510
5511`GL_FRONT_LEFT'
5512 The fragment color/data value is written into the front left color
5513 buffer.
5514
5515`GL_FRONT_RIGHT'
5516 The fragment color/data value is written into the front right color
5517 buffer.
5518
5519`GL_BACK_LEFT'
5520 The fragment color/data value is written into the back left color
5521 buffer.
5522
5523`GL_BACK_RIGHT'
5524 The fragment color/data value is written into the back right color
5525 buffer.
5526
5527`GL_AUXi'
5528 The fragment color/data value is written into auxiliary buffer `i'.
5529
5530Except for `GL_NONE', the preceding symbolic constants may not appear
5531more than once in BUFS. The maximum number of draw buffers supported is
5532implementation dependent and can be queried by calling `glGet' with the
5533argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5534queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5535
5536`GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5537accepted value.
5538
5539`GL_INVALID_ENUM' is generated if N is less than 0.
5540
5541`GL_INVALID_OPERATION' is generated if a symbolic constant other than
5542`GL_NONE' appears more than once in BUFS.
5543
5544`GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5545than `GL_NONE' ) indicates a color buffer that does not exist in the
5546current GL context.
5547
5548`GL_INVALID_VALUE' is generated if N is greater than
5549`GL_MAX_DRAW_BUFFERS'.
5550
5551`GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5552between the execution of `glBegin' and the corresponding execution of
5553`glEnd'.")
8925f36f
AW
5554
5555(define-gl-procedure
5556 glDrawBuffer
5557 "glDrawBuffer"
5558 (funcsynopsis
5559 (funcprototype
5560 (funcdef "void " (function "glDrawBuffer"))
5561 (paramdef "GLenum " (parameter "mode"))))
3c9b6116
AW
5562 "Specify which color buffers are to be drawn into.
5563
5564MODE
5565 Specifies up to four color buffers to be drawn into. Symbolic
5566 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5567 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5568 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5569 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5570 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5571 number of available aux buffers.) The initial value is `GL_FRONT'
5572 for single-buffered contexts, and `GL_BACK' for double-buffered
5573 contexts.
5574
5575When colors are written to the frame buffer, they are written into the
5576color buffers specified by `glDrawBuffer'. The specifications are as
5577follows:
5578
5579`GL_NONE'
5580 No color buffers are written.
5581
5582`GL_FRONT_LEFT'
5583 Only the front left color buffer is written.
5584
5585`GL_FRONT_RIGHT'
5586 Only the front right color buffer is written.
5587
5588`GL_BACK_LEFT'
5589 Only the back left color buffer is written.
5590
5591`GL_BACK_RIGHT'
5592 Only the back right color buffer is written.
5593
5594`GL_FRONT'
5595 Only the front left and front right color buffers are written. If
5596 there is no front right color buffer, only the front left color
5597 buffer is written.
5598
5599`GL_BACK'
5600 Only the back left and back right color buffers are written. If
5601 there is no back right color buffer, only the back left color
5602 buffer is written.
5603
5604`GL_LEFT'
5605 Only the front left and back left color buffers are written. If
5606 there is no back left color buffer, only the front left color
5607 buffer is written.
5608
5609`GL_RIGHT'
5610 Only the front right and back right color buffers are written. If
5611 there is no back right color buffer, only the front right color
5612 buffer is written.
5613
5614`GL_FRONT_AND_BACK'
5615 All the front and back color buffers (front left, front right, back
5616 left, back right) are written. If there are no back color buffers,
5617 only the front left and front right color buffers are written. If
5618 there are no right color buffers, only the front left and back left
5619 color buffers are written. If there are no right or back color
5620 buffers, only the front left color buffer is written.
5621
5622`GL_AUX'I
5623 Only auxiliary color buffer I is written.
5624
5625If more than one color buffer is selected for drawing, then blending or
5626logical operations are computed and applied independently for each color
5627buffer and can produce different results in each buffer.
5628
5629Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5630include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5631include only FRONT buffers, and double-buffered contexts include both
5632FRONT and BACK buffers. The context is selected at GL initialization.
5633
5634`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5635
5636`GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5637MODE exists.
5638
5639`GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5640between the execution of `glBegin' and the corresponding execution of
5641`glEnd'.")
8925f36f
AW
5642
5643(define-gl-procedure
5644 glDrawElements
5645 "glDrawElements"
5646 (funcsynopsis
5647 (funcprototype
5648 (funcdef "void " (function "glDrawElements"))
5649 (paramdef "GLenum " (parameter "mode"))
5650 (paramdef "GLsizei " (parameter "count"))
5651 (paramdef "GLenum " (parameter "type"))
5652 (paramdef
5653 "const GLvoid * "
5654 (parameter "indices"))))
3c9b6116
AW
5655 "Render primitives from array data.
5656
5657MODE
5658 Specifies what kind of primitives to render. Symbolic constants
5659 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5660 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5661 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5662
5663COUNT
5664 Specifies the number of elements to be rendered.
5665
5666TYPE
5667 Specifies the type of the values in INDICES. Must be one of
5668 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5669
5670INDICES
5671 Specifies a pointer to the location where the indices are stored.
5672
5673`glDrawElements' specifies multiple geometric primitives with very few
5674subroutine calls. Instead of calling a GL function to pass each
5675individual vertex, normal, texture coordinate, edge flag, or color, you
5676can prespecify separate arrays of vertices, normals, and so on, and use
5677them to construct a sequence of primitives with a single call to
5678`glDrawElements'.
5679
5680When `glDrawElements' is called, it uses COUNT sequential elements from
5681an enabled array, starting at INDICES to construct a sequence of
5682geometric primitives. MODE specifies what kind of primitives are
5683constructed and how the array elements construct these primitives. If
5684more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5685not enabled, no geometric primitives are constructed.
5686
5687Vertex attributes that are modified by `glDrawElements' have an
5688unspecified value after `glDrawElements' returns. For example, if
5689`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5690after `glDrawElements' executes. Attributes that aren't modified
5691maintain their previous values.
5692
5693`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5694
5695`GL_INVALID_VALUE' is generated if COUNT is negative.
5696
5697`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5698bound to an enabled array or the element array and the buffer object's
5699data store is currently mapped.
5700
5701`GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5702between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f
AW
5703
5704(define-gl-procedure
5705 glDrawPixels
5706 "glDrawPixels"
5707 (funcsynopsis
5708 (funcprototype
5709 (funcdef "void " (function "glDrawPixels"))
5710 (paramdef "GLsizei " (parameter "width"))
5711 (paramdef "GLsizei " (parameter "height"))
5712 (paramdef "GLenum " (parameter "format"))
5713 (paramdef "GLenum " (parameter "type"))
5714 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116 5715 "Write a block of pixels to the frame buffer.
8925f36f 5716
3c9b6116
AW
5717WIDTH
5718 HEIGHT
8925f36f 5719
3c9b6116
AW
5720 Specify the dimensions of the pixel rectangle to be written into
5721 the frame buffer.
8925f36f 5722
3c9b6116
AW
5723FORMAT
5724 Specifies the format of the pixel data. Symbolic constants
5725 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5726 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5727 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5728 accepted.
8925f36f 5729
3c9b6116
AW
5730TYPE
5731 Specifies the data type for DATA. Symbolic constants
5732 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5733 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5734 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5735 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5736 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5737 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5738 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5739 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5740 are accepted.
8925f36f 5741
3c9b6116
AW
5742DATA
5743 Specifies a pointer to the pixel data.
8925f36f 5744
3c9b6116
AW
5745`glDrawPixels' reads pixel data from memory and writes it into the frame
5746buffer relative to the current raster position, provided that the raster
5747position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5748raster position; use `glGet' with argument
5749`GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5750position is valid, and `glGet' with argument
5751`GL_CURRENT_RASTER_POSITION' to query the raster position.
8925f36f 5752
3c9b6116
AW
5753Several parameters define the encoding of pixel data in memory and
5754control the processing of the pixel data before it is placed in the
5755frame buffer. These parameters are set with four commands:
5756`glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5757reference page describes the effects on `glDrawPixels' of many, but not
5758all, of the parameters specified by these four commands.
8925f36f 5759
3c9b6116
AW
5760Data is read from DATA as a sequence of signed or unsigned bytes, signed
5761or unsigned shorts, signed or unsigned integers, or single-precision
5762floating-point values, depending on TYPE. When TYPE is one of
5763`GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5764`GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5765integers, or floating-point values is interpreted as one color or depth
5766component, or one index, depending on FORMAT. When TYPE is one of
5767`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5768`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5769`GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5770unsigned value is interpreted as containing all the components for a
5771single pixel, with the color components arranged according to FORMAT.
5772When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5773`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5774`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5775`GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5776containing all color components, specified by FORMAT, for a single pixel
5777in a reversed order. Indices are always treated individually. Color
5778components are treated as groups of one, two, three, or four values,
5779again based on FORMAT. Both individual indices and groups of components
5780are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5781unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5782`GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5783with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5784`glPixelStore').
8925f36f 5785
3c9b6116
AW
5786WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5787default, these pixels are taken from adjacent memory locations, except
5788that after all WIDTH pixels are read, the read pointer is advanced to
5789the next four-byte boundary. The four-byte row alignment is specified by
5790`glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5791one, two, four, or eight bytes. Other pixel store parameters specify
5792different read pointer advancements, both before the first pixel is read
5793and after all WIDTH pixels are read. See the `glPixelStore' reference
5794page for details on these options.
5795
5796If a non-zero named buffer object is bound to the
5797`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5798pixels is specified, DATA is treated as a byte offset into the buffer
5799object's data store.
5800
5801The WIDTH×HEIGHT pixels that are read from memory are each operated on
5802in the same way, based on the values of several parameters specified by
5803`glPixelTransfer' and `glPixelMap'. The details of these operations, as
5804well as the target buffer into which the pixels are drawn, are specific
5805to the format of the pixels, as specified by FORMAT. FORMAT can assume
5806one of 13 symbolic values:
5807
5808`GL_COLOR_INDEX'
5809 Each pixel is a single value, a color index. It is converted to
5810 fixed-point format, with an unspecified number of bits to the right
5811 of the binary point, regardless of the memory data type.
5812 Floating-point values convert to true fixed-point values. Signed
5813 and unsigned integer data is converted with all fraction bits set
5814 to 0. Bitmap data convert to either 0 or 1.
5815
5816 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5817 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5818 negative, the shift is to the right. In either case, zero bits fill
5819 otherwise unspecified bit locations in the result.
5820
5821 If the GL is in RGBA mode, the resulting index is converted to an
5822 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5823 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5824 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5825 if `GL_MAP_COLOR' is true, the index is replaced with the value
5826 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5827 the lookup replacement of the index is done or not, the integer
5828 part of the index is then ANDed with 2^B-1 , where B is the number
5829 of bits in a color index buffer.
5830
5831 The GL then converts the resulting indices or RGBA colors to
5832 fragments by attaching the current raster position Z coordinate and
5833 texture coordinates to each pixel, then assigning X and Y window
5834 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5835 Y_N=Y_R+⌊N/WIDTH,⌋
5836
5837 where (X_R,Y_R) is the current raster position. These pixel
5838 fragments are then treated just like the fragments generated by
5839 rasterizing points, lines, or polygons. Texture mapping, fog, and
5840 all the fragment operations are applied before the fragments are
5841 written to the frame buffer.
5842
5843`GL_STENCIL_INDEX'
5844 Each pixel is a single value, a stencil index. It is converted to
5845 fixed-point format, with an unspecified number of bits to the right
5846 of the binary point, regardless of the memory data type.
5847 Floating-point values convert to true fixed-point values. Signed
5848 and unsigned integer data is converted with all fraction bits set
5849 to 0. Bitmap data convert to either 0 or 1.
5850
5851 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5852 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5853 negative, the shift is to the right. In either case, zero bits fill
5854 otherwise unspecified bit locations in the result. If
5855 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5856 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5857 lookup replacement of the index is done or not, the integer part of
5858 the index is then ANDed with 2^B-1 , where B is the number of bits
5859 in the stencil buffer. The resulting stencil indices are then
5860 written to the stencil buffer such that the N th index is written
5861 to location
5862
5863 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5864
5865 where (X_R,Y_R) is the current raster position. Only the pixel
5866 ownership test, the scissor test, and the stencil writemask affect
5867 these write operations.
5868
5869`GL_DEPTH_COMPONENT'
5870 Each pixel is a single-depth component. Floating-point data is
5871 converted directly to an internal floating-point format with
5872 unspecified precision. Signed integer data is mapped linearly to
5873 the internal floating-point format such that the most positive
5874 representable integer value maps to 1.0, and the most negative
5875 representable value maps to -1.0 . Unsigned integer data is mapped
5876 similarly: the largest integer value maps to 1.0, and 0 maps to
5877 0.0. The resulting floating-point depth value is then multiplied by
5878 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5879 clamped to the range [0,1] .
5880
5881 The GL then converts the resulting depth components to fragments by
5882 attaching the current raster position color or color index and
5883 texture coordinates to each pixel, then assigning X and Y window
5884 coordinates to the N th fragment such that
5885
5886 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5887
5888 where (X_R,Y_R) is the current raster position. These pixel
5889 fragments are then treated just like the fragments generated by
5890 rasterizing points, lines, or polygons. Texture mapping, fog, and
5891 all the fragment operations are applied before the fragments are
5892 written to the frame buffer.
5893
5894`GL_RGBA'
5895`GL_BGRA'
5896 Each pixel is a four-component group: For `GL_RGBA', the red
5897 component is first, followed by green, followed by blue, followed
5898 by alpha; for `GL_BGRA' the order is blue, green, red and then
5899 alpha. Floating-point values are converted directly to an internal
5900 floating-point format with unspecified precision. Signed integer
5901 values are mapped linearly to the internal floating-point format
5902 such that the most positive representable integer value maps to
5903 1.0, and the most negative representable value maps to -1.0 . (Note
5904 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5905 integer data is mapped similarly: The largest integer value maps to
5906 1.0, and 0 maps to 0.0. The resulting floating-point color values
5907 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5908 C is RED, GREEN, BLUE, and ALPHA for the respective color
5909 components. The results are clamped to the range [0,1] .
5910
5911 If `GL_MAP_COLOR' is true, each color component is scaled by the
5912 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5913 value that it references in that table. C is R, G, B, or A
5914 respectively.
5915
5916 The GL then converts the resulting RGBA colors to fragments by
5917 attaching the current raster position Z coordinate and texture
5918 coordinates to each pixel, then assigning X and Y window
5919 coordinates to the N th fragment such that
5920
5921 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5922
5923 where (X_R,Y_R) is the current raster position. These pixel
5924 fragments are then treated just like the fragments generated by
5925 rasterizing points, lines, or polygons. Texture mapping, fog, and
5926 all the fragment operations are applied before the fragments are
5927 written to the frame buffer.
5928
5929`GL_RED'
5930 Each pixel is a single red component. This component is converted
5931 to the internal floating-point format in the same way the red
5932 component of an RGBA pixel is. It is then converted to an RGBA
5933 pixel with green and blue set to 0, and alpha set to 1. After this
5934 conversion, the pixel is treated as if it had been read as an RGBA
5935 pixel.
5936
5937`GL_GREEN'
5938 Each pixel is a single green component. This component is converted
5939 to the internal floating-point format in the same way the green
5940 component of an RGBA pixel is. It is then converted to an RGBA
5941 pixel with red and blue set to 0, and alpha set to 1. After this
5942 conversion, the pixel is treated as if it had been read as an RGBA
5943 pixel.
5944
5945`GL_BLUE'
5946 Each pixel is a single blue component. This component is converted
5947 to the internal floating-point format in the same way the blue
5948 component of an RGBA pixel is. It is then converted to an RGBA
5949 pixel with red and green set to 0, and alpha set to 1. After this
5950 conversion, the pixel is treated as if it had been read as an RGBA
5951 pixel.
5952
5953`GL_ALPHA'
5954 Each pixel is a single alpha component. This component is converted
5955 to the internal floating-point format in the same way the alpha
5956 component of an RGBA pixel is. It is then converted to an RGBA
5957 pixel with red, green, and blue set to 0. After this conversion,
5958 the pixel is treated as if it had been read as an RGBA pixel.
5959
5960`GL_RGB'
5961`GL_BGR'
5962 Each pixel is a three-component group: red first, followed by
5963 green, followed by blue; for `GL_BGR', the first component is blue,
5964 followed by green and then red. Each component is converted to the
5965 internal floating-point format in the same way the red, green, and
5966 blue components of an RGBA pixel are. The color triple is converted
5967 to an RGBA pixel with alpha set to 1. After this conversion, the
5968 pixel is treated as if it had been read as an RGBA pixel.
5969
5970`GL_LUMINANCE'
5971 Each pixel is a single luminance component. This component is
5972 converted to the internal floating-point format in the same way the
5973 red component of an RGBA pixel is. It is then converted to an RGBA
5974 pixel with red, green, and blue set to the converted luminance
5975 value, and alpha set to 1. After this conversion, the pixel is
5976 treated as if it had been read as an RGBA pixel.
5977
5978`GL_LUMINANCE_ALPHA'
5979 Each pixel is a two-component group: luminance first, followed by
5980 alpha. The two components are converted to the internal
5981 floating-point format in the same way the red component of an RGBA
5982 pixel is. They are then converted to an RGBA pixel with red, green,
5983 and blue set to the converted luminance value, and alpha set to the
5984 converted alpha value. After this conversion, the pixel is treated
5985 as if it had been read as an RGBA pixel.
5986
5987The following table summarizes the meaning of the valid constants for
5988the TYPE parameter:
5989
5990
5991
5992*Type*
5993 *Corresponding Type*
5994
5995`GL_UNSIGNED_BYTE'
5996 unsigned 8-bit integer
5997
5998`GL_BYTE'
5999 signed 8-bit integer
6000
6001`GL_BITMAP'
6002 single bits in unsigned 8-bit integers
6003
6004`GL_UNSIGNED_SHORT'
6005 unsigned 16-bit integer
6006
6007`GL_SHORT'
6008 signed 16-bit integer
6009
6010`GL_UNSIGNED_INT'
6011 unsigned 32-bit integer
6012
6013`GL_INT'
6014 32-bit integer
6015
6016`GL_FLOAT'
6017 single-precision floating-point
6018
6019`GL_UNSIGNED_BYTE_3_3_2'
6020 unsigned 8-bit integer
6021
6022`GL_UNSIGNED_BYTE_2_3_3_REV'
6023 unsigned 8-bit integer with reversed component ordering
6024
6025`GL_UNSIGNED_SHORT_5_6_5'
6026 unsigned 16-bit integer
6027
6028`GL_UNSIGNED_SHORT_5_6_5_REV'
6029 unsigned 16-bit integer with reversed component ordering
6030
6031`GL_UNSIGNED_SHORT_4_4_4_4'
6032 unsigned 16-bit integer
6033
6034`GL_UNSIGNED_SHORT_4_4_4_4_REV'
6035 unsigned 16-bit integer with reversed component ordering
6036
6037`GL_UNSIGNED_SHORT_5_5_5_1'
6038 unsigned 16-bit integer
6039
6040`GL_UNSIGNED_SHORT_1_5_5_5_REV'
6041 unsigned 16-bit integer with reversed component ordering
6042
6043`GL_UNSIGNED_INT_8_8_8_8'
6044 unsigned 32-bit integer
6045
6046`GL_UNSIGNED_INT_8_8_8_8_REV'
6047 unsigned 32-bit integer with reversed component ordering
6048
6049`GL_UNSIGNED_INT_10_10_10_2'
6050 unsigned 32-bit integer
6051
6052`GL_UNSIGNED_INT_2_10_10_10_REV'
6053 unsigned 32-bit integer with reversed component ordering
6054
6055
6056
6057The rasterization described so far assumes pixel zoom factors of 1. If
6058`glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
6059are converted to fragments as follows. If (X_R,Y_R) is the current
6060raster position, and a given pixel is in the N th column and M th row of
6061the pixel rectangle, then fragments are generated for pixels whose
6062centers are in the rectangle with corners at
6063
6064(X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
6065
6066where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
6067`GL_ZOOM_Y'.
6068
6069`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
6070accepted values.
6071
6072`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
6073either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
6074
6075`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
6076
6077`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
6078there is no stencil buffer.
6079
6080`GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
6081`GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
6082`GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
6083mode.
6084
6085`GL_INVALID_OPERATION' is generated if FORMAT is one of
6086`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
6087`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
6088is not `GL_RGB'.
6089
6090`GL_INVALID_OPERATION' is generated if FORMAT is one of
6091`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
6092`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
6093`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
6094`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
6095FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
6096
6097`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6098bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
6099data store is currently mapped.
6100
6101`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6102bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
6103unpacked from the buffer object such that the memory reads required
6104would exceed the data store size.
6105
6106`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6107bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
6108divisible into the number of bytes needed to store in memory a datum
6109indicated by TYPE.
6110
6111`GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
6112between the execution of `glBegin' and the corresponding execution of
6113`glEnd'.")
8925f36f
AW
6114
6115(define-gl-procedure
3c9b6116
AW
6116 glDrawRangeElements
6117 "glDrawRangeElements"
8925f36f
AW
6118 (funcsynopsis
6119 (funcprototype
3c9b6116
AW
6120 (funcdef
6121 "void "
6122 (function "glDrawRangeElements"))
6123 (paramdef "GLenum " (parameter "mode"))
6124 (paramdef "GLuint " (parameter "start"))
6125 (paramdef "GLuint " (parameter "end"))
6126 (paramdef "GLsizei " (parameter "count"))
8925f36f 6127 (paramdef "GLenum " (parameter "type"))
3c9b6116
AW
6128 (paramdef
6129 "const GLvoid * "
6130 (parameter "indices"))))
6131 "Render primitives from array data.
8925f36f 6132
3c9b6116
AW
6133MODE
6134 Specifies what kind of primitives to render. Symbolic constants
6135 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
6136 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
6137 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
8925f36f 6138
3c9b6116
AW
6139START
6140 Specifies the minimum array index contained in INDICES.
6141
6142END
6143 Specifies the maximum array index contained in INDICES.
6144
6145COUNT
6146 Specifies the number of elements to be rendered.
6147
6148TYPE
6149 Specifies the type of the values in INDICES. Must be one of
6150 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
6151
6152INDICES
6153 Specifies a pointer to the location where the indices are stored.
6154
6155`glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
6156START, END, and COUNT match the corresponding arguments to
6157`glDrawElements', with the additional constraint that all values in the
6158arrays COUNT must lie between START and END, inclusive.
6159
6160Implementations denote recommended maximum amounts of vertex and index
6161data, which may be queried by calling `glGet' with argument
6162`GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
6163is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
6164greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
6165operate at reduced performance. There is no requirement that all
6166vertices in the range [START,END] be referenced. However, the
6167implementation may partially process unused vertices, reducing
6168performance from what could be achieved with an optimal index set.
6169
6170When `glDrawRangeElements' is called, it uses COUNT sequential elements
6171from an enabled array, starting at START to construct a sequence of
6172geometric primitives. MODE specifies what kind of primitives are
6173constructed, and how the array elements construct these primitives. If
6174more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
6175not enabled, no geometric primitives are constructed.
6176
6177Vertex attributes that are modified by `glDrawRangeElements' have an
6178unspecified value after `glDrawRangeElements' returns. For example, if
6179`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
6180after `glDrawRangeElements' executes. Attributes that aren't modified
6181maintain their previous values.
6182
6183It is an error for indices to lie outside the range [START,END] , but
6184implementations may not check for this situation. Such indices cause
6185implementation-dependent behavior.
6186
6187`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6188
6189`GL_INVALID_VALUE' is generated if COUNT is negative.
6190
6191`GL_INVALID_VALUE' is generated if END<START .
6192
6193`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6194bound to an enabled array or the element array and the buffer object's
6195data store is currently mapped.
6196
6197`GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
6198between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f
AW
6199
6200(define-gl-procedure
3c9b6116
AW
6201 glEdgeFlagPointer
6202 "glEdgeFlagPointer"
8925f36f
AW
6203 (funcsynopsis
6204 (funcprototype
3c9b6116 6205 (funcdef "void " (function "glEdgeFlagPointer"))
8925f36f 6206 (paramdef "GLsizei " (parameter "stride"))
3c9b6116
AW
6207 (paramdef
6208 "const GLvoid * "
6209 (parameter "pointer"))))
6210 "Define an array of edge flags.
8925f36f 6211
3c9b6116
AW
6212STRIDE
6213 Specifies the byte offset between consecutive edge flags. If STRIDE
6214 is 0, the edge flags are understood to be tightly packed in the
6215 array. The initial value is 0.
8925f36f 6216
3c9b6116
AW
6217POINTER
6218 Specifies a pointer to the first edge flag in the array. The
6219 initial value is 0.
8925f36f 6220
3c9b6116
AW
6221`glEdgeFlagPointer' specifies the location and data format of an array
6222of boolean edge flags to use when rendering. STRIDE specifies the byte
6223stride from one edge flag to the next, allowing vertices and attributes
6224to be packed into a single array or stored in separate arrays.
8925f36f 6225
3c9b6116
AW
6226If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
6227target (see `glBindBuffer') while an edge flag array is specified,
6228POINTER is treated as a byte offset into the buffer object's data store.
6229Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
6230edge flag vertex array client-side state
6231(`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
8925f36f 6232
3c9b6116
AW
6233When an edge flag array is specified, STRIDE and POINTER are saved as
6234client-side state, in addition to the current vertex array buffer object
6235binding.
6236
6237To enable and disable the edge flag array, call `glEnableClientState'
6238and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
6239enabled, the edge flag array is used when `glDrawArrays',
6240`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
6241`glDrawRangeElements', or `glArrayElement' is called.
6242
6243`GL_INVALID_ENUM' is generated if STRIDE is negative.")
8925f36f
AW
6244
6245(define-gl-procedure
3c9b6116
AW
6246 glEdgeFlag
6247 "glEdgeFlag"
8925f36f
AW
6248 (funcsynopsis
6249 (funcprototype
3c9b6116
AW
6250 (funcdef "void " (function "glEdgeFlag"))
6251 (paramdef "GLboolean " (parameter "flag"))))
6252 "Flag edges as either boundary or nonboundary.
6253
6254FLAG
6255 Specifies the current edge flag value, either `GL_TRUE' or
6256 `GL_FALSE'. The initial value is `GL_TRUE'.
6257
6258Each vertex of a polygon, separate triangle, or separate quadrilateral
6259specified between a `glBegin'/`glEnd' pair is marked as the start of
6260either a boundary or nonboundary edge. If the current edge flag is true
6261when the vertex is specified, the vertex is marked as the start of a
6262boundary edge. Otherwise, the vertex is marked as the start of a
6263nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6264FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6265
6266The vertices of connected triangles and connected quadrilaterals are
6267always marked as boundary, regardless of the value of the edge flag.
6268
6269Boundary and nonboundary edge flags on vertices are significant only if
6270`GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6271`glPolygonMode'.")
8925f36f
AW
6272
6273(define-gl-procedure
3c9b6116
AW
6274 glEnableClientState
6275 "glEnableClientState"
8925f36f
AW
6276 (funcsynopsis
6277 (funcprototype
3c9b6116
AW
6278 (funcdef
6279 "void "
6280 (function "glEnableClientState"))
6281 (paramdef "GLenum " (parameter "cap"))))
6282 "Enable or disable client-side capability.
6283
6284CAP
6285 Specifies the capability to enable. Symbolic constants
6286 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6287 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6288 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6289
6290`glEnableClientState' and `glDisableClientState' enable or disable
6291individual client-side capabilities. By default, all client-side
6292capabilities are disabled. Both `glEnableClientState' and
6293`glDisableClientState' take a single argument, CAP, which can assume one
6294of the following values:
6295
6296`GL_COLOR_ARRAY'
6297 If enabled, the color array is enabled for writing and used during
6298 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6299 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6300 is called. See `glColorPointer'.
6301
6302`GL_EDGE_FLAG_ARRAY'
6303 If enabled, the edge flag array is enabled for writing and used
6304 during rendering when `glArrayElement', `glDrawArrays',
6305 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6306 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6307
6308`GL_FOG_COORD_ARRAY'
6309 If enabled, the fog coordinate array is enabled for writing and
6310 used during rendering when `glArrayElement', `glDrawArrays',
6311 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6312 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6313
6314`GL_INDEX_ARRAY'
6315 If enabled, the index array is enabled for writing and used during
6316 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6317 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6318 is called. See `glIndexPointer'.
6319
6320`GL_NORMAL_ARRAY'
6321 If enabled, the normal array is enabled for writing and used during
6322 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6323 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6324 is called. See `glNormalPointer'.
6325
6326`GL_SECONDARY_COLOR_ARRAY'
6327 If enabled, the secondary color array is enabled for writing and
6328 used during rendering when `glArrayElement', `glDrawArrays',
6329 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6330 `glMultiDrawElements' is called. See `glColorPointer'.
6331
6332`GL_TEXTURE_COORD_ARRAY'
6333 If enabled, the texture coordinate array is enabled for writing and
6334 used during rendering when `glArrayElement', `glDrawArrays',
6335 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6336 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6337
6338`GL_VERTEX_ARRAY'
6339 If enabled, the vertex array is enabled for writing and used during
6340 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6341 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6342 is called. See `glVertexPointer'.
6343
6344`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6345
6346`glEnableClientState' is not allowed between the execution of `glBegin'
6347and the corresponding `glEnd', but an error may or may not be generated.
6348If no error is generated, the behavior is undefined.")
8925f36f
AW
6349
6350(define-gl-procedure
3c9b6116
AW
6351 glEnableVertexAttribArray
6352 "glEnableVertexAttribArray"
8925f36f
AW
6353 (funcsynopsis
6354 (funcprototype
3c9b6116
AW
6355 (funcdef
6356 "void "
6357 (function "glEnableVertexAttribArray"))
6358 (paramdef "GLuint " (parameter "index")))
6359 (funcprototype
6360 (funcdef
6361 "void "
6362 (function "glDisableVertexAttribArray"))
6363 (paramdef "GLuint " (parameter "index"))))
6364 "Enable or disable a generic vertex attribute array.
6365
6366INDEX
6367 Specifies the index of the generic vertex attribute to be enabled
6368 or disabled.
6369
6370`glEnableVertexAttribArray' enables the generic vertex attribute array
6371specified by INDEX. `glDisableVertexAttribArray' disables the generic
6372vertex attribute array specified by INDEX. By default, all client-side
6373capabilities are disabled, including all generic vertex attribute
6374arrays. If enabled, the values in the generic vertex attribute array
6375will be accessed and used for rendering when calls are made to vertex
6376array commands such as `glDrawArrays', `glDrawElements',
6377`glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6378`glMultiDrawArrays'.
6379
6380`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6381`GL_MAX_VERTEX_ATTRIBS'.
6382
6383`GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6384' or `glDisableVertexAttribArray ' is executed between the execution of
6385`glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
6386
6387(define-gl-procedure
3c9b6116
AW
6388 glEnable
6389 "glEnable"
8925f36f
AW
6390 (funcsynopsis
6391 (funcprototype
3c9b6116
AW
6392 (funcdef "void " (function "glEnable"))
6393 (paramdef "GLenum " (parameter "cap"))))
6394 "Enable or disable server-side GL capabilities.
6395
6396CAP
6397 Specifies a symbolic constant indicating a GL capability.
6398
6399`glEnable' and `glDisable' enable and disable various capabilities. Use
6400`glIsEnabled' or `glGet' to determine the current setting of any
6401capability. The initial value for each capability with the exception of
6402`GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6403`GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6404
6405Both `glEnable' and `glDisable' take a single argument, CAP, which can
6406assume one of the following values:
6407
6408`GL_ALPHA_TEST'
6409
6410
6411 If enabled, do alpha testing. See `glAlphaFunc'.
6412
6413`GL_AUTO_NORMAL'
6414
6415
6416 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6417 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6418
6419`GL_BLEND'
6420
6421
6422 If enabled, blend the computed fragment color values with the
6423 values in the color buffers. See `glBlendFunc'.
6424
6425`GL_CLIP_PLANE'I
6426
6427
6428 If enabled, clip geometry against user-defined clipping plane I.
6429 See `glClipPlane'.
6430
6431`GL_COLOR_LOGIC_OP'
6432
6433
6434 If enabled, apply the currently selected logical operation to the
6435 computed fragment color and color buffer values. See `glLogicOp'.
6436
6437`GL_COLOR_MATERIAL'
6438
6439
6440 If enabled, have one or more material parameters track the current
6441 color. See `glColorMaterial'.
6442
6443`GL_COLOR_SUM'
6444
6445
6446 If enabled and no fragment shader is active, add the secondary
6447 color value to the computed fragment color. See `glSecondaryColor'.
6448
6449`GL_COLOR_TABLE'
6450
6451
6452 If enabled, perform a color table lookup on the incoming RGBA color
6453 values. See `glColorTable'.
6454
6455`GL_CONVOLUTION_1D'
6456
6457
6458 If enabled, perform a 1D convolution operation on incoming RGBA
6459 color values. See `glConvolutionFilter1D'.
6460
6461`GL_CONVOLUTION_2D'
6462
6463
6464 If enabled, perform a 2D convolution operation on incoming RGBA
6465 color values. See `glConvolutionFilter2D'.
6466
6467`GL_CULL_FACE'
6468
6469
6470 If enabled, cull polygons based on their winding in window
6471 coordinates. See `glCullFace'.
6472
6473`GL_DEPTH_TEST'
6474
6475
6476 If enabled, do depth comparisons and update the depth buffer. Note
6477 that even if the depth buffer exists and the depth mask is
6478 non-zero, the depth buffer is not updated if the depth test is
6479 disabled. See `glDepthFunc' and `glDepthRange'.
6480
6481`GL_DITHER'
6482
6483
6484 If enabled, dither color components or indices before they are
6485 written to the color buffer.
6486
6487`GL_FOG'
6488
6489
6490 If enabled and no fragment shader is active, blend a fog color into
6491 the post-texturing color. See `glFog'.
6492
6493`GL_HISTOGRAM'
6494
6495
6496 If enabled, histogram incoming RGBA color values. See
6497 `glHistogram'.
6498
6499`GL_INDEX_LOGIC_OP'
6500
6501
6502 If enabled, apply the currently selected logical operation to the
6503 incoming index and color buffer indices. See `glLogicOp'.
6504
6505`GL_LIGHT'I
6506
6507
6508 If enabled, include light I in the evaluation of the lighting
6509 equation. See `glLightModel' and `glLight'.
6510
6511`GL_LIGHTING'
6512
6513
6514 If enabled and no vertex shader is active, use the current lighting
6515 parameters to compute the vertex color or index. Otherwise, simply
6516 associate the current color or index with each vertex. See
6517 `glMaterial', `glLightModel', and `glLight'.
6518
6519`GL_LINE_SMOOTH'
6520
6521
6522 If enabled, draw lines with correct filtering. Otherwise, draw
6523 aliased lines. See `glLineWidth'.
6524
6525`GL_LINE_STIPPLE'
6526
6527
6528 If enabled, use the current line stipple pattern when drawing
6529 lines. See `glLineStipple'.
6530
6531`GL_MAP1_COLOR_4'
6532
6533
6534 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6535 `glEvalPoint1' generate RGBA values. See `glMap1'.
6536
6537`GL_MAP1_INDEX'
6538
6539
6540 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6541 `glEvalPoint1' generate color indices. See `glMap1'.
6542
6543`GL_MAP1_NORMAL'
6544
6545
6546 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6547 `glEvalPoint1' generate normals. See `glMap1'.
6548
6549`GL_MAP1_TEXTURE_COORD_1'
6550
6551
6552 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6553 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6554
6555`GL_MAP1_TEXTURE_COORD_2'
6556
6557
6558 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6559 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6560
6561`GL_MAP1_TEXTURE_COORD_3'
6562
6563
6564 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6565 `glEvalPoint1' generate S, T, and R texture coordinates. See
6566 `glMap1'.
6567
6568`GL_MAP1_TEXTURE_COORD_4'
6569
6570
6571 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6572 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6573 `glMap1'.
6574
6575`GL_MAP1_VERTEX_3'
6576
6577
6578 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6579 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6580 `glMap1'.
6581
6582`GL_MAP1_VERTEX_4'
6583
6584
6585 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6586 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6587 coordinates. See `glMap1'.
6588
6589`GL_MAP2_COLOR_4'
6590
6591
6592 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6593 `glEvalPoint2' generate RGBA values. See `glMap2'.
6594
6595`GL_MAP2_INDEX'
6596
6597
6598 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6599 `glEvalPoint2' generate color indices. See `glMap2'.
6600
6601`GL_MAP2_NORMAL'
6602
6603
6604 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6605 `glEvalPoint2' generate normals. See `glMap2'.
6606
6607`GL_MAP2_TEXTURE_COORD_1'
6608
6609
6610 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6611 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6612
6613`GL_MAP2_TEXTURE_COORD_2'
6614
6615
6616 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6617 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6618
6619`GL_MAP2_TEXTURE_COORD_3'
6620
6621
6622 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6623 `glEvalPoint2' generate S, T, and R texture coordinates. See
6624 `glMap2'.
6625
6626`GL_MAP2_TEXTURE_COORD_4'
6627
6628
6629 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6630 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6631 `glMap2'.
6632
6633`GL_MAP2_VERTEX_3'
6634
6635
6636 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6637 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6638 `glMap2'.
6639
6640`GL_MAP2_VERTEX_4'
6641
6642
6643 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6644 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6645 coordinates. See `glMap2'.
6646
6647`GL_MINMAX'
6648
6649
6650 If enabled, compute the minimum and maximum values of incoming RGBA
6651 color values. See `glMinmax'.
6652
6653`GL_MULTISAMPLE'
6654
6655
6656 If enabled, use multiple fragment samples in computing the final
6657 color of a pixel. See `glSampleCoverage'.
6658
6659`GL_NORMALIZE'
6660
6661
6662 If enabled and no vertex shader is active, normal vectors are
6663 normalized to unit length after transformation and before lighting.
6664 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6665 See `glNormal' and `glNormalPointer'.
6666
6667`GL_POINT_SMOOTH'
6668
6669
6670 If enabled, draw points with proper filtering. Otherwise, draw
6671 aliased points. See `glPointSize'.
6672
6673`GL_POINT_SPRITE'
6674
6675
6676 If enabled, calculate texture coordinates for points based on
6677 texture environment and point parameter settings. Otherwise texture
6678 coordinates are constant across points.
6679
6680`GL_POLYGON_OFFSET_FILL'
6681
6682
6683 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6684 offset is added to depth values of a polygon's fragments before the
6685 depth comparison is performed. See `glPolygonOffset'.
6686
6687`GL_POLYGON_OFFSET_LINE'
6688
6689
6690 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6691 offset is added to depth values of a polygon's fragments before the
6692 depth comparison is performed. See `glPolygonOffset'.
6693
6694`GL_POLYGON_OFFSET_POINT'
6695
6696
6697 If enabled, an offset is added to depth values of a polygon's
6698 fragments before the depth comparison is performed, if the polygon
6699 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6700
6701`GL_POLYGON_SMOOTH'
6702
6703
6704 If enabled, draw polygons with proper filtering. Otherwise, draw
6705 aliased polygons. For correct antialiased polygons, an alpha buffer
6706 is needed and the polygons must be sorted front to back.
6707
6708`GL_POLYGON_STIPPLE'
6709
6710
6711 If enabled, use the current polygon stipple pattern when rendering
6712 polygons. See `glPolygonStipple'.
6713
6714`GL_POST_COLOR_MATRIX_COLOR_TABLE'
6715
6716
6717 If enabled, perform a color table lookup on RGBA color values after
6718 color matrix transformation. See `glColorTable'.
6719
6720`GL_POST_CONVOLUTION_COLOR_TABLE'
6721
6722
6723 If enabled, perform a color table lookup on RGBA color values after
6724 convolution. See `glColorTable'.
6725
6726`GL_RESCALE_NORMAL'
6727
6728
6729 If enabled and no vertex shader is active, normal vectors are
6730 scaled after transformation and before lighting by a factor
6731 computed from the modelview matrix. If the modelview matrix scales
6732 space uniformly, this has the effect of restoring the transformed
6733 normal to unit length. This method is generally more efficient than
6734 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6735
6736`GL_SAMPLE_ALPHA_TO_COVERAGE'
6737
6738
6739 If enabled, compute a temporary coverage value where each bit is
6740 determined by the alpha value at the corresponding sample location.
6741 The temporary coverage value is then ANDed with the fragment
6742 coverage value.
6743
6744`GL_SAMPLE_ALPHA_TO_ONE'
6745
6746
6747 If enabled, each sample alpha value is replaced by the maximum
6748 representable alpha value.
6749
6750`GL_SAMPLE_COVERAGE'
6751
6752
6753 If enabled, the fragment's coverage is ANDed with the temporary
6754 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6755 invert the coverage value. See `glSampleCoverage'.
6756
6757`GL_SEPARABLE_2D'
6758
6759
6760 If enabled, perform a two-dimensional convolution operation using a
6761 separable convolution filter on incoming RGBA color values. See
6762 `glSeparableFilter2D'.
6763
6764`GL_SCISSOR_TEST'
6765
6766
6767 If enabled, discard fragments that are outside the scissor
6768 rectangle. See `glScissor'.
6769
6770`GL_STENCIL_TEST'
6771
6772
6773 If enabled, do stencil testing and update the stencil buffer. See
6774 `glStencilFunc' and `glStencilOp'.
6775
6776`GL_TEXTURE_1D'
6777
6778
6779 If enabled and no fragment shader is active, one-dimensional
6780 texturing is performed (unless two- or three-dimensional or
6781 cube-mapped texturing is also enabled). See `glTexImage1D'.
6782
6783`GL_TEXTURE_2D'
6784
6785
6786 If enabled and no fragment shader is active, two-dimensional
6787 texturing is performed (unless three-dimensional or cube-mapped
6788 texturing is also enabled). See `glTexImage2D'.
6789
6790`GL_TEXTURE_3D'
6791
6792
6793 If enabled and no fragment shader is active, three-dimensional
6794 texturing is performed (unless cube-mapped texturing is also
6795 enabled). See `glTexImage3D'.
6796
6797`GL_TEXTURE_CUBE_MAP'
6798
6799
6800 If enabled and no fragment shader is active, cube-mapped texturing
6801 is performed. See `glTexImage2D'.
6802
6803`GL_TEXTURE_GEN_Q'
6804
6805
6806 If enabled and no vertex shader is active, the Q texture coordinate
6807 is computed using the texture generation function defined with
6808 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6809 See `glTexGen'.
6810
6811`GL_TEXTURE_GEN_R'
6812
6813
6814 If enabled and no vertex shader is active, the R texture coordinate
6815 is computed using the texture generation function defined with
6816 `glTexGen'. Otherwise, the current R texture coordinate is used.
6817 See `glTexGen'.
6818
6819`GL_TEXTURE_GEN_S'
6820
6821
6822 If enabled and no vertex shader is active, the S texture coordinate
6823 is computed using the texture generation function defined with
6824 `glTexGen'. Otherwise, the current S texture coordinate is used.
6825 See `glTexGen'.
6826
6827`GL_TEXTURE_GEN_T'
6828
6829
6830 If enabled and no vertex shader is active, the T texture coordinate
6831 is computed using the texture generation function defined with
6832 `glTexGen'. Otherwise, the current T texture coordinate is used.
6833 See `glTexGen'.
6834
6835`GL_VERTEX_PROGRAM_POINT_SIZE'
6836
6837
6838 If enabled and a vertex shader is active, then the derived point
6839 size is taken from the (potentially clipped) shader builtin
6840 `gl_PointSize' and clamped to the implementation-dependent point
6841 size range.
6842
6843`GL_VERTEX_PROGRAM_TWO_SIDE'
6844
6845
6846 If enabled and a vertex shader is active, it specifies that the GL
6847 will choose between front and back colors based on the polygon's
6848 face direction of which the vertex being shaded is a part. It has
6849 no effect on points or lines.
6850
6851`GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6852previously.
6853
6854`GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6855executed between the execution of `glBegin' and the corresponding
6856execution of `glEnd'.")
6857
6858(define-gl-procedure
6859 glEvalCoord
6860 "glEvalCoord"
6861 (funcsynopsis
6862 (funcprototype
6863 (funcdef "void " (function "glEvalCoord1f"))
6864 (paramdef "GLfloat " (parameter "u"))))
6865 "Evaluate enabled one- and two-dimensional maps.
6866
6867U
6868 Specifies a value that is the domain coordinate U to the basis
6869 function defined in a previous `glMap1' or `glMap2' command.
6870
6871V
6872 Specifies a value that is the domain coordinate V to the basis
6873 function defined in a previous `glMap2' command. This argument is
6874 not present in a `glEvalCoord1' command.
6875
6876`glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6877`glEvalCoord2' does the same for two-dimensional maps using two domain
6878values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6879and disable it, call `glEnable' and `glDisable'.
6880
6881When one of the `glEvalCoord' commands is issued, all currently enabled
6882maps of the indicated dimension are evaluated. Then, for each enabled
6883map, it is as if the corresponding GL command had been issued with the
6884computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6885enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6886`GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6887`GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6888produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6889`GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6890`GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6891`GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6892`GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6893command is simulated.
6894
6895For color, color index, normal, and texture coordinates the GL uses
6896evaluated values instead of current values for those evaluations that
6897are enabled, and current values otherwise, However, the evaluated values
6898do not update the current values. Thus, if `glVertex' commands are
6899interspersed with `glEvalCoord' commands, the color, normal, and texture
6900coordinates associated with the `glVertex' commands are not affected by
6901the values generated by the `glEvalCoord' commands, but only by the most
6902recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6903
6904No commands are issued for maps that are not enabled. If more than one
6905texture evaluation is enabled for a particular dimension (for example,
6906`GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6907evaluation of the map that produces the larger number of coordinates (in
6908this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6909overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6910`GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6911four-component vertex map is enabled for the specified dimension, the
6912`glEvalCoord' command is ignored.
6913
6914If you have enabled automatic normal generation, by calling `glEnable'
6915with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6916analytically, regardless of the contents or enabling of the
6917`GL_MAP2_NORMAL' map. Let
6918
6919`m'=∂`p',/∂U,,×∂`p',/∂V,,
6920
6921Then the generated normal `n' is `n'=`m'/∥`m',∥,
6922
6923If automatic normal generation is disabled, the corresponding normal map
6924`GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6925automatic normal generation nor a normal map is enabled, no normal is
6926generated for `glEvalCoord2' commands.")
6927
6928(define-gl-procedure
6929 glEvalMesh
6930 "glEvalMesh"
6931 (funcsynopsis
6932 (funcprototype
6933 (funcdef "void " (function "glEvalMesh1"))
6934 (paramdef "GLenum " (parameter "mode"))
6935 (paramdef "GLint " (parameter "i1"))
6936 (paramdef "GLint " (parameter "i2"))))
6937 "Compute a one- or two-dimensional grid of points or lines.
6938
6939MODE
6940 In `glEvalMesh1', specifies whether to compute a one-dimensional
6941 mesh of points or lines. Symbolic constants `GL_POINT' and
6942 `GL_LINE' are accepted.
6943
6944I1
6945 I2
6946
6947 Specify the first and last integer values for grid domain variable
6948 I .
6949
6950`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6951and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6952steps through the integer domain of a one- or two-dimensional grid,
6953whose range is the domain of the evaluation maps specified by `glMap1'
6954and `glMap2'. MODE determines whether the resulting vertices are
6955connected as points, lines, or filled polygons.
6956
6957In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6958the following code fragment were executed:
6959
6960where
6961
6962
6963 glBegin( TYPE );
6964 for ( i = I1; i <= I2; i += 1 )
6965 glEvalCoord1( i·ΔU+U_1
6966
6967 );
6968 glEnd();
6969
6970ΔU=(U_2-U_1,)/N
6971
6972and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6973command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6974MODE is `GL_LINE'.
6975
6976The one absolute numeric requirement is that if I=N , then the value
6977computed from I·ΔU+U_1 is exactly U_2 .
6978
6979In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6980
6981ΔV=(V_2-V_1,)/M
6982
6983where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6984recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6985`glEvalMesh2' command is equivalent to:
6986
6987
6988
6989
6990 for ( j = J1; j < J2; j += 1 ) {
6991 glBegin( GL_QUAD_STRIP );
6992 for ( i = I1; i <= I2; i += 1 ) {
6993 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6994
6995 );
6996 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6997
6998 );
6999 }
7000 glEnd();
7001 }
7002
7003If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
7004
7005
7006
7007
7008 for ( j = J1; j <= J2; j += 1 ) {
7009 glBegin( GL_LINE_STRIP );
7010 for ( i = I1; i <= I2; i += 1 )
7011 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7012
7013 );
7014 glEnd();
7015 }
7016
7017 for ( i = I1; i <= I2; i += 1 ) {
7018 glBegin( GL_LINE_STRIP );
7019 for ( j = J1; j <= J1; j += 1 )
7020 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7021
7022 );
7023 glEnd();
7024 }
7025
7026And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
7027equivalent to:
7028
7029
7030
7031
7032 glBegin( GL_POINTS );
7033 for ( j = J1; j <= J2; j += 1 )
7034 for ( i = I1; i <= I2; i += 1 )
7035 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7036
7037 );
7038 glEnd();
7039
7040In all three cases, the only absolute numeric requirements are that if
7041I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
7042, then the value computed from J·ΔV+V_1 is exactly V_2 .
7043
7044`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7045
7046`GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
7047the execution of `glBegin' and the corresponding execution of `glEnd'.")
7048
7049(define-gl-procedure
7050 glEvalPoint
7051 "glEvalPoint"
7052 (funcsynopsis
7053 (funcprototype
7054 (funcdef "void " (function "glEvalPoint1"))
7055 (paramdef "GLint " (parameter "i"))))
7056 "Generate and evaluate a single point in a mesh.
7057
7058I
7059 Specifies the integer value for grid domain variable I .
7060
7061J
7062 Specifies the integer value for grid domain variable J
7063 (`glEvalPoint2' only).
7064
7065`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
7066and evaluate a series of evenly spaced map domain values. `glEvalPoint'
7067can be used to evaluate a single grid point in the same gridspace that
7068is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
7069calling where ΔU=(U_2-U_1,)/N
7070
7071
7072 glEvalCoord1( i·ΔU+U_1
7073
7074 );
7075
7076and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
7077command. The one absolute numeric requirement is that if I=N , then the
7078value computed from I·ΔU+U_1 is exactly U_2 .
7079
7080In the two-dimensional case, `glEvalPoint2', let
7081
7082ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
7083
7084where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
7085recent `glMapGrid2' command. Then the `glEvalPoint2' command is
7086equivalent to calling The only absolute numeric requirements are that if
7087I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
7088, then the value computed from J·ΔV+V_1 is exactly V_2 .
7089
7090
7091 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7092
7093 );")
7094
7095(define-gl-procedure
7096 glFeedbackBuffer
7097 "glFeedbackBuffer"
7098 (funcsynopsis
7099 (funcprototype
7100 (funcdef "void " (function "glFeedbackBuffer"))
7101 (paramdef "GLsizei " (parameter "size"))
7102 (paramdef "GLenum " (parameter "type"))
7103 (paramdef "GLfloat * " (parameter "buffer"))))
7104 "Controls feedback mode.
7105
7106SIZE
7107 Specifies the maximum number of values that can be written into
7108 BUFFER.
7109
7110TYPE
7111 Specifies a symbolic constant that describes the information that
7112 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
7113 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
7114
7115BUFFER
7116 Returns the feedback data.
7117
7118The `glFeedbackBuffer' function controls feedback. Feedback, like
7119selection, is a GL mode. The mode is selected by calling `glRenderMode'
7120with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
7121produced by rasterization. Instead, information about primitives that
7122would have been rasterized is fed back to the application using the GL.
7123
7124`glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
7125of floating-point values into which feedback information is placed. SIZE
7126indicates the size of the array. TYPE is a symbolic constant describing
7127the information that is fed back for each vertex. `glFeedbackBuffer'
7128must be issued before feedback mode is enabled (by calling
7129`glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
7130without establishing the feedback buffer, or calling `glFeedbackBuffer'
7131while the GL is in feedback mode, is an error.
7132
7133When `glRenderMode' is called while in feedback mode, it returns the
7134number of entries placed in the feedback array and resets the feedback
7135array pointer to the base of the feedback buffer. The returned value
7136never exceeds SIZE. If the feedback data required more room than was
7137available in BUFFER, `glRenderMode' returns a negative value. To take
7138the GL out of feedback mode, call `glRenderMode' with a parameter value
7139other than `GL_FEEDBACK'.
7140
7141While in feedback mode, each primitive, bitmap, or pixel rectangle that
7142would be rasterized generates a block of values that are copied into the
7143feedback array. If doing so would cause the number of entries to exceed
7144the maximum, the block is partially written so as to fill the array (if
7145there is any room left at all), and an overflow flag is set. Each block
7146begins with a code indicating the primitive type, followed by values
7147that describe the primitive's vertices and associated data. Entries are
7148also written for bitmaps and pixel rectangles. Feedback occurs after
7149polygon culling and `glPolygonMode' interpretation of polygons has taken
7150place, so polygons that are culled are not returned in the feedback
7151buffer. It can also occur after polygons with more than three edges are
7152broken up into triangles, if the GL implementation renders polygons by
7153performing this decomposition.
7154
7155The `glPassThrough' command can be used to insert a marker into the
7156feedback buffer. See `glPassThrough'.
7157
7158Following is the grammar for the blocks of values written into the
7159feedback buffer. Each primitive is indicated with a unique identifying
7160value followed by some number of vertices. Polygon entries include an
7161integer value indicating how many vertices follow. A vertex is fed back
7162as some number of floating-point values, as determined by TYPE. Colors
7163are fed back as four values in RGBA mode and one value in color index
7164mode.
7165
7166feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
7167point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
7168← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
7169`GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
7170polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
7171`GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
7172`GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
7173vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
7174value 3d ← value value value 3dColor ← value value value color
71753dColorTexture ← value value value color tex 4dColorTexture ← value
7176value value value color tex color ← rgba | index rgba ← value value
7177value value index ← value tex ← value value value value
7178
7179VALUE is a floating-point number, and N is a floating-point integer
7180giving the number of vertices in the polygon. `GL_POINT_TOKEN',
7181`GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
7182`GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
7183`GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
7184`GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
7185reset. The data returned as a vertex depends on the feedback TYPE.
7186
7187The following table gives the correspondence between TYPE and the number
7188of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
7189
7190
7191
7192*Type*
7193 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
7194
7195`GL_2D'
7196 X, Y, , , 2
7197
7198`GL_3D'
7199 X, Y, Z, , , 3
7200
7201`GL_3D_COLOR'
7202 X, Y, Z, K , , 3+K
7203
7204`GL_3D_COLOR_TEXTURE'
7205 X, Y, Z, K , 4 , 7+K
7206
7207`GL_4D_COLOR_TEXTURE'
7208 X, Y, Z, W, K , 4 , 8+K
7209
7210Feedback vertex coordinates are in window coordinates, except W, which
7211is in clip coordinates. Feedback colors are lighted, if lighting is
7212enabled. Feedback texture coordinates are generated, if texture
7213coordinate generation is enabled. They are always transformed by the
7214texture matrix.
7215
7216`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
7217
7218`GL_INVALID_VALUE' is generated if SIZE is negative.
7219
7220`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
7221while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
7222with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
7223once.
7224
7225`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
7226between the execution of `glBegin' and the corresponding execution of
7227`glEnd'.")
7228
7229(define-gl-procedure
7230 glFinish
7231 "glFinish"
7232 (funcsynopsis
7233 (funcprototype
7234 (funcdef "void " (function "glFinish"))
7235 (paramdef (parameter "void"))))
7236 "Block until all GL execution is complete.
7237
7238`glFinish' does not return until the effects of all previously called GL
7239commands are complete. Such effects include all changes to GL state, all
7240changes to connection state, and all changes to the frame buffer
7241contents.
7242
7243`GL_INVALID_OPERATION' is generated if `glFinish' is executed between
7244the execution of `glBegin' and the corresponding execution of `glEnd'.")
7245
7246(define-gl-procedure
7247 glFlush
7248 "glFlush"
7249 (funcsynopsis
7250 (funcprototype
7251 (funcdef "void " (function "glFlush"))
7252 (paramdef (parameter "void"))))
7253 "Force execution of GL commands in finite time.
7254
7255Different GL implementations buffer commands in several different
7256locations, including network buffers and the graphics accelerator
7257itself. `glFlush' empties all of these buffers, causing all issued
7258commands to be executed as quickly as they are accepted by the actual
7259rendering engine. Though this execution may not be completed in any
7260particular time period, it does complete in finite time.
7261
7262Because any GL program might be executed over a network, or on an
7263accelerator that buffers commands, all programs should call `glFlush'
7264whenever they count on having all of their previously issued commands
7265completed. For example, call `glFlush' before waiting for user input
7266that depends on the generated image.
7267
7268`GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
7269execution of `glBegin' and the corresponding execution of `glEnd'.")
7270
7271(define-gl-procedure
7272 glFogCoordPointer
7273 "glFogCoordPointer"
7274 (funcsynopsis
7275 (funcprototype
7276 (funcdef "void " (function "glFogCoordPointer"))
7277 (paramdef "GLenum " (parameter "type"))
7278 (paramdef "GLsizei " (parameter "stride"))
7279 (paramdef "GLvoid * " (parameter "pointer"))))
7280 "Define an array of fog coordinates.
7281
7282TYPE
7283 Specifies the data type of each fog coordinate. Symbolic constants
7284 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7285 `GL_FLOAT'.
7286
7287STRIDE
7288 Specifies the byte offset between consecutive fog coordinates. If
7289 STRIDE is 0, the array elements are understood to be tightly
7290 packed. The initial value is 0.
7291
7292POINTER
7293 Specifies a pointer to the first coordinate of the first fog
7294 coordinate in the array. The initial value is 0.
7295
7296`glFogCoordPointer' specifies the location and data format of an array
7297of fog coordinates to use when rendering. TYPE specifies the data type
7298of each fog coordinate, and STRIDE specifies the byte stride from one
7299fog coordinate to the next, allowing vertices and attributes to be
7300packed into a single array or stored in separate arrays.
7301
7302If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7303target (see `glBindBuffer') while a fog coordinate array is specified,
7304POINTER is treated as a byte offset into the buffer object's data store.
7305Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7306fog coordinate vertex array client-side state
7307(`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7308
7309When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7310saved as client-side state, in addition to the current vertex array
7311buffer object binding.
7312
7313To enable and disable the fog coordinate array, call
7314`glEnableClientState' and `glDisableClientState' with the argument
7315`GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7316`glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7317`glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7318called.
7319
7320`GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7321`GL_DOUBLE'.
7322
7323`GL_INVALID_VALUE' is generated if STRIDE is negative.")
7324
7325(define-gl-procedure
7326 glFogCoord
7327 "glFogCoord"
7328 (funcsynopsis
7329 (funcprototype
7330 (funcdef "void " (function "glFogCoordd"))
7331 (paramdef "GLdouble " (parameter "coord"))))
7332 "Set the current fog coordinates.
7333
7334COORD
7335 Specify the fog distance.
7336
7337`glFogCoord' specifies the fog coordinate that is associated with each
7338vertex and the current raster position. The value specified is
7339interpolated and used in computing the fog color (see `glFog').")
7340
7341(define-gl-procedure
7342 glFog
7343 "glFog"
7344 (funcsynopsis
7345 (funcprototype
7346 (funcdef "void " (function "glFogf"))
7347 (paramdef "GLenum " (parameter "pname"))
7348 (paramdef "GLfloat " (parameter "param"))))
7349 "Specify fog parameters.
7350
7351PNAME
7352 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7353 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7354 `GL_FOG_COORD_SRC' are accepted.
7355
7356PARAM
7357 Specifies the value that PNAME will be set to.
7358
7359Fog is initially disabled. While enabled, fog affects rasterized
7360geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7361enable and disable fog, call `glEnable' and `glDisable' with argument
7362`GL_FOG'.
7363
7364`glFog' assigns the value or values in PARAMS to the fog parameter
7365specified by PNAME. The following values are accepted for PNAME:
7366
7367`GL_FOG_MODE'
7368 PARAMS is a single integer or floating-point value that specifies
7369 the equation to be used to compute the fog blend factor, F . Three
7370 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7371 `GL_EXP2'. The equations corresponding to these symbolic constants
7372 are defined below. The initial fog mode is `GL_EXP'.
7373
7374`GL_FOG_DENSITY'
7375 PARAMS is a single integer or floating-point value that specifies
7376 DENSITY , the fog density used in both exponential fog equations.
7377 Only nonnegative densities are accepted. The initial fog density is
7378 1.
7379
7380`GL_FOG_START'
7381 PARAMS is a single integer or floating-point value that specifies
7382 START , the near distance used in the linear fog equation. The
7383 initial near distance is 0.
7384
7385`GL_FOG_END'
7386 PARAMS is a single integer or floating-point value that specifies
7387 END , the far distance used in the linear fog equation. The initial
7388 far distance is 1.
7389
7390`GL_FOG_INDEX'
7391 PARAMS is a single integer or floating-point value that specifies
7392 I_F , the fog color index. The initial fog index is 0.
7393
7394`GL_FOG_COLOR'
7395 PARAMS contains four integer or floating-point values that specify
7396 C_F , the fog color. Integer values are mapped linearly such that
7397 the most positive representable value maps to 1.0, and the most
7398 negative representable value maps to -1.0 . Floating-point values
7399 are mapped directly. After conversion, all color components are
7400 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7401
7402`GL_FOG_COORD_SRC'
7403 PARAMS contains either of the following symbolic constants:
7404 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7405 that the current fog coordinate should be used as distance value in
7406 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7407 current fragment depth should be used as distance value in the fog
7408 computation.
7409
7410Fog blends a fog color with each rasterized pixel fragment's
7411post-texturing color using a blending factor F . Factor F is computed in
7412one of three ways, depending on the fog mode. Let C be either the
7413distance in eye coordinate from the origin (in the case that the
7414`GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7415(in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7416for `GL_LINEAR' fog is F=END-C,/END-START,
7417
7418The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7419
7420The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7421
7422Regardless of the fog mode, F is clamped to the range [0,1] after it is
7423computed. Then, if the GL is in RGBA color mode, the fragment's red,
7424green, and blue colors, represented by C_R , are replaced by
7425
7426C_R,^″=F×C_R+(1-F,)×C_F
7427
7428Fog does not affect a fragment's alpha component.
7429
7430In color index mode, the fragment's color index I_R is replaced by
7431
7432I_R,^″=I_R+(1-F,)×I_F
7433
7434
7435
7436`GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7437PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7438
7439`GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7440is negative.
7441
7442`GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7443execution of `glBegin' and the corresponding execution of `glEnd'.")
7444
7445(define-gl-procedure
7446 glFrontFace
7447 "glFrontFace"
7448 (funcsynopsis
7449 (funcprototype
7450 (funcdef "void " (function "glFrontFace"))
7451 (paramdef "GLenum " (parameter "mode"))))
7452 "Define front- and back-facing polygons.
7453
7454MODE
7455 Specifies the orientation of front-facing polygons. `GL_CW' and
7456 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7457
7458In a scene composed entirely of opaque closed surfaces, back-facing
7459polygons are never visible. Eliminating these invisible polygons has the
7460obvious benefit of speeding up the rendering of the image. To enable and
7461disable elimination of back-facing polygons, call `glEnable' and
7462`glDisable' with argument `GL_CULL_FACE'.
7463
7464The projection of a polygon to window coordinates is said to have
7465clockwise winding if an imaginary object following the path from its
7466first vertex, its second vertex, and so on, to its last vertex, and
7467finally back to its first vertex, moves in a clockwise direction about
7468the interior of the polygon. The polygon's winding is said to be
7469counterclockwise if the imaginary object following the same path moves
7470in a counterclockwise direction about the interior of the polygon.
7471`glFrontFace' specifies whether polygons with clockwise winding in
7472window coordinates, or counterclockwise winding in window coordinates,
7473are taken to be front-facing. Passing `GL_CCW' to MODE selects
7474counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7475polygons as front-facing. By default, counterclockwise polygons are
7476taken to be front-facing.
7477
7478`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7479
7480`GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7481the execution of `glBegin' and the corresponding execution of `glEnd'.")
7482
7483(define-gl-procedure
7484 glFrustum
7485 "glFrustum"
7486 (funcsynopsis
7487 (funcprototype
7488 (funcdef "void " (function "glFrustum"))
7489 (paramdef "GLdouble " (parameter "left"))
7490 (paramdef "GLdouble " (parameter "right"))
7491 (paramdef "GLdouble " (parameter "bottom"))
7492 (paramdef "GLdouble " (parameter "top"))
7493 (paramdef "GLdouble " (parameter "nearVal"))
7494 (paramdef "GLdouble " (parameter "farVal"))))
7495 "Multiply the current matrix by a perspective matrix.
7496
7497LEFT
7498 RIGHT
7499
7500 Specify the coordinates for the left and right vertical clipping
7501 planes.
7502
7503BOTTOM
7504 TOP
7505
7506 Specify the coordinates for the bottom and top horizontal clipping
7507 planes.
7508
7509NEARVAL
7510 FARVAL
7511
7512 Specify the distances to the near and far depth clipping planes.
7513 Both distances must be positive.
7514
7515`glFrustum' describes a perspective matrix that produces a perspective
7516projection. The current matrix (see `glMatrixMode') is multiplied by
7517this matrix and the result replaces the current matrix, as if
7518`glMultMatrix' were called with the following matrix as its argument:
7519
7520
7521
7522[(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7523C D), (0 0 -1 0),]
7524
7525A=RIGHT+LEFT,/RIGHT-LEFT,
7526
7527B=TOP+BOTTOM,/TOP-BOTTOM,
7528
7529C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7530
7531D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7532
7533
7534
7535Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7536and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7537that are mapped to the lower left and upper right corners of the window,
7538assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7539location of the far clipping plane. Both NEARVAL and FARVAL must be
7540positive.
7541
7542Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7543matrix stack.
7544
7545`GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7546if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7547
7548`GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7549the execution of `glBegin' and the corresponding execution of `glEnd'.")
7550
7551(define-gl-procedure
7552 glGenBuffers
7553 "glGenBuffers"
7554 (funcsynopsis
7555 (funcprototype
7556 (funcdef "void " (function "glGenBuffers"))
7557 (paramdef "GLsizei " (parameter "n"))
7558 (paramdef "GLuint * " (parameter "buffers"))))
7559 "Generate buffer object names.
7560
7561N
7562 Specifies the number of buffer object names to be generated.
7563
7564BUFFERS
7565 Specifies an array in which the generated buffer object names are
7566 stored.
7567
7568`glGenBuffers' returns N buffer object names in BUFFERS. There is no
7569guarantee that the names form a contiguous set of integers; however, it
7570is guaranteed that none of the returned names was in use immediately
7571before the call to `glGenBuffers'.
7572
7573Buffer object names returned by a call to `glGenBuffers' are not
7574returned by subsequent calls, unless they are first deleted with
7575`glDeleteBuffers'.
7576
7577No buffer objects are associated with the returned buffer object names
7578until they are first bound by calling `glBindBuffer'.
7579
7580`GL_INVALID_VALUE' is generated if N is negative.
7581
7582`GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7583between the execution of `glBegin' and the corresponding execution of
7584`glEnd'.")
7585
7586(define-gl-procedure
7587 glGenLists
7588 "glGenLists"
7589 (funcsynopsis
7590 (funcprototype
7591 (funcdef "GLuint " (function "glGenLists"))
7592 (paramdef "GLsizei " (parameter "range"))))
7593 "Generate a contiguous set of empty display lists.
7594
7595RANGE
7596 Specifies the number of contiguous empty display lists to be
7597 generated.
7598
7599`glGenLists' has one argument, RANGE. It returns an integer N such that
7600RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7601are created. If RANGE is 0, if there is no group of RANGE contiguous
7602names available, or if any error is generated, no display lists are
7603generated, and 0 is returned.
7604
7605`GL_INVALID_VALUE' is generated if RANGE is negative.
7606
7607`GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7608the execution of `glBegin' and the corresponding execution of `glEnd'.")
7609
7610(define-gl-procedure
7611 glGenQueries
7612 "glGenQueries"
7613 (funcsynopsis
7614 (funcprototype
7615 (funcdef "void " (function "glGenQueries"))
7616 (paramdef "GLsizei " (parameter "n"))
7617 (paramdef "GLuint * " (parameter "ids"))))
7618 "Generate query object names.
7619
7620N
7621 Specifies the number of query object names to be generated.
7622
7623IDS
7624 Specifies an array in which the generated query object names are
7625 stored.
7626
7627`glGenQueries' returns N query object names in IDS. There is no
7628guarantee that the names form a contiguous set of integers; however, it
7629is guaranteed that none of the returned names was in use immediately
7630before the call to `glGenQueries'.
7631
7632Query object names returned by a call to `glGenQueries' are not returned
7633by subsequent calls, unless they are first deleted with
7634`glDeleteQueries'.
7635
7636No query objects are associated with the returned query object names
7637until they are first used by calling `glBeginQuery'.
7638
7639`GL_INVALID_VALUE' is generated if N is negative.
7640
7641`GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7642between the execution of `glBegin' and the corresponding execution of
7643`glEnd'.")
7644
7645(define-gl-procedure
7646 glGenTextures
7647 "glGenTextures"
7648 (funcsynopsis
7649 (funcprototype
7650 (funcdef "void " (function "glGenTextures"))
7651 (paramdef "GLsizei " (parameter "n"))
7652 (paramdef "GLuint * " (parameter "textures"))))
7653 "Generate texture names.
7654
7655N
7656 Specifies the number of texture names to be generated.
7657
7658TEXTURES
7659 Specifies an array in which the generated texture names are stored.
7660
7661`glGenTextures' returns N texture names in TEXTURES. There is no
7662guarantee that the names form a contiguous set of integers; however, it
7663is guaranteed that none of the returned names was in use immediately
7664before the call to `glGenTextures'.
7665
7666The generated textures have no dimensionality; they assume the
7667dimensionality of the texture target to which they are first bound (see
7668`glBindTexture').
7669
7670Texture names returned by a call to `glGenTextures' are not returned by
7671subsequent calls, unless they are first deleted with `glDeleteTextures'.
7672
7673`GL_INVALID_VALUE' is generated if N is negative.
7674
7675`GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7676between the execution of `glBegin' and the corresponding execution of
7677`glEnd'.")
7678
7679(define-gl-procedure
7680 glGetActiveAttrib
7681 "glGetActiveAttrib"
7682 (funcsynopsis
7683 (funcprototype
7684 (funcdef "void " (function "glGetActiveAttrib"))
7685 (paramdef "GLuint " (parameter "program"))
7686 (paramdef "GLuint " (parameter "index"))
7687 (paramdef "GLsizei " (parameter "bufSize"))
7688 (paramdef "GLsizei *" (parameter "length"))
7689 (paramdef "GLint *" (parameter "size"))
7690 (paramdef "GLenum *" (parameter "type"))
7691 (paramdef "GLchar *" (parameter "name"))))
7692 "Returns information about an active attribute variable for the specified
7693program object.
7694
7695PROGRAM
7696 Specifies the program object to be queried.
7697
7698INDEX
7699 Specifies the index of the attribute variable to be queried.
7700
7701BUFSIZE
7702 Specifies the maximum number of characters OpenGL is allowed to
7703 write in the character buffer indicated by NAME.
7704
7705LENGTH
7706 Returns the number of characters actually written by OpenGL in the
7707 string indicated by NAME (excluding the null terminator) if a value
7708 other than `NULL' is passed.
7709
7710SIZE
7711 Returns the size of the attribute variable.
7712
7713TYPE
7714 Returns the data type of the attribute variable.
7715
7716NAME
7717 Returns a null terminated string containing the name of the
7718 attribute variable.
7719
7720`glGetActiveAttrib' returns information about an active attribute
7721variable in the program object specified by PROGRAM. The number of
7722active attributes can be obtained by calling `glGetProgram' with the
7723value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7724active attribute variable. Permissible values for INDEX range from 0 to
7725the number of active attribute variables minus 1.
7726
7727A vertex shader may use either built-in attribute variables,
7728user-defined attribute variables, or both. Built-in attribute variables
7729have a prefix of \"gl_\" and reference conventional OpenGL vertex
7730attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7731Language specification for a complete list.) User-defined attribute
7732variables have arbitrary names and obtain their values through numbered
7733generic vertex attributes. An attribute variable (either built-in or
7734user-defined) is considered active if it is determined during the link
7735operation that it may be accessed during program execution. Therefore,
7736PROGRAM should have previously been the target of a call to
7737`glLinkProgram', but it is not necessary for it to have been linked
7738successfully.
7739
7740The size of the character buffer required to store the longest attribute
7741variable name in PROGRAM can be obtained by calling `glGetProgram' with
7742the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7743allocate a buffer of sufficient size to store the returned attribute
7744name. The size of this character buffer is passed in BUFSIZE, and a
7745pointer to this character buffer is passed in NAME.
7746
7747`glGetActiveAttrib' returns the name of the attribute variable indicated
7748by INDEX, storing it in the character buffer specified by NAME. The
7749string returned will be null terminated. The actual number of characters
7750written into this buffer is returned in LENGTH, and this count does not
7751include the null termination character. If the length of the returned
7752string is not required, a value of `NULL' can be passed in the LENGTH
7753argument.
7754
7755The TYPE argument will return a pointer to the attribute variable's data
7756type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7757`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7758`GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7759`GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7760`GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7761size of the attribute, in units of the type returned in TYPE.
7762
7763The list of active attribute variables may include both built-in
7764attribute variables (which begin with the prefix \"gl_\") as well as
7765user-defined attribute variable names.
7766
7767This function will return as much information as it can about the
7768specified active attribute variable. If no information is available,
7769LENGTH will be 0, and NAME will be an empty string. This situation could
7770occur if this function is called after a link operation that failed. If
7771an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7772unmodified.
7773
7774`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7775OpenGL.
7776
7777`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7778
7779`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7780number of active attribute variables in PROGRAM.
7781
7782`GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7783between the execution of `glBegin' and the corresponding execution of
7784`glEnd'.
7785
7786`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7787
7788(define-gl-procedure
7789 glGetActiveUniform
7790 "glGetActiveUniform"
7791 (funcsynopsis
7792 (funcprototype
7793 (funcdef "void " (function "glGetActiveUniform"))
7794 (paramdef "GLuint " (parameter "program"))
7795 (paramdef "GLuint " (parameter "index"))
7796 (paramdef "GLsizei " (parameter "bufSize"))
7797 (paramdef "GLsizei *" (parameter "length"))
7798 (paramdef "GLint *" (parameter "size"))
7799 (paramdef "GLenum *" (parameter "type"))
7800 (paramdef "GLchar *" (parameter "name"))))
7801 "Returns information about an active uniform variable for the specified
7802program object.
7803
7804PROGRAM
7805 Specifies the program object to be queried.
7806
7807INDEX
7808 Specifies the index of the uniform variable to be queried.
7809
7810BUFSIZE
7811 Specifies the maximum number of characters OpenGL is allowed to
7812 write in the character buffer indicated by NAME.
7813
7814LENGTH
7815 Returns the number of characters actually written by OpenGL in the
7816 string indicated by NAME (excluding the null terminator) if a value
7817 other than `NULL' is passed.
7818
7819SIZE
7820 Returns the size of the uniform variable.
7821
7822TYPE
7823 Returns the data type of the uniform variable.
7824
7825NAME
7826 Returns a null terminated string containing the name of the uniform
7827 variable.
7828
7829`glGetActiveUniform' returns information about an active uniform
7830variable in the program object specified by PROGRAM. The number of
7831active uniform variables can be obtained by calling `glGetProgram' with
7832the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7833active uniform variable. Permissible values for INDEX range from 0 to
7834the number of active uniform variables minus 1.
7835
7836Shaders may use either built-in uniform variables, user-defined uniform
7837variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7838and reference existing OpenGL state or values derived from such state
7839(e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7840specification for a complete list.) User-defined uniform variables have
7841arbitrary names and obtain their values from the application through
7842calls to `glUniform'. A uniform variable (either built-in or
7843user-defined) is considered active if it is determined during the link
7844operation that it may be accessed during program execution. Therefore,
7845PROGRAM should have previously been the target of a call to
7846`glLinkProgram', but it is not necessary for it to have been linked
7847successfully.
7848
7849The size of the character buffer required to store the longest uniform
7850variable name in PROGRAM can be obtained by calling `glGetProgram' with
7851the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7852allocate a buffer of sufficient size to store the returned uniform
7853variable name. The size of this character buffer is passed in BUFSIZE,
7854and a pointer to this character buffer is passed in NAME.
7855
7856`glGetActiveUniform' returns the name of the uniform variable indicated
7857by INDEX, storing it in the character buffer specified by NAME. The
7858string returned will be null terminated. The actual number of characters
7859written into this buffer is returned in LENGTH, and this count does not
7860include the null termination character. If the length of the returned
7861string is not required, a value of `NULL' can be passed in the LENGTH
7862argument.
7863
7864The TYPE argument will return a pointer to the uniform variable's data
7865type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7866`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7867`GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7868`GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7869`GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7870`GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7871`GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7872`GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7873
7874If one or more elements of an array are active, the name of the array is
7875returned in NAME, the type is returned in TYPE, and the SIZE parameter
7876returns the highest array element index used, plus one, as determined by
7877the compiler and/or linker. Only one active uniform variable will be
7878reported for a uniform array.
7879
7880Uniform variables that are declared as structures or arrays of
7881structures will not be returned directly by this function. Instead, each
7882of these uniform variables will be reduced to its fundamental components
7883containing the \".\" and \"[]\" operators such that each of the names is
7884valid as an argument to `glGetUniformLocation'. Each of these reduced
7885uniform variables is counted as one active uniform variable and is
7886assigned an index. A valid name cannot be a structure, an array of
7887structures, or a subcomponent of a vector or matrix.
7888
7889The size of the uniform variable will be returned in SIZE. Uniform
7890variables other than arrays will have a size of 1. Structures and arrays
7891of structures will be reduced as described earlier, such that each of
7892the names returned will be a data type in the earlier list. If this
7893reduction results in an array, the size returned will be as described
7894for uniform arrays; otherwise, the size returned will be 1.
7895
7896The list of active uniform variables may include both built-in uniform
7897variables (which begin with the prefix \"gl_\") as well as user-defined
7898uniform variable names.
7899
7900This function will return as much information as it can about the
7901specified active uniform variable. If no information is available,
7902LENGTH will be 0, and NAME will be an empty string. This situation could
7903occur if this function is called after a link operation that failed. If
7904an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7905unmodified.
7906
7907`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7908OpenGL.
7909
7910`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7911
7912`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7913number of active uniform variables in PROGRAM.
7914
7915`GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7916between the execution of `glBegin' and the corresponding execution of
7917`glEnd'.
7918
7919`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7920
7921(define-gl-procedure
7922 glGetAttachedShaders
7923 "glGetAttachedShaders"
7924 (funcsynopsis
7925 (funcprototype
7926 (funcdef
7927 "void "
7928 (function "glGetAttachedShaders"))
7929 (paramdef "GLuint " (parameter "program"))
7930 (paramdef "GLsizei " (parameter "maxCount"))
7931 (paramdef "GLsizei *" (parameter "count"))
7932 (paramdef "GLuint *" (parameter "shaders"))))
7933 "Returns the handles of the shader objects attached to a program object.
7934
7935PROGRAM
7936 Specifies the program object to be queried.
7937
7938MAXCOUNT
7939 Specifies the size of the array for storing the returned object
7940 names.
7941
7942COUNT
7943 Returns the number of names actually returned in OBJECTS.
7944
7945SHADERS
7946 Specifies an array that is used to return the names of attached
7947 shader objects.
7948
7949`glGetAttachedShaders' returns the names of the shader objects attached
7950to PROGRAM. The names of shader objects that are attached to PROGRAM
7951will be returned in SHADERS. The actual number of shader names written
7952into SHADERS is returned in COUNT. If no shader objects are attached to
7953PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7954be returned in SHADERS is specified by MAXCOUNT.
7955
7956If the number of names actually returned is not required (for instance,
7957if it has just been obtained by calling `glGetProgram'), a value of
7958`NULL' may be passed for count. If no shader objects are attached to
7959PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7960attached shaders can be obtained by calling `glGetProgram' with the
7961value `GL_ATTACHED_SHADERS'.
7962
7963`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7964OpenGL.
7965
7966`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7967
7968`GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7969
7970`GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7971executed between the execution of `glBegin' and the corresponding
7972execution of `glEnd'.")
7973
7974(define-gl-procedure
7975 glGetAttribLocation
7976 "glGetAttribLocation"
7977 (funcsynopsis
7978 (funcprototype
7979 (funcdef
7980 "GLint "
7981 (function "glGetAttribLocation"))
7982 (paramdef "GLuint " (parameter "program"))
7983 (paramdef "const GLchar *" (parameter "name"))))
7984 "Returns the location of an attribute variable.
7985
7986PROGRAM
7987 Specifies the program object to be queried.
7988
7989NAME
7990 Points to a null terminated string containing the name of the
7991 attribute variable whose location is to be queried.
7992
7993`glGetAttribLocation' queries the previously linked program object
7994specified by PROGRAM for the attribute variable specified by NAME and
7995returns the index of the generic vertex attribute that is bound to that
7996attribute variable. If NAME is a matrix attribute variable, the index of
7997the first column of the matrix is returned. If the named attribute
7998variable is not an active attribute in the specified program object or
7999if NAME starts with the reserved prefix \"gl_\", a value of -1 is
8000returned.
8001
8002The association between an attribute variable name and a generic
8003attribute index can be specified at any time by calling
8004`glBindAttribLocation'. Attribute bindings do not go into effect until
8005`glLinkProgram' is called. After a program object has been linked
8006successfully, the index values for attribute variables remain fixed
8007until the next link command occurs. The attribute values can only be
8008queried after a link if the link was successful. `glGetAttribLocation'
8009returns the binding that actually went into effect the last time
8010`glLinkProgram' was called for the specified program object. Attribute
8011bindings that have been specified since the last link operation are not
8012returned by `glGetAttribLocation'.
8013
8014`GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
8015by OpenGL.
8016
8017`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8018
8019`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8020linked.
8021
8022`GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
8023between the execution of `glBegin' and the corresponding execution of
8024`glEnd'.")
8025
8026(define-gl-procedure
8027 glGetBufferParameteriv
8028 "glGetBufferParameteriv"
8029 (funcsynopsis
8030 (funcprototype
8031 (funcdef
8032 "void "
8033 (function "glGetBufferParameteriv"))
8034 (paramdef "GLenum " (parameter "target"))
8035 (paramdef "GLenum " (parameter "value"))
8036 (paramdef "GLint * " (parameter "data"))))
8037 "Return parameters of a buffer object.
8038
8039TARGET
8040 Specifies the target buffer object. The symbolic constant must be
8041 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8042 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8043
8044VALUE
8045 Specifies the symbolic name of a buffer object parameter. Accepted
8046 values are `GL_BUFFER_ACCESS', `GL_BUFFER_MAPPED',
8047 `GL_BUFFER_SIZE', or `GL_BUFFER_USAGE'.
8048
8049DATA
8050 Returns the requested parameter.
8051
8052`glGetBufferParameteriv' returns in DATA a selected parameter of the
8053buffer object specified by TARGET.
8054
8055VALUE names a specific buffer object parameter, as follows:
8056
8057`GL_BUFFER_ACCESS'
8058 PARAMS returns the access policy set while mapping the buffer
8059 object. The initial value is `GL_READ_WRITE'.
8060
8061`GL_BUFFER_MAPPED'
8062 PARAMS returns a flag indicating whether the buffer object is
8063 currently mapped. The initial value is `GL_FALSE'.
8064
8065`GL_BUFFER_SIZE'
8066 PARAMS returns the size of the buffer object, measured in bytes.
8067 The initial value is 0.
8068
8069`GL_BUFFER_USAGE'
8070 PARAMS returns the buffer object's usage pattern. The initial value
8071 is `GL_STATIC_DRAW'.
8072
8073`GL_INVALID_ENUM' is generated if TARGET or VALUE is not an accepted
8074value.
8075
8076`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8077is bound to TARGET.
8078
8079`GL_INVALID_OPERATION' is generated if `glGetBufferParameteriv' is
8080executed between the execution of `glBegin' and the corresponding
8081execution of `glEnd'.")
8082
8083(define-gl-procedure
8084 glGetBufferPointerv
8085 "glGetBufferPointerv"
8086 (funcsynopsis
8087 (funcprototype
8088 (funcdef
8089 "void "
8090 (function "glGetBufferPointerv"))
8091 (paramdef "GLenum " (parameter "target"))
8092 (paramdef "GLenum " (parameter "pname"))
8093 (paramdef "GLvoid ** " (parameter "params"))))
8094 "Return the pointer to a mapped buffer object's data store.
8095
8096TARGET
8097 Specifies the target buffer object. The symbolic constant must be
8098 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8099 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8100
8101PNAME
8102 Specifies the pointer to be returned. The symbolic constant must be
8103 `GL_BUFFER_MAP_POINTER'.
8104
8105PARAMS
8106 Returns the pointer value specified by PNAME.
8107
8108`glGetBufferPointerv' returns pointer information. PNAME is a symbolic
8109constant indicating the pointer to be returned, which must be
8110`GL_BUFFER_MAP_POINTER', the pointer to which the buffer object's data
8111store is mapped. If the data store is not currently mapped, `NULL' is
8112returned. PARAMS is a pointer to a location in which to place the
8113returned pointer value.
8114
8115`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
8116value.
8117
8118`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8119is bound to TARGET.
8120
8121`GL_INVALID_OPERATION' is generated if `glGetBufferPointerv' is executed
8122between the execution of `glBegin' and the corresponding execution of
8123`glEnd'.")
8124
8125(define-gl-procedure
8126 glGetBufferSubData
8127 "glGetBufferSubData"
8128 (funcsynopsis
8129 (funcprototype
8130 (funcdef "void " (function "glGetBufferSubData"))
8131 (paramdef "GLenum " (parameter "target"))
8132 (paramdef "GLintptr " (parameter "offset"))
8133 (paramdef "GLsizeiptr " (parameter "size"))
8134 (paramdef "GLvoid * " (parameter "data"))))
8135 "Returns a subset of a buffer object's data store.
8136
8137TARGET
8138 Specifies the target buffer object. The symbolic constant must be
8139 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8140 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8141
8142OFFSET
8143 Specifies the offset into the buffer object's data store from which
8144 data will be returned, measured in bytes.
8145
8146SIZE
8147 Specifies the size in bytes of the data store region being
8148 returned.
8149
8150DATA
8151 Specifies a pointer to the location where buffer object data is
8152 returned.
8153
8154`glGetBufferSubData' returns some or all of the data from the buffer
8155object currently bound to TARGET. Data starting at byte offset OFFSET
8156and extending for SIZE bytes is copied from the data store to the memory
8157pointed to by DATA. An error is thrown if the buffer object is currently
8158mapped, or if OFFSET and SIZE together define a range beyond the bounds
8159of the buffer object's data store.
8160
8161`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
8162`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
8163`GL_PIXEL_UNPACK_BUFFER'.
8164
8165`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
8166together they define a region of memory that extends beyond the buffer
8167object's allocated data store.
8168
8169`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8170is bound to TARGET.
8171
8172`GL_INVALID_OPERATION' is generated if the buffer object being queried
8173is mapped.
8174
8175`GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
8176between the execution of `glBegin' and the corresponding execution of
8177`glEnd'.")
8178
8179(define-gl-procedure
8180 glGetClipPlane
8181 "glGetClipPlane"
8182 (funcsynopsis
8183 (funcprototype
8184 (funcdef "void " (function "glGetClipPlane"))
8185 (paramdef "GLenum " (parameter "plane"))
8186 (paramdef "GLdouble * " (parameter "equation"))))
8187 "Return the coefficients of the specified clipping plane.
8188
8189PLANE
8190 Specifies a clipping plane. The number of clipping planes depends
8191 on the implementation, but at least six clipping planes are
8192 supported. They are identified by symbolic names of the form
8193 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
8194 `GL_MAX_CLIP_PLANES' - 1.
8195
8196EQUATION
8197 Returns four double-precision values that are the coefficients of
8198 the plane equation of PLANE in eye coordinates. The initial value
8199 is (0, 0, 0, 0).
8200
8201`glGetClipPlane' returns in EQUATION the four coefficients of the plane
8202equation for PLANE.
8203
8204`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
8205
8206`GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
8207between the execution of `glBegin' and the corresponding execution of
8208`glEnd'.")
8209
8210(define-gl-procedure
8211 glGetColorTableParameter
8212 "glGetColorTableParameter"
8213 (funcsynopsis
8214 (funcprototype
8215 (funcdef
8216 "void "
8217 (function "glGetColorTableParameterfv"))
8218 (paramdef "GLenum " (parameter "target"))
8219 (paramdef "GLenum " (parameter "pname"))
8220 (paramdef "GLfloat * " (parameter "params"))))
8221 "Get color lookup table parameters.
8222
8223TARGET
8224 The target color table. Must be `GL_COLOR_TABLE',
8225 `GL_POST_CONVOLUTION_COLOR_TABLE',
8226 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
8227 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
8228 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8229
8230PNAME
8231 The symbolic name of a color lookup table parameter. Must be one of
8232 `GL_COLOR_TABLE_BIAS', `GL_COLOR_TABLE_SCALE',
8233 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
8234 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
8235 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
8236 `GL_COLOR_TABLE_LUMINANCE_SIZE', or
8237 `GL_COLOR_TABLE_INTENSITY_SIZE'.
8238
8239PARAMS
8240 A pointer to an array where the values of the parameter will be
8241 stored.
8242
8243Returns parameters specific to color table TARGET.
8244
8245When PNAME is set to `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS',
8246`glGetColorTableParameter' returns the color table scale or bias
8247parameters for the table specified by TARGET. For these queries, TARGET
8248must be set to `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8249`GL_POST_COLOR_MATRIX_COLOR_TABLE' and PARAMS points to an array of four
8250elements, which receive the scale or bias factors for red, green, blue,
8251and alpha, in that order.
8252
8253`glGetColorTableParameter' can also be used to retrieve the format and
8254size parameters for a color table. For these queries, set TARGET to
8255either the color table target or the proxy color table target. The
8256format and size parameters are set by `glColorTable'.
8257
8258The following table lists the format and size parameters that may be
8259queried. For each symbolic constant listed below for PNAME, PARAMS must
8260point to an array of the given length and receive the values indicated.
8261
8262
8263
8264*Parameter*
8265 *N*, *Meaning*
8266
8267`GL_COLOR_TABLE_FORMAT'
8268 1 , Internal format (e.g., `GL_RGBA')
8269
8270`GL_COLOR_TABLE_WIDTH'
8271 1 , Number of elements in table
8272
8273`GL_COLOR_TABLE_RED_SIZE'
8274 1 , Size of red component, in bits
8275
8276`GL_COLOR_TABLE_GREEN_SIZE'
8277 1 , Size of green component
8278
8279`GL_COLOR_TABLE_BLUE_SIZE'
8280 1 , Size of blue component
8281
8282`GL_COLOR_TABLE_ALPHA_SIZE'
8283 1 , Size of alpha component
8284
8285`GL_COLOR_TABLE_LUMINANCE_SIZE'
8286 1 , Size of luminance component
8287
8288`GL_COLOR_TABLE_INTENSITY_SIZE'
8289 1 , Size of intensity component
8290
8291
8292
8293`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
8294value.
8295
8296`GL_INVALID_OPERATION' is generated if `glGetColorTableParameter' is
8297executed between the execution of `glBegin' and the corresponding
8298execution of `glEnd'.")
8299
8300(define-gl-procedure
8301 glGetColorTable
8302 "glGetColorTable"
8303 (funcsynopsis
8304 (funcprototype
8305 (funcdef "void " (function "glGetColorTable"))
8306 (paramdef "GLenum " (parameter "target"))
8307 (paramdef "GLenum " (parameter "format"))
8308 (paramdef "GLenum " (parameter "type"))
8309 (paramdef "GLvoid * " (parameter "table"))))
8310 "Retrieve contents of a color lookup table.
8311
8312TARGET
8313 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8314 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
8315
8316FORMAT
8317 The format of the pixel data in TABLE. The possible values are
8318 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
8319 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8320
8321TYPE
8322 The type of the pixel data in TABLE. Symbolic constants
8323 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8324 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8325 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8326 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8327 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8328 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8329 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8330 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8331 are accepted.
8332
8333TABLE
8334 Pointer to a one-dimensional array of pixel data containing the
8335 contents of the color table.
8336
8337`glGetColorTable' returns in TABLE the contents of the color table
8338specified by TARGET. No pixel transfer operations are performed, but
8339pixel storage modes that are applicable to `glReadPixels' are performed.
8340
8341If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8342target (see `glBindBuffer') while a histogram table is requested, TABLE
8343is treated as a byte offset into the buffer object's data store.
8344
8345Color components that are requested in the specified FORMAT, but which
8346are not included in the internal format of the color lookup table, are
8347returned as zero. The assignments of internal color components to the
8348components requested by FORMAT are
8349
8350*Internal Component*
8351 *Resulting Component*
8352
8353Red
8354 Red
8355
8356Green
8357 Green
8358
8359Blue
8360 Blue
8361
8362Alpha
8363 Alpha
8364
8365Luminance
8366 Red
8367
8368Intensity
8369 Red
8370
8371
8372
8373`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8374values.
8375
8376`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8377values.
8378
8379`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8380values.
8381
8382`GL_INVALID_OPERATION' is generated if TYPE is one of
8383`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8384`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8385is not `GL_RGB'.
8386
8387`GL_INVALID_OPERATION' is generated if TYPE is one of
8388`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8389`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8390`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8391`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8392FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8393
8394`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8395bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8396store is currently mapped.
8397
8398`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8399bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8400to the buffer object such that the memory writes required would exceed
8401the data store size.
8402
8403`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8404bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
8405divisible into the number of bytes needed to store in memory a datum
8406indicated by TYPE.
8407
8408`GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
8409between the execution of `glBegin' and the corresponding execution of
8410`glEnd'.")
8411
8412(define-gl-procedure
8413 glGetCompressedTexImage
8414 "glGetCompressedTexImage"
8415 (funcsynopsis
8416 (funcprototype
8417 (funcdef
8418 "void "
8419 (function "glGetCompressedTexImage"))
8420 (paramdef "GLenum " (parameter "target"))
8421 (paramdef "GLint " (parameter "lod"))
8422 (paramdef "GLvoid * " (parameter "img"))))
8423 "Return a compressed texture image.
8424
8425TARGET
8426 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8427 `GL_TEXTURE_2D', and
8428 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8429 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8430 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8431 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8432
8433LOD
8434 Specifies the level-of-detail number of the desired image. Level 0
8435 is the base image level. Level N is the N th mipmap reduction
8436 image.
8437
8438IMG
8439 Returns the compressed texture image.
8440
8441`glGetCompressedTexImage' returns the compressed texture image
8442associated with TARGET and LOD into IMG. IMG should be an array of
8443`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
8444desired texture image was one specified by `glTexImage1D'
8445(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8446`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
8447specifies the level-of-detail number of the desired image.
8448
8449If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8450target (see `glBindBuffer') while a texture image is requested, IMG is
8451treated as a byte offset into the buffer object's data store.
8452
8453To minimize errors, first verify that the texture is compressed by
8454calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
8455If the texture is compressed, then determine the amount of memory
8456required to store the compressed texture by calling
8457`glGetTexLevelParameter' with argument
8458`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
8459format of the texture by calling `glGetTexLevelParameter' with argument
8460`GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
8461associate the internal format and size with the retrieved texture image.
8462These data can be used by the respective texture or subtexture loading
8463routine used for loading TARGET textures.
8464
8465`GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
8466the maximum number of LODs permitted by the implementation.
8467
8468`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
8469to retrieve a texture that is in an uncompressed internal format.
8470
8471`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8472bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8473store is currently mapped.
8474
8475`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8476bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8477to the buffer object such that the memory writes required would exceed
8478the data store size.
8479
8480`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
8481executed between the execution of `glBegin' and the corresponding
8482execution of `glEnd'.")
8483
8484(define-gl-procedure
8485 glGetConvolutionFilter
8486 "glGetConvolutionFilter"
8487 (funcsynopsis
8488 (funcprototype
8489 (funcdef
8490 "void "
8491 (function "glGetConvolutionFilter"))
8492 (paramdef "GLenum " (parameter "target"))
8493 (paramdef "GLenum " (parameter "format"))
8494 (paramdef "GLenum " (parameter "type"))
8495 (paramdef "GLvoid * " (parameter "image"))))
8496 "Get current 1D or 2D convolution filter kernel.
8497
8498TARGET
8499 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
8500 `GL_CONVOLUTION_2D'.
8501
8502FORMAT
8503 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
8504 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
8505 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8506
8507TYPE
8508 Data type of components in the output image. Symbolic constants
8509 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8510 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8511 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8512 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8513 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8514 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8515 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8516 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8517 are accepted.
8518
8519IMAGE
8520 Pointer to storage for the output image.
8521
8522`glGetConvolutionFilter' returns the current 1D or 2D convolution filter
8523kernel as an image. The one- or two-dimensional image is placed in IMAGE
8524according to the specifications in FORMAT and TYPE. No pixel transfer
8525operations are performed on this image, but the relevant pixel storage
8526modes are applied.
8527
8528If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8529target (see `glBindBuffer') while a convolution filter is requested,
8530IMAGE is treated as a byte offset into the buffer object's data store.
8531
8532Color components that are present in FORMAT but not included in the
8533internal format of the filter are returned as zero. The assignments of
8534internal color components to the components of FORMAT are as follows.
8535
8536*Internal Component*
8537 *Resulting Component*
8538
8539Red
8540 Red
8541
8542Green
8543 Green
8544
8545Blue
8546 Blue
8547
8548Alpha
8549 Alpha
8550
8551Luminance
8552 Red
8553
8554Intensity
8555 Red
8556
8557
8558
8559`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8560values.
8561
8562`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8563values.
8564
8565`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8566values.
8567
8568`GL_INVALID_OPERATION' is generated if TYPE is one of
8569`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8570`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8571is not `GL_RGB'.
8572
8573`GL_INVALID_OPERATION' is generated if TYPE is one of
8574`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8575`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8576`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8577`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8578FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8579
8580`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8581bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8582store is currently mapped.
8583
8584`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8585bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8586to the buffer object such that the memory writes required would exceed
8587the data store size.
8588
8589`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8590bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8591divisible into the number of bytes needed to store in memory a datum
8592indicated by TYPE.
8593
8594`GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8595executed between the execution of `glBegin' and the corresponding
8596execution of `glEnd'.")
8597
8598(define-gl-procedure
8599 glGetConvolutionParameter
8600 "glGetConvolutionParameter"
8601 (funcsynopsis
8602 (funcprototype
8603 (funcdef
8604 "void "
8605 (function "glGetConvolutionParameterfv"))
8606 (paramdef "GLenum " (parameter "target"))
8607 (paramdef "GLenum " (parameter "pname"))
8608 (paramdef "GLfloat * " (parameter "params"))))
8609 "Get convolution parameters.
8610
8611TARGET
8612 The filter whose parameters are to be retrieved. Must be one of
8613 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
8614
8615PNAME
8616 The parameter to be retrieved. Must be one of
8617 `GL_CONVOLUTION_BORDER_MODE', `GL_CONVOLUTION_BORDER_COLOR',
8618 `GL_CONVOLUTION_FILTER_SCALE', `GL_CONVOLUTION_FILTER_BIAS',
8619 `GL_CONVOLUTION_FORMAT', `GL_CONVOLUTION_WIDTH',
8620 `GL_CONVOLUTION_HEIGHT', `GL_MAX_CONVOLUTION_WIDTH', or
8621 `GL_MAX_CONVOLUTION_HEIGHT'.
8622
8623PARAMS
8624 Pointer to storage for the parameters to be retrieved.
8625
8626`glGetConvolutionParameter' retrieves convolution parameters. TARGET
8627determines which convolution filter is queried. PNAME determines which
8628parameter is returned:
8629
8630`GL_CONVOLUTION_BORDER_MODE'
8631
8632
8633 The convolution border mode. See `glConvolutionParameter' for a
8634 list of border modes.
8635
8636`GL_CONVOLUTION_BORDER_COLOR'
8637
8638
8639 The current convolution border color. PARAMS must be a pointer to
8640 an array of four elements, which will receive the red, green, blue,
8641 and alpha border colors.
8642
8643`GL_CONVOLUTION_FILTER_SCALE'
8644
8645
8646 The current filter scale factors. PARAMS must be a pointer to an
8647 array of four elements, which will receive the red, green, blue,
8648 and alpha filter scale factors in that order.
8649
8650`GL_CONVOLUTION_FILTER_BIAS'
8651
8652
8653 The current filter bias factors. PARAMS must be a pointer to an
8654 array of four elements, which will receive the red, green, blue,
8655 and alpha filter bias terms in that order.
8656
8657`GL_CONVOLUTION_FORMAT'
8658
8659
8660 The current internal format. See `glConvolutionFilter1D',
8661 `glConvolutionFilter2D', and `glSeparableFilter2D' for lists of
8662 allowable formats.
8663
8664`GL_CONVOLUTION_WIDTH'
8665
8666
8667 The current filter image width.
8668
8669`GL_CONVOLUTION_HEIGHT'
8670
8671
8672 The current filter image height.
8673
8674`GL_MAX_CONVOLUTION_WIDTH'
8675
8676
8677 The maximum acceptable filter image width.
8678
8679`GL_MAX_CONVOLUTION_HEIGHT'
8680
8681
8682 The maximum acceptable filter image height.
8683
8684`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8685values.
8686
8687`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8688values.
8689
8690`GL_INVALID_ENUM' is generated if TARGET is `GL_CONVOLUTION_1D' and
8691PNAME is `GL_CONVOLUTION_HEIGHT' or `GL_MAX_CONVOLUTION_HEIGHT'.
8692
8693`GL_INVALID_OPERATION' is generated if `glGetConvolutionParameter' is
8694executed between the execution of `glBegin' and the corresponding
8695execution of `glEnd'.")
8696
8697(define-gl-procedure
8698 glGetError
8699 "glGetError"
8700 (funcsynopsis
8701 (funcprototype
8702 (funcdef "GLenum " (function "glGetError"))
8703 (paramdef (parameter "void"))))
8704 "Return error information.
8705
8706`glGetError' returns the value of the error flag. Each detectable error
8707is assigned a numeric code and symbolic name. When an error occurs, the
8708error flag is set to the appropriate error code value. No other errors
8709are recorded until `glGetError' is called, the error code is returned,
8710and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8711returns `GL_NO_ERROR', there has been no detectable error since the last
8712call to `glGetError', or since the GL was initialized.
8713
8714To allow for distributed implementations, there may be several error
8715flags. If any single error flag has recorded an error, the value of that
8716flag is returned and that flag is reset to `GL_NO_ERROR' when
8717`glGetError' is called. If more than one flag has recorded an error,
8718`glGetError' returns and clears an arbitrary error flag value. Thus,
8719`glGetError' should always be called in a loop, until it returns
8720`GL_NO_ERROR', if all error flags are to be reset.
8721
8722Initially, all error flags are set to `GL_NO_ERROR'.
8723
8724The following errors are currently defined:
8725
8726`GL_NO_ERROR'
8727 No error has been recorded. The value of this symbolic constant is
8728 guaranteed to be 0.
8729
8730`GL_INVALID_ENUM'
8731 An unacceptable value is specified for an enumerated argument. The
8732 offending command is ignored and has no other side effect than to
8733 set the error flag.
8734
8735`GL_INVALID_VALUE'
8736 A numeric argument is out of range. The offending command is
8737 ignored and has no other side effect than to set the error flag.
8738
8739`GL_INVALID_OPERATION'
8740 The specified operation is not allowed in the current state. The
8741 offending command is ignored and has no other side effect than to
8742 set the error flag.
8743
8744`GL_STACK_OVERFLOW'
8745 This command would cause a stack overflow. The offending command is
8746 ignored and has no other side effect than to set the error flag.
8747
8748`GL_STACK_UNDERFLOW'
8749 This command would cause a stack underflow. The offending command
8750 is ignored and has no other side effect than to set the error flag.
8751
8752`GL_OUT_OF_MEMORY'
8753 There is not enough memory left to execute the command. The state
8754 of the GL is undefined, except for the state of the error flags,
8755 after this error is recorded.
8756
8757`GL_TABLE_TOO_LARGE'
8758 The specified table exceeds the implementation's maximum supported
8759 table size. The offending command is ignored and has no other side
8760 effect than to set the error flag.
8761
8762When an error flag is set, results of a GL operation are undefined only
8763if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8764generating the error is ignored and has no effect on the GL state or
8765frame buffer contents. If the generating command returns a value, it
8766returns 0. If `glGetError' itself generates an error, it returns 0.
8767
8768`GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8769the execution of `glBegin' and the corresponding execution of `glEnd'.
8770In this case, `glGetError' returns 0.")
8771
8772(define-gl-procedure
8773 glGetHistogramParameter
8774 "glGetHistogramParameter"
8775 (funcsynopsis
8776 (funcprototype
8777 (funcdef
8778 "void "
8779 (function "glGetHistogramParameterfv"))
8780 (paramdef "GLenum " (parameter "target"))
8781 (paramdef "GLenum " (parameter "pname"))
8782 (paramdef "GLfloat * " (parameter "params"))))
8783 "Get histogram parameters.
8784
8785TARGET
8786 Must be one of `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
8787
8788PNAME
8789 The name of the parameter to be retrieved. Must be one of
8790 `GL_HISTOGRAM_WIDTH', `GL_HISTOGRAM_FORMAT',
8791 `GL_HISTOGRAM_RED_SIZE', `GL_HISTOGRAM_GREEN_SIZE',
8792 `GL_HISTOGRAM_BLUE_SIZE', `GL_HISTOGRAM_ALPHA_SIZE',
8793 `GL_HISTOGRAM_LUMINANCE_SIZE', or `GL_HISTOGRAM_SINK'.
8794
8795PARAMS
8796 Pointer to storage for the returned values.
8797
8798`glGetHistogramParameter' is used to query parameter values for the
8799current histogram or for a proxy. The histogram state information may be
8800queried by calling `glGetHistogramParameter' with a TARGET of
8801`GL_HISTOGRAM' (to obtain information for the current histogram table)
8802or `GL_PROXY_HISTOGRAM' (to obtain information from the most recent
8803proxy request) and one of the following values for the PNAME argument:
8804
8805
8806
8807*Parameter*
8808 *Description*
8809
8810`GL_HISTOGRAM_WIDTH'
8811 Histogram table width
8812
8813`GL_HISTOGRAM_FORMAT'
8814 Internal format
8815
8816`GL_HISTOGRAM_RED_SIZE'
8817 Red component counter size, in bits
8818
8819`GL_HISTOGRAM_GREEN_SIZE'
8820 Green component counter size, in bits
8821
8822`GL_HISTOGRAM_BLUE_SIZE'
8823 Blue component counter size, in bits
8824
8825`GL_HISTOGRAM_ALPHA_SIZE'
8826 Alpha component counter size, in bits
8827
8828`GL_HISTOGRAM_LUMINANCE_SIZE'
8829 Luminance component counter size, in bits
8830
8831`GL_HISTOGRAM_SINK'
8832 Value of the SINK parameter
8833
8834
8835
8836`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8837values.
8838
8839`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8840values.
8841
8842`GL_INVALID_OPERATION' is generated if `glGetHistogramParameter' is
8843executed between the execution of `glBegin' and the corresponding
8844execution of `glEnd'.")
8845
8846(define-gl-procedure
8847 glGetHistogram
8848 "glGetHistogram"
8849 (funcsynopsis
8850 (funcprototype
8851 (funcdef "void " (function "glGetHistogram"))
8852 (paramdef "GLenum " (parameter "target"))
8853 (paramdef "GLboolean " (parameter "reset"))
8854 (paramdef "GLenum " (parameter "format"))
8855 (paramdef "GLenum " (parameter "type"))
8856 (paramdef "GLvoid * " (parameter "values"))))
8857 "Get histogram table.
8858
8859TARGET
8860 Must be `GL_HISTOGRAM'.
8861
8862RESET
8863 If `GL_TRUE', each component counter that is actually returned is
8864 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8865 of the counters in the histogram table is modified.
8866
8867FORMAT
8868 The format of values to be returned in VALUES. Must be one of
8869 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8870 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8871
8872TYPE
8873 The type of values to be returned in VALUES. Symbolic constants
8874 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8875 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8876 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8877 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8878 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8879 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8880 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8881 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8882 are accepted.
8883
8884VALUES
8885 A pointer to storage for the returned histogram table.
8886
8887`glGetHistogram' returns the current histogram table as a
8888one-dimensional image with the same width as the histogram. No pixel
8889transfer operations are performed on this image, but pixel storage modes
8890that are applicable to 1D images are honored.
8891
8892If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8893target (see `glBindBuffer') while a histogram table is requested, VALUES
8894is treated as a byte offset into the buffer object's data store.
8895
8896Color components that are requested in the specified FORMAT, but which
8897are not included in the internal format of the histogram, are returned
8898as zero. The assignments of internal color components to the components
8899requested by FORMAT are:
8900
8901*Internal Component*
8902 *Resulting Component*
8903
8904Red
8905 Red
8906
8907Green
8908 Green
8909
8910Blue
8911 Blue
8912
8913Alpha
8914 Alpha
8915
8916Luminance
8917 Red
8918
8919
8920
8921`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8922
8923`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8924values.
8925
8926`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8927values.
8928
8929`GL_INVALID_OPERATION' is generated if TYPE is one of
8930`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8931`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8932is not `GL_RGB'.
8933
8934`GL_INVALID_OPERATION' is generated if TYPE is one of
8935`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8936`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8937`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8938`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8939FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8940
8941`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8942bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8943store is currently mapped.
8944
8945`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8946bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8947to the buffer object such that the memory writes required would exceed
8948the data store size.
8949
8950`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8951bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8952divisible into the number of bytes needed to store in memory a datum
8953indicated by TYPE.
8954
8955`GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8956between the execution of `glBegin' and the corresponding execution of
8957`glEnd'.")
8958
8959(define-gl-procedure
8960 glGetLight
8961 "glGetLight"
8962 (funcsynopsis
8963 (funcprototype
8964 (funcdef "void " (function "glGetLightfv"))
8965 (paramdef "GLenum " (parameter "light"))
8966 (paramdef "GLenum " (parameter "pname"))
8967 (paramdef "GLfloat * " (parameter "params"))))
8968 "Return light source parameter values.
8969
8970LIGHT
8971 Specifies a light source. The number of possible lights depends on
8972 the implementation, but at least eight lights are supported. They
8973 are identified by symbolic names of the form `GL_LIGHT' I where I
8974 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
8975
8976PNAME
8977 Specifies a light source parameter for LIGHT. Accepted symbolic
8978 names are `GL_AMBIENT', `GL_DIFFUSE', `GL_SPECULAR', `GL_POSITION',
8979 `GL_SPOT_DIRECTION', `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF',
8980 `GL_CONSTANT_ATTENUATION', `GL_LINEAR_ATTENUATION', and
8981 `GL_QUADRATIC_ATTENUATION'.
8982
8983PARAMS
8984 Returns the requested data.
8985
8986`glGetLight' returns in PARAMS the value or values of a light source
8987parameter. LIGHT names the light and is a symbolic name of the form
8988`GL_LIGHT'I where i ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
8989`GL_MAX_LIGHTS' is an implementation dependent constant that is greater
8990than or equal to eight. PNAME specifies one of ten light source
8991parameters, again by symbolic name.
8992
8993The following parameters are defined:
8994
8995`GL_AMBIENT'
8996 PARAMS returns four integer or floating-point values representing
8997 the ambient intensity of the light source. Integer values, when
8998 requested, are linearly mapped from the internal floating-point
8999 representation such that 1.0 maps to the most positive
9000 representable integer value, and -1.0 maps to the most negative
9001 representable integer value. If the internal value is outside the
9002 range [-1,1] , the corresponding integer return value is undefined.
9003 The initial value is (0, 0, 0, 1).
9004
9005`GL_DIFFUSE'
9006 PARAMS returns four integer or floating-point values representing
9007 the diffuse intensity of the light source. Integer values, when
9008 requested, are linearly mapped from the internal floating-point
9009 representation such that 1.0 maps to the most positive
9010 representable integer value, and -1.0 maps to the most negative
9011 representable integer value. If the internal value is outside the
9012 range [-1,1] , the corresponding integer return value is undefined.
9013 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
9014 lights, the initial value is (0, 0, 0, 0).
9015
9016`GL_SPECULAR'
9017 PARAMS returns four integer or floating-point values representing
9018 the specular intensity of the light source. Integer values, when
9019 requested, are linearly mapped from the internal floating-point
9020 representation such that 1.0 maps to the most positive
9021 representable integer value, and -1.0 maps to the most negative
9022 representable integer value. If the internal value is outside the
9023 range [-1,1] , the corresponding integer return value is undefined.
9024 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
9025 lights, the initial value is (0, 0, 0, 0).
9026
9027`GL_POSITION'
9028 PARAMS returns four integer or floating-point values representing
9029 the position of the light source. Integer values, when requested,
9030 are computed by rounding the internal floating-point values to the
9031 nearest integer value. The returned values are those maintained in
9032 eye coordinates. They will not be equal to the values specified
9033 using `glLight', unless the modelview matrix was identity at the
9034 time `glLight' was called. The initial value is (0, 0, 1, 0).
9035
9036`GL_SPOT_DIRECTION'
9037 PARAMS returns three integer or floating-point values representing
9038 the direction of the light source. Integer values, when requested,
9039 are computed by rounding the internal floating-point values to the
9040 nearest integer value. The returned values are those maintained in
9041 eye coordinates. They will not be equal to the values specified
9042 using `glLight', unless the modelview matrix was identity at the
9043 time `glLight' was called. Although spot direction is normalized
9044 before being used in the lighting equation, the returned values are
9045 the transformed versions of the specified values prior to
9046 normalization. The initial value is (0,0-1) .
9047
9048`GL_SPOT_EXPONENT'
9049 PARAMS returns a single integer or floating-point value
9050 representing the spot exponent of the light. An integer value, when
9051 requested, is computed by rounding the internal floating-point
9052 representation to the nearest integer. The initial value is 0.
9053
9054`GL_SPOT_CUTOFF'
9055 PARAMS returns a single integer or floating-point value
9056 representing the spot cutoff angle of the light. An integer value,
9057 when requested, is computed by rounding the internal floating-point
9058 representation to the nearest integer. The initial value is 180.
9059
9060`GL_CONSTANT_ATTENUATION'
9061 PARAMS returns a single integer or floating-point value
9062 representing the constant (not distance-related) attenuation of the
9063 light. An integer value, when requested, is computed by rounding
9064 the internal floating-point representation to the nearest integer.
9065 The initial value is 1.
9066
9067`GL_LINEAR_ATTENUATION'
9068 PARAMS returns a single integer or floating-point value
9069 representing the linear attenuation of the light. An integer value,
9070 when requested, is computed by rounding the internal floating-point
9071 representation to the nearest integer. The initial value is 0.
9072
9073`GL_QUADRATIC_ATTENUATION'
9074 PARAMS returns a single integer or floating-point value
9075 representing the quadratic attenuation of the light. An integer
9076 value, when requested, is computed by rounding the internal
9077 floating-point representation to the nearest integer. The initial
9078 value is 0.
9079
9080`GL_INVALID_ENUM' is generated if LIGHT or PNAME is not an accepted
9081value.
9082
9083`GL_INVALID_OPERATION' is generated if `glGetLight' is executed between
9084the execution of `glBegin' and the corresponding execution of `glEnd'.")
9085
9086(define-gl-procedure
9087 glGetMap
9088 "glGetMap"
9089 (funcsynopsis
9090 (funcprototype
9091 (funcdef "void " (function "glGetMapdv"))
9092 (paramdef "GLenum " (parameter "target"))
9093 (paramdef "GLenum " (parameter "query"))
9094 (paramdef "GLdouble * " (parameter "v"))))
9095 "Return evaluator parameters.
9096
9097TARGET
9098 Specifies the symbolic name of a map. Accepted values are
9099 `GL_MAP1_COLOR_4', `GL_MAP1_INDEX', `GL_MAP1_NORMAL',
9100 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
9101 `GL_MAP1_TEXTURE_COORD_3', `GL_MAP1_TEXTURE_COORD_4',
9102 `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4', `GL_MAP2_COLOR_4',
9103 `GL_MAP2_INDEX', `GL_MAP2_NORMAL', `GL_MAP2_TEXTURE_COORD_1',
9104 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3',
9105 `GL_MAP2_TEXTURE_COORD_4', `GL_MAP2_VERTEX_3', and
9106 `GL_MAP2_VERTEX_4'.
9107
9108QUERY
9109 Specifies which parameter to return. Symbolic names `GL_COEFF',
9110 `GL_ORDER', and `GL_DOMAIN' are accepted.
9111
9112V
9113 Returns the requested data.
9114
9115`glMap1' and `glMap2' define evaluators. `glGetMap' returns evaluator
9116parameters. TARGET chooses a map, QUERY selects a specific parameter,
9117and V points to storage where the values will be returned.
9118
9119The acceptable values for the TARGET parameter are described in the
9120`glMap1' and `glMap2' reference pages.
9121
9122QUERY can assume the following values:
9123
9124`GL_COEFF'
9125 V returns the control points for the evaluator function.
9126 One-dimensional evaluators return ORDER control points, and
9127 two-dimensional evaluators return UORDER×VORDER control points.
9128 Each control point consists of one, two, three, or four integer,
9129 single-precision floating-point, or double-precision floating-point
9130 values, depending on the type of the evaluator. The GL returns
9131 two-dimensional control points in row-major order, incrementing the
9132 UORDER index quickly and the VORDER index after each row. Integer
9133 values, when requested, are computed by rounding the internal
9134 floating-point values to the nearest integer values.
9135
9136`GL_ORDER'
9137 V returns the order of the evaluator function. One-dimensional
9138 evaluators return a single value, ORDER . The initial value is 1.
9139 Two-dimensional evaluators return two values, UORDER and VORDER .
9140 The initial value is 1,1.
9141
9142`GL_DOMAIN'
9143 V returns the linear U and V mapping parameters. One-dimensional
9144 evaluators return two values, U1 and U2 , as specified by `glMap1'.
9145 Two-dimensional evaluators return four values ( U1 , U2 , V1 , and
9146 V2 ) as specified by `glMap2'. Integer values, when requested, are
9147 computed by rounding the internal floating-point values to the
9148 nearest integer values.
9149
9150`GL_INVALID_ENUM' is generated if either TARGET or QUERY is not an
9151accepted value.
9152
9153`GL_INVALID_OPERATION' is generated if `glGetMap' is executed between
9154the execution of `glBegin' and the corresponding execution of `glEnd'.")
9155
9156(define-gl-procedure
9157 glGetMaterial
9158 "glGetMaterial"
9159 (funcsynopsis
9160 (funcprototype
9161 (funcdef "void " (function "glGetMaterialfv"))
9162 (paramdef "GLenum " (parameter "face"))
9163 (paramdef "GLenum " (parameter "pname"))
9164 (paramdef "GLfloat * " (parameter "params"))))
9165 "Return material parameters.
9166
9167FACE
9168 Specifies which of the two materials is being queried. `GL_FRONT'
9169 or `GL_BACK' are accepted, representing the front and back
9170 materials, respectively.
9171
9172PNAME
9173 Specifies the material parameter to return. `GL_AMBIENT',
9174 `GL_DIFFUSE', `GL_SPECULAR', `GL_EMISSION', `GL_SHININESS', and
9175 `GL_COLOR_INDEXES' are accepted.
9176
9177PARAMS
9178 Returns the requested data.
9179
9180`glGetMaterial' returns in PARAMS the value or values of parameter PNAME
9181of material FACE. Six parameters are defined:
9182
9183`GL_AMBIENT'
9184 PARAMS returns four integer or floating-point values representing
9185 the ambient reflectance of the material. Integer values, when
9186 requested, are linearly mapped from the internal floating-point
9187 representation such that 1.0 maps to the most positive
9188 representable integer value, and -1.0 maps to the most negative
9189 representable integer value. If the internal value is outside the
9190 range [-1,1] , the corresponding integer return value is undefined.
9191 The initial value is (0.2, 0.2, 0.2, 1.0)
9192
9193`GL_DIFFUSE'
9194 PARAMS returns four integer or floating-point values representing
9195 the diffuse reflectance of the material. Integer values, when
9196 requested, are linearly mapped from the internal floating-point
9197 representation such that 1.0 maps to the most positive
9198 representable integer value, and -1.0 maps to the most negative
9199 representable integer value. If the internal value is outside the
9200 range [-1,1] , the corresponding integer return value is undefined.
9201 The initial value is (0.8, 0.8, 0.8, 1.0).
9202
9203`GL_SPECULAR'
9204 PARAMS returns four integer or floating-point values representing
9205 the specular reflectance of the material. Integer values, when
9206 requested, are linearly mapped from the internal floating-point
9207 representation such that 1.0 maps to the most positive
9208 representable integer value, and -1.0 maps to the most negative
9209 representable integer value. If the internal value is outside the
9210 range [-1,1] , the corresponding integer return value is undefined.
9211 The initial value is (0, 0, 0, 1).
9212
9213`GL_EMISSION'
9214 PARAMS returns four integer or floating-point values representing
9215 the emitted light intensity of the material. Integer values, when
9216 requested, are linearly mapped from the internal floating-point
9217 representation such that 1.0 maps to the most positive
9218 representable integer value, and -1.0 maps to the most negative
9219 representable integer value. If the internal value is outside the
9220 range [-1,1] , the corresponding integer return value is undefined.
9221 The initial value is (0, 0, 0, 1).
9222
9223`GL_SHININESS'
9224 PARAMS returns one integer or floating-point value representing the
9225 specular exponent of the material. Integer values, when requested,
9226 are computed by rounding the internal floating-point value to the
9227 nearest integer value. The initial value is 0.
9228
9229`GL_COLOR_INDEXES'
9230 PARAMS returns three integer or floating-point values representing
9231 the ambient, diffuse, and specular indices of the material. These
9232 indices are used only for color index lighting. (All the other
9233 parameters are used only for RGBA lighting.) Integer values, when
9234 requested, are computed by rounding the internal floating-point
9235 values to the nearest integer values.
9236
9237`GL_INVALID_ENUM' is generated if FACE or PNAME is not an accepted
9238value.
9239
9240`GL_INVALID_OPERATION' is generated if `glGetMaterial' is executed
9241between the execution of `glBegin' and the corresponding execution of
9242`glEnd'.")
9243
9244(define-gl-procedure
9245 glGetMinmaxParameter
9246 "glGetMinmaxParameter"
9247 (funcsynopsis
9248 (funcprototype
9249 (funcdef
9250 "void "
9251 (function "glGetMinmaxParameterfv"))
9252 (paramdef "GLenum " (parameter "target"))
9253 (paramdef "GLenum " (parameter "pname"))
9254 (paramdef "GLfloat * " (parameter "params"))))
9255 "Get minmax parameters.
9256
9257TARGET
9258 Must be `GL_MINMAX'.
9259
9260PNAME
9261 The parameter to be retrieved. Must be one of `GL_MINMAX_FORMAT' or
9262 `GL_MINMAX_SINK'.
9263
9264PARAMS
9265 A pointer to storage for the retrieved parameters.
9266
9267`glGetMinmaxParameter' retrieves parameters for the current minmax table
9268by setting PNAME to one of the following values:
9269
9270
9271
9272*Parameter*
9273 *Description*
9274
9275`GL_MINMAX_FORMAT'
9276 Internal format of minmax table
9277
9278`GL_MINMAX_SINK'
9279 Value of the SINK parameter
9280
9281
9282
9283`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
9284
9285`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
9286values.
9287
9288`GL_INVALID_OPERATION' is generated if `glGetMinmaxParameter' is
9289executed between the execution of `glBegin' and the corresponding
9290execution of `glEnd'.")
9291
9292(define-gl-procedure
9293 glGetMinmax
9294 "glGetMinmax"
9295 (funcsynopsis
9296 (funcprototype
9297 (funcdef "void " (function "glGetMinmax"))
9298 (paramdef "GLenum " (parameter "target"))
9299 (paramdef "GLboolean " (parameter "reset"))
9300 (paramdef "GLenum " (parameter "format"))
9301 (paramdef "GLenum " (parameter "types"))
9302 (paramdef "GLvoid * " (parameter "values"))))
9303 "Get minimum and maximum pixel values.
9304
9305TARGET
9306 Must be `GL_MINMAX'.
9307
9308RESET
9309 If `GL_TRUE', all entries in the minmax table that are actually
9310 returned are reset to their initial values. (Other entries are
9311 unaltered.) If `GL_FALSE', the minmax table is unaltered.
9312
9313FORMAT
9314 The format of the data to be returned in VALUES. Must be one of
9315 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
9316 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9317
9318TYPES
9319 The type of the data to be returned in VALUES. Symbolic constants
9320 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9321 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9322 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9323 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9324 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9325 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9326 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9327 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
9328 are accepted.
9329
9330VALUES
9331 A pointer to storage for the returned values.
9332
9333`glGetMinmax' returns the accumulated minimum and maximum pixel values
9334(computed on a per-component basis) in a one-dimensional image of width
93352. The first set of return values are the minima, and the second set of
9336return values are the maxima. The format of the return values is
9337determined by FORMAT, and their type is determined by TYPES.
9338
9339If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9340target (see `glBindBuffer') while minimum and maximum pixel values are
9341requested, VALUES is treated as a byte offset into the buffer object's
9342data store.
9343
9344No pixel transfer operations are performed on the return values, but
9345pixel storage modes that are applicable to one-dimensional images are
9346performed. Color components that are requested in the specified FORMAT,
9347but that are not included in the internal format of the minmax table,
9348are returned as zero. The assignment of internal color components to the
9349components requested by FORMAT are as follows:
9350
9351
9352
9353*Internal Component*
9354 *Resulting Component*
9355
9356Red
9357 Red
9358
9359Green
9360 Green
9361
9362Blue
9363 Blue
9364
9365Alpha
9366 Alpha
9367
9368Luminance
9369 Red
9370
9371If RESET is `GL_TRUE', the minmax table entries corresponding to the
9372return values are reset to their initial values. Minimum and maximum
9373values that are not returned are not modified, even if RESET is
9374`GL_TRUE'.
9375
9376`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
9377
9378`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
9379values.
9380
9381`GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
9382values.
9383
9384`GL_INVALID_OPERATION' is generated if TYPES is one of
9385`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9386`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9387is not `GL_RGB'.
9388
9389`GL_INVALID_OPERATION' is generated if TYPES is one of
9390`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9391`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9392`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9393`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9394FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
9395
9396`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9397bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9398store is currently mapped.
9399
9400`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9401bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9402to the buffer object such that the memory writes required would exceed
9403the data store size.
9404
9405`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9406bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
9407divisible into the number of bytes needed to store in memory a datum
9408indicated by TYPE.
9409
9410`GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
9411the execution of `glBegin' and the corresponding execution of `glEnd'.")
9412
9413(define-gl-procedure
9414 glGetPixelMap
9415 "glGetPixelMap"
9416 (funcsynopsis
9417 (funcprototype
9418 (funcdef "void " (function "glGetPixelMapfv"))
9419 (paramdef "GLenum " (parameter "map"))
9420 (paramdef "GLfloat * " (parameter "data"))))
9421 "Return the specified pixel map.
9422
9423MAP
9424 Specifies the name of the pixel map to return. Accepted values are
9425 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
9426 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
9427 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
9428 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
9429 `GL_PIXEL_MAP_B_TO_B', and `GL_PIXEL_MAP_A_TO_A'.
9430
9431DATA
9432 Returns the pixel map contents.
9433
9434See the `glPixelMap' reference page for a description of the acceptable
9435values for the MAP parameter. `glGetPixelMap' returns in DATA the
9436contents of the pixel map specified in MAP. Pixel maps are used during
9437the execution of `glReadPixels', `glDrawPixels', `glCopyPixels',
9438`glTexImage1D', `glTexImage2D', `glTexImage3D', `glTexSubImage1D',
9439`glTexSubImage2D', `glTexSubImage3D', `glCopyTexImage1D',
9440`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D', and
9441`glCopyTexSubImage3D'. to map color indices, stencil indices, color
9442components, and depth components to other values.
9443
9444If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9445target (see `glBindBuffer') while a pixel map is requested, DATA is
9446treated as a byte offset into the buffer object's data store.
9447
9448Unsigned integer values, if requested, are linearly mapped from the
9449internal fixed or floating-point representation such that 1.0 maps to
9450the largest representable integer value, and 0.0 maps to 0. Return
9451unsigned integer values are undefined if the map value was not in the
9452range [0,1].
9453
9454To determine the required size of MAP, call `glGet' with the appropriate
9455symbolic constant.
9456
9457`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
9458
9459`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9460bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9461store is currently mapped.
9462
9463`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9464bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9465to the buffer object such that the memory writes required would exceed
9466the data store size.
9467
9468`GL_INVALID_OPERATION' is generated by `glGetPixelMapfv' if a non-zero
9469buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9470DATA is not evenly divisible into the number of bytes needed to store in
9471memory a GLfloat datum.
9472
9473`GL_INVALID_OPERATION' is generated by `glGetPixelMapuiv' if a non-zero
9474buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9475DATA is not evenly divisible into the number of bytes needed to store in
9476memory a GLuint datum.
9477
9478`GL_INVALID_OPERATION' is generated by `glGetPixelMapusv' if a non-zero
9479buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9480DATA is not evenly divisible into the number of bytes needed to store in
9481memory a GLushort datum.
9482
9483`GL_INVALID_OPERATION' is generated if `glGetPixelMap' is executed
9484between the execution of `glBegin' and the corresponding execution of
9485`glEnd'.")
9486
9487(define-gl-procedure
9488 glGetPointerv
9489 "glGetPointerv"
9490 (funcsynopsis
9491 (funcprototype
9492 (funcdef "void " (function "glGetPointerv"))
9493 (paramdef "GLenum " (parameter "pname"))
9494 (paramdef "GLvoid ** " (parameter "params"))))
9495 "Return the address of the specified pointer.
9496
9497PNAME
9498 Specifies the array or buffer pointer to be returned. Symbolic
9499 constants `GL_COLOR_ARRAY_POINTER', `GL_EDGE_FLAG_ARRAY_POINTER',
9500 `GL_FOG_COORD_ARRAY_POINTER', `GL_FEEDBACK_BUFFER_POINTER',
9501 `GL_INDEX_ARRAY_POINTER', `GL_NORMAL_ARRAY_POINTER',
9502 `GL_SECONDARY_COLOR_ARRAY_POINTER', `GL_SELECTION_BUFFER_POINTER',
9503 `GL_TEXTURE_COORD_ARRAY_POINTER', or `GL_VERTEX_ARRAY_POINTER' are
9504 accepted.
9505
9506PARAMS
9507 Returns the pointer value specified by PNAME.
9508
9509`glGetPointerv' returns pointer information. PNAME is a symbolic
9510constant indicating the pointer to be returned, and PARAMS is a pointer
9511to a location in which to place the returned data.
9512
9513For all PNAME arguments except `GL_FEEDBACK_BUFFER_POINTER' and
9514`GL_SELECTION_BUFFER_POINTER', if a non-zero named buffer object was
9515bound to the `GL_ARRAY_BUFFER' target (see `glBindBuffer') when the
9516desired pointer was previously specified, the pointer returned is a byte
9517offset into the buffer object's data store. Buffer objects are only
9518available in OpenGL versions 1.5 and greater.
9519
9520`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
9521
9522(define-gl-procedure
9523 glGetPolygonStipple
9524 "glGetPolygonStipple"
9525 (funcsynopsis
9526 (funcprototype
9527 (funcdef
9528 "void "
9529 (function "glGetPolygonStipple"))
9530 (paramdef "GLubyte * " (parameter "pattern"))))
9531 "Return the polygon stipple pattern.
9532
9533PATTERN
9534 Returns the stipple pattern. The initial value is all 1's.
9535
9536`glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
9537pattern. The pattern is packed into memory as if `glReadPixels' with
9538both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
9539`GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
9540internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
9541transfer operations (shift, offset, pixel map) are not applied to the
9542returned stipple image.
9543
9544If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9545target (see `glBindBuffer') while a polygon stipple pattern is
9546requested, PATTERN is treated as a byte offset into the buffer object's
9547data store.
9548
9549`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9550bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9551store is currently mapped.
9552
9553`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9554bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9555to the buffer object such that the memory writes required would exceed
9556the data store size.
9557
9558`GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
9559between the execution of `glBegin' and the corresponding execution of
9560`glEnd'.")
9561
9562(define-gl-procedure
9563 glGetProgramInfoLog
9564 "glGetProgramInfoLog"
9565 (funcsynopsis
9566 (funcprototype
9567 (funcdef
9568 "void "
9569 (function "glGetProgramInfoLog"))
9570 (paramdef "GLuint " (parameter "program"))
9571 (paramdef "GLsizei " (parameter "maxLength"))
9572 (paramdef "GLsizei *" (parameter "length"))
9573 (paramdef "GLchar *" (parameter "infoLog"))))
9574 "Returns the information log for a program object.
9575
9576PROGRAM
9577 Specifies the program object whose information log is to be
9578 queried.
9579
9580MAXLENGTH
9581 Specifies the size of the character buffer for storing the returned
9582 information log.
9583
9584LENGTH
9585 Returns the length of the string returned in INFOLOG (excluding the
9586 null terminator).
9587
9588INFOLOG
9589 Specifies an array of characters that is used to return the
9590 information log.
9591
9592`glGetProgramInfoLog' returns the information log for the specified
9593program object. The information log for a program object is modified
9594when the program object is linked or validated. The string that is
9595returned will be null terminated.
9596
9597`glGetProgramInfoLog' returns in INFOLOG as much of the information log
9598as it can, up to a maximum of MAXLENGTH characters. The number of
9599characters actually returned, excluding the null termination character,
9600is specified by LENGTH. If the length of the returned string is not
9601required, a value of `NULL' can be passed in the LENGTH argument. The
9602size of the buffer required to store the returned information log can be
9603obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
9604
9605The information log for a program object is either an empty string, or a
9606string containing information about the last link operation, or a string
9607containing information about the last validation operation. It may
9608contain diagnostic messages, warning messages, and other information.
9609When a program object is created, its information log will be a string
9610of length 0.
9611
9612`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9613OpenGL.
9614
9615`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
9616
9617`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
9618
9619`GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
9620between the execution of `glBegin' and the corresponding execution of
9621`glEnd'.")
9622
9623(define-gl-procedure
9624 glGetProgramiv
9625 "glGetProgramiv"
9626 (funcsynopsis
9627 (funcprototype
9628 (funcdef "void " (function "glGetProgramiv"))
9629 (paramdef "GLuint " (parameter "program"))
9630 (paramdef "GLenum " (parameter "pname"))
9631 (paramdef "GLint *" (parameter "params"))))
9632 "Returns a parameter from a program object.
9633
9634PROGRAM
9635 Specifies the program object to be queried.
9636
9637PNAME
9638 Specifies the object parameter. Accepted symbolic names are
9639 `GL_DELETE_STATUS', `GL_LINK_STATUS', `GL_VALIDATE_STATUS',
9640 `GL_INFO_LOG_LENGTH', `GL_ATTACHED_SHADERS',
9641 `GL_ACTIVE_ATTRIBUTES', `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH',
9642 `GL_ACTIVE_UNIFORMS', `GL_ACTIVE_UNIFORM_MAX_LENGTH'.
9643
9644PARAMS
9645 Returns the requested object parameter.
9646
9647`glGetProgram' returns in PARAMS the value of a parameter for a specific
9648program object. The following parameters are defined:
9649
9650`GL_DELETE_STATUS'
9651
9652
9653 PARAMS returns `GL_TRUE' if PROGRAM is currently flagged for
9654 deletion, and `GL_FALSE' otherwise.
9655
9656`GL_LINK_STATUS'
9657
9658
9659 PARAMS returns `GL_TRUE' if the last link operation on PROGRAM was
9660 successful, and `GL_FALSE' otherwise.
9661
9662`GL_VALIDATE_STATUS'
9663
9664
9665 PARAMS returns `GL_TRUE' or if the last validation operation on
9666 PROGRAM was successful, and `GL_FALSE' otherwise.
9667
9668`GL_INFO_LOG_LENGTH'
9669
9670
9671 PARAMS returns the number of characters in the information log for
9672 PROGRAM including the null termination character (i.e., the size of
9673 the character buffer required to store the information log). If
9674 PROGRAM has no information log, a value of 0 is returned.
9675
9676`GL_ATTACHED_SHADERS'
9677
9678
9679 PARAMS returns the number of shader objects attached to PROGRAM.
9680
9681`GL_ACTIVE_ATTRIBUTES'
9682
9683
9684 PARAMS returns the number of active attribute variables for
9685 PROGRAM.
9686
9687`GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'
9688
9689
9690 PARAMS returns the length of the longest active attribute name for
9691 PROGRAM, including the null termination character (i.e., the size
9692 of the character buffer required to store the longest attribute
9693 name). If no active attributes exist, 0 is returned.
9694
9695`GL_ACTIVE_UNIFORMS'
9696
9697
9698 PARAMS returns the number of active uniform variables for PROGRAM.
9699
9700`GL_ACTIVE_UNIFORM_MAX_LENGTH'
9701
9702
9703 PARAMS returns the length of the longest active uniform variable
9704 name for PROGRAM, including the null termination character (i.e.,
9705 the size of the character buffer required to store the longest
9706 uniform variable name). If no active uniform variables exist, 0 is
9707 returned.
9708
9709`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9710OpenGL.
9711
9712`GL_INVALID_OPERATION' is generated if PROGRAM does not refer to a
9713program object.
9714
9715`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9716
9717`GL_INVALID_OPERATION' is generated if `glGetProgram' is executed
9718between the execution of `glBegin' and the corresponding execution of
9719`glEnd'.")
9720
9721(define-gl-procedure
9722 glGetQueryiv
9723 "glGetQueryiv"
9724 (funcsynopsis
9725 (funcprototype
9726 (funcdef "void " (function "glGetQueryiv"))
9727 (paramdef "GLenum " (parameter "target"))
9728 (paramdef "GLenum " (parameter "pname"))
9729 (paramdef "GLint * " (parameter "params"))))
9730 "Return parameters of a query object target.
9731
9732TARGET
9733 Specifies a query object target. Must be `GL_SAMPLES_PASSED'.
9734
9735PNAME
9736 Specifies the symbolic name of a query object target parameter.
9737 Accepted values are `GL_CURRENT_QUERY' or `GL_QUERY_COUNTER_BITS'.
9738
9739PARAMS
9740 Returns the requested data.
9741
9742`glGetQueryiv' returns in PARAMS a selected parameter of the query
9743object target specified by TARGET.
9744
9745PNAME names a specific query object target parameter. When TARGET is
9746`GL_SAMPLES_PASSED', PNAME can be as follows:
9747
9748`GL_CURRENT_QUERY'
9749 PARAMS returns the name of the currently active occlusion query
9750 object. If no occlusion query is active, 0 is returned. The initial
9751 value is 0.
9752
9753`GL_QUERY_COUNTER_BITS'
9754 PARAMS returns the number of bits in the query counter used to
9755 accumulate passing samples. If the number of bits returned is 0,
9756 the implementation does not support a query counter, and the
9757 results obtained from `glGetQueryObject' are useless.
9758
9759`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
9760value.
9761
9762`GL_INVALID_OPERATION' is generated if `glGetQueryiv' is executed
9763between the execution of `glBegin' and the corresponding execution of
9764`glEnd'.")
9765
9766(define-gl-procedure
9767 glGetQueryObject
9768 "glGetQueryObject"
9769 (funcsynopsis
9770 (funcprototype
9771 (funcdef "void " (function "glGetQueryObjectiv"))
9772 (paramdef "GLuint " (parameter "id"))
9773 (paramdef "GLenum " (parameter "pname"))
9774 (paramdef "GLint * " (parameter "params"))))
9775 "Return parameters of a query object.
9776
9777ID
9778 Specifies the name of a query object.
9779
9780PNAME
9781 Specifies the symbolic name of a query object parameter. Accepted
9782 values are `GL_QUERY_RESULT' or `GL_QUERY_RESULT_AVAILABLE'.
9783
9784PARAMS
9785 Returns the requested data.
9786
9787`glGetQueryObject' returns in PARAMS a selected parameter of the query
9788object specified by ID.
9789
9790PNAME names a specific query object parameter. PNAME can be as follows:
9791
9792`GL_QUERY_RESULT'
9793 PARAMS returns the value of the query object's passed samples
9794 counter. The initial value is 0.
9795
9796`GL_QUERY_RESULT_AVAILABLE'
9797 PARAMS returns whether the passed samples counter is immediately
9798 available. If a delay would occur waiting for the query result,
9799 `GL_FALSE' is returned. Otherwise, `GL_TRUE' is returned, which
9800 also indicates that the results of all previous queries are
9801 available as well.
9802
9803`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9804
9805`GL_INVALID_OPERATION' is generated if ID is not the name of a query
9806object.
9807
9808`GL_INVALID_OPERATION' is generated if ID is the name of a currently
9809active query object.
9810
9811`GL_INVALID_OPERATION' is generated if `glGetQueryObject' is executed
9812between the execution of `glBegin' and the corresponding execution of
9813`glEnd'.")
9814
9815(define-gl-procedure
9816 glGetSeparableFilter
9817 "glGetSeparableFilter"
9818 (funcsynopsis
9819 (funcprototype
9820 (funcdef
9821 "void "
9822 (function "glGetSeparableFilter"))
9823 (paramdef "GLenum " (parameter "target"))
9824 (paramdef "GLenum " (parameter "format"))
9825 (paramdef "GLenum " (parameter "type"))
9826 (paramdef "GLvoid * " (parameter "row"))
9827 (paramdef "GLvoid * " (parameter "column"))
9828 (paramdef "GLvoid * " (parameter "span"))))
9829 "Get separable convolution filter kernel images.
9830
9831TARGET
9832 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
9833
9834FORMAT
9835 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
9836 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
9837 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9838
9839TYPE
9840 Data type of components in the output images. Symbolic constants
9841 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9842 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9843 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9844 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9845 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9846 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9847 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9848 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
9849 are accepted.
9850
9851ROW
9852 Pointer to storage for the row filter image.
9853
9854COLUMN
9855 Pointer to storage for the column filter image.
9856
9857SPAN
9858 Pointer to storage for the span filter image (currently unused).
9859
9860`glGetSeparableFilter' returns the two one-dimensional filter kernel
9861images for the current separable 2D convolution filter. The row image is
9862placed in ROW and the column image is placed in COLUMN according to the
9863specifications in FORMAT and TYPE. (In the current implementation, SPAN
9864is not affected in any way.) No pixel transfer operations are performed
9865on the images, but the relevant pixel storage modes are applied.
9866
9867If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9868target (see `glBindBuffer') while a separable convolution filter is
9869requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
9870buffer object's data store.
9871
9872Color components that are present in FORMAT but not included in the
9873internal format of the filters are returned as zero. The assignments of
9874internal color components to the components of FORMAT are as follows:
9875
9876
9877
9878*Internal Component*
9879 *Resulting Component*
9880
9881Red
9882 Red
9883
9884Green
9885 Green
9886
9887Blue
9888 Blue
9889
9890Alpha
9891 Alpha
9892
9893Luminance
9894 Red
9895
9896Intensity
9897 Red
9898
9899
9900
9901`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
9902
9903`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
9904values.
9905
9906`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
9907values.
9908
9909`GL_INVALID_OPERATION' is generated if TYPE is one of
9910`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9911`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9912is not `GL_RGB'.
9913
9914`GL_INVALID_OPERATION' is generated if TYPE is one of
9915`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9916`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9917`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9918`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9919FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
9920
9921`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9922bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9923store is currently mapped.
9924
9925`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9926bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9927to the buffer object such that the memory writes required would exceed
9928the data store size.
9929
9930`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9931bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
9932evenly divisible into the number of bytes needed to store in memory a
9933datum indicated by TYPE.
9934
9935`GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
9936executed between the execution of `glBegin' and the corresponding
9937execution of `glEnd'.")
9938
9939(define-gl-procedure
9940 glGetShaderInfoLog
9941 "glGetShaderInfoLog"
9942 (funcsynopsis
9943 (funcprototype
9944 (funcdef "void " (function "glGetShaderInfoLog"))
9945 (paramdef "GLuint " (parameter "shader"))
9946 (paramdef "GLsizei " (parameter "maxLength"))
9947 (paramdef "GLsizei *" (parameter "length"))
9948 (paramdef "GLchar *" (parameter "infoLog"))))
9949 "Returns the information log for a shader object.
9950
9951SHADER
9952 Specifies the shader object whose information log is to be queried.
9953
9954MAXLENGTH
9955 Specifies the size of the character buffer for storing the returned
9956 information log.
9957
9958LENGTH
9959 Returns the length of the string returned in INFOLOG (excluding the
9960 null terminator).
9961
9962INFOLOG
9963 Specifies an array of characters that is used to return the
9964 information log.
9965
9966`glGetShaderInfoLog' returns the information log for the specified
9967shader object. The information log for a shader object is modified when
9968the shader is compiled. The string that is returned will be null
9969terminated.
9970
9971`glGetShaderInfoLog' returns in INFOLOG as much of the information log
9972as it can, up to a maximum of MAXLENGTH characters. The number of
9973characters actually returned, excluding the null termination character,
9974is specified by LENGTH. If the length of the returned string is not
9975required, a value of `NULL' can be passed in the LENGTH argument. The
9976size of the buffer required to store the returned information log can be
9977obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
9978
9979The information log for a shader object is a string that may contain
9980diagnostic messages, warning messages, and other information about the
9981last compile operation. When a shader object is created, its information
9982log will be a string of length 0.
9983
9984`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
9985OpenGL.
9986
9987`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
9988
9989`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
9990
9991`GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
9992between the execution of `glBegin' and the corresponding execution of
9993`glEnd'.")
9994
9995(define-gl-procedure
9996 glGetShaderSource
9997 "glGetShaderSource"
9998 (funcsynopsis
9999 (funcprototype
10000 (funcdef "void " (function "glGetShaderSource"))
10001 (paramdef "GLuint " (parameter "shader"))
8925f36f
AW
10002 (paramdef "GLsizei " (parameter "bufSize"))
10003 (paramdef "GLsizei *" (parameter "length"))
3c9b6116
AW
10004 (paramdef "GLchar *" (parameter "source"))))
10005 "Returns the source code string from a shader object.
10006
10007SHADER
10008 Specifies the shader object to be queried.
10009
10010BUFSIZE
10011 Specifies the size of the character buffer for storing the returned
10012 source code string.
10013
10014LENGTH
10015 Returns the length of the string returned in SOURCE (excluding the
10016 null terminator).
10017
10018SOURCE
10019 Specifies an array of characters that is used to return the source
10020 code string.
10021
10022`glGetShaderSource' returns the concatenation of the source code strings
10023from the shader object specified by SHADER. The source code strings for
10024a shader object are the result of a previous call to `glShaderSource'.
10025The string returned by the function will be null terminated.
10026
10027`glGetShaderSource' returns in SOURCE as much of the source code string
10028as it can, up to a maximum of BUFSIZE characters. The number of
10029characters actually returned, excluding the null termination character,
10030is specified by LENGTH. If the length of the returned string is not
10031required, a value of `NULL' can be passed in the LENGTH argument. The
10032size of the buffer required to store the returned source code string can
10033be obtained by calling `glGetShader' with the value
10034`GL_SHADER_SOURCE_LENGTH'.
10035
10036`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
10037OpenGL.
10038
10039`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
10040
10041`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
10042
10043`GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
10044between the execution of `glBegin' and the corresponding execution of
10045`glEnd'.")
10046
10047(define-gl-procedure
10048 glGetShaderiv
10049 "glGetShaderiv"
10050 (funcsynopsis
10051 (funcprototype
10052 (funcdef "void " (function "glGetShaderiv"))
10053 (paramdef "GLuint " (parameter "shader"))
10054 (paramdef "GLenum " (parameter "pname"))
10055 (paramdef "GLint *" (parameter "params"))))
10056 "Returns a parameter from a shader object.
10057
10058SHADER
10059 Specifies the shader object to be queried.
10060
10061PNAME
10062 Specifies the object parameter. Accepted symbolic names are
10063 `GL_SHADER_TYPE', `GL_DELETE_STATUS', `GL_COMPILE_STATUS',
10064 `GL_INFO_LOG_LENGTH', `GL_SHADER_SOURCE_LENGTH'.
10065
10066PARAMS
10067 Returns the requested object parameter.
10068
10069`glGetShader' returns in PARAMS the value of a parameter for a specific
10070shader object. The following parameters are defined:
10071
10072`GL_SHADER_TYPE'
10073 PARAMS returns `GL_VERTEX_SHADER' if SHADER is a vertex shader
10074 object, and `GL_FRAGMENT_SHADER' if SHADER is a fragment shader
10075 object.
10076
10077`GL_DELETE_STATUS'
10078 PARAMS returns `GL_TRUE' if SHADER is currently flagged for
10079 deletion, and `GL_FALSE' otherwise.
10080
10081`GL_COMPILE_STATUS'
10082 PARAMS returns `GL_TRUE' if the last compile operation on SHADER
10083 was successful, and `GL_FALSE' otherwise.
10084
10085`GL_INFO_LOG_LENGTH'
10086 PARAMS returns the number of characters in the information log for
10087 SHADER including the null termination character (i.e., the size of
10088 the character buffer required to store the information log). If
10089 SHADER has no information log, a value of 0 is returned.
10090
10091`GL_SHADER_SOURCE_LENGTH'
10092 PARAMS returns the length of the concatenation of the source
10093 strings that make up the shader source for the SHADER, including
10094 the null termination character. (i.e., the size of the character
10095 buffer required to store the shader source). If no source code
10096 exists, 0 is returned.
10097
10098`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
10099OpenGL.
10100
10101`GL_INVALID_OPERATION' is generated if SHADER does not refer to a shader
10102object.
10103
10104`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
10105
10106`GL_INVALID_OPERATION' is generated if `glGetShader' is executed between
10107the execution of `glBegin' and the corresponding execution of `glEnd'.")
10108
10109(define-gl-procedure
10110 glGetString
10111 "glGetString"
10112 (funcsynopsis
10113 (funcprototype
10114 (funcdef
10115 "const GLubyte* "
10116 (function "glGetString"))
10117 (paramdef "GLenum " (parameter "name"))))
10118 "Return a string describing the current GL connection.
10119
10120NAME
10121 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
10122 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
10123
10124`glGetString' returns a pointer to a static string describing some
10125aspect of the current GL connection. NAME can be one of the following:
10126
10127`GL_VENDOR'
10128
10129
10130 Returns the company responsible for this GL implementation. This
10131 name does not change from release to release.
10132
10133`GL_RENDERER'
10134
10135
10136 Returns the name of the renderer. This name is typically specific
10137 to a particular configuration of a hardware platform. It does not
10138 change from release to release.
10139
10140`GL_VERSION'
10141
10142
10143 Returns a version or release number.
10144
10145`GL_SHADING_LANGUAGE_VERSION'
10146
10147
10148 Returns a version or release number for the shading language.
10149
10150`GL_EXTENSIONS'
10151
10152
10153 Returns a space-separated list of supported extensions to GL.
10154
10155Because the GL does not include queries for the performance
10156characteristics of an implementation, some applications are written to
10157recognize known platforms and modify their GL usage based on known
10158performance characteristics of these platforms. Strings `GL_VENDOR' and
10159`GL_RENDERER' together uniquely specify a platform. They do not change
10160from release to release and should be used by platform-recognition
10161algorithms.
10162
10163Some applications want to make use of features that are not part of the
10164standard GL. These features may be implemented as extensions to the
10165standard GL. The `GL_EXTENSIONS' string is a space-separated list of
10166supported GL extensions. (Extension names never contain a space
10167character.)
10168
10169The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
10170version number. The version number uses one of these forms:
10171
10172MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
10173
10174Vendor-specific information may follow the version number. Its format
10175depends on the implementation, but a space always separates the version
10176number and the vendor-specific information.
10177
10178All strings are null-terminated.
10179
10180`GL_INVALID_ENUM' is generated if NAME is not an accepted value.
10181
10182`GL_INVALID_OPERATION' is generated if `glGetString' is executed between
10183the execution of `glBegin' and the corresponding execution of `glEnd'.")
10184
10185(define-gl-procedure
10186 glGetTexEnv
10187 "glGetTexEnv"
10188 (funcsynopsis
10189 (funcprototype
10190 (funcdef "void " (function "glGetTexEnvfv"))
10191 (paramdef "GLenum " (parameter "target"))
10192 (paramdef "GLenum " (parameter "pname"))
10193 (paramdef "GLfloat * " (parameter "params"))))
10194 "Return texture environment parameters.
10195
10196TARGET
10197 Specifies a texture environment. May be `GL_TEXTURE_ENV',
10198 `GL_TEXTURE_FILTER_CONTROL', or `GL_POINT_SPRITE'.
10199
10200PNAME
10201 Specifies the symbolic name of a texture environment parameter.
10202 Accepted values are `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
10203 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
10204 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
10205 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
10206 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
10207 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
10208 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
10209
10210PARAMS
10211 Returns the requested data.
10212
10213`glGetTexEnv' returns in PARAMS selected values of a texture environment
10214that was specified with `glTexEnv'. TARGET specifies a texture
10215environment.
10216
10217When TARGET is `GL_TEXTURE_FILTER_CONTROL', PNAME must be
10218`GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_POINT_SPRITE', PNAME must be
10219`GL_COORD_REPLACE'. When TARGET is `GL_TEXTURE_ENV', PNAME can be
10220`GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR', `GL_COMBINE_RGB',
10221`GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE', `GL_SRC0_RGB',
10222`GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', `GL_SRC1_ALPHA', or
10223`GL_SRC2_ALPHA'.
10224
10225PNAME names a specific texture environment parameter, as follows:
10226
10227`GL_TEXTURE_ENV_MODE'
10228 PARAMS returns the single-valued texture environment mode, a
10229 symbolic constant. The initial value is `GL_MODULATE'.
10230
10231`GL_TEXTURE_ENV_COLOR'
10232 PARAMS returns four integer or floating-point values that are the
10233 texture environment color. Integer values, when requested, are
10234 linearly mapped from the internal floating-point representation
10235 such that 1.0 maps to the most positive representable integer, and
10236 -1.0 maps to the most negative representable integer. The initial
10237 value is (0, 0, 0, 0).
10238
10239`GL_TEXTURE_LOD_BIAS'
10240 PARAMS returns a single floating-point value that is the texture
10241 level-of-detail bias. The initial value is 0.
10242
10243`GL_COMBINE_RGB'
10244 PARAMS returns a single symbolic constant value representing the
10245 current RGB combine mode. The initial value is `GL_MODULATE'.
10246
10247`GL_COMBINE_ALPHA'
10248 PARAMS returns a single symbolic constant value representing the
10249 current alpha combine mode. The initial value is `GL_MODULATE'.
10250
10251`GL_SRC0_RGB'
10252 PARAMS returns a single symbolic constant value representing the
10253 texture combiner zero's RGB source. The initial value is
10254 `GL_TEXTURE'.
10255
10256`GL_SRC1_RGB'
10257 PARAMS returns a single symbolic constant value representing the
10258 texture combiner one's RGB source. The initial value is
10259 `GL_PREVIOUS'.
10260
10261`GL_SRC2_RGB'
10262 PARAMS returns a single symbolic constant value representing the
10263 texture combiner two's RGB source. The initial value is
10264 `GL_CONSTANT'.
10265
10266`GL_SRC0_ALPHA'
10267 PARAMS returns a single symbolic constant value representing the
10268 texture combiner zero's alpha source. The initial value is
10269 `GL_TEXTURE'.
10270
10271`GL_SRC1_ALPHA'
10272 PARAMS returns a single symbolic constant value representing the
10273 texture combiner one's alpha source. The initial value is
10274 `GL_PREVIOUS'.
10275
10276`GL_SRC2_ALPHA'
10277 PARAMS returns a single symbolic constant value representing the
10278 texture combiner two's alpha source. The initial value is
10279 `GL_CONSTANT'.
10280
10281`GL_OPERAND0_RGB'
10282 PARAMS returns a single symbolic constant value representing the
10283 texture combiner zero's RGB operand. The initial value is
10284 `GL_SRC_COLOR'.
10285
10286`GL_OPERAND1_RGB'
10287 PARAMS returns a single symbolic constant value representing the
10288 texture combiner one's RGB operand. The initial value is
10289 `GL_SRC_COLOR'.
10290
10291`GL_OPERAND2_RGB'
10292 PARAMS returns a single symbolic constant value representing the
10293 texture combiner two's RGB operand. The initial value is
10294 `GL_SRC_ALPHA'.
10295
10296`GL_OPERAND0_ALPHA'
10297 PARAMS returns a single symbolic constant value representing the
10298 texture combiner zero's alpha operand. The initial value is
10299 `GL_SRC_ALPHA'.
10300
10301`GL_OPERAND1_ALPHA'
10302 PARAMS returns a single symbolic constant value representing the
10303 texture combiner one's alpha operand. The initial value is
10304 `GL_SRC_ALPHA'.
10305
10306`GL_OPERAND2_ALPHA'
10307 PARAMS returns a single symbolic constant value representing the
10308 texture combiner two's alpha operand. The initial value is
10309 `GL_SRC_ALPHA'.
10310
10311`GL_RGB_SCALE'
10312 PARAMS returns a single floating-point value representing the
10313 current RGB texture combiner scaling factor. The initial value is
10314 1.0.
10315
10316`GL_ALPHA_SCALE'
10317 PARAMS returns a single floating-point value representing the
10318 current alpha texture combiner scaling factor. The initial value is
10319 1.0.
10320
10321`GL_COORD_REPLACE'
10322 PARAMS returns a single boolean value representing the current
10323 point sprite texture coordinate replacement enable state. The
10324 initial value is `GL_FALSE'.
10325
10326`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10327value.
10328
10329`GL_INVALID_OPERATION' is generated if `glGetTexEnv' is executed between
10330the execution of `glBegin' and the corresponding execution of `glEnd'.")
10331
10332(define-gl-procedure
10333 glGetTexGen
10334 "glGetTexGen"
10335 (funcsynopsis
10336 (funcprototype
10337 (funcdef "void " (function "glGetTexGendv"))
10338 (paramdef "GLenum " (parameter "coord"))
10339 (paramdef "GLenum " (parameter "pname"))
10340 (paramdef "GLdouble * " (parameter "params"))))
10341 "Return texture coordinate generation parameters.
10342
10343COORD
10344 Specifies a texture coordinate. Must be `GL_S', `GL_T', `GL_R', or
10345 `GL_Q'.
10346
10347PNAME
10348 Specifies the symbolic name of the value(s) to be returned. Must be
10349 either `GL_TEXTURE_GEN_MODE' or the name of one of the texture
10350 generation plane equations: `GL_OBJECT_PLANE' or `GL_EYE_PLANE'.
10351
10352PARAMS
10353 Returns the requested data.
10354
10355`glGetTexGen' returns in PARAMS selected parameters of a texture
10356coordinate generation function that was specified using `glTexGen'.
10357COORD names one of the (S, T, R, Q) texture coordinates, using the
10358symbolic constant `GL_S', `GL_T', `GL_R', or `GL_Q'.
10359
10360PNAME specifies one of three symbolic names:
10361
10362`GL_TEXTURE_GEN_MODE'
10363 PARAMS returns the single-valued texture generation function, a
10364 symbolic constant. The initial value is `GL_EYE_LINEAR'.
10365
10366`GL_OBJECT_PLANE'
10367 PARAMS returns the four plane equation coefficients that specify
10368 object linear-coordinate generation. Integer values, when
10369 requested, are mapped directly from the internal floating-point
10370 representation.
10371
10372`GL_EYE_PLANE'
10373 PARAMS returns the four plane equation coefficients that specify
10374 eye linear-coordinate generation. Integer values, when requested,
10375 are mapped directly from the internal floating-point
10376 representation. The returned values are those maintained in eye
10377 coordinates. They are not equal to the values specified using
10378 `glTexGen', unless the modelview matrix was identity when
10379 `glTexGen' was called.
10380
10381`GL_INVALID_ENUM' is generated if COORD or PNAME is not an accepted
10382value.
10383
10384`GL_INVALID_OPERATION' is generated if `glGetTexGen' is executed between
10385the execution of `glBegin' and the corresponding execution of `glEnd'.")
10386
10387(define-gl-procedure
10388 glGetTexImage
10389 "glGetTexImage"
10390 (funcsynopsis
10391 (funcprototype
10392 (funcdef "void " (function "glGetTexImage"))
10393 (paramdef "GLenum " (parameter "target"))
10394 (paramdef "GLint " (parameter "level"))
10395 (paramdef "GLenum " (parameter "format"))
10396 (paramdef "GLenum " (parameter "type"))
10397 (paramdef "GLvoid * " (parameter "img"))))
10398 "Return a texture image.
10399
10400TARGET
10401 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
10402 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10403 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10404 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10405 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
10406
10407LEVEL
10408 Specifies the level-of-detail number of the desired image. Level 0
10409 is the base image level. Level N is the N th mipmap reduction
10410 image.
10411
10412FORMAT
10413 Specifies a pixel format for the returned data. The supported
10414 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
10415 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
10416 `GL_LUMINANCE_ALPHA'.
10417
10418TYPE
10419 Specifies a pixel type for the returned data. The supported types
10420 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
10421 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
10422 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
10423 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
10424 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
10425 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
10426 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
10427 `GL_UNSIGNED_INT_2_10_10_10_REV'.
10428
10429IMG
10430 Returns the texture image. Should be a pointer to an array of the
10431 type specified by TYPE.
10432
10433`glGetTexImage' returns a texture image into IMG. TARGET specifies
10434whether the desired texture image is one specified by `glTexImage1D'
10435(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
10436`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
10437specifies the level-of-detail number of the desired image. FORMAT and
10438TYPE specify the format and type of the desired image array. See the
10439reference pages `glTexImage1D' and `glDrawPixels' for a description of
10440the acceptable values for the FORMAT and TYPE parameters, respectively.
10441
10442If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
10443target (see `glBindBuffer') while a texture image is requested, IMG is
10444treated as a byte offset into the buffer object's data store.
10445
10446To understand the operation of `glGetTexImage', consider the selected
10447internal four-component texture image to be an RGBA color buffer the
10448size of the image. The semantics of `glGetTexImage' are then identical
10449to those of `glReadPixels', with the exception that no pixel transfer
10450operations are performed, when called with the same FORMAT and TYPE,
10451with X and Y set to 0, WIDTH set to the width of the texture image
10452(including border if one was specified), and HEIGHT set to 1 for 1D
10453images, or to the height of the texture image (including border if one
10454was specified) for 2D images. Because the internal texture image is an
10455RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
10456`GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
10457accepted.
10458
10459If the selected texture image does not contain four components, the
10460following mappings are applied. Single-component textures are treated as
10461RGBA buffers with red set to the single-component value, green set to 0,
10462blue set to 0, and alpha set to 1. Two-component textures are treated as
10463RGBA buffers with red set to the value of component zero, alpha set to
10464the value of component one, and green and blue set to 0. Finally,
10465three-component textures are treated as RGBA buffers with red set to
10466component zero, green set to component one, blue set to component two,
10467and alpha set to 1.
10468
10469To determine the required size of IMG, use `glGetTexLevelParameter' to
10470determine the dimensions of the internal texture image, then scale the
10471required number of pixels by the storage required for each pixel, based
10472on FORMAT and TYPE. Be sure to take the pixel storage parameters into
10473account, especially `GL_PACK_ALIGNMENT'.
10474
10475`GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
10476accepted value.
10477
10478`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10479
10480`GL_INVALID_VALUE' may be generated if LEVEL is greater than
10481LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10482
10483`GL_INVALID_OPERATION' is returned if TYPE is one of
10484`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
10485`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
10486is not `GL_RGB'.
10487
10488`GL_INVALID_OPERATION' is returned if TYPE is one of
10489`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
10490`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
10491`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
10492`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
10493FORMAT is neither `GL_RGBA' or `GL_BGRA'.
10494
10495`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10496bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
10497store is currently mapped.
10498
10499`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10500bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
10501to the buffer object such that the memory writes required would exceed
10502the data store size.
10503
10504`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10505bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
10506divisible into the number of bytes needed to store in memory a datum
10507indicated by TYPE.
10508
10509`GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
10510between the execution of `glBegin' and the corresponding execution of
10511`glEnd'.")
10512
10513(define-gl-procedure
10514 glGetTexLevelParameter
10515 "glGetTexLevelParameter"
10516 (funcsynopsis
10517 (funcprototype
10518 (funcdef
10519 "void "
10520 (function "glGetTexLevelParameterfv"))
10521 (paramdef "GLenum " (parameter "target"))
10522 (paramdef "GLint " (parameter "level"))
10523 (paramdef "GLenum " (parameter "pname"))
10524 (paramdef "GLfloat * " (parameter "params"))))
10525 "Return texture parameter values for a specific level of detail.
10526
10527TARGET
10528 Specifies the symbolic name of the target texture, either
10529 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D',
10530 `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10531 `GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10532 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10533 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10534 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10535
10536LEVEL
10537 Specifies the level-of-detail number of the desired image. Level 0
10538 is the base image level. Level N is the N th mipmap reduction
10539 image.
10540
10541PNAME
10542 Specifies the symbolic name of a texture parameter.
10543 `GL_TEXTURE_WIDTH', `GL_TEXTURE_HEIGHT', `GL_TEXTURE_DEPTH',
10544 `GL_TEXTURE_INTERNAL_FORMAT', `GL_TEXTURE_BORDER',
10545 `GL_TEXTURE_RED_SIZE', `GL_TEXTURE_GREEN_SIZE',
10546 `GL_TEXTURE_BLUE_SIZE', `GL_TEXTURE_ALPHA_SIZE',
10547 `GL_TEXTURE_LUMINANCE_SIZE', `GL_TEXTURE_INTENSITY_SIZE',
10548 `GL_TEXTURE_DEPTH_SIZE', `GL_TEXTURE_COMPRESSED', and
10549 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' are accepted.
10550
10551PARAMS
10552 Returns the requested data.
10553
10554`glGetTexLevelParameter' returns in PARAMS texture parameter values for
10555a specific level-of-detail value, specified as LEVEL. TARGET defines the
10556target texture, either `GL_TEXTURE_1D', `GL_TEXTURE_2D',
10557`GL_TEXTURE_3D', `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10558`GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10559`GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10560`GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10561`GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10562
10563`GL_MAX_TEXTURE_SIZE', and `GL_MAX_3D_TEXTURE_SIZE' are not really
10564descriptive enough. It has to report the largest square texture image
10565that can be accommodated with mipmaps and borders, but a long skinny
10566texture, or a texture without mipmaps and borders, may easily fit in
10567texture memory. The proxy targets allow the user to more accurately
10568query whether the GL can accommodate a texture of a given configuration.
10569If the texture cannot be accommodated, the texture state variables,
10570which may be queried with `glGetTexLevelParameter', are set to 0. If the
10571texture can be accommodated, the texture state values will be set as
10572they would be set for a non-proxy target.
10573
10574PNAME specifies the texture parameter whose value or values will be
10575returned.
10576
10577The accepted parameter names are as follows:
10578
10579`GL_TEXTURE_WIDTH'
10580
10581
10582 PARAMS returns a single value, the width of the texture image. This
10583 value includes the border of the texture image. The initial value
10584 is 0.
10585
10586`GL_TEXTURE_HEIGHT'
10587
10588
10589 PARAMS returns a single value, the height of the texture image.
10590 This value includes the border of the texture image. The initial
10591 value is 0.
10592
10593`GL_TEXTURE_DEPTH'
10594
10595
10596 PARAMS returns a single value, the depth of the texture image. This
10597 value includes the border of the texture image. The initial value
10598 is 0.
10599
10600`GL_TEXTURE_INTERNAL_FORMAT'
10601
10602
10603 PARAMS returns a single value, the internal format of the texture
10604 image.
10605
10606`GL_TEXTURE_BORDER'
10607
10608
10609 PARAMS returns a single value, the width in pixels of the border of
10610 the texture image. The initial value is 0.
10611
10612`GL_TEXTURE_RED_SIZE',
10613`GL_TEXTURE_GREEN_SIZE',
10614`GL_TEXTURE_BLUE_SIZE',
10615`GL_TEXTURE_ALPHA_SIZE',
10616`GL_TEXTURE_LUMINANCE_SIZE',
10617`GL_TEXTURE_INTENSITY_SIZE',
10618`GL_TEXTURE_DEPTH_SIZE'
10619
10620
10621 The internal storage resolution of an individual component. The
10622 resolution chosen by the GL will be a close match for the
10623 resolution requested by the user with the component argument of
10624 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
10625 and `glCopyTexImage2D'. The initial value is 0.
10626
10627`GL_TEXTURE_COMPRESSED'
10628
10629
10630 PARAMS returns a single boolean value indicating if the texture
10631 image is stored in a compressed internal format. The initiali value
10632 is `GL_FALSE'.
10633
10634`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'
10635
10636
10637 PARAMS returns a single integer value, the number of unsigned bytes
10638 of the compressed texture image that would be returned from
10639 `glGetCompressedTexImage'.
10640
10641`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10642value.
10643
10644`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10645
10646`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
10647where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10648
10649`GL_INVALID_OPERATION' is generated if `glGetTexLevelParameter' is
10650executed between the execution of `glBegin' and the corresponding
10651execution of `glEnd'.
10652
10653`GL_INVALID_OPERATION' is generated if
10654`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' is queried on texture images with an
10655uncompressed internal format or on proxy targets.")
10656
10657(define-gl-procedure
10658 glGetTexParameter
10659 "glGetTexParameter"
10660 (funcsynopsis
10661 (funcprototype
10662 (funcdef
10663 "void "
10664 (function "glGetTexParameterfv"))
10665 (paramdef "GLenum " (parameter "target"))
10666 (paramdef "GLenum " (parameter "pname"))
10667 (paramdef "GLfloat * " (parameter "params"))))
10668 "Return texture parameter values.
10669
10670TARGET
10671 Specifies the symbolic name of the target texture. `GL_TEXTURE_1D',
10672 `GL_TEXTURE_2D', `GL_TEXTURE_3D', and `GL_TEXTURE_CUBE_MAP' are
10673 accepted.
10674
10675PNAME
10676 Specifies the symbolic name of a texture parameter.
10677 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_FILTER',
10678 `GL_TEXTURE_MIN_LOD', `GL_TEXTURE_MAX_LOD',
10679 `GL_TEXTURE_BASE_LEVEL', `GL_TEXTURE_MAX_LEVEL',
10680 `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T', `GL_TEXTURE_WRAP_R',
10681 `GL_TEXTURE_BORDER_COLOR', `GL_TEXTURE_PRIORITY',
10682 `GL_TEXTURE_RESIDENT', `GL_TEXTURE_COMPARE_MODE',
10683 `GL_TEXTURE_COMPARE_FUNC', `GL_DEPTH_TEXTURE_MODE', and
10684 `GL_GENERATE_MIPMAP' are accepted.
10685
10686PARAMS
10687 Returns the texture parameters.
10688
10689`glGetTexParameter' returns in PARAMS the value or values of the texture
10690parameter specified as PNAME. TARGET defines the target texture, either
10691`GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
10692`GL_TEXTURE_CUBE_MAP', to specify one-, two-, or three-dimensional or
10693cube-mapped texturing. PNAME accepts the same symbols as
10694`glTexParameter', with the same interpretations:
10695
10696`GL_TEXTURE_MAG_FILTER'
10697 Returns the single-valued texture magnification filter, a symbolic
10698 constant. The initial value is `GL_LINEAR'.
10699
10700`GL_TEXTURE_MIN_FILTER'
10701 Returns the single-valued texture minification filter, a symbolic
10702 constant. The initial value is `GL_NEAREST_MIPMAP_LINEAR'.
10703
10704`GL_TEXTURE_MIN_LOD'
10705 Returns the single-valued texture minimum level-of-detail value.
10706 The initial value is -1000 .
10707
10708`GL_TEXTURE_MAX_LOD'
10709 Returns the single-valued texture maximum level-of-detail value.
10710 The initial value is 1000.
10711
10712`GL_TEXTURE_BASE_LEVEL'
10713 Returns the single-valued base texture mipmap level. The initial
10714 value is 0.
10715
10716`GL_TEXTURE_MAX_LEVEL'
10717 Returns the single-valued maximum texture mipmap array level. The
10718 initial value is 1000.
10719
10720`GL_TEXTURE_WRAP_S'
10721 Returns the single-valued wrapping function for texture coordinate
10722 S , a symbolic constant. The initial value is `GL_REPEAT'.
10723
10724`GL_TEXTURE_WRAP_T'
10725 Returns the single-valued wrapping function for texture coordinate
10726 T , a symbolic constant. The initial value is `GL_REPEAT'.
10727
10728`GL_TEXTURE_WRAP_R'
10729 Returns the single-valued wrapping function for texture coordinate
10730 R , a symbolic constant. The initial value is `GL_REPEAT'.
10731
10732`GL_TEXTURE_BORDER_COLOR'
10733 Returns four integer or floating-point numbers that comprise the
10734 RGBA color of the texture border. Floating-point values are
10735 returned in the range [0,1] . Integer values are returned as a
10736 linear mapping of the internal floating-point representation such
10737 that 1.0 maps to the most positive representable integer and -1.0
10738 maps to the most negative representable integer. The initial value
10739 is (0, 0, 0, 0).
10740
10741`GL_TEXTURE_PRIORITY'
10742 Returns the residence priority of the target texture (or the named
10743 texture bound to it). The initial value is 1. See
10744 `glPrioritizeTextures'.
10745
10746`GL_TEXTURE_RESIDENT'
10747 Returns the residence status of the target texture. If the value
10748 returned in PARAMS is `GL_TRUE', the texture is resident in texture
10749 memory. See `glAreTexturesResident'.
10750
10751`GL_TEXTURE_COMPARE_MODE'
10752 Returns a single-valued texture comparison mode, a symbolic
10753 constant. The initial value is `GL_NONE'. See `glTexParameter'.
10754
10755`GL_TEXTURE_COMPARE_FUNC'
10756 Returns a single-valued texture comparison function, a symbolic
10757 constant. The initial value is `GL_LEQUAL'. See `glTexParameter'.
10758
10759`GL_DEPTH_TEXTURE_MODE'
10760 Returns a single-valued texture format indicating how the depth
10761 values should be converted into color components. The initial value
10762 is `GL_LUMINANCE'. See `glTexParameter'.
10763
10764`GL_GENERATE_MIPMAP'
10765 Returns a single boolean value indicating if automatic mipmap level
10766 updates are enabled. See `glTexParameter'.
10767
10768`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10769value.
10770
10771`GL_INVALID_OPERATION' is generated if `glGetTexParameter' is executed
10772between the execution of `glBegin' and the corresponding execution of
10773`glEnd'.")
10774
10775(define-gl-procedure
10776 glGetUniformLocation
10777 "glGetUniformLocation"
10778 (funcsynopsis
10779 (funcprototype
10780 (funcdef
10781 "GLint "
10782 (function "glGetUniformLocation"))
10783 (paramdef "GLuint " (parameter "program"))
10784 (paramdef "const GLchar *" (parameter "name"))))
10785 "Returns the location of a uniform variable.
10786
10787PROGRAM
10788 Specifies the program object to be queried.
10789
10790NAME
10791 Points to a null terminated string containing the name of the
10792 uniform variable whose location is to be queried.
10793
10794`glGetUniformLocation ' returns an integer that represents the location
10795of a specific uniform variable within a program object. NAME must be a
10796null terminated string that contains no white space. NAME must be an
10797active uniform variable name in PROGRAM that is not a structure, an
10798array of structures, or a subcomponent of a vector or a matrix. This
10799function returns -1 if NAME does not correspond to an active uniform
10800variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
10801
10802Uniform variables that are structures or arrays of structures may be
10803queried by calling `glGetUniformLocation' for each field within the
10804structure. The array element operator \"[]\" and the structure field
10805operator \".\" may be used in NAME in order to select elements within an
10806array or fields within a structure. The result of using these operators
10807is not allowed to be another structure, an array of structures, or a
10808subcomponent of a vector or a matrix. Except if the last part of NAME
10809indicates a uniform variable array, the location of the first element of
10810an array can be retrieved by using the name of the array, or by using
10811the name appended by \"[0]\".
10812
10813The actual locations assigned to uniform variables are not known until
10814the program object is linked successfully. After linking has occurred,
10815the command `glGetUniformLocation' can be used to obtain the location of
10816a uniform variable. This location value can then be passed to
10817`glUniform' to set the value of the uniform variable or to
10818`glGetUniform' in order to query the current value of the uniform
10819variable. After a program object has been linked successfully, the index
10820values for uniform variables remain fixed until the next link command
10821occurs. Uniform variable locations and values can only be queried after
10822a link if the link was successful.
10823
10824`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10825OpenGL.
10826
10827`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10828
10829`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
10830linked.
10831
10832`GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
10833executed between the execution of `glBegin' and the corresponding
10834execution of `glEnd'.")
10835
10836(define-gl-procedure
10837 glGetUniformfv
10838 "glGetUniformfv"
10839 (funcsynopsis
10840 (funcprototype
10841 (funcdef "void " (function "glGetUniformfv"))
10842 (paramdef "GLuint " (parameter "program"))
10843 (paramdef "GLint " (parameter "location"))
10844 (paramdef "GLfloat *" (parameter "params")))
10845 (funcprototype
10846 (funcdef "void " (function "glGetUniformiv"))
10847 (paramdef "GLuint " (parameter "program"))
10848 (paramdef "GLint " (parameter "location"))
10849 (paramdef "GLint *" (parameter "params"))))
10850 "Returns the value of a uniform variable.
10851
10852PROGRAM
10853 Specifies the program object to be queried.
10854
10855LOCATION
10856 Specifies the location of the uniform variable to be queried.
10857
10858PARAMS
10859 Returns the value of the specified uniform variable.
10860
10861`glGetUniform' returns in PARAMS the value(s) of the specified uniform
10862variable. The type of the uniform variable specified by LOCATION
10863determines the number of values returned. If the uniform variable is
10864defined in the shader as a boolean, int, or float, a single value will
10865be returned. If it is defined as a vec2, ivec2, or bvec2, two values
10866will be returned. If it is defined as a vec3, ivec3, or bvec3, three
10867values will be returned, and so on. To query values stored in uniform
10868variables declared as arrays, call `glGetUniform' for each element of
10869the array. To query values stored in uniform variables declared as
10870structures, call `glGetUniform' for each field in the structure. The
10871values for uniform variables declared as a matrix will be returned in
10872column major order.
10873
10874The locations assigned to uniform variables are not known until the
10875program object is linked. After linking has occurred, the command
10876`glGetUniformLocation' can be used to obtain the location of a uniform
10877variable. This location value can then be passed to `glGetUniform' in
10878order to query the current value of the uniform variable. After a
10879program object has been linked successfully, the index values for
10880uniform variables remain fixed until the next link command occurs. The
10881uniform variable values can only be queried after a link if the link was
10882successful.
10883
10884`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10885OpenGL.
10886
10887`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10888
10889`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
10890linked.
10891
10892`GL_INVALID_OPERATION' is generated if LOCATION does not correspond to a
10893valid uniform variable location for the specified program object.
10894
10895`GL_INVALID_OPERATION' is generated if `glGetUniform' is executed
10896between the execution of `glBegin' and the corresponding execution of
10897`glEnd'.")
10898
10899(define-gl-procedure
10900 glGetVertexAttribPointerv
10901 "glGetVertexAttribPointerv"
10902 (funcsynopsis
10903 (funcprototype
10904 (funcdef
10905 "void "
10906 (function "glGetVertexAttribPointerv"))
10907 (paramdef "GLuint " (parameter "index"))
10908 (paramdef "GLenum " (parameter "pname"))
10909 (paramdef "GLvoid **" (parameter "pointer"))))
10910 "Return the address of the specified generic vertex attribute pointer.
10911
10912INDEX
10913 Specifies the generic vertex attribute parameter to be returned.
10914
10915PNAME
10916 Specifies the symbolic name of the generic vertex attribute
10917 parameter to be returned. Must be `GL_VERTEX_ATTRIB_ARRAY_POINTER'.
10918
10919POINTER
10920 Returns the pointer value.
10921
10922`glGetVertexAttribPointerv' returns pointer information. INDEX is the
10923generic vertex attribute to be queried, PNAME is a symbolic constant
10924indicating the pointer to be returned, and PARAMS is a pointer to a
10925location in which to place the returned data.
10926
10927If a non-zero named buffer object was bound to the `GL_ARRAY_BUFFER'
10928target (see `glBindBuffer') when the desired pointer was previously
10929specified, the POINTER returned is a byte offset into the buffer
10930object's data store.
10931
10932`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
10933`GL_MAX_VERTEX_ATTRIBS'.
10934
10935`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
10936
10937(define-gl-procedure
10938 glGetVertexAttribdv
10939 "glGetVertexAttribdv"
10940 (funcsynopsis
10941 (funcprototype
10942 (funcdef
10943 "void "
10944 (function "glGetVertexAttribdv"))
10945 (paramdef "GLuint " (parameter "index"))
10946 (paramdef "GLenum " (parameter "pname"))
10947 (paramdef "GLdouble *" (parameter "params")))
10948 (funcprototype
10949 (funcdef
10950 "void "
10951 (function "glGetVertexAttribfv"))
10952 (paramdef "GLuint " (parameter "index"))
10953 (paramdef "GLenum " (parameter "pname"))
10954 (paramdef "GLfloat *" (parameter "params")))
10955 (funcprototype
10956 (funcdef
10957 "void "
10958 (function "glGetVertexAttribiv"))
10959 (paramdef "GLuint " (parameter "index"))
10960 (paramdef "GLenum " (parameter "pname"))
10961 (paramdef "GLint *" (parameter "params"))))
10962 "Return a generic vertex attribute parameter.
10963
10964INDEX
10965 Specifies the generic vertex attribute parameter to be queried.
10966
10967PNAME
10968 Specifies the symbolic name of the vertex attribute parameter to be
10969 queried. Accepted values are
10970 `GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING',
10971 `GL_VERTEX_ATTRIB_ARRAY_ENABLED', `GL_VERTEX_ATTRIB_ARRAY_SIZE',
10972 `GL_VERTEX_ATTRIB_ARRAY_STRIDE', `GL_VERTEX_ATTRIB_ARRAY_TYPE',
10973 `GL_VERTEX_ATTRIB_ARRAY_NORMALIZED', or `GL_CURRENT_VERTEX_ATTRIB'.
10974
10975PARAMS
10976 Returns the requested data.
10977
10978`glGetVertexAttrib' returns in PARAMS the value of a generic vertex
10979attribute parameter. The generic vertex attribute to be queried is
10980specified by INDEX, and the parameter to be queried is specified by
10981PNAME.
10982
10983The accepted parameter names are as follows:
10984
10985`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING'
10986
10987
10988 PARAMS returns a single value, the name of the buffer object
10989 currently bound to the binding point corresponding to generic
10990 vertex attribute array INDEX. If no buffer object is bound, 0 is
10991 returned. The initial value is 0.
10992
10993`GL_VERTEX_ATTRIB_ARRAY_ENABLED'
10994
10995
10996 PARAMS returns a single value that is non-zero (true) if the vertex
10997 attribute array for INDEX is enabled and 0 (false) if it is
10998 disabled. The initial value is `GL_FALSE'.
10999
11000`GL_VERTEX_ATTRIB_ARRAY_SIZE'
11001
11002
11003 PARAMS returns a single value, the size of the vertex attribute
11004 array for INDEX. The size is the number of values for each element
11005 of the vertex attribute array, and it will be 1, 2, 3, or 4. The
11006 initial value is 4.
11007
11008`GL_VERTEX_ATTRIB_ARRAY_STRIDE'
11009
11010
11011 PARAMS returns a single value, the array stride for (number of
11012 bytes between successive elements in) the vertex attribute array
11013 for INDEX. A value of 0 indicates that the array elements are
11014 stored sequentially in memory. The initial value is 0.
11015
11016`GL_VERTEX_ATTRIB_ARRAY_TYPE'
11017
11018
11019 PARAMS returns a single value, a symbolic constant indicating the
11020 array type for the vertex attribute array for INDEX. Possible
11021 values are `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
11022 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
11023 `GL_DOUBLE'. The initial value is `GL_FLOAT'.
11024
11025`GL_VERTEX_ATTRIB_ARRAY_NORMALIZED'
11026
11027
11028 PARAMS returns a single value that is non-zero (true) if
11029 fixed-point data types for the vertex attribute array indicated by
11030 INDEX are normalized when they are converted to floating point, and
11031 0 (false) otherwise. The initial value is `GL_FALSE'.
11032
11033`GL_CURRENT_VERTEX_ATTRIB'
11034
11035
11036 PARAMS returns four values that represent the current value for the
11037 generic vertex attribute specified by index. Generic vertex
11038 attribute 0 is unique in that it has no current state, so an error
11039 will be generated if INDEX is 0. The initial value for all other
11040 generic vertex attributes is (0,0,0,1).
11041
11042All of the parameters except `GL_CURRENT_VERTEX_ATTRIB' represent
11043client-side state.
11044
11045`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
11046`GL_MAX_VERTEX_ATTRIBS'.
11047
11048`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11049
11050`GL_INVALID_OPERATION' is generated if INDEX is 0 and PNAME is
11051`GL_CURRENT_VERTEX_ATTRIB'.")
11052
11053(define-gl-procedure
11054 glGet
11055 "glGet"
11056 (funcsynopsis
11057 (funcprototype
11058 (funcdef "void " (function "glGetBooleanv"))
11059 (paramdef "GLenum " (parameter "pname"))
11060 (paramdef "GLboolean * " (parameter "params"))))
11061 "Return the value or values of a selected parameter.
11062
11063PNAME
11064 Specifies the parameter value to be returned. The symbolic
11065 constants in the list below are accepted.
11066
11067PARAMS
11068 Returns the value or values of the specified parameter.
11069
11070These four commands return values for simple state variables in GL.
11071PNAME is a symbolic constant indicating the state variable to be
11072returned, and PARAMS is a pointer to an array of the indicated type in
11073which to place the returned data.
11074
11075Type conversion is performed if PARAMS has a different type than the
11076state variable value being requested. If `glGetBooleanv' is called, a
11077floating-point (or integer) value is converted to `GL_FALSE' if and only
11078if it is 0.0 (or 0). Otherwise, it is converted to `GL_TRUE'. If
11079`glGetIntegerv' is called, boolean values are returned as `GL_TRUE' or
11080`GL_FALSE', and most floating-point values are rounded to the nearest
11081integer value. Floating-point colors and normals, however, are returned
11082with a linear mapping that maps 1.0 to the most positive representable
11083integer value and -1.0 to the most negative representable integer value.
11084If `glGetFloatv' or `glGetDoublev' is called, boolean values are
11085returned as `GL_TRUE' or `GL_FALSE', and integer values are converted to
11086floating-point values.
11087
11088The following symbolic constants are accepted by PNAME:
11089
11090`GL_ACCUM_ALPHA_BITS'
11091
11092
11093 PARAMS returns one value, the number of alpha bitplanes in the
11094 accumulation buffer.
11095
11096`GL_ACCUM_BLUE_BITS'
11097
11098
11099 PARAMS returns one value, the number of blue bitplanes in the
11100 accumulation buffer.
11101
11102`GL_ACCUM_CLEAR_VALUE'
11103
11104
11105 PARAMS returns four values: the red, green, blue, and alpha values
11106 used to clear the accumulation buffer. Integer values, if
11107 requested, are linearly mapped from the internal floating-point
11108 representation such that 1.0 returns the most positive
11109 representable integer value, and -1.0 returns the most negative
11110 representable integer value. The initial value is (0, 0, 0, 0). See
11111 `glClearAccum'.
11112
11113`GL_ACCUM_GREEN_BITS'
11114
11115
11116 PARAMS returns one value, the number of green bitplanes in the
11117 accumulation buffer.
11118
11119`GL_ACCUM_RED_BITS'
11120
11121
11122 PARAMS returns one value, the number of red bitplanes in the
11123 accumulation buffer.
11124
11125`GL_ACTIVE_TEXTURE'
11126
11127
11128 PARAMS returns a single value indicating the active multitexture
11129 unit. The initial value is `GL_TEXTURE0'. See `glActiveTexture'.
11130
11131`GL_ALIASED_POINT_SIZE_RANGE'
11132
11133
11134 PARAMS returns two values, the smallest and largest supported sizes
11135 for aliased points.
11136
11137`GL_ALIASED_LINE_WIDTH_RANGE'
11138
11139
11140 PARAMS returns two values, the smallest and largest supported
11141 widths for aliased lines.
11142
11143`GL_ALPHA_BIAS'
11144
11145
11146 PARAMS returns one value, the alpha bias factor used during pixel
11147 transfers. The initial value is 0. See `glPixelTransfer'.
11148
11149`GL_ALPHA_BITS'
11150
11151
11152 PARAMS returns one value, the number of alpha bitplanes in each
11153 color buffer.
11154
11155`GL_ALPHA_SCALE'
11156
11157
11158 PARAMS returns one value, the alpha scale factor used during pixel
11159 transfers. The initial value is 1. See `glPixelTransfer'.
11160
11161`GL_ALPHA_TEST'
11162
11163
11164 PARAMS returns a single boolean value indicating whether alpha
11165 testing of fragments is enabled. The initial value is `GL_FALSE'.
11166 See `glAlphaFunc'.
11167
11168`GL_ALPHA_TEST_FUNC'PARAMS returns one value,
11169
11170
11171 the symbolic name of the alpha test function. The initial value is
11172 `GL_ALWAYS'. See `glAlphaFunc'.
11173
11174`GL_ALPHA_TEST_REF'
11175
11176
11177 PARAMS returns one value, the reference value for the alpha test.
11178 The initial value is 0. See `glAlphaFunc'. An integer value, if
11179 requested, is linearly mapped from the internal floating-point
11180 representation such that 1.0 returns the most positive
11181 representable integer value, and -1.0 returns the most negative
11182 representable integer value.
11183
11184`GL_ARRAY_BUFFER_BINDING'
11185
11186
11187 PARAMS returns a single value, the name of the buffer object
11188 currently bound to the target `GL_ARRAY_BUFFER'. If no buffer
11189 object is bound to this target, 0 is returned. The initial value is
11190 0. See `glBindBuffer'.
11191
11192`GL_ATTRIB_STACK_DEPTH'
11193
11194
11195 PARAMS returns one value, the depth of the attribute stack. If the
11196 stack is empty, 0 is returned. The initial value is 0. See
11197 `glPushAttrib'.
11198
11199`GL_AUTO_NORMAL'
11200
11201
11202 PARAMS returns a single boolean value indicating whether 2D map
11203 evaluation automatically generates surface normals. The initial
11204 value is `GL_FALSE'. See `glMap2'.
11205
11206`GL_AUX_BUFFERS'
11207
11208
11209 PARAMS returns one value, the number of auxiliary color buffers
11210 available.
11211
11212`GL_BLEND'
11213
11214
11215 PARAMS returns a single boolean value indicating whether blending
11216 is enabled. The initial value is `GL_FALSE'. See `glBlendFunc'.
11217
11218`GL_BLEND_COLOR'
11219
11220
11221 PARAMS returns four values, the red, green, blue, and alpha values
11222 which are the components of the blend color. See `glBlendColor'.
11223
11224`GL_BLEND_DST_ALPHA'
11225
11226
11227 PARAMS returns one value, the symbolic constant identifying the
11228 alpha destination blend function. The initial value is `GL_ZERO'.
11229 See `glBlendFunc' and `glBlendFuncSeparate'.
11230
11231`GL_BLEND_DST_RGB'
11232
11233
11234 PARAMS returns one value, the symbolic constant identifying the RGB
11235 destination blend function. The initial value is `GL_ZERO'. See
11236 `glBlendFunc' and `glBlendFuncSeparate'.
11237
11238`GL_BLEND_EQUATION_RGB'
11239
11240
11241 PARAMS returns one value, a symbolic constant indicating whether
11242 the RGB blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11243 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11244 `glBlendEquationSeparate'.
11245
11246`GL_BLEND_EQUATION_ALPHA'
11247
11248
11249 PARAMS returns one value, a symbolic constant indicating whether
11250 the Alpha blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11251 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11252 `glBlendEquationSeparate'.
11253
11254`GL_BLEND_SRC_ALPHA'
11255
11256
11257 PARAMS returns one value, the symbolic constant identifying the
11258 alpha source blend function. The initial value is `GL_ONE'. See
11259 `glBlendFunc' and `glBlendFuncSeparate'.
11260
11261`GL_BLEND_SRC_RGB'
11262
11263
11264 PARAMS returns one value, the symbolic constant identifying the RGB
11265 source blend function. The initial value is `GL_ONE'. See
11266 `glBlendFunc' and `glBlendFuncSeparate'.
11267
11268`GL_BLUE_BIAS'
11269
11270
11271 PARAMS returns one value, the blue bias factor used during pixel
11272 transfers. The initial value is 0. See `glPixelTransfer'.
11273
11274`GL_BLUE_BITS'
11275
11276
11277 PARAMS returns one value, the number of blue bitplanes in each
11278 color buffer.
11279
11280`GL_BLUE_SCALE'
11281
11282
11283 PARAMS returns one value, the blue scale factor used during pixel
11284 transfers. The initial value is 1. See `glPixelTransfer'.
11285
11286`GL_CLIENT_ACTIVE_TEXTURE'
11287
11288
11289 PARAMS returns a single integer value indicating the current client
11290 active multitexture unit. The initial value is `GL_TEXTURE0'. See
11291 `glClientActiveTexture'.
11292
11293`GL_CLIENT_ATTRIB_STACK_DEPTH'
11294
11295
11296 PARAMS returns one value indicating the depth of the attribute
11297 stack. The initial value is 0. See `glPushClientAttrib'.
11298
11299`GL_CLIP_PLANE'I
11300
11301
11302 PARAMS returns a single boolean value indicating whether the
11303 specified clipping plane is enabled. The initial value is
11304 `GL_FALSE'. See `glClipPlane'.
11305
11306`GL_COLOR_ARRAY'
11307
11308
11309 PARAMS returns a single boolean value indicating whether the color
11310 array is enabled. The initial value is `GL_FALSE'. See
11311 `glColorPointer'.
11312
11313`GL_COLOR_ARRAY_BUFFER_BINDING'
11314
11315
11316 PARAMS returns a single value, the name of the buffer object
11317 associated with the color array. This buffer object would have been
11318 bound to the target `GL_ARRAY_BUFFER' at the time of the most
11319 recent call to `glColorPointer'. If no buffer object was bound to
11320 this target, 0 is returned. The initial value is 0. See
11321 `glBindBuffer'.
11322
11323`GL_COLOR_ARRAY_SIZE'
11324
11325
11326 PARAMS returns one value, the number of components per color in the
11327 color array. The initial value is 4. See `glColorPointer'.
11328
11329`GL_COLOR_ARRAY_STRIDE'
11330
11331
11332 PARAMS returns one value, the byte offset between consecutive
11333 colors in the color array. The initial value is 0. See
11334 `glColorPointer'.
11335
11336`GL_COLOR_ARRAY_TYPE'
11337
11338
11339 PARAMS returns one value, the data type of each component in the
11340 color array. The initial value is `GL_FLOAT'. See `glColorPointer'.
11341
11342`GL_COLOR_CLEAR_VALUE'
11343
11344
11345 PARAMS returns four values: the red, green, blue, and alpha values
11346 used to clear the color buffers. Integer values, if requested, are
11347 linearly mapped from the internal floating-point representation
11348 such that 1.0 returns the most positive representable integer
11349 value, and -1.0 returns the most negative representable integer
11350 value. The initial value is (0, 0, 0, 0). See `glClearColor'.
11351
11352`GL_COLOR_LOGIC_OP'
11353
11354
11355 PARAMS returns a single boolean value indicating whether a
11356 fragment's RGBA color values are merged into the framebuffer using
11357 a logical operation. The initial value is `GL_FALSE'. See
11358 `glLogicOp'.
11359
11360`GL_COLOR_MATERIAL'
11361
11362
11363 PARAMS returns a single boolean value indicating whether one or
11364 more material parameters are tracking the current color. The
11365 initial value is `GL_FALSE'. See `glColorMaterial'.
11366
11367`GL_COLOR_MATERIAL_FACE'
11368
11369
11370 PARAMS returns one value, a symbolic constant indicating which
11371 materials have a parameter that is tracking the current color. The
11372 initial value is `GL_FRONT_AND_BACK'. See `glColorMaterial'.
11373
11374`GL_COLOR_MATERIAL_PARAMETER'
11375
11376
11377 PARAMS returns one value, a symbolic constant indicating which
11378 material parameters are tracking the current color. The initial
11379 value is `GL_AMBIENT_AND_DIFFUSE'. See `glColorMaterial'.
11380
11381`GL_COLOR_MATRIX'
11382
11383
11384 PARAMS returns sixteen values: the color matrix on the top of the
11385 color matrix stack. Initially this matrix is the identity matrix.
11386 See `glPushMatrix'.
11387
11388`GL_COLOR_MATRIX_STACK_DEPTH'
11389
11390
11391 PARAMS returns one value, the maximum supported depth of the
11392 projection matrix stack. The value must be at least 2. See
11393 `glPushMatrix'.
11394
11395`GL_COLOR_SUM'
11396
11397
11398 PARAMS returns a single boolean value indicating whether primary
11399 and secondary color sum is enabled. See `glSecondaryColor'.
11400
11401`GL_COLOR_TABLE'
11402
11403
11404 PARAMS returns a single boolean value indicating whether the color
11405 table lookup is enabled. See `glColorTable'.
11406
11407`GL_COLOR_WRITEMASK'
11408
11409
11410 PARAMS returns four boolean values: the red, green, blue, and alpha
11411 write enables for the color buffers. The initial value is
11412 (`GL_TRUE', `GL_TRUE', `GL_TRUE', `GL_TRUE'). See `glColorMask'.
11413
11414`GL_COMPRESSED_TEXTURE_FORMATS'
11415
11416
11417 PARAMS returns a list of symbolic constants of length
11418 `GL_NUM_COMPRESSED_TEXTURE_FORMATS' indicating which compressed
11419 texture formats are available. See `glCompressedTexImage2D'.
11420
11421`GL_CONVOLUTION_1D'
11422
11423
11424 PARAMS returns a single boolean value indicating whether 1D
11425 convolution is enabled. The initial value is `GL_FALSE'. See
11426 `glConvolutionFilter1D'.
11427
11428`GL_CONVOLUTION_2D'
11429
11430
11431 PARAMS returns a single boolean value indicating whether 2D
11432 convolution is enabled. The initial value is `GL_FALSE'. See
11433 `glConvolutionFilter2D'.
11434
11435`GL_CULL_FACE'
11436
11437
11438 PARAMS returns a single boolean value indicating whether polygon
11439 culling is enabled. The initial value is `GL_FALSE'. See
11440 `glCullFace'.
11441
11442`GL_CULL_FACE_MODE'
11443
11444
11445 PARAMS returns one value, a symbolic constant indicating which
11446 polygon faces are to be culled. The initial value is `GL_BACK'. See
11447 `glCullFace'.
11448
11449`GL_CURRENT_COLOR'
11450
11451
11452 PARAMS returns four values: the red, green, blue, and alpha values
11453 of the current color. Integer values, if requested, are linearly
11454 mapped from the internal floating-point representation such that
11455 1.0 returns the most positive representable integer value, and -1.0
11456 returns the most negative representable integer value. The initial
11457 value is (1, 1, 1, 1). See `glColor'.
11458
11459`GL_CURRENT_FOG_COORD'
11460
11461
11462 PARAMS returns one value, the current fog coordinate. The initial
11463 value is 0. See `glFogCoord'.
11464
11465`GL_CURRENT_INDEX'
11466
11467
11468 PARAMS returns one value, the current color index. The initial
11469 value is 1. See `glIndex'.
11470
11471`GL_CURRENT_NORMAL'
11472
11473
11474 PARAMS returns three values: the X, Y, and Z values of the current
11475 normal. Integer values, if requested, are linearly mapped from the
11476 internal floating-point representation such that 1.0 returns the
11477 most positive representable integer value, and -1.0 returns the
11478 most negative representable integer value. The initial value is (0,
11479 0, 1). See `glNormal'.
11480
11481`GL_CURRENT_PROGRAM'
11482
11483
11484 PARAMS returns one value, the name of the program object that is
11485 currently active, or 0 if no program object is active. See
11486 `glUseProgram'.
11487
11488`GL_CURRENT_RASTER_COLOR'
11489
11490
11491 PARAMS returns four values: the red, green, blue, and alpha color
11492 values of the current raster position. Integer values, if
11493 requested, are linearly mapped from the internal floating-point
11494 representation such that 1.0 returns the most positive
11495 representable integer value, and -1.0 returns the most negative
11496 representable integer value. The initial value is (1, 1, 1, 1). See
11497 `glRasterPos'.
11498
11499`GL_CURRENT_RASTER_DISTANCE'
11500
11501
11502 PARAMS returns one value, the distance from the eye to the current
11503 raster position. The initial value is 0. See `glRasterPos'.
11504
11505`GL_CURRENT_RASTER_INDEX'
11506
11507
11508 PARAMS returns one value, the color index of the current raster
11509 position. The initial value is 1. See `glRasterPos'.
11510
11511`GL_CURRENT_RASTER_POSITION'
11512
11513
11514 PARAMS returns four values: the X, Y, Z, and W components of the
11515 current raster position. X, Y, and Z are in window coordinates, and
11516 W is in clip coordinates. The initial value is (0, 0, 0, 1). See
11517 `glRasterPos'.
11518
11519`GL_CURRENT_RASTER_POSITION_VALID'
11520
11521
11522 PARAMS returns a single boolean value indicating whether the
11523 current raster position is valid. The initial value is `GL_TRUE'.
11524 See `glRasterPos'.
11525
11526`GL_CURRENT_RASTER_SECONDARY_COLOR'
11527
11528
11529 PARAMS returns four values: the red, green, blue, and alpha
11530 secondary color values of the current raster position. Integer
11531 values, if requested, are linearly mapped from the internal
11532 floating-point representation such that 1.0 returns the most
11533 positive representable integer value, and -1.0 returns the most
11534 negative representable integer value. The initial value is (1, 1,
11535 1, 1). See `glRasterPos'.
11536
11537`GL_CURRENT_RASTER_TEXTURE_COORDS'
11538
11539
11540 PARAMS returns four values: the S, T, R, and Q texture coordinates
11541 of the current raster position. The initial value is (0, 0, 0, 1).
11542 See `glRasterPos' and `glMultiTexCoord'.
11543
11544`GL_CURRENT_SECONDARY_COLOR'
11545
11546
11547 PARAMS returns four values: the red, green, blue, and alpha values
11548 of the current secondary color. Integer values, if requested, are
11549 linearly mapped from the internal floating-point representation
11550 such that 1.0 returns the most positive representable integer
11551 value, and -1.0 returns the most negative representable integer
11552 value. The initial value is (0, 0, 0, 0). See `glSecondaryColor'.
11553
11554`GL_CURRENT_TEXTURE_COORDS'
11555
11556
11557 PARAMS returns four values: the S, T, R, and Q current texture
11558 coordinates. The initial value is (0, 0, 0, 1). See
11559 `glMultiTexCoord'.
11560
11561`GL_DEPTH_BIAS'
11562
11563
11564 PARAMS returns one value, the depth bias factor used during pixel
11565 transfers. The initial value is 0. See `glPixelTransfer'.
11566
11567`GL_DEPTH_BITS'
11568
11569
11570 PARAMS returns one value, the number of bitplanes in the depth
11571 buffer.
11572
11573`GL_DEPTH_CLEAR_VALUE'
11574
11575
11576 PARAMS returns one value, the value that is used to clear the depth
11577 buffer. Integer values, if requested, are linearly mapped from the
11578 internal floating-point representation such that 1.0 returns the
11579 most positive representable integer value, and -1.0 returns the
11580 most negative representable integer value. The initial value is 1.
11581 See `glClearDepth'.
11582
11583`GL_DEPTH_FUNC'
11584
11585
11586 PARAMS returns one value, the symbolic constant that indicates the
11587 depth comparison function. The initial value is `GL_LESS'. See
11588 `glDepthFunc'.
11589
11590`GL_DEPTH_RANGE'
11591
11592
11593 PARAMS returns two values: the near and far mapping limits for the
11594 depth buffer. Integer values, if requested, are linearly mapped
11595 from the internal floating-point representation such that 1.0
11596 returns the most positive representable integer value, and -1.0
11597 returns the most negative representable integer value. The initial
11598 value is (0, 1). See `glDepthRange'.
11599
11600`GL_DEPTH_SCALE'
11601
11602
11603 PARAMS returns one value, the depth scale factor used during pixel
11604 transfers. The initial value is 1. See `glPixelTransfer'.
11605
11606`GL_DEPTH_TEST'
11607
11608
11609 PARAMS returns a single boolean value indicating whether depth
11610 testing of fragments is enabled. The initial value is `GL_FALSE'.
11611 See `glDepthFunc' and `glDepthRange'.
11612
11613`GL_DEPTH_WRITEMASK'
11614
11615
11616 PARAMS returns a single boolean value indicating if the depth
11617 buffer is enabled for writing. The initial value is `GL_TRUE'. See
11618 `glDepthMask'.
11619
11620`GL_DITHER'
11621
11622
11623 PARAMS returns a single boolean value indicating whether dithering
11624 of fragment colors and indices is enabled. The initial value is
11625 `GL_TRUE'.
11626
11627`GL_DOUBLEBUFFER'
11628
11629
11630 PARAMS returns a single boolean value indicating whether double
11631 buffering is supported.
11632
11633`GL_DRAW_BUFFER'
11634
11635
11636 PARAMS returns one value, a symbolic constant indicating which
11637 buffers are being drawn to. See `glDrawBuffer'. The initial value
11638 is `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11639
11640`GL_DRAW_BUFFER'I
11641
11642
11643 PARAMS returns one value, a symbolic constant indicating which
11644 buffers are being drawn to by the corresponding output color. See
11645 `glDrawBuffers'. The initial value of `GL_DRAW_BUFFER0' is
11646 `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11647 The initial values of draw buffers for all other output colors is
11648 `GL_NONE'.
11649
11650`GL_EDGE_FLAG'
11651
11652
11653 PARAMS returns a single boolean value indicating whether the
11654 current edge flag is `GL_TRUE' or `GL_FALSE'. The initial value is
11655 `GL_TRUE'. See `glEdgeFlag'.
11656
11657`GL_EDGE_FLAG_ARRAY'
11658
11659
11660 PARAMS returns a single boolean value indicating whether the edge
11661 flag array is enabled. The initial value is `GL_FALSE'. See
11662 `glEdgeFlagPointer'.
11663
11664`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING'
11665
11666
11667 PARAMS returns a single value, the name of the buffer object
11668 associated with the edge flag array. This buffer object would have
11669 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
11670 recent call to `glEdgeFlagPointer'. If no buffer object was bound
11671 to this target, 0 is returned. The initial value is 0. See
11672 `glBindBuffer'.
11673
11674`GL_EDGE_FLAG_ARRAY_STRIDE'
11675
11676
11677 PARAMS returns one value, the byte offset between consecutive edge
11678 flags in the edge flag array. The initial value is 0. See
11679 `glEdgeFlagPointer'.
11680
11681`GL_ELEMENT_ARRAY_BUFFER_BINDING'
11682
11683
11684 PARAMS returns a single value, the name of the buffer object
11685 currently bound to the target `GL_ELEMENT_ARRAY_BUFFER'. If no
11686 buffer object is bound to this target, 0 is returned. The initial
11687 value is 0. See `glBindBuffer'.
11688
11689`GL_FEEDBACK_BUFFER_SIZE'
11690
11691
11692 PARAMS returns one value, the size of the feedback buffer. See
11693 `glFeedbackBuffer'.
11694
11695`GL_FEEDBACK_BUFFER_TYPE'
11696
11697
11698 PARAMS returns one value, the type of the feedback buffer. See
11699 `glFeedbackBuffer'.
11700
11701`GL_FOG'
11702
11703
11704 PARAMS returns a single boolean value indicating whether fogging is
11705 enabled. The initial value is `GL_FALSE'. See `glFog'.
11706
11707`GL_FOG_COORD_ARRAY'
11708
11709
11710 PARAMS returns a single boolean value indicating whether the fog
11711 coordinate array is enabled. The initial value is `GL_FALSE'. See
11712 `glFogCoordPointer'.
11713
11714`GL_FOG_COORD_ARRAY_BUFFER_BINDING'
11715
11716
11717 PARAMS returns a single value, the name of the buffer object
11718 associated with the fog coordinate array. This buffer object would
11719 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11720 most recent call to `glFogCoordPointer'. If no buffer object was
11721 bound to this target, 0 is returned. The initial value is 0. See
11722 `glBindBuffer'.
11723
11724`GL_FOG_COORD_ARRAY_STRIDE'
11725
11726
11727 PARAMS returns one value, the byte offset between consecutive fog
11728 coordinates in the fog coordinate array. The initial value is 0.
11729 See `glFogCoordPointer'.
11730
11731`GL_FOG_COORD_ARRAY_TYPE'
11732
11733
11734 PARAMS returns one value, the type of the fog coordinate array. The
11735 initial value is `GL_FLOAT'. See `glFogCoordPointer'.
11736
11737`GL_FOG_COORD_SRC'
11738
11739
11740 PARAMS returns one value, a symbolic constant indicating the source
11741 of the fog coordinate. The initial value is `GL_FRAGMENT_DEPTH'.
11742 See `glFog'.
11743
11744`GL_FOG_COLOR'
11745
11746
11747 PARAMS returns four values: the red, green, blue, and alpha
11748 components of the fog color. Integer values, if requested, are
11749 linearly mapped from the internal floating-point representation
11750 such that 1.0 returns the most positive representable integer
11751 value, and -1.0 returns the most negative representable integer
11752 value. The initial value is (0, 0, 0, 0). See `glFog'.
11753
11754`GL_FOG_DENSITY'
11755
11756
11757 PARAMS returns one value, the fog density parameter. The initial
11758 value is 1. See `glFog'.
11759
11760`GL_FOG_END'
11761
11762
11763 PARAMS returns one value, the end factor for the linear fog
11764 equation. The initial value is 1. See `glFog'.
11765
11766`GL_FOG_HINT'
11767
11768
11769 PARAMS returns one value, a symbolic constant indicating the mode
11770 of the fog hint. The initial value is `GL_DONT_CARE'. See `glHint'.
11771
11772`GL_FOG_INDEX'
11773
11774
11775 PARAMS returns one value, the fog color index. The initial value is
11776 0. See `glFog'.
11777
11778`GL_FOG_MODE'
11779
11780
11781 PARAMS returns one value, a symbolic constant indicating which fog
11782 equation is selected. The initial value is `GL_EXP'. See `glFog'.
11783
11784`GL_FOG_START'
11785
11786
11787 PARAMS returns one value, the start factor for the linear fog
11788 equation. The initial value is 0. See `glFog'.
11789
11790`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
11791
11792
11793 PARAMS returns one value, a symbolic constant indicating the mode
11794 of the derivative accuracy hint for fragment shaders. The initial
11795 value is `GL_DONT_CARE'. See `glHint'.
11796
11797`GL_FRONT_FACE'
11798
11799
11800 PARAMS returns one value, a symbolic constant indicating whether
11801 clockwise or counterclockwise polygon winding is treated as
11802 front-facing. The initial value is `GL_CCW'. See `glFrontFace'.
11803
11804`GL_GENERATE_MIPMAP_HINT'
11805
11806
11807 PARAMS returns one value, a symbolic constant indicating the mode
11808 of the mipmap generation filtering hint. The initial value is
11809 `GL_DONT_CARE'. See `glHint'.
11810
11811`GL_GREEN_BIAS'
11812
11813
11814 PARAMS returns one value, the green bias factor used during pixel
11815 transfers. The initial value is 0.
11816
11817`GL_GREEN_BITS'
11818
11819
11820 PARAMS returns one value, the number of green bitplanes in each
11821 color buffer.
11822
11823`GL_GREEN_SCALE'
11824
11825
11826 PARAMS returns one value, the green scale factor used during pixel
11827 transfers. The initial value is 1. See `glPixelTransfer'.
11828
11829`GL_HISTOGRAM'
11830
11831
11832 PARAMS returns a single boolean value indicating whether histogram
11833 is enabled. The initial value is `GL_FALSE'. See `glHistogram'.
11834
11835`GL_INDEX_ARRAY'
11836
11837
11838 PARAMS returns a single boolean value indicating whether the color
11839 index array is enabled. The initial value is `GL_FALSE'. See
11840 `glIndexPointer'.
11841
11842`GL_INDEX_ARRAY_BUFFER_BINDING'
11843
11844
11845 PARAMS returns a single value, the name of the buffer object
11846 associated with the color index array. This buffer object would
11847 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11848 most recent call to `glIndexPointer'. If no buffer object was bound
11849 to this target, 0 is returned. The initial value is 0. See
11850 `glBindBuffer'.
11851
11852`GL_INDEX_ARRAY_STRIDE'
11853
11854
11855 PARAMS returns one value, the byte offset between consecutive color
11856 indexes in the color index array. The initial value is 0. See
11857 `glIndexPointer'.
11858
11859`GL_INDEX_ARRAY_TYPE'
11860
11861
11862 PARAMS returns one value, the data type of indexes in the color
11863 index array. The initial value is `GL_FLOAT'. See `glIndexPointer'.
11864
11865`GL_INDEX_BITS'
11866
11867
11868 PARAMS returns one value, the number of bitplanes in each color
11869 index buffer.
11870
11871`GL_INDEX_CLEAR_VALUE'
11872
11873
11874 PARAMS returns one value, the color index used to clear the color
11875 index buffers. The initial value is 0. See `glClearIndex'.
11876
11877`GL_INDEX_LOGIC_OP'
11878
11879
11880 PARAMS returns a single boolean value indicating whether a
11881 fragment's index values are merged into the framebuffer using a
11882 logical operation. The initial value is `GL_FALSE'. See
11883 `glLogicOp'.
11884
11885`GL_INDEX_MODE'
11886
11887
11888 PARAMS returns a single boolean value indicating whether the GL is
11889 in color index mode (`GL_TRUE') or RGBA mode (`GL_FALSE').
11890
11891`GL_INDEX_OFFSET'
11892
11893
11894 PARAMS returns one value, the offset added to color and stencil
11895 indices during pixel transfers. The initial value is 0. See
11896 `glPixelTransfer'.
11897
11898`GL_INDEX_SHIFT'
11899
11900
11901 PARAMS returns one value, the amount that color and stencil indices
11902 are shifted during pixel transfers. The initial value is 0. See
11903 `glPixelTransfer'.
11904
11905`GL_INDEX_WRITEMASK'
11906
11907
11908 PARAMS returns one value, a mask indicating which bitplanes of each
11909 color index buffer can be written. The initial value is all 1's.
11910 See `glIndexMask'.
11911
11912`GL_LIGHT'I
11913
11914
11915 PARAMS returns a single boolean value indicating whether the
11916 specified light is enabled. The initial value is `GL_FALSE'. See
11917 `glLight' and `glLightModel'.
11918
11919`GL_LIGHTING'
11920
11921
11922 PARAMS returns a single boolean value indicating whether lighting
11923 is enabled. The initial value is `GL_FALSE'. See `glLightModel'.
11924
11925`GL_LIGHT_MODEL_AMBIENT'
11926
11927
11928 PARAMS returns four values: the red, green, blue, and alpha
11929 components of the ambient intensity of the entire scene. Integer
11930 values, if requested, are linearly mapped from the internal
11931 floating-point representation such that 1.0 returns the most
11932 positive representable integer value, and -1.0 returns the most
11933 negative representable integer value. The initial value is (0.2,
11934 0.2, 0.2, 1.0). See `glLightModel'.
11935
11936`GL_LIGHT_MODEL_COLOR_CONTROL'
11937
11938
11939 PARAMS returns single enumerated value indicating whether specular
11940 reflection calculations are separated from normal lighting
11941 computations. The initial value is `GL_SINGLE_COLOR'.
11942
11943`GL_LIGHT_MODEL_LOCAL_VIEWER'
11944
11945
11946 PARAMS returns a single boolean value indicating whether specular
11947 reflection calculations treat the viewer as being local to the
11948 scene. The initial value is `GL_FALSE'. See `glLightModel'.
11949
11950`GL_LIGHT_MODEL_TWO_SIDE'
11951
11952
11953 PARAMS returns a single boolean value indicating whether separate
11954 materials are used to compute lighting for front- and back-facing
11955 polygons. The initial value is `GL_FALSE'. See `glLightModel'.
11956
11957`GL_LINE_SMOOTH'
11958
11959
11960 PARAMS returns a single boolean value indicating whether
11961 antialiasing of lines is enabled. The initial value is `GL_FALSE'.
11962 See `glLineWidth'.
11963
11964`GL_LINE_SMOOTH_HINT'
11965
11966
11967 PARAMS returns one value, a symbolic constant indicating the mode
11968 of the line antialiasing hint. The initial value is `GL_DONT_CARE'.
11969 See `glHint'.
11970
11971`GL_LINE_STIPPLE'
11972
11973
11974 PARAMS returns a single boolean value indicating whether stippling
11975 of lines is enabled. The initial value is `GL_FALSE'. See
11976 `glLineStipple'.
11977
11978`GL_LINE_STIPPLE_PATTERN'
11979
11980
11981 PARAMS returns one value, the 16-bit line stipple pattern. The
11982 initial value is all 1's. See `glLineStipple'.
11983
11984`GL_LINE_STIPPLE_REPEAT'
11985
11986
11987 PARAMS returns one value, the line stipple repeat factor. The
11988 initial value is 1. See `glLineStipple'.
11989
11990`GL_LINE_WIDTH'
11991
11992
11993 PARAMS returns one value, the line width as specified with
11994 `glLineWidth'. The initial value is 1.
11995
11996`GL_LINE_WIDTH_GRANULARITY'
11997
11998
11999 PARAMS returns one value, the width difference between adjacent
12000 supported widths for antialiased lines. See `glLineWidth'.
12001
12002`GL_LINE_WIDTH_RANGE'
12003
12004
12005 PARAMS returns two values: the smallest and largest supported
12006 widths for antialiased lines. See `glLineWidth'.
12007
12008`GL_LIST_BASE'
12009
12010
12011 PARAMS returns one value, the base offset added to all names in
12012 arrays presented to `glCallLists'. The initial value is 0. See
12013 `glListBase'.
12014
12015`GL_LIST_INDEX'
12016
12017
12018 PARAMS returns one value, the name of the display list currently
12019 under construction. 0 is returned if no display list is currently
12020 under construction. The initial value is 0. See `glNewList'.
12021
12022`GL_LIST_MODE'
12023
12024
12025 PARAMS returns one value, a symbolic constant indicating the
12026 construction mode of the display list currently under construction.
12027 The initial value is 0. See `glNewList'.
12028
12029`GL_LOGIC_OP_MODE'
12030
12031
12032 PARAMS returns one value, a symbolic constant indicating the
12033 selected logic operation mode. The initial value is `GL_COPY'. See
12034 `glLogicOp'.
12035
12036`GL_MAP1_COLOR_4'
12037
12038
12039 PARAMS returns a single boolean value indicating whether 1D
12040 evaluation generates colors. The initial value is `GL_FALSE'. See
12041 `glMap1'.
12042
12043`GL_MAP1_GRID_DOMAIN'
12044
12045
12046 PARAMS returns two values: the endpoints of the 1D map's grid
12047 domain. The initial value is (0, 1). See `glMapGrid'.
12048
12049`GL_MAP1_GRID_SEGMENTS'
12050
12051
12052 PARAMS returns one value, the number of partitions in the 1D map's
12053 grid domain. The initial value is 1. See `glMapGrid'.
12054
12055`GL_MAP1_INDEX'
12056
12057
12058 PARAMS returns a single boolean value indicating whether 1D
12059 evaluation generates color indices. The initial value is
12060 `GL_FALSE'. See `glMap1'.
12061
12062`GL_MAP1_NORMAL'
12063
12064
12065 PARAMS returns a single boolean value indicating whether 1D
12066 evaluation generates normals. The initial value is `GL_FALSE'. See
12067 `glMap1'.
12068
12069`GL_MAP1_TEXTURE_COORD_1'
12070
12071
12072 PARAMS returns a single boolean value indicating whether 1D
12073 evaluation generates 1D texture coordinates. The initial value is
12074 `GL_FALSE'. See `glMap1'.
12075
12076`GL_MAP1_TEXTURE_COORD_2'
12077
12078
12079 PARAMS returns a single boolean value indicating whether 1D
12080 evaluation generates 2D texture coordinates. The initial value is
12081 `GL_FALSE'. See `glMap1'.
12082
12083`GL_MAP1_TEXTURE_COORD_3'
12084
12085
12086 PARAMS returns a single boolean value indicating whether 1D
12087 evaluation generates 3D texture coordinates. The initial value is
12088 `GL_FALSE'. See `glMap1'.
12089
12090`GL_MAP1_TEXTURE_COORD_4'
12091
12092
12093 PARAMS returns a single boolean value indicating whether 1D
12094 evaluation generates 4D texture coordinates. The initial value is
12095 `GL_FALSE'. See `glMap1'.
12096
12097`GL_MAP1_VERTEX_3'
12098
12099
12100 PARAMS returns a single boolean value indicating whether 1D
12101 evaluation generates 3D vertex coordinates. The initial value is
12102 `GL_FALSE'. See `glMap1'.
12103
12104`GL_MAP1_VERTEX_4'
12105
12106
12107 PARAMS returns a single boolean value indicating whether 1D
12108 evaluation generates 4D vertex coordinates. The initial value is
12109 `GL_FALSE'. See `glMap1'.
12110
12111`GL_MAP2_COLOR_4'
12112
12113
12114 PARAMS returns a single boolean value indicating whether 2D
12115 evaluation generates colors. The initial value is `GL_FALSE'. See
12116 `glMap2'.
12117
12118`GL_MAP2_GRID_DOMAIN'
12119
12120
12121 PARAMS returns four values: the endpoints of the 2D map's I and J
12122 grid domains. The initial value is (0,1; 0,1). See `glMapGrid'.
12123
12124`GL_MAP2_GRID_SEGMENTS'
12125
12126
12127 PARAMS returns two values: the number of partitions in the 2D map's
12128 I and J grid domains. The initial value is (1,1). See `glMapGrid'.
12129
12130`GL_MAP2_INDEX'
12131
12132
12133 PARAMS returns a single boolean value indicating whether 2D
12134 evaluation generates color indices. The initial value is
12135 `GL_FALSE'. See `glMap2'.
12136
12137`GL_MAP2_NORMAL'
12138
12139
12140 PARAMS returns a single boolean value indicating whether 2D
12141 evaluation generates normals. The initial value is `GL_FALSE'. See
12142 `glMap2'.
12143
12144`GL_MAP2_TEXTURE_COORD_1'
12145
12146
12147 PARAMS returns a single boolean value indicating whether 2D
12148 evaluation generates 1D texture coordinates. The initial value is
12149 `GL_FALSE'. See `glMap2'.
12150
12151`GL_MAP2_TEXTURE_COORD_2'
12152
12153
12154 PARAMS returns a single boolean value indicating whether 2D
12155 evaluation generates 2D texture coordinates. The initial value is
12156 `GL_FALSE'. See `glMap2'.
12157
12158`GL_MAP2_TEXTURE_COORD_3'
12159
12160
12161 PARAMS returns a single boolean value indicating whether 2D
12162 evaluation generates 3D texture coordinates. The initial value is
12163 `GL_FALSE'. See `glMap2'.
12164
12165`GL_MAP2_TEXTURE_COORD_4'
12166
12167
12168 PARAMS returns a single boolean value indicating whether 2D
12169 evaluation generates 4D texture coordinates. The initial value is
12170 `GL_FALSE'. See `glMap2'.
12171
12172`GL_MAP2_VERTEX_3'
12173
12174
12175 PARAMS returns a single boolean value indicating whether 2D
12176 evaluation generates 3D vertex coordinates. The initial value is
12177 `GL_FALSE'. See `glMap2'.
12178
12179`GL_MAP2_VERTEX_4'
12180
12181
12182 PARAMS returns a single boolean value indicating whether 2D
12183 evaluation generates 4D vertex coordinates. The initial value is
12184 `GL_FALSE'. See `glMap2'.
12185
12186`GL_MAP_COLOR'
12187
12188
12189 PARAMS returns a single boolean value indicating if colors and
12190 color indices are to be replaced by table lookup during pixel
12191 transfers. The initial value is `GL_FALSE'. See `glPixelTransfer'.
12192
12193`GL_MAP_STENCIL'
12194
12195
12196 PARAMS returns a single boolean value indicating if stencil indices
12197 are to be replaced by table lookup during pixel transfers. The
12198 initial value is `GL_FALSE'. See `glPixelTransfer'.
12199
12200`GL_MATRIX_MODE'
12201
12202
12203 PARAMS returns one value, a symbolic constant indicating which
12204 matrix stack is currently the target of all matrix operations. The
12205 initial value is `GL_MODELVIEW'. See `glMatrixMode'.
12206
12207`GL_MAX_3D_TEXTURE_SIZE'
12208
12209
12210 PARAMS returns one value, a rough estimate of the largest 3D
12211 texture that the GL can handle. The value must be at least 16. If
12212 the GL version is 1.2 or greater, use `GL_PROXY_TEXTURE_3D' to
12213 determine if a texture is too large. See `glTexImage3D'.
12214
12215`GL_MAX_CLIENT_ATTRIB_STACK_DEPTH'
12216
12217
12218 PARAMS returns one value indicating the maximum supported depth of
12219 the client attribute stack. See `glPushClientAttrib'.
12220
12221`GL_MAX_ATTRIB_STACK_DEPTH'
12222
12223
12224 PARAMS returns one value, the maximum supported depth of the
12225 attribute stack. The value must be at least 16. See `glPushAttrib'.
12226
12227`GL_MAX_CLIP_PLANES'
12228
12229
12230 PARAMS returns one value, the maximum number of application-defined
12231 clipping planes. The value must be at least 6. See `glClipPlane'.
12232
12233`GL_MAX_COLOR_MATRIX_STACK_DEPTH'
12234
12235
12236 PARAMS returns one value, the maximum supported depth of the color
12237 matrix stack. The value must be at least 2. See `glPushMatrix'.
12238
12239`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS'
12240
12241
12242 PARAMS returns one value, the maximum supported texture image units
12243 that can be used to access texture maps from the vertex shader and
12244 the fragment processor combined. If both the vertex shader and the
12245 fragment processing stage access the same texture image unit, then
12246 that counts as using two texture image units against this limit.
12247 The value must be at least 2. See `glActiveTexture'.
12248
12249`GL_MAX_CUBE_MAP_TEXTURE_SIZE'
12250
12251
12252 PARAMS returns one value. The value gives a rough estimate of the
12253 largest cube-map texture that the GL can handle. The value must be
12254 at least 16. If the GL version is 1.3 or greater, use
12255 `GL_PROXY_TEXTURE_CUBE_MAP' to determine if a texture is too large.
12256 See `glTexImage2D'.
12257
12258`GL_MAX_DRAW_BUFFERS'
12259
12260
12261 PARAMS returns one value, the maximum number of simultaneous output
12262 colors allowed from a fragment shader using the `gl_FragData'
12263 built-in array. The value must be at least 1. See `glDrawBuffers'.
12264
12265`GL_MAX_ELEMENTS_INDICES'
12266
12267
12268 PARAMS returns one value, the recommended maximum number of vertex
12269 array indices. See `glDrawRangeElements'.
12270
12271`GL_MAX_ELEMENTS_VERTICES'
12272
12273
12274 PARAMS returns one value, the recommended maximum number of vertex
12275 array vertices. See `glDrawRangeElements'.
12276
12277`GL_MAX_EVAL_ORDER'
12278
12279
12280 PARAMS returns one value, the maximum equation order supported by
12281 1D and 2D evaluators. The value must be at least 8. See `glMap1'
12282 and `glMap2'.
12283
12284`GL_MAX_FRAGMENT_UNIFORM_COMPONENTS'
12285
12286
12287 PARAMS returns one value, the maximum number of individual
12288 floating-point, integer, or boolean values that can be held in
12289 uniform variable storage for a fragment shader. The value must be
12290 at least 64. See `glUniform'.
12291
12292`GL_MAX_LIGHTS'
12293
12294
12295 PARAMS returns one value, the maximum number of lights. The value
12296 must be at least 8. See `glLight'.
12297
12298`GL_MAX_LIST_NESTING'
12299
12300
12301 PARAMS returns one value, the maximum recursion depth allowed
12302 during display-list traversal. The value must be at least 64. See
12303 `glCallList'.
12304
12305`GL_MAX_MODELVIEW_STACK_DEPTH'
12306
12307
12308 PARAMS returns one value, the maximum supported depth of the
12309 modelview matrix stack. The value must be at least 32. See
12310 `glPushMatrix'.
12311
12312`GL_MAX_NAME_STACK_DEPTH'
12313
12314
12315 PARAMS returns one value, the maximum supported depth of the
12316 selection name stack. The value must be at least 64. See
12317 `glPushName'.
12318
12319`GL_MAX_PIXEL_MAP_TABLE'
12320
12321
12322 PARAMS returns one value, the maximum supported size of a
12323 `glPixelMap' lookup table. The value must be at least 32. See
12324 `glPixelMap'.
12325
12326`GL_MAX_PROJECTION_STACK_DEPTH'
12327
12328
12329 PARAMS returns one value, the maximum supported depth of the
12330 projection matrix stack. The value must be at least 2. See
12331 `glPushMatrix'.
12332
12333`GL_MAX_TEXTURE_COORDS'
12334
12335
12336 PARAMS returns one value, the maximum number of texture coordinate
12337 sets available to vertex and fragment shaders. The value must be at
12338 least 2. See `glActiveTexture' and `glClientActiveTexture'.
12339
12340`GL_MAX_TEXTURE_IMAGE_UNITS'
12341
12342
12343 PARAMS returns one value, the maximum supported texture image units
12344 that can be used to access texture maps from the fragment shader.
12345 The value must be at least 2. See `glActiveTexture'.
12346
12347`GL_MAX_TEXTURE_LOD_BIAS'
12348
12349
12350 PARAMS returns one value, the maximum, absolute value of the
12351 texture level-of-detail bias. The value must be at least 4.
12352
12353`GL_MAX_TEXTURE_SIZE'
12354
12355
12356 PARAMS returns one value. The value gives a rough estimate of the
12357 largest texture that the GL can handle. The value must be at least
12358 64. If the GL version is 1.1 or greater, use `GL_PROXY_TEXTURE_1D'
12359 or `GL_PROXY_TEXTURE_2D' to determine if a texture is too large.
12360 See `glTexImage1D' and `glTexImage2D'.
12361
12362`GL_MAX_TEXTURE_STACK_DEPTH'
12363
12364
12365 PARAMS returns one value, the maximum supported depth of the
12366 texture matrix stack. The value must be at least 2. See
12367 `glPushMatrix'.
12368
12369`GL_MAX_TEXTURE_UNITS'
12370
12371
12372 PARAMS returns a single value indicating the number of conventional
12373 texture units supported. Each conventional texture unit includes
12374 both a texture coordinate set and a texture image unit.
12375 Conventional texture units may be used for fixed-function
12376 (non-shader) rendering. The value must be at least 2. Additional
12377 texture coordinate sets and texture image units may be accessed
12378 from vertex and fragment shaders. See `glActiveTexture' and
12379 `glClientActiveTexture'.
12380
12381`GL_MAX_VARYING_FLOATS'
12382
12383
12384 PARAMS returns one value, the maximum number of interpolators
12385 available for processing varying variables used by vertex and
12386 fragment shaders. This value represents the number of individual
12387 floating-point values that can be interpolated; varying variables
12388 declared as vectors, matrices, and arrays will all consume multiple
12389 interpolators. The value must be at least 32.
12390
12391`GL_MAX_VERTEX_ATTRIBS'
12392
12393
12394 PARAMS returns one value, the maximum number of 4-component generic
12395 vertex attributes accessible to a vertex shader. The value must be
12396 at least 16. See `glVertexAttrib'.
12397
12398`GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS'
12399
12400
12401 PARAMS returns one value, the maximum supported texture image units
12402 that can be used to access texture maps from the vertex shader. The
12403 value may be 0. See `glActiveTexture'.
12404
12405`GL_MAX_VERTEX_UNIFORM_COMPONENTS'
12406
12407
12408 PARAMS returns one value, the maximum number of individual
12409 floating-point, integer, or boolean values that can be held in
12410 uniform variable storage for a vertex shader. The value must be at
12411 least 512. See `glUniform'.
12412
12413`GL_MAX_VIEWPORT_DIMS'
12414
12415
12416 PARAMS returns two values: the maximum supported width and height
12417 of the viewport. These must be at least as large as the visible
12418 dimensions of the display being rendered to. See `glViewport'.
12419
12420`GL_MINMAX'
12421
12422
12423 PARAMS returns a single boolean value indicating whether pixel
12424 minmax values are computed. The initial value is `GL_FALSE'. See
12425 `glMinmax'.
12426
12427`GL_MODELVIEW_MATRIX'
12428
12429
12430 PARAMS returns sixteen values: the modelview matrix on the top of
12431 the modelview matrix stack. Initially this matrix is the identity
12432 matrix. See `glPushMatrix'.
12433
12434`GL_MODELVIEW_STACK_DEPTH'
12435
12436
12437 PARAMS returns one value, the number of matrices on the modelview
12438 matrix stack. The initial value is 1. See `glPushMatrix'.
12439
12440`GL_NAME_STACK_DEPTH'
12441
12442
12443 PARAMS returns one value, the number of names on the selection name
12444 stack. The initial value is 0. See `glPushName'.
12445
12446`GL_NORMAL_ARRAY'
12447
12448
12449 PARAMS returns a single boolean value, indicating whether the
12450 normal array is enabled. The initial value is `GL_FALSE'. See
12451 `glNormalPointer'.
12452
12453`GL_NORMAL_ARRAY_BUFFER_BINDING'
12454
12455
12456 PARAMS returns a single value, the name of the buffer object
12457 associated with the normal array. This buffer object would have
12458 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
12459 recent call to `glNormalPointer'. If no buffer object was bound to
12460 this target, 0 is returned. The initial value is 0. See
12461 `glBindBuffer'.
12462
12463`GL_NORMAL_ARRAY_STRIDE'
12464
12465
12466 PARAMS returns one value, the byte offset between consecutive
12467 normals in the normal array. The initial value is 0. See
12468 `glNormalPointer'.
12469
12470`GL_NORMAL_ARRAY_TYPE'
12471
12472
12473 PARAMS returns one value, the data type of each coordinate in the
12474 normal array. The initial value is `GL_FLOAT'. See
12475 `glNormalPointer'.
12476
12477`GL_NORMALIZE'
12478
12479
12480 PARAMS returns a single boolean value indicating whether normals
12481 are automatically scaled to unit length after they have been
12482 transformed to eye coordinates. The initial value is `GL_FALSE'.
12483 See `glNormal'.
12484
12485`GL_NUM_COMPRESSED_TEXTURE_FORMATS'
12486
12487
12488 PARAMS returns a single integer value indicating the number of
12489 available compressed texture formats. The minimum value is 0. See
12490 `glCompressedTexImage2D'.
12491
12492`GL_PACK_ALIGNMENT'
12493
12494
12495 PARAMS returns one value, the byte alignment used for writing pixel
12496 data to memory. The initial value is 4. See `glPixelStore'.
12497
12498`GL_PACK_IMAGE_HEIGHT'
12499
12500
12501 PARAMS returns one value, the image height used for writing pixel
12502 data to memory. The initial value is 0. See `glPixelStore'.
12503
12504`GL_PACK_LSB_FIRST'
12505
12506
12507 PARAMS returns a single boolean value indicating whether single-bit
12508 pixels being written to memory are written first to the least
12509 significant bit of each unsigned byte. The initial value is
12510 `GL_FALSE'. See `glPixelStore'.
12511
12512`GL_PACK_ROW_LENGTH'
12513
12514
12515 PARAMS returns one value, the row length used for writing pixel
12516 data to memory. The initial value is 0. See `glPixelStore'.
12517
12518`GL_PACK_SKIP_IMAGES'
12519
12520
12521 PARAMS returns one value, the number of pixel images skipped before
12522 the first pixel is written into memory. The initial value is 0. See
12523 `glPixelStore'.
12524
12525`GL_PACK_SKIP_PIXELS'
12526
12527
12528 PARAMS returns one value, the number of pixel locations skipped
12529 before the first pixel is written into memory. The initial value is
12530 0. See `glPixelStore'.
12531
12532`GL_PACK_SKIP_ROWS'
12533
12534
12535 PARAMS returns one value, the number of rows of pixel locations
12536 skipped before the first pixel is written into memory. The initial
12537 value is 0. See `glPixelStore'.
12538
12539`GL_PACK_SWAP_BYTES'
12540
12541
12542 PARAMS returns a single boolean value indicating whether the bytes
12543 of two-byte and four-byte pixel indices and components are swapped
12544 before being written to memory. The initial value is `GL_FALSE'.
12545 See `glPixelStore'.
12546
12547`GL_PERSPECTIVE_CORRECTION_HINT'
12548
12549
12550 PARAMS returns one value, a symbolic constant indicating the mode
12551 of the perspective correction hint. The initial value is
12552 `GL_DONT_CARE'. See `glHint'.
12553
12554`GL_PIXEL_MAP_A_TO_A_SIZE'
12555
12556
12557 PARAMS returns one value, the size of the alpha-to-alpha pixel
12558 translation table. The initial value is 1. See `glPixelMap'.
12559
12560`GL_PIXEL_MAP_B_TO_B_SIZE'
12561
12562
12563 PARAMS returns one value, the size of the blue-to-blue pixel
12564 translation table. The initial value is 1. See `glPixelMap'.
12565
12566`GL_PIXEL_MAP_G_TO_G_SIZE'
12567
12568
12569 PARAMS returns one value, the size of the green-to-green pixel
12570 translation table. The initial value is 1. See `glPixelMap'.
12571
12572`GL_PIXEL_MAP_I_TO_A_SIZE'
12573
12574
12575 PARAMS returns one value, the size of the index-to-alpha pixel
12576 translation table. The initial value is 1. See `glPixelMap'.
12577
12578`GL_PIXEL_MAP_I_TO_B_SIZE'
12579
12580
12581 PARAMS returns one value, the size of the index-to-blue pixel
12582 translation table. The initial value is 1. See `glPixelMap'.
12583
12584`GL_PIXEL_MAP_I_TO_G_SIZE'
12585
12586
12587 PARAMS returns one value, the size of the index-to-green pixel
12588 translation table. The initial value is 1. See `glPixelMap'.
12589
12590`GL_PIXEL_MAP_I_TO_I_SIZE'
12591
12592
12593 PARAMS returns one value, the size of the index-to-index pixel
12594 translation table. The initial value is 1. See `glPixelMap'.
12595
12596`GL_PIXEL_MAP_I_TO_R_SIZE'
12597
12598
12599 PARAMS returns one value, the size of the index-to-red pixel
12600 translation table. The initial value is 1. See `glPixelMap'.
12601
12602`GL_PIXEL_MAP_R_TO_R_SIZE'
12603
12604
12605 PARAMS returns one value, the size of the red-to-red pixel
12606 translation table. The initial value is 1. See `glPixelMap'.
12607
12608`GL_PIXEL_MAP_S_TO_S_SIZE'
12609
12610
12611 PARAMS returns one value, the size of the stencil-to-stencil pixel
12612 translation table. The initial value is 1. See `glPixelMap'.
12613
12614`GL_PIXEL_PACK_BUFFER_BINDING'
12615
12616
12617 PARAMS returns a single value, the name of the buffer object
12618 currently bound to the target `GL_PIXEL_PACK_BUFFER'. If no buffer
12619 object is bound to this target, 0 is returned. The initial value is
12620 0. See `glBindBuffer'.
12621
12622`GL_PIXEL_UNPACK_BUFFER_BINDING'
12623
12624
12625 PARAMS returns a single value, the name of the buffer object
12626 currently bound to the target `GL_PIXEL_UNPACK_BUFFER'. If no
12627 buffer object is bound to this target, 0 is returned. The initial
12628 value is 0. See `glBindBuffer'.
12629
12630`GL_POINT_DISTANCE_ATTENUATION'
12631
12632
12633 PARAMS returns three values, the coefficients for computing the
12634 attenuation value for points. See `glPointParameter'.
12635
12636`GL_POINT_FADE_THRESHOLD_SIZE'
12637
12638
12639 PARAMS returns one value, the point size threshold for determining
12640 the point size. See `glPointParameter'.
12641
12642`GL_POINT_SIZE'
12643
12644
12645 PARAMS returns one value, the point size as specified by
12646 `glPointSize'. The initial value is 1.
12647
12648`GL_POINT_SIZE_GRANULARITY'
12649
12650
12651 PARAMS returns one value, the size difference between adjacent
12652 supported sizes for antialiased points. See `glPointSize'.
12653
12654`GL_POINT_SIZE_MAX'
12655
12656
12657 PARAMS returns one value, the upper bound for the attenuated point
12658 sizes. The initial value is 0.0. See `glPointParameter'.
12659
12660`GL_POINT_SIZE_MIN'
12661
12662
12663 PARAMS returns one value, the lower bound for the attenuated point
12664 sizes. The initial value is 1.0. See `glPointParameter'.
12665
12666`GL_POINT_SIZE_RANGE'
12667
12668
12669 PARAMS returns two values: the smallest and largest supported sizes
12670 for antialiased points. The smallest size must be at most 1, and
12671 the largest size must be at least 1. See `glPointSize'.
12672
12673`GL_POINT_SMOOTH'
12674
12675
12676 PARAMS returns a single boolean value indicating whether
12677 antialiasing of points is enabled. The initial value is `GL_FALSE'.
12678 See `glPointSize'.
12679
12680`GL_POINT_SMOOTH_HINT'
12681
12682
12683 PARAMS returns one value, a symbolic constant indicating the mode
12684 of the point antialiasing hint. The initial value is
12685 `GL_DONT_CARE'. See `glHint'.
12686
12687`GL_POINT_SPRITE'
12688
12689
12690 PARAMS returns a single boolean value indicating whether point
12691 sprite is enabled. The initial value is `GL_FALSE'.
12692
12693`GL_POLYGON_MODE'
12694
12695
12696 PARAMS returns two values: symbolic constants indicating whether
12697 front-facing and back-facing polygons are rasterized as points,
12698 lines, or filled polygons. The initial value is `GL_FILL'. See
12699 `glPolygonMode'.
12700
12701`GL_POLYGON_OFFSET_FACTOR'
12702
12703
12704 PARAMS returns one value, the scaling factor used to determine the
12705 variable offset that is added to the depth value of each fragment
12706 generated when a polygon is rasterized. The initial value is 0. See
12707 `glPolygonOffset'.
12708
12709`GL_POLYGON_OFFSET_UNITS'
12710
12711
12712 PARAMS returns one value. This value is multiplied by an
12713 implementation-specific value and then added to the depth value of
12714 each fragment generated when a polygon is rasterized. The initial
12715 value is 0. See `glPolygonOffset'.
12716
12717`GL_POLYGON_OFFSET_FILL'
12718
12719
12720 PARAMS returns a single boolean value indicating whether polygon
12721 offset is enabled for polygons in fill mode. The initial value is
12722 `GL_FALSE'. See `glPolygonOffset'.
12723
12724`GL_POLYGON_OFFSET_LINE'
12725
12726
12727 PARAMS returns a single boolean value indicating whether polygon
12728 offset is enabled for polygons in line mode. The initial value is
12729 `GL_FALSE'. See `glPolygonOffset'.
12730
12731`GL_POLYGON_OFFSET_POINT'
12732
12733
12734 PARAMS returns a single boolean value indicating whether polygon
12735 offset is enabled for polygons in point mode. The initial value is
12736 `GL_FALSE'. See `glPolygonOffset'.
12737
12738`GL_POLYGON_SMOOTH'
12739
12740
12741 PARAMS returns a single boolean value indicating whether
12742 antialiasing of polygons is enabled. The initial value is
12743 `GL_FALSE'. See `glPolygonMode'.
12744
12745`GL_POLYGON_SMOOTH_HINT'
12746
12747
12748 PARAMS returns one value, a symbolic constant indicating the mode
12749 of the polygon antialiasing hint. The initial value is
12750 `GL_DONT_CARE'. See `glHint'.
12751
12752`GL_POLYGON_STIPPLE'
12753
12754
12755 PARAMS returns a single boolean value indicating whether polygon
12756 stippling is enabled. The initial value is `GL_FALSE'. See
12757 `glPolygonStipple'.
12758
12759`GL_POST_COLOR_MATRIX_COLOR_TABLE'
12760
12761
12762 PARAMS returns a single boolean value indicating whether post color
12763 matrix transformation lookup is enabled. The initial value is
12764 `GL_FALSE'. See `glColorTable'.
12765
12766`GL_POST_COLOR_MATRIX_RED_BIAS'
12767
12768
12769 PARAMS returns one value, the red bias factor applied to RGBA
12770 fragments after color matrix transformations. The initial value is
12771 0. See `glPixelTransfer'.
12772
12773`GL_POST_COLOR_MATRIX_GREEN_BIAS'
12774
12775
12776 PARAMS returns one value, the green bias factor applied to RGBA
12777 fragments after color matrix transformations. The initial value is
12778 0. See `glPixelTransfer'
12779
12780`GL_POST_COLOR_MATRIX_BLUE_BIAS'
12781
12782
12783 PARAMS returns one value, the blue bias factor applied to RGBA
12784 fragments after color matrix transformations. The initial value is
12785 0. See `glPixelTransfer'.
12786
12787`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12788
12789
12790 PARAMS returns one value, the alpha bias factor applied to RGBA
12791 fragments after color matrix transformations. The initial value is
12792 0. See `glPixelTransfer'.
12793
12794`GL_POST_COLOR_MATRIX_RED_SCALE'
12795
12796
12797 PARAMS returns one value, the red scale factor applied to RGBA
12798 fragments after color matrix transformations. The initial value is
12799 1. See `glPixelTransfer'.
12800
12801`GL_POST_COLOR_MATRIX_GREEN_SCALE'
12802
12803
12804 PARAMS returns one value, the green scale factor applied to RGBA
12805 fragments after color matrix transformations. The initial value is
12806 1. See `glPixelTransfer'.
12807
12808`GL_POST_COLOR_MATRIX_BLUE_SCALE'
12809
12810
12811 PARAMS returns one value, the blue scale factor applied to RGBA
12812 fragments after color matrix transformations. The initial value is
12813 1. See `glPixelTransfer'.
12814
12815`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12816
12817
12818 PARAMS returns one value, the alpha scale factor applied to RGBA
12819 fragments after color matrix transformations. The initial value is
12820 1. See `glPixelTransfer'.
12821
12822`GL_POST_CONVOLUTION_COLOR_TABLE'
12823
12824
12825 PARAMS returns a single boolean value indicating whether post
12826 convolution lookup is enabled. The initial value is `GL_FALSE'. See
12827 `glColorTable'.
12828
12829`GL_POST_CONVOLUTION_RED_BIAS'
12830
12831
12832 PARAMS returns one value, the red bias factor applied to RGBA
12833 fragments after convolution. The initial value is 0. See
12834 `glPixelTransfer'.
12835
12836`GL_POST_CONVOLUTION_GREEN_BIAS'
12837
12838
12839 PARAMS returns one value, the green bias factor applied to RGBA
12840 fragments after convolution. The initial value is 0. See
12841 `glPixelTransfer'.
12842
12843`GL_POST_CONVOLUTION_BLUE_BIAS'
12844
12845
12846 PARAMS returns one value, the blue bias factor applied to RGBA
12847 fragments after convolution. The initial value is 0. See
12848 `glPixelTransfer'.
12849
12850`GL_POST_CONVOLUTION_ALPHA_BIAS'
12851
12852
12853 PARAMS returns one value, the alpha bias factor applied to RGBA
12854 fragments after convolution. The initial value is 0. See
12855 `glPixelTransfer'.
12856
12857`GL_POST_CONVOLUTION_RED_SCALE'
12858
12859
12860 PARAMS returns one value, the red scale factor applied to RGBA
12861 fragments after convolution. The initial value is 1. See
12862 `glPixelTransfer'.
12863
12864`GL_POST_CONVOLUTION_GREEN_SCALE'
12865
12866
12867 PARAMS returns one value, the green scale factor applied to RGBA
12868 fragments after convolution. The initial value is 1. See
12869 `glPixelTransfer'.
12870
12871`GL_POST_CONVOLUTION_BLUE_SCALE'
12872
12873
12874 PARAMS returns one value, the blue scale factor applied to RGBA
12875 fragments after convolution. The initial value is 1. See
12876 `glPixelTransfer'.
12877
12878`GL_POST_CONVOLUTION_ALPHA_SCALE'
12879
12880
12881 PARAMS returns one value, the alpha scale factor applied to RGBA
12882 fragments after convolution. The initial value is 1. See
12883 `glPixelTransfer'.
12884
12885`GL_PROJECTION_MATRIX'
12886
12887
12888 PARAMS returns sixteen values: the projection matrix on the top of
12889 the projection matrix stack. Initially this matrix is the identity
12890 matrix. See `glPushMatrix'.
12891
12892`GL_PROJECTION_STACK_DEPTH'
12893
12894
12895 PARAMS returns one value, the number of matrices on the projection
12896 matrix stack. The initial value is 1. See `glPushMatrix'.
12897
12898`GL_READ_BUFFER'
12899
12900
12901 PARAMS returns one value, a symbolic constant indicating which
12902 color buffer is selected for reading. The initial value is
12903 `GL_BACK' if there is a back buffer, otherwise it is `GL_FRONT'.
12904 See `glReadPixels' and `glAccum'.
12905
12906`GL_RED_BIAS'
12907
12908
12909 PARAMS returns one value, the red bias factor used during pixel
12910 transfers. The initial value is 0.
12911
12912`GL_RED_BITS'
12913
12914
12915 PARAMS returns one value, the number of red bitplanes in each color
12916 buffer.
12917
12918`GL_RED_SCALE'
12919
12920
12921 PARAMS returns one value, the red scale factor used during pixel
12922 transfers. The initial value is 1. See `glPixelTransfer'.
12923
12924`GL_RENDER_MODE'
12925
12926
12927 PARAMS returns one value, a symbolic constant indicating whether
12928 the GL is in render, select, or feedback mode. The initial value is
12929 `GL_RENDER'. See `glRenderMode'.
12930
12931`GL_RESCALE_NORMAL'
12932
12933
12934 PARAMS returns single boolean value indicating whether normal
12935 rescaling is enabled. See `glEnable'.
12936
12937`GL_RGBA_MODE'
12938
12939
12940 PARAMS returns a single boolean value indicating whether the GL is
12941 in RGBA mode (true) or color index mode (false). See `glColor'.
12942
12943`GL_SAMPLE_BUFFERS'
12944
12945
12946 PARAMS returns a single integer value indicating the number of
12947 sample buffers associated with the framebuffer. See
12948 `glSampleCoverage'.
12949
12950`GL_SAMPLE_COVERAGE_VALUE'
12951
12952
12953 PARAMS returns a single positive floating-point value indicating
12954 the current sample coverage value. See `glSampleCoverage'.
12955
12956`GL_SAMPLE_COVERAGE_INVERT'
12957
12958
12959 PARAMS returns a single boolean value indicating if the temporary
12960 coverage value should be inverted. See `glSampleCoverage'.
12961
12962`GL_SAMPLES'
12963
12964
12965 PARAMS returns a single integer value indicating the coverage mask
12966 size. See `glSampleCoverage'.
12967
12968`GL_SCISSOR_BOX'
12969
12970
12971 PARAMS returns four values: the X and Y window coordinates of the
12972 scissor box, followed by its width and height. Initially the X and
12973 Y window coordinates are both 0 and the width and height are set to
12974 the size of the window. See `glScissor'.
12975
12976`GL_SCISSOR_TEST'
12977
12978
12979 PARAMS returns a single boolean value indicating whether scissoring
12980 is enabled. The initial value is `GL_FALSE'. See `glScissor'.
12981
12982`GL_SECONDARY_COLOR_ARRAY'
12983
12984
12985 PARAMS returns a single boolean value indicating whether the
12986 secondary color array is enabled. The initial value is `GL_FALSE'.
12987 See `glSecondaryColorPointer'.
12988
12989`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING'
12990
12991
12992 PARAMS returns a single value, the name of the buffer object
12993 associated with the secondary color array. This buffer object would
12994 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
12995 most recent call to `glSecondaryColorPointer'. If no buffer object
12996 was bound to this target, 0 is returned. The initial value is 0.
12997 See `glBindBuffer'.
12998
12999`GL_SECONDARY_COLOR_ARRAY_SIZE'
13000
13001
13002 PARAMS returns one value, the number of components per color in the
13003 secondary color array. The initial value is 3. See
13004 `glSecondaryColorPointer'.
13005
13006`GL_SECONDARY_COLOR_ARRAY_STRIDE'
13007
13008
13009 PARAMS returns one value, the byte offset between consecutive
13010 colors in the secondary color array. The initial value is 0. See
13011 `glSecondaryColorPointer'.
13012
13013`GL_SECONDARY_COLOR_ARRAY_TYPE'
13014
13015
13016 PARAMS returns one value, the data type of each component in the
13017 secondary color array. The initial value is `GL_FLOAT'. See
13018 `glSecondaryColorPointer'.
13019
13020`GL_SELECTION_BUFFER_SIZE'
13021
13022
13023 PARAMS return one value, the size of the selection buffer. See
13024 `glSelectBuffer'.
13025
13026`GL_SEPARABLE_2D'
13027
13028
13029 PARAMS returns a single boolean value indicating whether 2D
13030 separable convolution is enabled. The initial value is `GL_FALSE'.
13031 See `glSeparableFilter2D'.
13032
13033`GL_SHADE_MODEL'
13034
13035
13036 PARAMS returns one value, a symbolic constant indicating whether
13037 the shading mode is flat or smooth. The initial value is
13038 `GL_SMOOTH'. See `glShadeModel'.
13039
13040`GL_SMOOTH_LINE_WIDTH_RANGE'
13041
13042
13043 PARAMS returns two values, the smallest and largest supported
13044 widths for antialiased lines. See `glLineWidth'.
13045
13046`GL_SMOOTH_LINE_WIDTH_GRANULARITY'
13047
13048
13049 PARAMS returns one value, the granularity of widths for antialiased
13050 lines. See `glLineWidth'.
13051
13052`GL_SMOOTH_POINT_SIZE_RANGE'
13053
13054
13055 PARAMS returns two values, the smallest and largest supported
13056 widths for antialiased points. See `glPointSize'.
13057
13058`GL_SMOOTH_POINT_SIZE_GRANULARITY'
13059
13060
13061 PARAMS returns one value, the granularity of sizes for antialiased
13062 points. See `glPointSize'.
13063
13064`GL_STENCIL_BACK_FAIL'
13065
13066
13067 PARAMS returns one value, a symbolic constant indicating what
13068 action is taken for back-facing polygons when the stencil test
13069 fails. The initial value is `GL_KEEP'. See `glStencilOpSeparate'.
13070
13071`GL_STENCIL_BACK_FUNC'
13072
13073
13074 PARAMS returns one value, a symbolic constant indicating what
13075 function is used for back-facing polygons to compare the stencil
13076 reference value with the stencil buffer value. The initial value is
13077 `GL_ALWAYS'. See `glStencilFuncSeparate'.
13078
13079`GL_STENCIL_BACK_PASS_DEPTH_FAIL'
13080
13081
13082 PARAMS returns one value, a symbolic constant indicating what
13083 action is taken for back-facing polygons when the stencil test
13084 passes, but the depth test fails. The initial value is `GL_KEEP'.
13085 See `glStencilOpSeparate'.
13086
13087`GL_STENCIL_BACK_PASS_DEPTH_PASS'
13088
13089
13090 PARAMS returns one value, a symbolic constant indicating what
13091 action is taken for back-facing polygons when the stencil test
13092 passes and the depth test passes. The initial value is `GL_KEEP'.
13093 See `glStencilOpSeparate'.
13094
13095`GL_STENCIL_BACK_REF'
13096
13097
13098 PARAMS returns one value, the reference value that is compared with
13099 the contents of the stencil buffer for back-facing polygons. The
13100 initial value is 0. See `glStencilFuncSeparate'.
13101
13102`GL_STENCIL_BACK_VALUE_MASK'
13103
13104
13105 PARAMS returns one value, the mask that is used for back-facing
13106 polygons to mask both the stencil reference value and the stencil
13107 buffer value before they are compared. The initial value is all
13108 1's. See `glStencilFuncSeparate'.
13109
13110`GL_STENCIL_BACK_WRITEMASK'
13111
13112
13113 PARAMS returns one value, the mask that controls writing of the
13114 stencil bitplanes for back-facing polygons. The initial value is
13115 all 1's. See `glStencilMaskSeparate'.
13116
13117`GL_STENCIL_BITS'
13118
13119
13120 PARAMS returns one value, the number of bitplanes in the stencil
13121 buffer.
13122
13123`GL_STENCIL_CLEAR_VALUE'
13124
13125
13126 PARAMS returns one value, the index to which the stencil bitplanes
13127 are cleared. The initial value is 0. See `glClearStencil'.
13128
13129`GL_STENCIL_FAIL'
13130
13131
13132 PARAMS returns one value, a symbolic constant indicating what
13133 action is taken when the stencil test fails. The initial value is
13134 `GL_KEEP'. See `glStencilOp'. If the GL version is 2.0 or greater,
13135 this stencil state only affects non-polygons and front-facing
13136 polygons. Back-facing polygons use separate stencil state. See
13137 `glStencilOpSeparate'.
13138
13139`GL_STENCIL_FUNC'
13140
13141
13142 PARAMS returns one value, a symbolic constant indicating what
13143 function is used to compare the stencil reference value with the
13144 stencil buffer value. The initial value is `GL_ALWAYS'. See
13145 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
13146 state only affects non-polygons and front-facing polygons.
13147 Back-facing polygons use separate stencil state. See
13148 `glStencilFuncSeparate'.
13149
13150`GL_STENCIL_PASS_DEPTH_FAIL'
13151
13152
13153 PARAMS returns one value, a symbolic constant indicating what
13154 action is taken when the stencil test passes, but the depth test
13155 fails. The initial value is `GL_KEEP'. See `glStencilOp'. If the GL
13156 version is 2.0 or greater, this stencil state only affects
13157 non-polygons and front-facing polygons. Back-facing polygons use
13158 separate stencil state. See `glStencilOpSeparate'.
13159
13160`GL_STENCIL_PASS_DEPTH_PASS'
13161
13162
13163 PARAMS returns one value, a symbolic constant indicating what
13164 action is taken when the stencil test passes and the depth test
13165 passes. The initial value is `GL_KEEP'. See `glStencilOp'. If the
13166 GL version is 2.0 or greater, this stencil state only affects
13167 non-polygons and front-facing polygons. Back-facing polygons use
13168 separate stencil state. See `glStencilOpSeparate'.
13169
13170`GL_STENCIL_REF'
13171
13172
13173 PARAMS returns one value, the reference value that is compared with
13174 the contents of the stencil buffer. The initial value is 0. See
13175 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
13176 state only affects non-polygons and front-facing polygons.
13177 Back-facing polygons use separate stencil state. See
13178 `glStencilFuncSeparate'.
13179
13180`GL_STENCIL_TEST'
13181
13182
13183 PARAMS returns a single boolean value indicating whether stencil
13184 testing of fragments is enabled. The initial value is `GL_FALSE'.
13185 See `glStencilFunc' and `glStencilOp'.
13186
13187`GL_STENCIL_VALUE_MASK'
13188
13189
13190 PARAMS returns one value, the mask that is used to mask both the
13191 stencil reference value and the stencil buffer value before they
13192 are compared. The initial value is all 1's. See `glStencilFunc'. If
13193 the GL version is 2.0 or greater, this stencil state only affects
13194 non-polygons and front-facing polygons. Back-facing polygons use
13195 separate stencil state. See `glStencilFuncSeparate'.
13196
13197`GL_STENCIL_WRITEMASK'
13198
13199
13200 PARAMS returns one value, the mask that controls writing of the
13201 stencil bitplanes. The initial value is all 1's. See
13202 `glStencilMask'. If the GL version is 2.0 or greater, this stencil
13203 state only affects non-polygons and front-facing polygons.
13204 Back-facing polygons use separate stencil state. See
13205 `glStencilMaskSeparate'.
13206
13207`GL_STEREO'
13208
13209
13210 PARAMS returns a single boolean value indicating whether stereo
13211 buffers (left and right) are supported.
13212
13213`GL_SUBPIXEL_BITS'
13214
13215
13216 PARAMS returns one value, an estimate of the number of bits of
13217 subpixel resolution that are used to position rasterized geometry
13218 in window coordinates. The value must be at least 4.
13219
13220`GL_TEXTURE_1D'
13221
13222
13223 PARAMS returns a single boolean value indicating whether 1D texture
13224 mapping is enabled. The initial value is `GL_FALSE'. See
13225 `glTexImage1D'.
13226
13227`GL_TEXTURE_BINDING_1D'
13228
13229
13230 PARAMS returns a single value, the name of the texture currently
13231 bound to the target `GL_TEXTURE_1D'. The initial value is 0. See
13232 `glBindTexture'.
13233
13234`GL_TEXTURE_2D'
13235
13236
13237 PARAMS returns a single boolean value indicating whether 2D texture
13238 mapping is enabled. The initial value is `GL_FALSE'. See
13239 `glTexImage2D'.
13240
13241`GL_TEXTURE_BINDING_2D'
13242
13243
13244 PARAMS returns a single value, the name of the texture currently
13245 bound to the target `GL_TEXTURE_2D'. The initial value is 0. See
13246 `glBindTexture'.
13247
13248`GL_TEXTURE_3D'
13249
13250
13251 PARAMS returns a single boolean value indicating whether 3D texture
13252 mapping is enabled. The initial value is `GL_FALSE'. See
13253 `glTexImage3D'.
13254
13255`GL_TEXTURE_BINDING_3D'
13256
13257
13258 PARAMS returns a single value, the name of the texture currently
13259 bound to the target `GL_TEXTURE_3D'. The initial value is 0. See
13260 `glBindTexture'.
13261
13262`GL_TEXTURE_BINDING_CUBE_MAP'
13263
13264
13265 PARAMS returns a single value, the name of the texture currently
13266 bound to the target `GL_TEXTURE_CUBE_MAP'. The initial value is 0.
13267 See `glBindTexture'.
13268
13269`GL_TEXTURE_COMPRESSION_HINT'
13270
13271
13272 PARAMS returns a single value indicating the mode of the texture
13273 compression hint. The initial value is `GL_DONT_CARE'.
13274
13275`GL_TEXTURE_COORD_ARRAY'
13276
13277
13278 PARAMS returns a single boolean value indicating whether the
13279 texture coordinate array is enabled. The initial value is
13280 `GL_FALSE'. See `glTexCoordPointer'.
13281
13282`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING'
13283
13284
13285 PARAMS returns a single value, the name of the buffer object
13286 associated with the texture coordinate array. This buffer object
13287 would have been bound to the target `GL_ARRAY_BUFFER' at the time
13288 of the most recent call to `glTexCoordPointer'. If no buffer object
13289 was bound to this target, 0 is returned. The initial value is 0.
13290 See `glBindBuffer'.
13291
13292`GL_TEXTURE_COORD_ARRAY_SIZE'
13293
13294
13295 PARAMS returns one value, the number of coordinates per element in
13296 the texture coordinate array. The initial value is 4. See
13297 `glTexCoordPointer'.
13298
13299`GL_TEXTURE_COORD_ARRAY_STRIDE'
13300
13301
13302 PARAMS returns one value, the byte offset between consecutive
13303 elements in the texture coordinate array. The initial value is 0.
13304 See `glTexCoordPointer'.
13305
13306`GL_TEXTURE_COORD_ARRAY_TYPE'
13307
13308
13309 PARAMS returns one value, the data type of the coordinates in the
13310 texture coordinate array. The initial value is `GL_FLOAT'. See
13311 `glTexCoordPointer'.
13312
13313`GL_TEXTURE_CUBE_MAP'
13314
13315
13316 PARAMS returns a single boolean value indicating whether
13317 cube-mapped texture mapping is enabled. The initial value is
13318 `GL_FALSE'. See `glTexImage2D'.
13319
13320`GL_TEXTURE_GEN_Q'
13321
13322
13323 PARAMS returns a single boolean value indicating whether automatic
13324 generation of the Q texture coordinate is enabled. The initial
13325 value is `GL_FALSE'. See `glTexGen'.
13326
13327`GL_TEXTURE_GEN_R'
13328
13329
13330 PARAMS returns a single boolean value indicating whether automatic
13331 generation of the R texture coordinate is enabled. The initial
13332 value is `GL_FALSE'. See `glTexGen'.
13333
13334`GL_TEXTURE_GEN_S'
13335
13336
13337 PARAMS returns a single boolean value indicating whether automatic
13338 generation of the S texture coordinate is enabled. The initial
13339 value is `GL_FALSE'. See `glTexGen'.
13340
13341`GL_TEXTURE_GEN_T'
13342
13343
13344 PARAMS returns a single boolean value indicating whether automatic
13345 generation of the T texture coordinate is enabled. The initial
13346 value is `GL_FALSE'. See `glTexGen'.
13347
13348`GL_TEXTURE_MATRIX'
13349
13350
13351 PARAMS returns sixteen values: the texture matrix on the top of the
13352 texture matrix stack. Initially this matrix is the identity matrix.
13353 See `glPushMatrix'.
13354
13355`GL_TEXTURE_STACK_DEPTH'
13356
13357
13358 PARAMS returns one value, the number of matrices on the texture
13359 matrix stack. The initial value is 1. See `glPushMatrix'.
13360
13361`GL_TRANSPOSE_COLOR_MATRIX'
13362
13363
13364 PARAMS returns 16 values, the elements of the color matrix in
13365 row-major order. See `glLoadTransposeMatrix'.
13366
13367`GL_TRANSPOSE_MODELVIEW_MATRIX'
13368
13369
13370 PARAMS returns 16 values, the elements of the modelview matrix in
13371 row-major order. See `glLoadTransposeMatrix'.
13372
13373`GL_TRANSPOSE_PROJECTION_MATRIX'
13374
13375
13376 PARAMS returns 16 values, the elements of the projection matrix in
13377 row-major order. See `glLoadTransposeMatrix'.
13378
13379`GL_TRANSPOSE_TEXTURE_MATRIX'
13380
13381
13382 PARAMS returns 16 values, the elements of the texture matrix in
13383 row-major order. See `glLoadTransposeMatrix'.
13384
13385`GL_UNPACK_ALIGNMENT'
13386
13387
13388 PARAMS returns one value, the byte alignment used for reading pixel
13389 data from memory. The initial value is 4. See `glPixelStore'.
13390
13391`GL_UNPACK_IMAGE_HEIGHT'
13392
13393
13394 PARAMS returns one value, the image height used for reading pixel
13395 data from memory. The initial is 0. See `glPixelStore'.
13396
13397`GL_UNPACK_LSB_FIRST'
13398
13399
13400 PARAMS returns a single boolean value indicating whether single-bit
13401 pixels being read from memory are read first from the least
13402 significant bit of each unsigned byte. The initial value is
13403 `GL_FALSE'. See `glPixelStore'.
13404
13405`GL_UNPACK_ROW_LENGTH'
13406
13407
13408 PARAMS returns one value, the row length used for reading pixel
13409 data from memory. The initial value is 0. See `glPixelStore'.
13410
13411`GL_UNPACK_SKIP_IMAGES'
13412
13413
13414 PARAMS returns one value, the number of pixel images skipped before
13415 the first pixel is read from memory. The initial value is 0. See
13416 `glPixelStore'.
13417
13418`GL_UNPACK_SKIP_PIXELS'
13419
13420
13421 PARAMS returns one value, the number of pixel locations skipped
13422 before the first pixel is read from memory. The initial value is 0.
13423 See `glPixelStore'.
13424
13425`GL_UNPACK_SKIP_ROWS'
13426
13427
13428 PARAMS returns one value, the number of rows of pixel locations
13429 skipped before the first pixel is read from memory. The initial
13430 value is 0. See `glPixelStore'.
13431
13432`GL_UNPACK_SWAP_BYTES'
13433
13434
13435 PARAMS returns a single boolean value indicating whether the bytes
13436 of two-byte and four-byte pixel indices and components are swapped
13437 after being read from memory. The initial value is `GL_FALSE'. See
13438 `glPixelStore'.
13439
13440`GL_VERTEX_ARRAY'
13441
13442
13443 PARAMS returns a single boolean value indicating whether the vertex
13444 array is enabled. The initial value is `GL_FALSE'. See
13445 `glVertexPointer'.
13446
13447`GL_VERTEX_ARRAY_BUFFER_BINDING'
13448
13449
13450 PARAMS returns a single value, the name of the buffer object
13451 associated with the vertex array. This buffer object would have
13452 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
13453 recent call to `glVertexPointer'. If no buffer object was bound to
13454 this target, 0 is returned. The initial value is 0. See
13455 `glBindBuffer'.
13456
13457`GL_VERTEX_ARRAY_SIZE'
13458
13459
13460 PARAMS returns one value, the number of coordinates per vertex in
13461 the vertex array. The initial value is 4. See `glVertexPointer'.
13462
13463`GL_VERTEX_ARRAY_STRIDE'
13464
13465
13466 PARAMS returns one value, the byte offset between consecutive
13467 vertices in the vertex array. The initial value is 0. See
13468 `glVertexPointer'.
13469
13470`GL_VERTEX_ARRAY_TYPE'
13471
13472
13473 PARAMS returns one value, the data type of each coordinate in the
13474 vertex array. The initial value is `GL_FLOAT'. See
13475 `glVertexPointer'.
13476
13477`GL_VERTEX_PROGRAM_POINT_SIZE'
13478
13479
13480 PARAMS returns a single boolean value indicating whether vertex
13481 program point size mode is enabled. If enabled, and a vertex shader
13482 is active, then the point size is taken from the shader built-in
13483 `gl_PointSize'. If disabled, and a vertex shader is active, then
13484 the point size is taken from the point state as specified by
13485 `glPointSize'. The initial value is `GL_FALSE'.
13486
13487`GL_VERTEX_PROGRAM_TWO_SIDE'
13488
13489
13490 PARAMS returns a single boolean value indicating whether vertex
13491 program two-sided color mode is enabled. If enabled, and a vertex
13492 shader is active, then the GL chooses the back color output for
13493 back-facing polygons, and the front color output for non-polygons
13494 and front-facing polygons. If disabled, and a vertex shader is
13495 active, then the front color output is always selected. The initial
13496 value is `GL_FALSE'.
13497
13498`GL_VIEWPORT'
13499
13500
13501 PARAMS returns four values: the X and Y window coordinates of the
13502 viewport, followed by its width and height. Initially the X and Y
13503 window coordinates are both set to 0, and the width and height are
13504 set to the width and height of the window into which the GL will do
13505 its rendering. See `glViewport'.
13506
13507`GL_ZOOM_X'
13508
13509
13510 PARAMS returns one value, the X pixel zoom factor. The initial
13511 value is 1. See `glPixelZoom'.
13512
13513`GL_ZOOM_Y'
13514
13515
13516 PARAMS returns one value, the Y pixel zoom factor. The initial
13517 value is 1. See `glPixelZoom'.
13518
13519Many of the boolean parameters can also be queried more easily using
13520`glIsEnabled'.
13521
13522`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
13523
13524`GL_INVALID_OPERATION' is generated if `glGet' is executed between the
13525execution of `glBegin' and the corresponding execution of `glEnd'.")
13526
13527(define-gl-procedure
13528 glHint
13529 "glHint"
13530 (funcsynopsis
13531 (funcprototype
13532 (funcdef "void " (function "glHint"))
13533 (paramdef "GLenum " (parameter "target"))
13534 (paramdef "GLenum " (parameter "mode"))))
13535 "Specify implementation-specific hints.
13536
13537TARGET
13538 Specifies a symbolic constant indicating the behavior to be
13539 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
13540 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
13541 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
13542 `GL_TEXTURE_COMPRESSION_HINT', and
13543 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
13544
13545MODE
13546 Specifies a symbolic constant indicating the desired behavior.
13547 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
13548
13549Certain aspects of GL behavior, when there is room for interpretation,
13550can be controlled with hints. A hint is specified with two arguments.
13551TARGET is a symbolic constant indicating the behavior to be controlled,
13552and MODE is another symbolic constant indicating the desired behavior.
13553The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
13554the following:
13555
13556`GL_FASTEST'
13557
13558
13559 The most efficient option should be chosen.
13560
13561`GL_NICEST'
13562
13563
13564 The most correct, or highest quality, option should be chosen.
13565
13566`GL_DONT_CARE'
13567
13568
13569 No preference.
13570
13571Though the implementation aspects that can be hinted are well defined,
13572the interpretation of the hints depends on the implementation. The hint
13573aspects that can be specified with TARGET, along with suggested
13574semantics, are as follows:
13575
13576`GL_FOG_HINT'
13577
13578
13579 Indicates the accuracy of fog calculation. If per-pixel fog
13580 calculation is not efficiently supported by the GL implementation,
13581 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
13582 calculation of fog effects.
13583
13584`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
13585
13586
13587 Indicates the accuracy of the derivative calculation for the GL
13588 shading language fragment processing built-in functions: `dFdx',
13589 `dFdy', and `fwidth'.
13590
13591`GL_GENERATE_MIPMAP_HINT'
13592
13593
13594 Indicates the quality of filtering when generating mipmap images.
13595
13596`GL_LINE_SMOOTH_HINT'
13597
13598
13599 Indicates the sampling quality of antialiased lines. If a larger
13600 filter function is applied, hinting `GL_NICEST' can result in more
13601 pixel fragments being generated during rasterization.
13602
13603`GL_PERSPECTIVE_CORRECTION_HINT'
13604
13605
13606 Indicates the quality of color, texture coordinate, and fog
13607 coordinate interpolation. If perspective-corrected parameter
13608 interpolation is not efficiently supported by the GL
13609 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
13610 in simple linear interpolation of colors and/or texture
13611 coordinates.
13612
13613`GL_POINT_SMOOTH_HINT'
13614
13615
13616 Indicates the sampling quality of antialiased points. If a larger
13617 filter function is applied, hinting `GL_NICEST' can result in more
13618 pixel fragments being generated during rasterization.
13619
13620`GL_POLYGON_SMOOTH_HINT'
13621
13622
13623 Indicates the sampling quality of antialiased polygons. Hinting
13624 `GL_NICEST' can result in more pixel fragments being generated
13625 during rasterization, if a larger filter function is applied.
13626
13627`GL_TEXTURE_COMPRESSION_HINT'
13628
13629
13630 Indicates the quality and performance of the compressing texture
13631 images. Hinting `GL_FASTEST' indicates that texture images should
13632 be compressed as quickly as possible, while `GL_NICEST' indicates
13633 that texture images should be compressed with as little image
13634 quality loss as possible. `GL_NICEST' should be selected if the
13635 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
13636
13637`GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
13638accepted value.
13639
13640`GL_INVALID_OPERATION' is generated if `glHint' is executed between the
13641execution of `glBegin' and the corresponding execution of `glEnd'.")
13642
13643(define-gl-procedure
13644 glHistogram
13645 "glHistogram"
13646 (funcsynopsis
13647 (funcprototype
13648 (funcdef "void " (function "glHistogram"))
13649 (paramdef "GLenum " (parameter "target"))
13650 (paramdef "GLsizei " (parameter "width"))
13651 (paramdef "GLenum " (parameter "internalformat"))
13652 (paramdef "GLboolean " (parameter "sink"))))
13653 "Define histogram table.
13654
13655TARGET
13656 The histogram whose parameters are to be set. Must be one of
13657 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
13658
13659WIDTH
13660 The number of entries in the histogram table. Must be a power of 2.
13661
13662INTERNALFORMAT
13663 The format of entries in the histogram table. Must be one of
13664 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
13665 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
13666 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
13667 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
13668 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
13669 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
13670 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
13671 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
13672 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
13673
13674SINK
13675 If `GL_TRUE', pixels will be consumed by the histogramming process
13676 and no drawing or texture loading will take place. If `GL_FALSE',
13677 pixels will proceed to the minmax process after histogramming.
13678
13679When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
13680histogram table indices by clamping to the range [0,1], multiplying by
13681the width of the histogram table, and rounding to the nearest integer.
13682The table entries selected by the RGBA indices are then incremented. (If
13683the internal format of the histogram table includes luminance, then the
13684index derived from the R color component determines the luminance table
13685entry to be incremented.) If a histogram table entry is incremented
13686beyond its maximum value, then its value becomes undefined. (This is not
13687an error.)
13688
13689Histogramming is performed only for RGBA pixels (though these may be
13690specified originally as color indices and converted to RGBA by index
13691table lookup). Histogramming is enabled with `glEnable' and disabled
13692with `glDisable'.
13693
13694When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
13695histogram table to have WIDTH entries of the format specified by
13696INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
13697entries are initialized to zero. The values in the previous histogram
13698table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
13699after histogramming; no further processing of the pixels takes place,
13700and no drawing, texture loading, or pixel readback will result.
13701
13702When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
13703information as if the histogram table were to be redefined, but does not
13704actually define the new table. If the requested histogram table is too
13705large to be supported, then the state information will be set to zero.
13706This provides a way to determine if a histogram table with the given
13707parameters can be supported.
13708
13709
13710
13711`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
13712values.
13713
13714`GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
13715power of 2.
13716
13717`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
13718allowable values.
13719
13720`GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
13721histogram table specified is too large for the implementation.
13722
13723`GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
13724the execution of `glBegin' and the corresponding execution of `glEnd'.")
13725
13726(define-gl-procedure
13727 glIndexMask
13728 "glIndexMask"
13729 (funcsynopsis
13730 (funcprototype
13731 (funcdef "void " (function "glIndexMask"))
13732 (paramdef "GLuint " (parameter "mask"))))
13733 "Control the writing of individual bits in the color index buffers.
13734
13735MASK
13736 Specifies a bit mask to enable and disable the writing of
13737 individual bits in the color index buffers. Initially, the mask is
13738 all 1's.
13739
13740`glIndexMask' controls the writing of individual bits in the color index
13741buffers. The least significant N bits of MASK, where N is the number of
13742bits in a color index buffer, specify a mask. Where a 1 (one) appears in
13743the mask, it's possible to write to the corresponding bit in the color
13744index buffer (or buffers). Where a 0 (zero) appears, the corresponding
13745bit is write-protected.
13746
13747This mask is used only in color index mode, and it affects only the
13748buffers currently selected for writing (see `glDrawBuffer'). Initially,
13749all bits are enabled for writing.
13750
13751`GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
13752the execution of `glBegin' and the corresponding execution of `glEnd'.")
13753
13754(define-gl-procedure
13755 glIndexPointer
13756 "glIndexPointer"
13757 (funcsynopsis
13758 (funcprototype
13759 (funcdef "void " (function "glIndexPointer"))
13760 (paramdef "GLenum " (parameter "type"))
13761 (paramdef "GLsizei " (parameter "stride"))
13762 (paramdef
13763 "const GLvoid * "
13764 (parameter "pointer"))))
13765 "Define an array of color indexes.
13766
13767TYPE
13768 Specifies the data type of each color index in the array. Symbolic
13769 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
13770 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13771
13772STRIDE
13773 Specifies the byte offset between consecutive color indexes. If
13774 STRIDE is 0, the color indexes are understood to be tightly packed
13775 in the array. The initial value is 0.
13776
13777POINTER
13778 Specifies a pointer to the first index in the array. The initial
13779 value is 0.
13780
13781`glIndexPointer' specifies the location and data format of an array of
13782color indexes to use when rendering. TYPE specifies the data type of
13783each color index and STRIDE specifies the byte stride from one color
13784index to the next, allowing vertices and attributes to be packed into a
13785single array or stored in separate arrays.
13786
13787If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13788target (see `glBindBuffer') while a color index array is specified,
13789POINTER is treated as a byte offset into the buffer object's data store.
13790Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13791color index vertex array client-side state
13792(`GL_INDEX_ARRAY_BUFFER_BINDING').
13793
13794When a color index array is specified, TYPE, STRIDE, and POINTER are
13795saved as client-side state, in addition to the current vertex array
13796buffer object binding.
13797
13798To enable and disable the color index array, call `glEnableClientState'
13799and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
13800enabled, the color index array is used when `glDrawArrays',
13801`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
13802`glDrawRangeElements', or `glArrayElement' is called.
13803
13804`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13805
13806`GL_INVALID_VALUE' is generated if STRIDE is negative.")
13807
13808(define-gl-procedure
13809 glIndex
13810 "glIndex"
13811 (funcsynopsis
13812 (funcprototype
13813 (funcdef "void " (function "glIndexs"))
13814 (paramdef "GLshort " (parameter "c"))))
13815 "Set the current color index.
13816
13817C
13818 Specifies the new value for the current color index.
13819
13820
13821
13822`glIndex' updates the current (single-valued) color index. It takes one
13823argument, the new value for the current color index.
13824
13825The current index is stored as a floating-point value. Integer values
13826are converted directly to floating-point values, with no special
13827mapping. The initial value is 1.
13828
13829Index values outside the representable range of the color index buffer
13830are not clamped. However, before an index is dithered (if enabled) and
13831written to the frame buffer, it is converted to fixed-point format. Any
13832bits in the integer portion of the resulting fixed-point value that do
13833not correspond to bits in the frame buffer are masked out.")
13834
13835(define-gl-procedure
13836 glInitNames
13837 "glInitNames"
13838 (funcsynopsis
13839 (funcprototype
13840 (funcdef "void " (function "glInitNames"))
13841 (paramdef (parameter "void"))))
13842 "Initialize the name stack.
13843
13844The name stack is used during selection mode to allow sets of rendering
13845commands to be uniquely identified. It consists of an ordered set of
13846unsigned integers. `glInitNames' causes the name stack to be initialized
13847to its default empty state.
13848
13849The name stack is always empty while the render mode is not `GL_SELECT'.
13850Calls to `glInitNames' while the render mode is not `GL_SELECT' are
13851ignored.
13852
13853`GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
13854the execution of `glBegin' and the corresponding execution of `glEnd'.")
13855
13856(define-gl-procedure
13857 glInterleavedArrays
13858 "glInterleavedArrays"
13859 (funcsynopsis
13860 (funcprototype
13861 (funcdef
13862 "void "
13863 (function "glInterleavedArrays"))
13864 (paramdef "GLenum " (parameter "format"))
13865 (paramdef "GLsizei " (parameter "stride"))
13866 (paramdef
13867 "const GLvoid * "
13868 (parameter "pointer"))))
13869 "Simultaneously specify and enable several interleaved arrays.
13870
13871FORMAT
13872 Specifies the type of array to enable. Symbolic constants `GL_V2F',
13873 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
13874 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
13875 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
13876 `GL_T4F_C4F_N3F_V4F' are accepted.
13877
13878STRIDE
13879 Specifies the offset in bytes between each aggregate array element.
13880
13881`glInterleavedArrays' lets you specify and enable individual color,
13882normal, texture and vertex arrays whose elements are part of a larger
13883aggregate array element. For some implementations, this is more
13884efficient than specifying the arrays separately.
13885
13886If STRIDE is 0, the aggregate elements are stored consecutively.
13887Otherwise, STRIDE bytes occur between the beginning of one aggregate
13888array element and the beginning of the next aggregate array element.
13889
13890FORMAT serves as a ``key'' describing the extraction of individual
13891arrays from the aggregate array. If FORMAT contains a T, then texture
13892coordinates are extracted from the interleaved array. If C is present,
13893color values are extracted. If N is present, normal coordinates are
13894extracted. Vertex coordinates are always extracted.
13895
13896The digits 2, 3, and 4 denote how many values are extracted. F indicates
13897that values are extracted as floating-point values. Colors may also be
13898extracted as 4 unsigned bytes if 4UB follows the C. If a color is
13899extracted as 4 unsigned bytes, the vertex array element which follows is
13900located at the first possible floating-point aligned address.
13901
13902`GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
13903
13904`GL_INVALID_VALUE' is generated if STRIDE is negative.")
13905
13906(define-gl-procedure
13907 glIsBuffer
13908 "glIsBuffer"
13909 (funcsynopsis
13910 (funcprototype
13911 (funcdef "GLboolean " (function "glIsBuffer"))
13912 (paramdef "GLuint " (parameter "buffer"))))
13913 "Determine if a name corresponds to a buffer object.
13914
13915BUFFER
13916 Specifies a value that may be the name of a buffer object.
13917
13918`glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
13919buffer object. If BUFFER is zero, or is a non-zero value that is not
13920currently the name of a buffer object, or if an error occurs,
13921`glIsBuffer' returns `GL_FALSE'.
13922
13923A name returned by `glGenBuffers', but not yet associated with a buffer
13924object by calling `glBindBuffer', is not the name of a buffer object.
13925
13926`GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
13927the execution of `glBegin' and the corresponding execution of `glEnd'.")
13928
13929(define-gl-procedure
13930 glIsEnabled
13931 "glIsEnabled"
13932 (funcsynopsis
13933 (funcprototype
13934 (funcdef "GLboolean " (function "glIsEnabled"))
13935 (paramdef "GLenum " (parameter "cap"))))
13936 "Test whether a capability is enabled.
13937
13938CAP
13939 Specifies a symbolic constant indicating a GL capability.
13940
13941`glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
13942returns `GL_FALSE' otherwise. Initially all capabilities except
13943`GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
13944
13945The following capabilities are accepted for CAP:
13946
13947
13948
13949*Constant*
13950 *See*
13951
13952`GL_ALPHA_TEST'
13953 `glAlphaFunc'
13954
13955`GL_AUTO_NORMAL'
13956 `glEvalCoord'
13957
13958`GL_BLEND'
13959 `glBlendFunc', `glLogicOp'
13960
13961`GL_CLIP_PLANE'I
13962 `glClipPlane'
13963
13964`GL_COLOR_ARRAY'
13965 `glColorPointer'
13966
13967`GL_COLOR_LOGIC_OP'
13968 `glLogicOp'
13969
13970`GL_COLOR_MATERIAL'
13971 `glColorMaterial'
13972
13973`GL_COLOR_SUM'
13974 `glSecondaryColor'
13975
13976`GL_COLOR_TABLE'
13977 `glColorTable'
13978
13979`GL_CONVOLUTION_1D'
13980 `glConvolutionFilter1D'
13981
13982`GL_CONVOLUTION_2D'
13983 `glConvolutionFilter2D'
13984
13985`GL_CULL_FACE'
13986 `glCullFace'
13987
13988`GL_DEPTH_TEST'
13989 `glDepthFunc', `glDepthRange'
13990
13991`GL_DITHER'
13992 `glEnable'
13993
13994`GL_EDGE_FLAG_ARRAY'
13995 `glEdgeFlagPointer'
13996
13997`GL_FOG'
13998 `glFog'
13999
14000`GL_FOG_COORD_ARRAY'
14001 `glFogCoordPointer'
14002
14003`GL_HISTOGRAM'
14004 `glHistogram'
14005
14006`GL_INDEX_ARRAY'
14007 `glIndexPointer'
14008
14009`GL_INDEX_LOGIC_OP'
14010 `glLogicOp'
14011
14012`GL_LIGHT'I
14013 `glLightModel', `glLight'
14014
14015`GL_LIGHTING'
14016 `glMaterial', `glLightModel', `glLight'
14017
14018`GL_LINE_SMOOTH'
14019 `glLineWidth'
14020
14021`GL_LINE_STIPPLE'
14022 `glLineStipple'
14023
14024`GL_MAP1_COLOR_4'
14025 `glMap1'
14026
14027`GL_MAP1_INDEX'
14028 `glMap1'
14029
14030`GL_MAP1_NORMAL'
14031 `glMap1'
14032
14033`GL_MAP1_TEXTURE_COORD_1'
14034 `glMap1'
14035
14036`GL_MAP1_TEXTURE_COORD_2'
14037 `glMap1'
14038
14039`GL_MAP1_TEXTURE_COORD_3'
14040 `glMap1'
14041
14042`GL_MAP1_TEXTURE_COORD_4'
14043 `glMap1'
14044
14045`GL_MAP2_COLOR_4'
14046 `glMap2'
14047
14048`GL_MAP2_INDEX'
14049 `glMap2'
14050
14051`GL_MAP2_NORMAL'
14052 `glMap2'
14053
14054`GL_MAP2_TEXTURE_COORD_1'
14055 `glMap2'
14056
14057`GL_MAP2_TEXTURE_COORD_2'
14058 `glMap2'
14059
14060`GL_MAP2_TEXTURE_COORD_3'
14061 `glMap2'
14062
14063`GL_MAP2_TEXTURE_COORD_4'
14064 `glMap2'
14065
14066`GL_MAP2_VERTEX_3'
14067 `glMap2'
14068
14069`GL_MAP2_VERTEX_4'
14070 `glMap2'
14071
14072`GL_MINMAX'
14073 `glMinmax'
14074
14075`GL_MULTISAMPLE'
14076 `glSampleCoverage'
14077
14078`GL_NORMAL_ARRAY'
14079 `glNormalPointer'
14080
14081`GL_NORMALIZE'
14082 `glNormal'
14083
14084`GL_POINT_SMOOTH'
14085 `glPointSize'
14086
14087`GL_POINT_SPRITE'
14088 `glEnable'
14089
14090`GL_POLYGON_SMOOTH'
14091 `glPolygonMode'
14092
14093`GL_POLYGON_OFFSET_FILL'
14094 `glPolygonOffset'
14095
14096`GL_POLYGON_OFFSET_LINE'
14097 `glPolygonOffset'
14098
14099`GL_POLYGON_OFFSET_POINT'
14100 `glPolygonOffset'
14101
14102`GL_POLYGON_STIPPLE'
14103 `glPolygonStipple'
14104
14105`GL_POST_COLOR_MATRIX_COLOR_TABLE'
14106 `glColorTable'
14107
14108`GL_POST_CONVOLUTION_COLOR_TABLE'
14109 `glColorTable'
14110
14111`GL_RESCALE_NORMAL'
14112 `glNormal'
14113
14114`GL_SAMPLE_ALPHA_TO_COVERAGE'
14115 `glSampleCoverage'
14116
14117`GL_SAMPLE_ALPHA_TO_ONE'
14118 `glSampleCoverage'
14119
14120`GL_SAMPLE_COVERAGE'
14121 `glSampleCoverage'
14122
14123`GL_SCISSOR_TEST'
14124 `glScissor'
14125
14126`GL_SECONDARY_COLOR_ARRAY'
14127 `glSecondaryColorPointer'
14128
14129`GL_SEPARABLE_2D'
14130 `glSeparableFilter2D'
14131
14132`GL_STENCIL_TEST'
14133 `glStencilFunc', `glStencilOp'
14134
14135`GL_TEXTURE_1D'
14136 `glTexImage1D'
14137
14138`GL_TEXTURE_2D'
14139 `glTexImage2D'
14140
14141`GL_TEXTURE_3D'
14142 `glTexImage3D'
14143
14144`GL_TEXTURE_COORD_ARRAY'
14145 `glTexCoordPointer'
14146
14147`GL_TEXTURE_CUBE_MAP'
14148 `glTexImage2D'
14149
14150`GL_TEXTURE_GEN_Q'
14151 `glTexGen'
14152
14153`GL_TEXTURE_GEN_R'
14154 `glTexGen'
14155
14156`GL_TEXTURE_GEN_S'
14157 `glTexGen'
14158
14159`GL_TEXTURE_GEN_T'
14160 `glTexGen'
14161
14162`GL_VERTEX_ARRAY'
14163 `glVertexPointer'
14164
14165`GL_VERTEX_PROGRAM_POINT_SIZE'
14166 `glEnable'
14167
14168`GL_VERTEX_PROGRAM_TWO_SIDE'
14169 `glEnable'
14170
14171
14172
14173`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
14174
14175`GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
14176the execution of `glBegin' and the corresponding execution of `glEnd'.")
14177
14178(define-gl-procedure
14179 glIsList
14180 "glIsList"
14181 (funcsynopsis
14182 (funcprototype
14183 (funcdef "GLboolean " (function "glIsList"))
14184 (paramdef "GLuint " (parameter "list"))))
14185 "Determine if a name corresponds to a display list.
14186
14187LIST
14188 Specifies a potential display list name.
14189
14190`glIsList' returns `GL_TRUE' if LIST is the name of a display list and
14191returns `GL_FALSE' if it is not, or if an error occurs.
14192
14193A name returned by `glGenLists', but not yet associated with a display
14194list by calling `glNewList', is not the name of a display list.
14195
14196`GL_INVALID_OPERATION' is generated if `glIsList' is executed between
14197the execution of `glBegin' and the corresponding execution of `glEnd'.")
14198
14199(define-gl-procedure
14200 glIsProgram
14201 "glIsProgram"
14202 (funcsynopsis
14203 (funcprototype
14204 (funcdef "GLboolean " (function "glIsProgram"))
14205 (paramdef "GLuint " (parameter "program"))))
14206 "Determines if a name corresponds to a program object.
14207
14208PROGRAM
14209 Specifies a potential program object.
14210
14211`glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
14212object previously created with `glCreateProgram' and not yet deleted
14213with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
14214not the name of a program object, or if an error occurs, `glIsProgram'
14215returns `GL_FALSE'.
14216
14217`GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
14218the execution of `glBegin' and the corresponding execution of `glEnd'.")
14219
14220(define-gl-procedure
14221 glIsQuery
14222 "glIsQuery"
14223 (funcsynopsis
14224 (funcprototype
14225 (funcdef "GLboolean " (function "glIsQuery"))
14226 (paramdef "GLuint " (parameter "id"))))
14227 "Determine if a name corresponds to a query object.
14228
14229ID
14230 Specifies a value that may be the name of a query object.
14231
14232`glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
14233object. If ID is zero, or is a non-zero value that is not currently the
14234name of a query object, or if an error occurs, `glIsQuery' returns
14235`GL_FALSE'.
14236
14237A name returned by `glGenQueries', but not yet associated with a query
14238object by calling `glBeginQuery', is not the name of a query object.
14239
14240`GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
14241the execution of `glBegin' and the corresponding execution of `glEnd'.")
14242
14243(define-gl-procedure
14244 glIsShader
14245 "glIsShader"
14246 (funcsynopsis
14247 (funcprototype
14248 (funcdef "GLboolean " (function "glIsShader"))
14249 (paramdef "GLuint " (parameter "shader"))))
14250 "Determines if a name corresponds to a shader object.
14251
14252SHADER
14253 Specifies a potential shader object.
14254
14255`glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
14256previously created with `glCreateShader' and not yet deleted with
14257`glDeleteShader'. If SHADER is zero or a non-zero value that is not the
14258name of a shader object, or if an error occurs, `glIsShader ' returns
14259`GL_FALSE'.
14260
14261`GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
14262the execution of `glBegin' and the corresponding execution of `glEnd'.")
14263
14264(define-gl-procedure
14265 glIsTexture
14266 "glIsTexture"
14267 (funcsynopsis
14268 (funcprototype
14269 (funcdef "GLboolean " (function "glIsTexture"))
14270 (paramdef "GLuint " (parameter "texture"))))
14271 "Determine if a name corresponds to a texture.
14272
14273TEXTURE
14274 Specifies a value that may be the name of a texture.
14275
14276`glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
14277texture. If TEXTURE is zero, or is a non-zero value that is not
14278currently the name of a texture, or if an error occurs, `glIsTexture'
14279returns `GL_FALSE'.
14280
14281A name returned by `glGenTextures', but not yet associated with a
14282texture by calling `glBindTexture', is not the name of a texture.
14283
14284`GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
14285the execution of `glBegin' and the corresponding execution of `glEnd'.")
14286
14287(define-gl-procedure
14288 glLightModel
14289 "glLightModel"
14290 (funcsynopsis
14291 (funcprototype
14292 (funcdef "void " (function "glLightModelf"))
14293 (paramdef "GLenum " (parameter "pname"))
14294 (paramdef "GLfloat " (parameter "param"))))
14295 "Set the lighting model parameters.
14296
14297PNAME
14298 Specifies a single-valued lighting model parameter.
14299 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
14300 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
14301
14302PARAM
14303 Specifies the value that PARAM will be set to.
14304
14305`glLightModel' sets the lighting model parameter. PNAME names a
14306parameter and PARAMS gives the new value. There are three lighting model
14307parameters:
14308
14309`GL_LIGHT_MODEL_AMBIENT'
14310
14311
14312 PARAMS contains four integer or floating-point values that specify
14313 the ambient RGBA intensity of the entire scene. Integer values are
14314 mapped linearly such that the most positive representable value
14315 maps to 1.0, and the most negative representable value maps to -1.0
14316 . Floating-point values are mapped directly. Neither integer nor
14317 floating-point values are clamped. The initial ambient scene
14318 intensity is (0.2, 0.2, 0.2, 1.0).
14319
14320`GL_LIGHT_MODEL_COLOR_CONTROL'
14321
14322
14323 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
14324 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
14325 is generated from the lighting computation for a vertex.
14326 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
14327 computation of lighting be stored separately from the remainder of
14328 the lighting computation. The specular color is summed into the
14329 generated fragment's color after the application of texture mapping
14330 (if enabled). The initial value is `GL_SINGLE_COLOR'.
14331
14332`GL_LIGHT_MODEL_LOCAL_VIEWER'
14333
14334
14335 PARAMS is a single integer or floating-point value that specifies
14336 how specular reflection angles are computed. If PARAMS is 0 (or
14337 0.0), specular reflection angles take the view direction to be
14338 parallel to and in the direction of the -Z axis, regardless of the
14339 location of the vertex in eye coordinates. Otherwise, specular
14340 reflections are computed from the origin of the eye coordinate
14341 system. The initial value is 0.
14342
14343`GL_LIGHT_MODEL_TWO_SIDE'
14344
14345
14346 PARAMS is a single integer or floating-point value that specifies
14347 whether one- or two-sided lighting calculations are done for
14348 polygons. It has no effect on the lighting calculations for points,
14349 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
14350 specified, and only the FRONT material parameters are used in the
14351 lighting equation. Otherwise, two-sided lighting is specified. In
14352 this case, vertices of back-facing polygons are lighted using the
14353 BACK material parameters and have their normals reversed before the
14354 lighting equation is evaluated. Vertices of front-facing polygons
14355 are always lighted using the FRONT material parameters, with no
14356 change to their normals. The initial value is 0.
14357
14358In RGBA mode, the lighted color of a vertex is the sum of the material
14359emission intensity, the product of the material ambient reflectance and
14360the lighting model full-scene ambient intensity, and the contribution of
14361each enabled light source. Each light source contributes the sum of
14362three terms: ambient, diffuse, and specular. The ambient light source
14363contribution is the product of the material ambient reflectance and the
14364light's ambient intensity. The diffuse light source contribution is the
14365product of the material diffuse reflectance, the light's diffuse
14366intensity, and the dot product of the vertex's normal with the
14367normalized vector from the vertex to the light source. The specular
14368light source contribution is the product of the material specular
14369reflectance, the light's specular intensity, and the dot product of the
14370normalized vertex-to-eye and vertex-to-light vectors, raised to the
14371power of the shininess of the material. All three light source
14372contributions are attenuated equally based on the distance from the
14373vertex to the light source and on light source direction, spread
14374exponent, and spread cutoff angle. All dot products are replaced with 0
14375if they evaluate to a negative value.
14376
14377The alpha component of the resulting lighted color is set to the alpha
14378value of the material diffuse reflectance.
14379
14380In color index mode, the value of the lighted index of a vertex ranges
14381from the ambient to the specular values passed to `glMaterial' using
14382`GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
14383(.30, .59, .11) weighting of the lights' colors, the shininess of the
14384material, and the same reflection and attenuation equations as in the
14385RGBA case, determine how much above ambient the resulting index is.
14386
14387`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
14388
14389`GL_INVALID_ENUM' is generated if PNAME is
14390`GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
14391`GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
14392
14393`GL_INVALID_OPERATION' is generated if `glLightModel' is executed
14394between the execution of `glBegin' and the corresponding execution of
14395`glEnd'.")
14396
14397(define-gl-procedure
14398 glLight
14399 "glLight"
14400 (funcsynopsis
14401 (funcprototype
14402 (funcdef "void " (function "glLightf"))
14403 (paramdef "GLenum " (parameter "light"))
14404 (paramdef "GLenum " (parameter "pname"))
14405 (paramdef "GLfloat " (parameter "param"))))
14406 "Set light source parameters.
14407
14408LIGHT
14409 Specifies a light. The number of lights depends on the
14410 implementation, but at least eight lights are supported. They are
14411 identified by symbolic names of the form `GL_LIGHT' I , where i
14412 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
14413
14414PNAME
14415 Specifies a single-valued light source parameter for LIGHT.
14416 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
14417 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
14418 accepted.
14419
14420PARAM
14421 Specifies the value that parameter PNAME of light source LIGHT will
14422 be set to.
14423
14424`glLight' sets the values of individual light source parameters. LIGHT
14425names the light and is a symbolic name of the form `GL_LIGHT'I , where i
14426ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
14427of ten light source parameters, again by symbolic name. PARAMS is either
14428a single value or a pointer to an array that contains the new values.
14429
14430To enable and disable lighting calculation, call `glEnable' and
14431`glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
14432When it is enabled, light sources that are enabled contribute to the
14433lighting calculation. Light source I is enabled and disabled using
14434`glEnable' and `glDisable' with argument `GL_LIGHT'I .
14435
14436The ten light parameters are as follows:
14437
14438`GL_AMBIENT'
14439 PARAMS contains four integer or floating-point values that specify
14440 the ambient RGBA intensity of the light. Integer values are mapped
14441 linearly such that the most positive representable value maps to
14442 1.0, and the most negative representable value maps to -1.0 .
14443 Floating-point values are mapped directly. Neither integer nor
14444 floating-point values are clamped. The initial ambient light
14445 intensity is (0, 0, 0, 1).
14446
14447`GL_DIFFUSE'
14448 PARAMS contains four integer or floating-point values that specify
14449 the diffuse RGBA intensity of the light. Integer values are mapped
14450 linearly such that the most positive representable value maps to
14451 1.0, and the most negative representable value maps to -1.0 .
14452 Floating-point values are mapped directly. Neither integer nor
14453 floating-point values are clamped. The initial value for
14454 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14455 (0, 0, 0, 1).
14456
14457`GL_SPECULAR'
14458 PARAMS contains four integer or floating-point values that specify
14459 the specular RGBA intensity of the light. Integer values are mapped
14460 linearly such that the most positive representable value maps to
14461 1.0, and the most negative representable value maps to -1.0 .
14462 Floating-point values are mapped directly. Neither integer nor
14463 floating-point values are clamped. The initial value for
14464 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14465 (0, 0, 0, 1).
14466
14467`GL_POSITION'
14468 PARAMS contains four integer or floating-point values that specify
14469 the position of the light in homogeneous object coordinates. Both
14470 integer and floating-point values are mapped directly. Neither
14471 integer nor floating-point values are clamped.
14472
14473 The position is transformed by the modelview matrix when `glLight'
14474 is called (just as if it were a point), and it is stored in eye
14475 coordinates. If the W component of the position is 0, the light is
14476 treated as a directional source. Diffuse and specular lighting
14477 calculations take the light's direction, but not its actual
14478 position, into account, and attenuation is disabled. Otherwise,
14479 diffuse and specular lighting calculations are based on the actual
14480 location of the light in eye coordinates, and attenuation is
14481 enabled. The initial position is (0, 0, 1, 0); thus, the initial
14482 light source is directional, parallel to, and in the direction of
14483 the -Z axis.
14484
14485`GL_SPOT_DIRECTION'
14486 PARAMS contains three integer or floating-point values that specify
14487 the direction of the light in homogeneous object coordinates. Both
14488 integer and floating-point values are mapped directly. Neither
14489 integer nor floating-point values are clamped.
14490
14491 The spot direction is transformed by the upper 3x3 of the modelview
14492 matrix when `glLight' is called, and it is stored in eye
14493 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
14494 180, which it is initially. The initial direction is (0,0-1) .
14495
14496`GL_SPOT_EXPONENT'
14497 PARAMS is a single integer or floating-point value that specifies
14498 the intensity distribution of the light. Integer and floating-point
14499 values are mapped directly. Only values in the range [0,128] are
14500 accepted.
14501
14502 Effective light intensity is attenuated by the cosine of the angle
14503 between the direction of the light and the direction from the light
14504 to the vertex being lighted, raised to the power of the spot
14505 exponent. Thus, higher spot exponents result in a more focused
14506 light source, regardless of the spot cutoff angle (see
14507 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
14508 resulting in uniform light distribution.
14509
14510`GL_SPOT_CUTOFF'
14511 PARAMS is a single integer or floating-point value that specifies
14512 the maximum spread angle of a light source. Integer and
14513 floating-point values are mapped directly. Only values in the range
14514 [0,90] and the special value 180 are accepted. If the angle between
14515 the direction of the light and the direction from the light to the
14516 vertex being lighted is greater than the spot cutoff angle, the
14517 light is completely masked. Otherwise, its intensity is controlled
14518 by the spot exponent and the attenuation factors. The initial spot
14519 cutoff is 180, resulting in uniform light distribution.
14520
14521`GL_CONSTANT_ATTENUATION'
14522`GL_LINEAR_ATTENUATION'
14523`GL_QUADRATIC_ATTENUATION'
14524 PARAMS is a single integer or floating-point value that specifies
14525 one of the three light attenuation factors. Integer and
14526 floating-point values are mapped directly. Only nonnegative values
14527 are accepted. If the light is positional, rather than directional,
14528 its intensity is attenuated by the reciprocal of the sum of the
14529 constant factor, the linear factor times the distance between the
14530 light and the vertex being lighted, and the quadratic factor times
14531 the square of the same distance. The initial attenuation factors
14532 are (1, 0, 0), resulting in no attenuation.
14533
14534`GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
14535accepted value.
14536
14537`GL_INVALID_VALUE' is generated if a spot exponent value is specified
14538outside the range [0,128] , or if spot cutoff is specified outside the
14539range [0,90] (except for the special value 180), or if a negative
14540attenuation factor is specified.
14541
14542`GL_INVALID_OPERATION' is generated if `glLight' is executed between the
14543execution of `glBegin' and the corresponding execution of `glEnd'.")
14544
14545(define-gl-procedure
14546 glLineStipple
14547 "glLineStipple"
14548 (funcsynopsis
14549 (funcprototype
14550 (funcdef "void " (function "glLineStipple"))
14551 (paramdef "GLint " (parameter "factor"))
14552 (paramdef "GLushort " (parameter "pattern"))))
14553 "Specify the line stipple pattern.
14554
14555FACTOR
14556 Specifies a multiplier for each bit in the line stipple pattern. If
14557 FACTOR is 3, for example, each bit in the pattern is used three
14558 times before the next bit in the pattern is used. FACTOR is clamped
14559 to the range [1, 256] and defaults to 1.
14560
14561PATTERN
14562 Specifies a 16-bit integer whose bit pattern determines which
14563 fragments of a line will be drawn when the line is rasterized. Bit
14564 zero is used first; the default pattern is all 1's.
14565
14566Line stippling masks out certain fragments produced by rasterization;
14567those fragments will not be drawn. The masking is achieved by using
14568three parameters: the 16-bit line stipple pattern PATTERN, the repeat
14569count FACTOR, and an integer stipple counter S .
14570
14571Counter S is reset to 0 whenever `glBegin' is called and before each
14572line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
14573It is incremented after each fragment of a unit width aliased line
14574segment is generated or after each I fragments of an I width line
14575segment are generated. The I fragments associated with count S are
14576masked out if
14577
14578PATTERN bit (S/FACTOR,)%16
14579
14580is 0, otherwise these fragments are sent to the frame buffer. Bit zero
14581of PATTERN is the least significant bit.
14582
14583Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
14584purposes of stippling. Whether rectangle S is rasterized or not depends
14585on the fragment rule described for aliased lines, counting rectangles
14586rather than groups of fragments.
14587
14588To enable and disable line stippling, call `glEnable' and `glDisable'
14589with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
14590is applied as described above. When disabled, it is as if the pattern
14591were all 1's. Initially, line stippling is disabled.
14592
14593`GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
14594between the execution of `glBegin' and the corresponding execution of
14595`glEnd'.")
14596
14597(define-gl-procedure
14598 glLineWidth
14599 "glLineWidth"
14600 (funcsynopsis
14601 (funcprototype
14602 (funcdef "void " (function "glLineWidth"))
14603 (paramdef "GLfloat " (parameter "width"))))
14604 "Specify the width of rasterized lines.
14605
14606WIDTH
14607 Specifies the width of rasterized lines. The initial value is 1.
14608
14609`glLineWidth' specifies the rasterized width of both aliased and
14610antialiased lines. Using a line width other than 1 has different
14611effects, depending on whether line antialiasing is enabled. To enable
14612and disable line antialiasing, call `glEnable' and `glDisable' with
14613argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
14614
14615If line antialiasing is disabled, the actual width is determined by
14616rounding the supplied width to the nearest integer. (If the rounding
14617results in the value 0, it is as if the line width were 1.) If
14618∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
14619where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
14620each row that is rasterized.
14621
14622If antialiasing is enabled, line rasterization produces a fragment for
14623each pixel square that intersects the region lying within the rectangle
14624having width equal to the current line width, length equal to the actual
14625length of the line, and centered on the mathematical line segment. The
14626coverage value for each fragment is the window coordinate area of the
14627intersection of the rectangular region with the corresponding pixel
14628square. This value is saved and used in the final rasterization step.
14629
14630Not all widths can be supported when line antialiasing is enabled. If an
14631unsupported width is requested, the nearest supported width is used.
14632Only width 1 is guaranteed to be supported; others depend on the
14633implementation. Likewise, there is a range for aliased line widths as
14634well. To query the range of supported widths and the size difference
14635between supported widths within the range, call `glGet' with arguments
14636`GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
14637`GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
14638
14639`GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
14640
14641`GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
14642the execution of `glBegin' and the corresponding execution of `glEnd'.")
14643
14644(define-gl-procedure
14645 glLinkProgram
14646 "glLinkProgram"
14647 (funcsynopsis
14648 (funcprototype
14649 (funcdef "void " (function "glLinkProgram"))
14650 (paramdef "GLuint " (parameter "program"))))
14651 "Links a program object.
14652
14653PROGRAM
14654 Specifies the handle of the program object to be linked.
14655
14656`glLinkProgram' links the program object specified by PROGRAM. If any
14657shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
14658will be used to create an executable that will run on the programmable
14659vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
14660attached to PROGRAM, they will be used to create an executable that will
14661run on the programmable fragment processor.
14662
14663The status of the link operation will be stored as part of the program
14664object's state. This value will be set to `GL_TRUE' if the program
14665object was linked without errors and is ready for use, and `GL_FALSE'
14666otherwise. It can be queried by calling `glGetProgram' with arguments
14667PROGRAM and `GL_LINK_STATUS'.
14668
14669As a result of a successful link operation, all active user-defined
14670uniform variables belonging to PROGRAM will be initialized to 0, and
14671each of the program object's active uniform variables will be assigned a
14672location that can be queried by calling `glGetUniformLocation'. Also,
14673any active user-defined attribute variables that have not been bound to
14674a generic vertex attribute index will be bound to one at this time.
14675
14676Linking of a program object can fail for a number of reasons as
14677specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
14678lists some of the conditions that will cause a link error.
14679
14680 * The storage limit for uniform variables has been exceeded.
14681
14682 * The number of active uniform variables supported by the
14683 implementation has been exceeded.
14684
14685 * The `main' function is missing for the vertex shader or the
14686 fragment shader.
14687
14688 * A varying variable actually used in the fragment shader is not
14689 declared in the same way (or is not declared at all) in the vertex
14690 shader.
14691
14692 * A reference to a function or variable name is unresolved.
14693
14694 * A shared global is declared with two different types or two
14695 different initial values.
14696
14697 * One or more of the attached shader objects has not been
14698 successfully compiled.
14699
14700 * Binding a generic attribute matrix caused some rows of the matrix
14701 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
14702
14703 * Not enough contiguous vertex attribute slots could be found to bind
14704 attribute matrices.
14705
14706When a program object has been successfully linked, the program object
14707can be made part of current state by calling `glUseProgram'. Whether or
14708not the link operation was successful, the program object's information
14709log will be overwritten. The information log can be retrieved by calling
14710`glGetProgramInfoLog'.
14711
14712`glLinkProgram' will also install the generated executables as part of
14713the current rendering state if the link operation was successful and the
14714specified program object is already currently in use as a result of a
14715previous call to `glUseProgram'. If the program object currently in use
14716is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
14717but the executables and associated state will remain part of the current
14718state until a subsequent call to `glUseProgram' removes it from use.
14719After it is removed from use, it cannot be made part of current state
14720until it has been successfully relinked.
14721
14722If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
14723not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
14724shader will be linked against the implicit interface for fixed
14725functionality fragment processing. Similarly, if PROGRAM contains shader
14726objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
14727objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
14728against the implicit interface for fixed functionality vertex
14729processing.
14730
14731The program object's information log is updated and the program is
14732generated at the time of the link operation. After the link operation,
14733applications are free to modify attached shader objects, compile
14734attached shader objects, detach shader objects, delete shader objects,
14735and attach additional shader objects. None of these operations affects
14736the information log or the program that is part of the program object.
14737
14738`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
14739OpenGL.
14740
14741`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
14742
14743`GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
14744between the execution of `glBegin' and the corresponding execution of
14745`glEnd'.")
14746
14747(define-gl-procedure
14748 glListBase
14749 "glListBase"
14750 (funcsynopsis
14751 (funcprototype
14752 (funcdef "void " (function "glListBase"))
14753 (paramdef "GLuint " (parameter "base"))))
14754 "Set the display-list base for .
14755
14756BASE
14757 Specifies an integer offset that will be added to `glCallLists'
14758 offsets to generate display-list names. The initial value is 0.
14759
14760`glCallLists' specifies an array of offsets. Display-list names are
14761generated by adding BASE to each offset. Names that reference valid
14762display lists are executed; the others are ignored.
14763
14764`GL_INVALID_OPERATION' is generated if `glListBase' is executed between
14765the execution of `glBegin' and the corresponding execution of `glEnd'.")
14766
14767(define-gl-procedure
14768 glLoadIdentity
14769 "glLoadIdentity"
14770 (funcsynopsis
14771 (funcprototype
14772 (funcdef "void " (function "glLoadIdentity"))
14773 (paramdef (parameter "void"))))
14774 "Replace the current matrix with the identity matrix.
14775
14776`glLoadIdentity' replaces the current matrix with the identity matrix.
14777It is semantically equivalent to calling `glLoadMatrix' with the
14778identity matrix
14779
14780
14781
14782((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
14783
14784
14785
14786but in some cases it is more efficient.
14787
14788`GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
14789between the execution of `glBegin' and the corresponding execution of
14790`glEnd'.")
14791
14792(define-gl-procedure
14793 glLoadMatrix
14794 "glLoadMatrix"
14795 (funcsynopsis
14796 (funcprototype
14797 (funcdef "void " (function "glLoadMatrixd"))
14798 (paramdef "const GLdouble * " (parameter "m"))))
14799 "Replace the current matrix with the specified matrix.
14800
14801M
14802 Specifies a pointer to 16 consecutive values, which are used as the
14803 elements of a 4×4 column-major matrix.
14804
14805`glLoadMatrix' replaces the current matrix with the one whose elements
14806are specified by M. The current matrix is the projection matrix,
14807modelview matrix, or texture matrix, depending on the current matrix
14808mode (see `glMatrixMode').
14809
14810The current matrix, M, defines a transformation of coordinates. For
14811instance, assume M refers to the modelview matrix. If
14812V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14813vertex, and M points to an array of 16 single- or double-precision
14814floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14815transformation M\u2061(V,) does the following:
14816
14817M\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,]),
14818(M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
14819M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14820
14821
14822
14823Projection and texture transformations are similarly defined.
14824
14825`GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
14826between the execution of `glBegin' and the corresponding execution of
14827`glEnd'.")
14828
14829(define-gl-procedure
14830 glLoadName
14831 "glLoadName"
14832 (funcsynopsis
14833 (funcprototype
14834 (funcdef "void " (function "glLoadName"))
14835 (paramdef "GLuint " (parameter "name"))))
14836 "Load a name onto the name stack.
14837
14838NAME
14839 Specifies a name that will replace the top value on the name stack.
14840
14841The name stack is used during selection mode to allow sets of rendering
14842commands to be uniquely identified. It consists of an ordered set of
14843unsigned integers and is initially empty.
14844
14845`glLoadName' causes NAME to replace the value on the top of the name
14846stack.
14847
14848The name stack is always empty while the render mode is not `GL_SELECT'.
14849Calls to `glLoadName' while the render mode is not `GL_SELECT' are
14850ignored.
14851
14852`GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
14853name stack is empty.
14854
14855`GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
14856the execution of `glBegin' and the corresponding execution of `glEnd'.")
14857
14858(define-gl-procedure
14859 glLoadTransposeMatrix
14860 "glLoadTransposeMatrix"
14861 (funcsynopsis
14862 (funcprototype
14863 (funcdef
14864 "void "
14865 (function "glLoadTransposeMatrixd"))
14866 (paramdef "const GLdouble * " (parameter "m"))))
14867 "Replace the current matrix with the specified row-major ordered matrix.
14868
14869M
14870 Specifies a pointer to 16 consecutive values, which are used as the
14871 elements of a 4×4 row-major matrix.
14872
14873`glLoadTransposeMatrix' replaces the current matrix with the one whose
14874elements are specified by M. The current matrix is the projection
14875matrix, modelview matrix, or texture matrix, depending on the current
14876matrix mode (see `glMatrixMode').
14877
14878The current matrix, M, defines a transformation of coordinates. For
14879instance, assume M refers to the modelview matrix. If
14880V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14881vertex, and M points to an array of 16 single- or double-precision
14882floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14883transformation M\u2061(V,) does the following:
14884
14885M\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,]),
14886(M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
14887M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14888
14889
14890
14891Projection and texture transformations are similarly defined.
14892
14893Calling `glLoadTransposeMatrix' with matrix M is identical in operation
14894to `glLoadMatrix' with M^T , where T represents the transpose.
14895
14896`GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
14897executed between the execution of `glBegin' and the corresponding
14898execution of `glEnd'.")
14899
14900(define-gl-procedure
14901 glLogicOp
14902 "glLogicOp"
14903 (funcsynopsis
14904 (funcprototype
14905 (funcdef "void " (function "glLogicOp"))
14906 (paramdef "GLenum " (parameter "opcode"))))
14907 "Specify a logical pixel operation for color index rendering.
14908
14909OPCODE
14910 Specifies a symbolic constant that selects a logical operation. The
14911 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
14912 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
14913 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
14914 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
14915 initial value is `GL_COPY'.
14916
14917`glLogicOp' specifies a logical operation that, when enabled, is applied
14918between the incoming color index or RGBA color and the color index or
14919RGBA color at the corresponding location in the frame buffer. To enable
14920or disable the logical operation, call `glEnable' and `glDisable' using
14921the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
14922`GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
14923for both operations.
14924
14925
14926
14927*Opcode*
14928 *Resulting Operation*
14929
14930`GL_CLEAR'
14931 0
14932
14933`GL_SET'
14934 1
14935
14936`GL_COPY'
14937 s
14938
14939`GL_COPY_INVERTED'
14940 ~s
14941
14942`GL_NOOP'
14943 d
14944
14945`GL_INVERT'
14946 ~d
14947
14948`GL_AND'
14949 s & d
14950
14951`GL_NAND'
14952 ~(s & d)
14953
14954`GL_OR'
14955 s | d
14956
14957`GL_NOR'
14958 ~(s | d)
14959
14960`GL_XOR'
14961 s ^ d
14962
14963`GL_EQUIV'
14964 ~(s ^ d)
14965
14966`GL_AND_REVERSE'
14967 s & ~d
14968
14969`GL_AND_INVERTED'
14970 ~s & d
14971
14972`GL_OR_REVERSE'
14973 s | ~d
14974
14975`GL_OR_INVERTED'
14976 ~s | d
14977
14978OPCODE is a symbolic constant chosen from the list above. In the
14979explanation of the logical operations, S represents the incoming color
14980index and D represents the index in the frame buffer. Standard
14981C-language operators are used. As these bitwise operators suggest, the
14982logical operation is applied independently to each bit pair of the
14983source and destination indices or colors.
14984
14985`GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
14986
14987`GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
14988the execution of `glBegin' and the corresponding execution of `glEnd'.")
14989
14990(define-gl-procedure
14991 glMap1
14992 "glMap1"
14993 (funcsynopsis
14994 (funcprototype
14995 (funcdef "void " (function "glMap1f"))
14996 (paramdef "GLenum " (parameter "target"))
14997 (paramdef "GLfloat " (parameter "u1"))
14998 (paramdef "GLfloat " (parameter "u2"))
14999 (paramdef "GLint " (parameter "stride"))
15000 (paramdef "GLint " (parameter "order"))
15001 (paramdef
15002 "const GLfloat * "
15003 (parameter "points"))))
15004 "Define a one-dimensional evaluator.
15005
15006TARGET
15007 Specifies the kind of values that are generated by the evaluator.
15008 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
15009 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
15010 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
15011 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
15012 accepted.
15013
15014U1
15015 U2
15016
15017 Specify a linear mapping of U , as presented to `glEvalCoord1', to
15018 U^ , the variable that is evaluated by the equations specified by
15019 this command.
15020
15021STRIDE
15022 Specifies the number of floats or doubles between the beginning of
15023 one control point and the beginning of the next one in the data
15024 structure referenced in POINTS. This allows control points to be
15025 embedded in arbitrary data structures. The only constraint is that
15026 the values for a particular control point must occupy contiguous
15027 memory locations.
15028
15029ORDER
15030 Specifies the number of control points. Must be positive.
15031
15032POINTS
15033 Specifies a pointer to the array of control points.
15034
15035Evaluators provide a way to use polynomial or rational polynomial
15036mapping to produce vertices, normals, texture coordinates, and colors.
15037The values produced by an evaluator are sent to further stages of GL
15038processing just as if they had been presented using `glVertex',
15039`glNormal', `glTexCoord', and `glColor' commands, except that the
15040generated values do not update the current normal, texture coordinates,
15041or color.
15042
15043All polynomial or rational polynomial splines of any degree (up to the
15044maximum degree supported by the GL implementation) can be described
15045using evaluators. These include almost all splines used in computer
15046graphics: B-splines, Bezier curves, Hermite splines, and so on.
15047
15048Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
15049as
15050
15051P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
15052
15053
15054
15055where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
15056polynomial of degree N (ORDER = N+1 ):
15057
15058B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
15059
15060Recall that
15061
150620^0==1 and ((N), (0),,)==1
15063
15064`glMap1' is used to define the basis and to specify what kind of values
15065are produced. Once defined, a map can be enabled and disabled by calling
15066`glEnable' and `glDisable' with the map name, one of the nine predefined
15067values for TARGET described below. `glEvalCoord1' evaluates the
15068one-dimensional maps that are enabled. When `glEvalCoord1' presents a
15069value U , the Bernstein functions are evaluated using U^ , where
15070U^=U-U1,/U2-U1,
15071
15072TARGET is a symbolic constant that indicates what kind of control points
15073are provided in POINTS, and what output is generated when the map is
15074evaluated. It can assume one of nine predefined values:
15075
15076`GL_MAP1_VERTEX_3'
15077 Each control point is three floating-point values representing X ,
15078 Y , and Z . Internal `glVertex3' commands are generated when the
15079 map is evaluated.
15080
15081`GL_MAP1_VERTEX_4'
15082 Each control point is four floating-point values representing X , Y
15083 , Z , and W . Internal `glVertex4' commands are generated when the
15084 map is evaluated.
15085
15086`GL_MAP1_INDEX'
15087 Each control point is a single floating-point value representing a
15088 color index. Internal `glIndex' commands are generated when the map
15089 is evaluated but the current index is not updated with the value of
15090 these `glIndex' commands.
15091
15092`GL_MAP1_COLOR_4'
15093 Each control point is four floating-point values representing red,
15094 green, blue, and alpha. Internal `glColor4' commands are generated
15095 when the map is evaluated but the current color is not updated with
15096 the value of these `glColor4' commands.
15097
15098`GL_MAP1_NORMAL'
15099 Each control point is three floating-point values representing the
15100 X , Y , and Z components of a normal vector. Internal `glNormal'
15101 commands are generated when the map is evaluated but the current
15102 normal is not updated with the value of these `glNormal' commands.
15103
15104`GL_MAP1_TEXTURE_COORD_1'
15105 Each control point is a single floating-point value representing
15106 the S texture coordinate. Internal `glTexCoord1' commands are
15107 generated when the map is evaluated but the current texture
15108 coordinates are not updated with the value of these `glTexCoord'
15109 commands.
15110
15111`GL_MAP1_TEXTURE_COORD_2'
15112 Each control point is two floating-point values representing the S
15113 and T texture coordinates. Internal `glTexCoord2' commands are
15114 generated when the map is evaluated but the current texture
15115 coordinates are not updated with the value of these `glTexCoord'
15116 commands.
15117
15118`GL_MAP1_TEXTURE_COORD_3'
15119 Each control point is three floating-point values representing the
15120 S , T , and R texture coordinates. Internal `glTexCoord3' commands
15121 are generated when the map is evaluated but the current texture
15122 coordinates are not updated with the value of these `glTexCoord'
15123 commands.
15124
15125`GL_MAP1_TEXTURE_COORD_4'
15126 Each control point is four floating-point values representing the S
15127 , T , R , and Q texture coordinates. Internal `glTexCoord4'
15128 commands are generated when the map is evaluated but the current
15129 texture coordinates are not updated with the value of these
15130 `glTexCoord' commands.
15131
15132STRIDE, ORDER, and POINTS define the array addressing for accessing the
15133control points. POINTS is the location of the first control point, which
15134occupies one, two, three, or four contiguous memory locations, depending
15135on which map is being defined. ORDER is the number of control points in
15136the array. STRIDE specifies how many float or double locations to
15137advance the internal memory pointer to reach the next control point.
15138
15139`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
15140
15141`GL_INVALID_VALUE' is generated if U1 is equal to U2.
15142
15143`GL_INVALID_VALUE' is generated if STRIDE is less than the number of
15144values in a control point.
15145
15146`GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
15147the return value of `GL_MAX_EVAL_ORDER'.
15148
15149`GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
15150execution of `glBegin' and the corresponding execution of `glEnd'.
15151
15152`GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
15153of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
15154
15155(define-gl-procedure
15156 glMap2
15157 "glMap2"
15158 (funcsynopsis
15159 (funcprototype
15160 (funcdef "void " (function "glMap2f"))
15161 (paramdef "GLenum " (parameter "target"))
15162 (paramdef "GLfloat " (parameter "u1"))
15163 (paramdef "GLfloat " (parameter "u2"))
15164 (paramdef "GLint " (parameter "ustride"))
15165 (paramdef "GLint " (parameter "uorder"))
15166 (paramdef "GLfloat " (parameter "v1"))
15167 (paramdef "GLfloat " (parameter "v2"))
15168 (paramdef "GLint " (parameter "vstride"))
15169 (paramdef "GLint " (parameter "vorder"))
15170 (paramdef
15171 "const GLfloat * "
15172 (parameter "points"))))
15173 "Define a two-dimensional evaluator.
15174
15175TARGET
15176 Specifies the kind of values that are generated by the evaluator.
15177 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
15178 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
15179 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
15180 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
15181 accepted.
15182
15183U1
15184 U2
15185
15186 Specify a linear mapping of U , as presented to `glEvalCoord2', to
15187 U^ , one of the two variables that are evaluated by the equations
15188 specified by this command. Initially, U1 is 0 and U2 is 1.
15189
15190USTRIDE
15191 Specifies the number of floats or doubles between the beginning of
15192 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
15193 where I and J are the U and V control point indices, respectively.
15194 This allows control points to be embedded in arbitrary data
15195 structures. The only constraint is that the values for a particular
15196 control point must occupy contiguous memory locations. The initial
15197 value of USTRIDE is 0.
15198
15199UORDER
15200 Specifies the dimension of the control point array in the U axis.
15201 Must be positive. The initial value is 1.
15202
15203V1
15204 V2
15205
15206 Specify a linear mapping of V , as presented to `glEvalCoord2', to
15207 V^ , one of the two variables that are evaluated by the equations
15208 specified by this command. Initially, V1 is 0 and V2 is 1.
15209
15210VSTRIDE
15211 Specifies the number of floats or doubles between the beginning of
15212 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
15213 where I and J are the U and V control point indices, respectively.
15214 This allows control points to be embedded in arbitrary data
15215 structures. The only constraint is that the values for a particular
15216 control point must occupy contiguous memory locations. The initial
15217 value of VSTRIDE is 0.
15218
15219VORDER
15220 Specifies the dimension of the control point array in the V axis.
15221 Must be positive. The initial value is 1.
15222
15223POINTS
15224 Specifies a pointer to the array of control points.
15225
15226Evaluators provide a way to use polynomial or rational polynomial
15227mapping to produce vertices, normals, texture coordinates, and colors.
15228The values produced by an evaluator are sent on to further stages of GL
15229processing just as if they had been presented using `glVertex',
15230`glNormal', `glTexCoord', and `glColor' commands, except that the
15231generated values do not update the current normal, texture coordinates,
15232or color.
15233
15234All polynomial or rational polynomial splines of any degree (up to the
15235maximum degree supported by the GL implementation) can be described
15236using evaluators. These include almost all surfaces used in computer
15237graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
15238and so on.
15239
15240Evaluators define surfaces based on bivariate Bernstein polynomials.
15241Define P\u2061(U^,V^) as
15242
15243P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
15244
15245
15246
15247where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
15248polynomial of degree N (UORDER = N+1 )
15249
15250B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
15251
15252and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
15253M+1 )
15254
15255B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
15256
15257Recall that 0^0==1 and ((N), (0),,)==1
15258
15259`glMap2' is used to define the basis and to specify what kind of values
15260are produced. Once defined, a map can be enabled and disabled by calling
15261`glEnable' and `glDisable' with the map name, one of the nine predefined
15262values for TARGET, described below. When `glEvalCoord2' presents values
15263U and V , the bivariate Bernstein polynomials are evaluated using U^ and
15264V^ , where
15265
15266U^=U-U1,/U2-U1,
15267
15268V^=V-V1,/V2-V1,
15269
15270TARGET is a symbolic constant that indicates what kind of control points
15271are provided in POINTS, and what output is generated when the map is
15272evaluated. It can assume one of nine predefined values:
15273
15274`GL_MAP2_VERTEX_3'
15275 Each control point is three floating-point values representing X ,
15276 Y , and Z . Internal `glVertex3' commands are generated when the
15277 map is evaluated.
15278
15279`GL_MAP2_VERTEX_4'
15280 Each control point is four floating-point values representing X , Y
15281 , Z , and W . Internal `glVertex4' commands are generated when the
15282 map is evaluated.
15283
15284`GL_MAP2_INDEX'
15285 Each control point is a single floating-point value representing a
15286 color index. Internal `glIndex' commands are generated when the map
15287 is evaluated but the current index is not updated with the value of
15288 these `glIndex' commands.
15289
15290`GL_MAP2_COLOR_4'
15291 Each control point is four floating-point values representing red,
15292 green, blue, and alpha. Internal `glColor4' commands are generated
15293 when the map is evaluated but the current color is not updated with
15294 the value of these `glColor4' commands.
15295
15296`GL_MAP2_NORMAL'
15297 Each control point is three floating-point values representing the
15298 X , Y , and Z components of a normal vector. Internal `glNormal'
15299 commands are generated when the map is evaluated but the current
15300 normal is not updated with the value of these `glNormal' commands.
15301
15302`GL_MAP2_TEXTURE_COORD_1'
15303 Each control point is a single floating-point value representing
15304 the S texture coordinate. Internal `glTexCoord1' commands are
15305 generated when the map is evaluated but the current texture
15306 coordinates are not updated with the value of these `glTexCoord'
15307 commands.
15308
15309`GL_MAP2_TEXTURE_COORD_2'
15310 Each control point is two floating-point values representing the S
15311 and T texture coordinates. Internal `glTexCoord2' commands are
15312 generated when the map is evaluated but the current texture
15313 coordinates are not updated with the value of these `glTexCoord'
15314 commands.
15315
15316`GL_MAP2_TEXTURE_COORD_3'
15317 Each control point is three floating-point values representing the
15318 S , T , and R texture coordinates. Internal `glTexCoord3' commands
15319 are generated when the map is evaluated but the current texture
15320 coordinates are not updated with the value of these `glTexCoord'
15321 commands.
15322
15323`GL_MAP2_TEXTURE_COORD_4'
15324 Each control point is four floating-point values representing the S
15325 , T , R , and Q texture coordinates. Internal `glTexCoord4'
15326 commands are generated when the map is evaluated but the current
15327 texture coordinates are not updated with the value of these
15328 `glTexCoord' commands.
15329
15330USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
15331for accessing the control points. POINTS is the location of the first
15332control point, which occupies one, two, three, or four contiguous memory
15333locations, depending on which map is being defined. There are
15334UORDER×VORDER control points in the array. USTRIDE specifies how many
15335float or double locations are skipped to advance the internal memory
15336pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
15337specifies how many float or double locations are skipped to advance the
15338internal memory pointer from control point R_I\u2062J, to control point
15339R_I\u2061(J+1,), .
15340
15341`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
15342
15343`GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
15344to V2.
15345
15346`GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
15347than the number of values in a control point.
15348
15349`GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
153501 or greater than the return value of `GL_MAX_EVAL_ORDER'.
15351
15352`GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
15353execution of `glBegin' and the corresponding execution of `glEnd'.
15354
15355`GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
15356of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
15357
15358(define-gl-procedure
15359 glMapBuffer
15360 "glMapBuffer"
15361 (funcsynopsis
15362 (funcprototype
15363 (funcdef "void * " (function "glMapBuffer"))
15364 (paramdef "GLenum " (parameter "target"))
15365 (paramdef "GLenum " (parameter "access"))))
15366 "Map a buffer object's data store.
15367
15368TARGET
15369 Specifies the target buffer object being mapped. The symbolic
15370 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
15371 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
15372
15373ACCESS
15374 Specifies the access policy, indicating whether it will be possible
15375 to read from, write to, or both read from and write to the buffer
15376 object's mapped data store. The symbolic constant must be
15377 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
15378
15379`glMapBuffer' maps to the client's address space the entire data store
15380of the buffer object currently bound to TARGET. The data can then be
15381directly read and/or written relative to the returned pointer, depending
15382on the specified ACCESS policy. If the GL is unable to map the buffer
15383object's data store, `glMapBuffer' generates an error and returns
15384`NULL'. This may occur for system-specific reasons, such as low virtual
15385memory availability.
15386
15387If a mapped data store is accessed in a way inconsistent with the
15388specified ACCESS policy, no error is generated, but performance may be
15389negatively impacted and system errors, including program termination,
15390may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
15391a hint, and does in fact constrain the usage of the mapped data store on
15392some GL implementations. In order to achieve the highest performance
15393available, a buffer object's data store should be used in ways
15394consistent with both its specified USAGE and ACCESS parameters.
15395
15396A mapped data store must be unmapped with `glUnmapBuffer' before its
15397buffer object is used. Otherwise an error will be generated by any GL
15398command that attempts to dereference the buffer object's data store.
15399When a data store is unmapped, the pointer to its data store becomes
15400invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
15401contents have become corrupt during the time the data store was mapped.
15402This can occur for system-specific reasons that affect the availability
15403of graphics memory, such as screen mode changes. In such situations,
15404`GL_FALSE' is returned and the data store contents are undefined. An
15405application must detect this rare condition and reinitialize the data
15406store.
15407
15408A buffer object's mapped data store is automatically unmapped when the
15409buffer object is deleted or its data store is recreated with
15410`glBufferData'.
15411
15412`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
15413`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
15414`GL_PIXEL_UNPACK_BUFFER'.
15415
15416`GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
15417`GL_WRITE_ONLY', or `GL_READ_WRITE'.
15418
15419`GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
15420is unable to map the buffer object's data store. This may occur for a
15421variety of system-specific reasons, such as the absence of sufficient
15422remaining virtual memory.
15423
15424`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
15425is bound to TARGET.
15426
15427`GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
15428buffer object whose data store is already mapped.
15429
15430`GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
15431buffer object whose data store is not currently mapped.
15432
15433`GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
15434is executed between the execution of `glBegin' and the corresponding
15435execution of `glEnd'.")
15436
15437(define-gl-procedure
15438 glMapGrid
15439 "glMapGrid"
15440 (funcsynopsis
15441 (funcprototype
15442 (funcdef "void " (function "glMapGrid1d"))
15443 (paramdef "GLint " (parameter "un"))
15444 (paramdef "GLdouble " (parameter "u1"))
15445 (paramdef "GLdouble " (parameter "u2"))))
15446 "Define a one- or two-dimensional mesh.
15447
15448UN
15449 Specifies the number of partitions in the grid range interval [U1,
15450 U2]. Must be positive.
15451
15452U1
15453 U2
15454
15455 Specify the mappings for integer grid domain values I=0 and I=UN .
15456
15457VN
15458 Specifies the number of partitions in the grid range interval [V1,
15459 V2] (`glMapGrid2' only).
15460
15461V1
15462 V2
15463
15464 Specify the mappings for integer grid domain values J=0 and J=VN
15465 (`glMapGrid2' only).
15466
15467`glMapGrid' and `glEvalMesh' are used together to efficiently generate
15468and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
15469steps through the integer domain of a one- or two-dimensional grid,
15470whose range is the domain of the evaluation maps specified by `glMap1'
15471and `glMap2'.
15472
15473`glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
15474the I (or I and J ) integer grid coordinates, to the U (or U and V )
15475floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
15476details of how U and V coordinates are evaluated.
15477
15478`glMapGrid1' specifies a single linear mapping such that integer grid
15479coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
15480exactly to U2. All other integer grid coordinates I are mapped so that
15481
15482U=I\u2061(U2-U1,)/UN+U1
15483
15484`glMapGrid2' specifies two such linear mappings. One maps integer grid
15485coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
15486to U2. The other maps integer grid coordinate J=0 exactly to V1, and
15487integer grid coordinate J=VN exactly to V2. Other integer grid
15488coordinates I and J are mapped such that
15489
15490U=I\u2061(U2-U1,)/UN+U1
15491
15492V=J\u2061(V2-V1,)/VN+V1
15493
15494The mappings specified by `glMapGrid' are used identically by
15495`glEvalMesh' and `glEvalPoint'.
15496
15497`GL_INVALID_VALUE' is generated if either UN or VN is not positive.
15498
15499`GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
15500the execution of `glBegin' and the corresponding execution of `glEnd'.")
15501
15502(define-gl-procedure
15503 glMaterial
15504 "glMaterial"
15505 (funcsynopsis
15506 (funcprototype
15507 (funcdef "void " (function "glMaterialf"))
15508 (paramdef "GLenum " (parameter "face"))
15509 (paramdef "GLenum " (parameter "pname"))
15510 (paramdef "GLfloat " (parameter "param"))))
15511 "Specify material parameters for the lighting model.
15512
15513FACE
15514 Specifies which face or faces are being updated. Must be one of
15515 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
15516
15517PNAME
15518 Specifies the single-valued material parameter of the face or faces
15519 that is being updated. Must be `GL_SHININESS'.
15520
15521PARAM
15522 Specifies the value that parameter `GL_SHININESS' will be set to.
15523
15524`glMaterial' assigns values to material parameters. There are two
15525matched sets of material parameters. One, the FRONT-FACING set, is used
15526to shade points, lines, bitmaps, and all polygons (when two-sided
15527lighting is disabled), or just front-facing polygons (when two-sided
15528lighting is enabled). The other set, BACK-FACING, is used to shade
15529back-facing polygons only when two-sided lighting is enabled. Refer to
15530the `glLightModel' reference page for details concerning one- and
15531two-sided lighting calculations.
15532
15533`glMaterial' takes three arguments. The first, FACE, specifies whether
15534the `GL_FRONT' materials, the `GL_BACK' materials, or both
15535`GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
15536specifies which of several parameters in one or both sets will be
15537modified. The third, PARAMS, specifies what value or values will be
15538assigned to the specified parameter.
15539
15540Material parameters are used in the lighting equation that is optionally
15541applied to each vertex. The equation is discussed in the `glLightModel'
15542reference page. The parameters that can be specified using `glMaterial',
15543and their interpretations by the lighting equation, are as follows:
15544
15545`GL_AMBIENT'
15546 PARAMS contains four integer or floating-point values that specify
15547 the ambient RGBA reflectance of the material. Integer values are
15548 mapped linearly such that the most positive representable value
15549 maps to 1.0, and the most negative representable value maps to -1.0
15550 . Floating-point values are mapped directly. Neither integer nor
15551 floating-point values are clamped. The initial ambient reflectance
15552 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
15553
15554`GL_DIFFUSE'
15555 PARAMS contains four integer or floating-point values that specify
15556 the diffuse RGBA reflectance of the material. Integer values are
15557 mapped linearly such that the most positive representable value
15558 maps to 1.0, and the most negative representable value maps to -1.0
15559 . Floating-point values are mapped directly. Neither integer nor
15560 floating-point values are clamped. The initial diffuse reflectance
15561 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
15562
15563`GL_SPECULAR'
15564 PARAMS contains four integer or floating-point values that specify
15565 the specular RGBA reflectance of the material. Integer values are
15566 mapped linearly such that the most positive representable value
15567 maps to 1.0, and the most negative representable value maps to -1.0
15568 . Floating-point values are mapped directly. Neither integer nor
15569 floating-point values are clamped. The initial specular reflectance
15570 for both front- and back-facing materials is (0, 0, 0, 1).
15571
15572`GL_EMISSION'
15573 PARAMS contains four integer or floating-point values that specify
15574 the RGBA emitted light intensity of the material. Integer values
15575 are mapped linearly such that the most positive representable value
15576 maps to 1.0, and the most negative representable value maps to -1.0
15577 . Floating-point values are mapped directly. Neither integer nor
15578 floating-point values are clamped. The initial emission intensity
15579 for both front- and back-facing materials is (0, 0, 0, 1).
15580
15581`GL_SHININESS'
15582 PARAMS is a single integer or floating-point value that specifies
15583 the RGBA specular exponent of the material. Integer and
15584 floating-point values are mapped directly. Only values in the range
15585 [0,128] are accepted. The initial specular exponent for both front-
15586 and back-facing materials is 0.
15587
15588`GL_AMBIENT_AND_DIFFUSE'
15589 Equivalent to calling `glMaterial' twice with the same parameter
15590 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
15591
15592`GL_COLOR_INDEXES'
15593 PARAMS contains three integer or floating-point values specifying
15594 the color indices for ambient, diffuse, and specular lighting.
15595 These three values, and `GL_SHININESS', are the only material
15596 values used by the color index mode lighting equation. Refer to the
15597 `glLightModel' reference page for a discussion of color index
15598 lighting.
15599
15600`GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
15601accepted value.
15602
15603`GL_INVALID_VALUE' is generated if a specular exponent outside the range
15604[0,128] is specified.")
15605
15606(define-gl-procedure
15607 glMatrixMode
15608 "glMatrixMode"
15609 (funcsynopsis
15610 (funcprototype
15611 (funcdef "void " (function "glMatrixMode"))
15612 (paramdef "GLenum " (parameter "mode"))))
15613 "Specify which matrix is the current matrix.
15614
15615MODE
15616 Specifies which matrix stack is the target for subsequent matrix
15617 operations. Three values are accepted: `GL_MODELVIEW',
15618 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
15619 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
15620 supported, `GL_COLOR' is also accepted.
15621
15622`glMatrixMode' sets the current matrix mode. MODE can assume one of four
15623values:
15624
15625`GL_MODELVIEW'
15626 Applies subsequent matrix operations to the modelview matrix stack.
15627
15628`GL_PROJECTION'
15629 Applies subsequent matrix operations to the projection matrix
15630 stack.
15631
15632`GL_TEXTURE'
15633 Applies subsequent matrix operations to the texture matrix stack.
15634
15635`GL_COLOR'
15636 Applies subsequent matrix operations to the color matrix stack.
15637
15638To find out which matrix stack is currently the target of all matrix
15639operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
15640value is `GL_MODELVIEW'.
15641
15642`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15643
15644`GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
15645between the execution of `glBegin' and the corresponding execution of
15646`glEnd'.")
15647
15648(define-gl-procedure
15649 glMinmax
15650 "glMinmax"
15651 (funcsynopsis
15652 (funcprototype
15653 (funcdef "void " (function "glMinmax"))
15654 (paramdef "GLenum " (parameter "target"))
15655 (paramdef "GLenum " (parameter "internalformat"))
15656 (paramdef "GLboolean " (parameter "sink"))))
15657 "Define minmax table.
15658
15659TARGET
15660 The minmax table whose parameters are to be set. Must be
15661 `GL_MINMAX'.
15662
15663INTERNALFORMAT
15664 The format of entries in the minmax table. Must be one of
15665 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15666 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
15667 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15668 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15669 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15670 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
15671 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
15672 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
15673 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
15674
15675SINK
15676 If `GL_TRUE', pixels will be consumed by the minmax process and no
15677 drawing or texture loading will take place. If `GL_FALSE', pixels
15678 will proceed to the final conversion process after minmax.
15679
15680When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
15681compared to the minimum and maximum values for each component, which are
15682stored in the two-element minmax table. (The first element stores the
15683minima, and the second element stores the maxima.) If a pixel component
15684is greater than the corresponding component in the maximum element, then
15685the maximum element is updated with the pixel component value. If a
15686pixel component is less than the corresponding component in the minimum
15687element, then the minimum element is updated with the pixel component
15688value. (In both cases, if the internal format of the minmax table
15689includes luminance, then the R color component of incoming pixels is
15690used for comparison.) The contents of the minmax table may be retrieved
15691at a later time by calling `glGetMinmax'. The minmax operation is
15692enabled or disabled by calling `glEnable' or `glDisable', respectively,
15693with an argument of `GL_MINMAX'.
15694
15695`glMinmax' redefines the current minmax table to have entries of the
15696format specified by INTERNALFORMAT. The maximum element is initialized
15697with the smallest possible component values, and the minimum element is
15698initialized with the largest possible component values. The values in
15699the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
15700pixels are discarded after minmax; no further processing of the pixels
15701takes place, and no drawing, texture loading, or pixel readback will
15702result.
15703
15704
15705
15706`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
15707values.
15708
15709`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
15710allowable values.
15711
15712`GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
15713the execution of `glBegin' and the corresponding execution of `glEnd'.")
15714
15715(define-gl-procedure
15716 glMultiDrawArrays
15717 "glMultiDrawArrays"
15718 (funcsynopsis
15719 (funcprototype
15720 (funcdef "void " (function "glMultiDrawArrays"))
15721 (paramdef "GLenum " (parameter "mode"))
15722 (paramdef "GLint * " (parameter "first"))
15723 (paramdef "GLsizei * " (parameter "count"))
15724 (paramdef "GLsizei " (parameter "primcount"))))
15725 "Render multiple sets of primitives from array data.
15726
15727MODE
15728 Specifies what kind of primitives to render. Symbolic constants
15729 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15730 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15731 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15732
15733FIRST
15734 Points to an array of starting indices in the enabled arrays.
15735
15736COUNT
15737 Points to an array of the number of indices to be rendered.
15738
15739PRIMCOUNT
15740 Specifies the size of the first and count
15741
15742`glMultiDrawArrays' specifies multiple sets of geometric primitives with
15743very few subroutine calls. Instead of calling a GL procedure to pass
15744each individual vertex, normal, texture coordinate, edge flag, or color,
15745you can prespecify separate arrays of vertices, normals, and colors and
15746use them to construct a sequence of primitives with a single call to
15747`glMultiDrawArrays'.
15748
15749`glMultiDrawArrays' behaves identically to `glDrawArrays' except that
15750PRIMCOUNT separate ranges of elements are specified instead.
15751
15752When `glMultiDrawArrays' is called, it uses COUNT sequential elements
15753from each enabled array to construct a sequence of geometric primitives,
15754beginning with element FIRST. MODE specifies what kind of primitives are
15755constructed, and how the array elements construct those primitives. If
15756`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
15757
15758Vertex attributes that are modified by `glMultiDrawArrays' have an
15759unspecified value after `glMultiDrawArrays' returns. For example, if
15760`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15761after `glMultiDrawArrays' executes. Attributes that aren't modified
15762remain well defined.
15763
15764`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15765
15766`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15767
15768`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15769bound to an enabled array and the buffer object's data store is
15770currently mapped.
15771
15772`GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
15773between the execution of `glBegin' and the corresponding `glEnd'.")
15774
15775(define-gl-procedure
15776 glMultiDrawElements
15777 "glMultiDrawElements"
15778 (funcsynopsis
15779 (funcprototype
15780 (funcdef
15781 "void "
15782 (function "glMultiDrawElements"))
15783 (paramdef "GLenum " (parameter "mode"))
15784 (paramdef "const GLsizei * " (parameter "count"))
15785 (paramdef "GLenum " (parameter "type"))
15786 (paramdef
15787 "const GLvoid ** "
15788 (parameter "indices"))
15789 (paramdef "GLsizei " (parameter "primcount"))))
15790 "Render multiple sets of primitives by specifying indices of array data
15791elements.
15792
15793MODE
15794 Specifies what kind of primitives to render. Symbolic constants
15795 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15796 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15797 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15798
15799COUNT
15800 Points to an array of the elements counts.
15801
15802TYPE
15803 Specifies the type of the values in INDICES. Must be one of
15804 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
15805
15806INDICES
15807 Specifies a pointer to the location where the indices are stored.
15808
15809PRIMCOUNT
15810 Specifies the size of the COUNT array.
15811
15812`glMultiDrawElements' specifies multiple sets of geometric primitives
15813with very few subroutine calls. Instead of calling a GL function to pass
15814each individual vertex, normal, texture coordinate, edge flag, or color,
15815you can prespecify separate arrays of vertices, normals, and so on, and
15816use them to construct a sequence of primitives with a single call to
15817`glMultiDrawElements'.
15818
15819`glMultiDrawElements' is identical in operation to `glDrawElements'
15820except that PRIMCOUNT separate lists of elements are specified.
15821
15822Vertex attributes that are modified by `glMultiDrawElements' have an
15823unspecified value after `glMultiDrawElements' returns. For example, if
15824`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15825after `glMultiDrawElements' executes. Attributes that aren't modified
15826maintain their previous values.
15827
15828`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15829
15830`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15831
15832`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15833bound to an enabled array or the element array and the buffer object's
15834data store is currently mapped.
15835
15836`GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
15837between the execution of `glBegin' and the corresponding `glEnd'.")
15838
15839(define-gl-procedure
15840 glMultiTexCoord
15841 "glMultiTexCoord"
15842 (funcsynopsis
15843 (funcprototype
15844 (funcdef "void " (function "glMultiTexCoord1s"))
15845 (paramdef "GLenum " (parameter "target"))
15846 (paramdef "GLshort " (parameter "s"))))
15847 "Set the current texture coordinates.
15848
15849TARGET
15850 Specifies the texture unit whose coordinates should be modified.
15851 The number of texture units is implementation dependent, but must
15852 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
15853 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
15854 implementation-dependent value.
15855
15856S
15857 T
15858
15859 R
15860
15861 Q
15862
15863 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
15864 Not all parameters are present in all forms of the command.
15865
15866`glMultiTexCoord' specifies texture coordinates in one, two, three, or
15867four dimensions. `glMultiTexCoord1' sets the current texture coordinates
15868to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
15869Similarly, `glMultiTexCoord3' specifies the texture coordinates as
15870(S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
15871as (S,TRQ) .
15872
15873The current texture coordinates are part of the data that is associated
15874with each vertex and with the current raster position. Initially, the
15875values for (S,TRQ) are (0,001) .")
15876
15877(define-gl-procedure
15878 glMultMatrix
15879 "glMultMatrix"
15880 (funcsynopsis
15881 (funcprototype
15882 (funcdef "void " (function "glMultMatrixd"))
15883 (paramdef "const GLdouble * " (parameter "m"))))
15884 "Multiply the current matrix with the specified matrix.
15885
15886M
15887 Points to 16 consecutive values that are used as the elements of a
15888 4×4 column-major matrix.
15889
15890`glMultMatrix' multiplies the current matrix with the one specified
15891using M, and replaces the current matrix with the product.
15892
15893The current matrix is determined by the current matrix mode (see
15894`glMatrixMode'). It is either the projection matrix, modelview matrix,
15895or the texture matrix.
15896
15897`GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
15898between the execution of `glBegin' and the corresponding execution of
15899`glEnd'.")
15900
15901(define-gl-procedure
15902 glMultTransposeMatrix
15903 "glMultTransposeMatrix"
15904 (funcsynopsis
15905 (funcprototype
15906 (funcdef
15907 "void "
15908 (function "glMultTransposeMatrixd"))
15909 (paramdef "const GLdouble * " (parameter "m"))))
15910 "Multiply the current matrix with the specified row-major ordered matrix.
15911
15912M
15913 Points to 16 consecutive values that are used as the elements of a
15914 4×4 row-major matrix.
15915
15916`glMultTransposeMatrix' multiplies the current matrix with the one
15917specified using M, and replaces the current matrix with the product.
15918
15919The current matrix is determined by the current matrix mode (see
15920`glMatrixMode'). It is either the projection matrix, modelview matrix,
15921or the texture matrix.
15922
15923`GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
15924executed between the execution of `glBegin' and the corresponding
15925execution of `glEnd'.")
15926
15927(define-gl-procedure
15928 glNewList
15929 "glNewList"
15930 (funcsynopsis
15931 (funcprototype
15932 (funcdef "void " (function "glNewList"))
15933 (paramdef "GLuint " (parameter "list"))
15934 (paramdef "GLenum " (parameter "mode"))))
15935 "Create or replace a display list.
15936
15937LIST
15938 Specifies the display-list name.
15939
15940MODE
15941 Specifies the compilation mode, which can be `GL_COMPILE' or
15942 `GL_COMPILE_AND_EXECUTE'.
15943
15944Display lists are groups of GL commands that have been stored for
15945subsequent execution. Display lists are created with `glNewList'. All
15946subsequent commands are placed in the display list, in the order issued,
15947until `glEndList' is called.
15948
15949`glNewList' has two arguments. The first argument, LIST, is a positive
15950integer that becomes the unique name for the display list. Names can be
15951created and reserved with `glGenLists' and tested for uniqueness with
15952`glIsList'. The second argument, MODE, is a symbolic constant that can
15953assume one of two values:
15954
15955`GL_COMPILE'
15956 Commands are merely compiled.
15957
15958`GL_COMPILE_AND_EXECUTE'
15959 Commands are executed as they are compiled into the display list.
15960
15961Certain commands are not compiled into the display list but are executed
15962immediately, regardless of the display-list mode. These commands are
15963`glAreTexturesResident', `glColorPointer', `glDeleteLists',
15964`glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
15965`glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
15966`glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
15967`glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
15968`glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
15969`glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
15970`glVertexPointer', and all of the `glGet' commands.
15971
15972Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
15973executed immediately and not compiled into the display list when their
15974first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
15975`GL_PROXY_TEXTURE_3D', respectively.
15976
15977When the `ARB_imaging' extension is supported, `glHistogram' executes
15978immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
15979`glColorTable' executes immediately when its first argument is
15980`GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
15981`GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
15982
15983For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
15984extension is supported, `glClientActiveTexture' is not compiled into
15985display lists, but executed immediately.
15986
15987When `glEndList' is encountered, the display-list definition is
15988completed by associating the list with the unique name LIST (specified
15989in the `glNewList' command). If a display list with name LIST already
15990exists, it is replaced only when `glEndList' is called.
15991
15992`GL_INVALID_VALUE' is generated if LIST is 0.
15993
15994`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15995
15996`GL_INVALID_OPERATION' is generated if `glEndList' is called without a
15997preceding `glNewList', or if `glNewList' is called while a display list
15998is being defined.
15999
16000`GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
16001executed between the execution of `glBegin' and the corresponding
16002execution of `glEnd'.
16003
16004`GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
16005compile the display list. If the GL version is 1.1 or greater, no change
16006is made to the previous contents of the display list, if any, and no
16007other change is made to the GL state. (It is as if no attempt had been
16008made to create the new display list.)")
16009
16010(define-gl-procedure
16011 glNormalPointer
16012 "glNormalPointer"
16013 (funcsynopsis
16014 (funcprototype
16015 (funcdef "void " (function "glNormalPointer"))
16016 (paramdef "GLenum " (parameter "type"))
16017 (paramdef "GLsizei " (parameter "stride"))
16018 (paramdef
16019 "const GLvoid * "
16020 (parameter "pointer"))))
16021 "Define an array of normals.
16022
16023TYPE
16024 Specifies the data type of each coordinate in the array. Symbolic
16025 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
16026 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
16027
16028STRIDE
16029 Specifies the byte offset between consecutive normals. If STRIDE is
16030 0, the normals are understood to be tightly packed in the array.
16031 The initial value is 0.
16032
16033POINTER
16034 Specifies a pointer to the first coordinate of the first normal in
16035 the array. The initial value is 0.
16036
16037`glNormalPointer' specifies the location and data format of an array of
16038normals to use when rendering. TYPE specifies the data type of each
16039normal coordinate, and STRIDE specifies the byte stride from one normal
16040to the next, allowing vertices and attributes to be packed into a single
16041array or stored in separate arrays. (Single-array storage may be more
16042efficient on some implementations; see `glInterleavedArrays'.)
16043
16044If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
16045target (see `glBindBuffer') while a normal array is specified, POINTER
16046is treated as a byte offset into the buffer object's data store. Also,
16047the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
16048vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
16049
16050When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
16051client-side state, in addition to the current vertex array buffer object
16052binding.
16053
16054To enable and disable the normal array, call `glEnableClientState' and
16055`glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
16056the normal array is used when `glDrawArrays', `glMultiDrawArrays',
16057`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
16058`glArrayElement' is called.
16059
16060`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
16061
16062`GL_INVALID_VALUE' is generated if STRIDE is negative.")
16063
16064(define-gl-procedure
16065 glNormal
16066 "glNormal"
16067 (funcsynopsis
16068 (funcprototype
16069 (funcdef "void " (function "glNormal3b"))
16070 (paramdef "GLbyte " (parameter "nx"))
16071 (paramdef "GLbyte " (parameter "ny"))
16072 (paramdef "GLbyte " (parameter "nz"))))
16073 "Set the current normal vector.
16074
16075NX
16076 NY
16077
16078 NZ
16079
16080 Specify the X , Y , and Z coordinates of the new current normal.
16081 The initial value of the current normal is the unit vector, (0, 0,
16082 1).
16083
16084
16085
16086The current normal is set to the given coordinates whenever `glNormal'
16087is issued. Byte, short, or integer arguments are converted to
16088floating-point format with a linear mapping that maps the most positive
16089representable integer value to 1.0 and the most negative representable
16090integer value to -1.0 .
16091
16092Normals specified with `glNormal' need not have unit length. If
16093`GL_NORMALIZE' is enabled, then normals of any length specified with
16094`glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
16095is enabled, normals are scaled by a scaling factor derived from the
16096modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
16097specified normals were of unit length, and that the modelview matrix
16098contain only uniform scales for proper results. To enable and disable
16099normalization, call `glEnable' and `glDisable' with either
16100`GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
16101disabled.")
16102
16103(define-gl-procedure
16104 glOrtho
16105 "glOrtho"
16106 (funcsynopsis
16107 (funcprototype
16108 (funcdef "void " (function "glOrtho"))
16109 (paramdef "GLdouble " (parameter "left"))
16110 (paramdef "GLdouble " (parameter "right"))
16111 (paramdef "GLdouble " (parameter "bottom"))
16112 (paramdef "GLdouble " (parameter "top"))
16113 (paramdef "GLdouble " (parameter "nearVal"))
16114 (paramdef "GLdouble " (parameter "farVal"))))
16115 "Multiply the current matrix with an orthographic matrix.
16116
16117LEFT
16118 RIGHT
16119
16120 Specify the coordinates for the left and right vertical clipping
16121 planes.
16122
16123BOTTOM
16124 TOP
16125
16126 Specify the coordinates for the bottom and top horizontal clipping
16127 planes.
16128
16129NEARVAL
16130 FARVAL
16131
16132 Specify the distances to the nearer and farther depth clipping
16133 planes. These values are negative if the plane is to be behind the
16134 viewer.
16135
16136`glOrtho' describes a transformation that produces a parallel
16137projection. The current matrix (see `glMatrixMode') is multiplied by
16138this matrix and the result replaces the current matrix, as if
16139`glMultMatrix' were called with the following matrix as its argument:
16140
16141((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
16142-2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
16143
16144where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
16145T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
16146
16147Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
16148and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
16149that are mapped to the lower left and upper right corners of the window,
16150respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
16151specifies the location of the far clipping plane. Both NEARVAL and
16152FARVAL can be either positive or negative.
16153
16154Use `glPushMatrix' and `glPopMatrix' to save and restore the current
16155matrix stack.
16156
16157`GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
16158NEAR = FAR.
16159
16160`GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
16161execution of `glBegin' and the corresponding execution of `glEnd'.")
16162
16163(define-gl-procedure
16164 glPassThrough
16165 "glPassThrough"
16166 (funcsynopsis
16167 (funcprototype
16168 (funcdef "void " (function "glPassThrough"))
16169 (paramdef "GLfloat " (parameter "token"))))
16170 "Place a marker in the feedback buffer.
16171
16172TOKEN
16173 Specifies a marker value to be placed in the feedback buffer
16174 following a `GL_PASS_THROUGH_TOKEN'.
16175
16176
16177
16178Feedback is a GL render mode. The mode is selected by calling
16179`glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
16180pixels are produced by rasterization. Instead, information about
16181primitives that would have been rasterized is fed back to the
16182application using the GL. See the `glFeedbackBuffer' reference page for
16183a description of the feedback buffer and the values in it.
16184
16185`glPassThrough' inserts a user-defined marker in the feedback buffer
16186when it is executed in feedback mode. TOKEN is returned as if it were a
16187primitive; it is indicated with its own unique identifying value:
16188`GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
16189respect to the specification of graphics primitives is maintained.
16190
16191`GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
16192between the execution of `glBegin' and the corresponding execution of
16193`glEnd'.")
16194
16195(define-gl-procedure
16196 glPixelMap
16197 "glPixelMap"
16198 (funcsynopsis
16199 (funcprototype
16200 (funcdef "void " (function "glPixelMapfv"))
16201 (paramdef "GLenum " (parameter "map"))
16202 (paramdef "GLsizei " (parameter "mapsize"))
16203 (paramdef
16204 "const GLfloat * "
16205 (parameter "values"))))
16206 "Set up pixel transfer maps.
16207
16208MAP
16209 Specifies a symbolic map name. Must be one of the following:
16210 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
16211 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
16212 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
16213 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
16214 `GL_PIXEL_MAP_B_TO_B', or `GL_PIXEL_MAP_A_TO_A'.
16215
16216MAPSIZE
16217 Specifies the size of the map being defined.
16218
16219VALUES
16220 Specifies an array of MAPSIZE values.
16221
16222`glPixelMap' sets up translation tables, or MAPS, used by
16223`glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
16224`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
16225`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
16226`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
16227`glTexSubImage3D'. Additionally, if the `ARB_imaging' subset is
16228supported, the routines `glColorTable', `glColorSubTable',
16229`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
16230`glMinmax', and `glSeparableFilter2D'. Use of these maps is described
16231completely in the `glPixelTransfer' reference page, and partly in the
16232reference pages for the pixel and texture image commands. Only the
16233specification of the maps is described in this reference page.
16234
16235MAP is a symbolic map name, indicating one of ten maps to set. MAPSIZE
16236specifies the number of entries in the map, and VALUES is a pointer to
16237an array of MAPSIZE map values.
16238
16239If a non-zero named buffer object is bound to the
16240`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a pixel
16241transfer map is specified, VALUES is treated as a byte offset into the
16242buffer object's data store.
16243
16244The ten maps are as follows:
16245
16246`GL_PIXEL_MAP_I_TO_I'
16247 Maps color indices to color indices.
16248
16249`GL_PIXEL_MAP_S_TO_S'
16250 Maps stencil indices to stencil indices.
16251
16252`GL_PIXEL_MAP_I_TO_R'
16253 Maps color indices to red components.
16254
16255`GL_PIXEL_MAP_I_TO_G'
16256 Maps color indices to green components.
16257
16258`GL_PIXEL_MAP_I_TO_B'
16259 Maps color indices to blue components.
16260
16261`GL_PIXEL_MAP_I_TO_A'
16262 Maps color indices to alpha components.
16263
16264`GL_PIXEL_MAP_R_TO_R'
16265 Maps red components to red components.
16266
16267`GL_PIXEL_MAP_G_TO_G'
16268 Maps green components to green components.
16269
16270`GL_PIXEL_MAP_B_TO_B'
16271 Maps blue components to blue components.
16272
16273`GL_PIXEL_MAP_A_TO_A'
16274 Maps alpha components to alpha components.
16275
16276The entries in a map can be specified as single-precision floating-point
16277numbers, unsigned short integers, or unsigned int integers. Maps that
16278store color component values (all but `GL_PIXEL_MAP_I_TO_I' and
16279`GL_PIXEL_MAP_S_TO_S') retain their values in floating-point format,
16280with unspecified mantissa and exponent sizes. Floating-point values
16281specified by `glPixelMapfv' are converted directly to the internal
16282floating-point format of these maps, then clamped to the range [0,1].
16283Unsigned integer values specified by `glPixelMapusv' and `glPixelMapuiv'
16284are converted linearly such that the largest representable integer maps
16285to 1.0, and 0 maps to 0.0.
16286
16287Maps that store indices, `GL_PIXEL_MAP_I_TO_I' and
16288`GL_PIXEL_MAP_S_TO_S', retain their values in fixed-point format, with
16289an unspecified number of bits to the right of the binary point.
16290Floating-point values specified by `glPixelMapfv' are converted directly
16291to the internal fixed-point format of these maps. Unsigned integer
16292values specified by `glPixelMapusv' and `glPixelMapuiv' specify integer
16293values, with all 0's to the right of the binary point.
16294
16295The following table shows the initial sizes and values for each of the
16296maps. Maps that are indexed by either color or stencil indices must have
16297MAPSIZE = 2^N for some N or the results are undefined. The maximum
16298allowable size for each map depends on the implementation and can be
16299determined by calling `glGet' with argument `GL_MAX_PIXEL_MAP_TABLE'.
16300The single maximum applies to all maps; it is at least 32.
16301
16302*MAP*
16303 *Lookup Index*, *Lookup Value*, *Initial Size*, *Initial Value*
16304
16305`GL_PIXEL_MAP_I_TO_I'
16306 color index , color index , 1 , 0
16307
16308`GL_PIXEL_MAP_S_TO_S'
16309 stencil index , stencil index , 1 , 0
16310
16311`GL_PIXEL_MAP_I_TO_R'
16312 color index , R , 1 , 0
16313
16314`GL_PIXEL_MAP_I_TO_G'
16315 color index , G , 1 , 0
16316
16317`GL_PIXEL_MAP_I_TO_B'
16318 color index , B , 1 , 0
16319
16320`GL_PIXEL_MAP_I_TO_A'
16321 color index , A , 1 , 0
16322
16323`GL_PIXEL_MAP_R_TO_R'
16324 R , R , 1 , 0
16325
16326`GL_PIXEL_MAP_G_TO_G'
16327 G , G , 1 , 0
16328
16329`GL_PIXEL_MAP_B_TO_B'
16330 B , B , 1 , 0
16331
16332`GL_PIXEL_MAP_A_TO_A'
16333 A , A , 1 , 0
16334
16335`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
16336
16337`GL_INVALID_VALUE' is generated if MAPSIZE is less than one or larger
16338than `GL_MAX_PIXEL_MAP_TABLE'.
16339
16340`GL_INVALID_VALUE' is generated if MAP is `GL_PIXEL_MAP_I_TO_I',
16341`GL_PIXEL_MAP_S_TO_S', `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
16342`GL_PIXEL_MAP_I_TO_B', or `GL_PIXEL_MAP_I_TO_A', and MAPSIZE is not a
16343power of two.
16344
16345`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16346bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16347data store is currently mapped.
16348
16349`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16350bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16351unpacked from the buffer object such that the memory reads required
16352would exceed the data store size.
16353
16354`GL_INVALID_OPERATION' is generated by `glPixelMapfv' if a non-zero
16355buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16356VALUES is not evenly divisible into the number of bytes needed to store
16357in memory a GLfloat datum.
16358
16359`GL_INVALID_OPERATION' is generated by `glPixelMapuiv' if a non-zero
16360buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16361VALUES is not evenly divisible into the number of bytes needed to store
16362in memory a GLuint datum.
16363
16364`GL_INVALID_OPERATION' is generated by `glPixelMapusv' if a non-zero
16365buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16366VALUES is not evenly divisible into the number of bytes needed to store
16367in memory a GLushort datum.
16368
16369`GL_INVALID_OPERATION' is generated if `glPixelMap' is executed between
16370the execution of `glBegin' and the corresponding execution of `glEnd'.")
16371
16372(define-gl-procedure
16373 glPixelStore
16374 "glPixelStore"
16375 (funcsynopsis
16376 (funcprototype
16377 (funcdef "void " (function "glPixelStoref"))
16378 (paramdef "GLenum " (parameter "pname"))
16379 (paramdef "GLfloat " (parameter "param"))))
16380 "Set pixel storage modes.
16381
16382PNAME
16383 Specifies the symbolic name of the parameter to be set. Six values
16384 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
16385 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
16386 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
16387 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
16388 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
16389 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
16390 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
16391 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
16392
16393PARAM
16394 Specifies the value that PNAME is set to.
16395
16396`glPixelStore' sets pixel storage modes that affect the operation of
16397subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
16398polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
16399`glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
16400`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
16401`glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
16402supported, pixel storage modes affect convolution filters (see
16403`glConvolutionFilter1D', `glConvolutionFilter2D', and
16404`glSeparableFilter2D', color table (see `glColorTable', and
16405`glColorSubTable', and unpacking histogram (See `glHistogram'), and
16406minmax (See `glMinmax') data.
16407
16408PNAME is a symbolic constant indicating the parameter to be set, and
16409PARAM is the new value. Six of the twelve storage parameters affect how
16410pixel data is returned to client memory. They are as follows:
16411
16412`GL_PACK_SWAP_BYTES'
16413 If true, byte ordering for multibyte color components, depth
16414 components, color indices, or stencil indices is reversed. That is,
16415 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16416 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
16417 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
16418 the memory order of components within a pixel, only on the order of
16419 bytes within components or indices. For example, the three
16420 components of a `GL_RGB' format pixel are always stored with red
16421 first, green second, and blue third, regardless of the value of
16422 `GL_PACK_SWAP_BYTES'.
16423
16424`GL_PACK_LSB_FIRST'
16425 If true, bits are ordered within a byte from least significant to
16426 most significant; otherwise, the first bit in each byte is the most
16427 significant one. This parameter is significant for bitmap data
16428 only.
16429
16430`GL_PACK_ROW_LENGTH'
16431 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
16432 pixels in a row. If the first pixel of a row is placed at location
16433 P in memory, then the location of the first pixel of the next row
16434 is obtained by skipping
16435
16436 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16437
16438 components or indices, where N is the number of components or
16439 indices in a pixel, L is the number of pixels in a row
16440 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16441 to the pixel routine otherwise), A is the value of
16442 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16443 component (if A<S , then it is as if A=S ). In the case of 1-bit
16444 values, the location of the next row is obtained by skipping
16445
16446 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16447
16448 components or indices.
16449
16450 The word COMPONENT in this description refers to the nonindex
16451 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16452 for example, has three components per pixel: first red, then green,
16453 and finally blue.
16454
16455`GL_PACK_IMAGE_HEIGHT'
16456 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
16457 pixels in an image three-dimensional texture volume, where
16458 ``image'' is defined by all pixels sharing the same third dimension
16459 index. If the first pixel of a row is placed at location P in
16460 memory, then the location of the first pixel of the next row is
16461 obtained by skipping
16462
16463 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16464
16465 components or indices, where N is the number of components or
16466 indices in a pixel, L is the number of pixels in a row
16467 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16468 to `glTexImage3D' otherwise), H is the number of rows in a pixel
16469 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16470 argument to the `glTexImage3D' routine otherwise), A is the value
16471 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16472 component (if A<S , then it is as if A=S ).
16473
16474 The word COMPONENT in this description refers to the nonindex
16475 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16476 for example, has three components per pixel: first red, then green,
16477 and finally blue.
16478
16479`GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
16480 These values are provided as a convenience to the programmer; they
16481 provide no functionality that cannot be duplicated simply by
16482 incrementing the pointer passed to `glReadPixels'. Setting
16483 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
16484 pointer by I\u2062N components or indices, where N is the number of
16485 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
16486 J is equivalent to incrementing the pointer by J\u2062M components or
16487 indices, where M is the number of components or indices per row, as
16488 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
16489 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
16490 pointer by K\u2062P , where P is the number of components or indices per
16491 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
16492
16493`GL_PACK_ALIGNMENT'
16494 Specifies the alignment requirements for the start of each pixel
16495 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16496 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16497 start on double-word boundaries).
16498
16499The other six of the twelve storage parameters affect how pixel data is
16500read from client memory. These values are significant for
16501`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
16502`glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
16503`glPolygonStipple'.
16504
16505Additionally, if the `ARB_imaging' extension is supported,
16506`glColorTable', `glColorSubTable', `glConvolutionFilter1D',
16507`glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
16508
16509`GL_UNPACK_SWAP_BYTES'
16510 If true, byte ordering for multibyte color components, depth
16511 components, color indices, or stencil indices is reversed. That is,
16512 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16513 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
16514 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
16515 effect on the memory order of components within a pixel, only on
16516 the order of bytes within components or indices. For example, the
16517 three components of a `GL_RGB' format pixel are always stored with
16518 red first, green second, and blue third, regardless of the value of
16519 `GL_UNPACK_SWAP_BYTES'.
16520
16521`GL_UNPACK_LSB_FIRST'
16522 If true, bits are ordered within a byte from least significant to
16523 most significant; otherwise, the first bit in each byte is the most
16524 significant one. This is relevant only for bitmap data.
16525
16526`GL_UNPACK_ROW_LENGTH'
16527 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
16528 pixels in a row. If the first pixel of a row is placed at location
16529 P in memory, then the location of the first pixel of the next row
16530 is obtained by skipping
16531
16532 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16533
16534 components or indices, where N is the number of components or
16535 indices in a pixel, L is the number of pixels in a row
16536 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16537 to the pixel routine otherwise), A is the value of
16538 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16539 component (if A<S , then it is as if A=S ). In the case of 1-bit
16540 values, the location of the next row is obtained by skipping
16541
16542 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16543
16544 components or indices.
16545
16546 The word COMPONENT in this description refers to the nonindex
16547 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16548 for example, has three components per pixel: first red, then green,
16549 and finally blue.
16550
16551`GL_UNPACK_IMAGE_HEIGHT'
16552 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
16553 pixels in an image of a three-dimensional texture volume. Where
16554 ``image'' is defined by all pixel sharing the same third dimension
16555 index. If the first pixel of a row is placed at location P in
16556 memory, then the location of the first pixel of the next row is
16557 obtained by skipping
16558
16559 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16560
16561 components or indices, where N is the number of components or
16562 indices in a pixel, L is the number of pixels in a row
16563 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16564 to `glTexImage3D' otherwise), H is the number of rows in an image
16565 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16566 argument to `glTexImage3D' otherwise), A is the value of
16567 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16568 component (if A<S , then it is as if A=S ).
16569
16570 The word COMPONENT in this description refers to the nonindex
16571 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16572 for example, has three components per pixel: first red, then green,
16573 and finally blue.
16574
16575`GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
16576 These values are provided as a convenience to the programmer; they
16577 provide no functionality that cannot be duplicated by incrementing
16578 the pointer passed to `glDrawPixels', `glTexImage1D',
16579 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
16580 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
16581 equivalent to incrementing the pointer by I\u2062N components or
16582 indices, where N is the number of components or indices in each
16583 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
16584 incrementing the pointer by J\u2062K components or indices, where K is
16585 the number of components or indices per row, as just computed in
16586 the `GL_UNPACK_ROW_LENGTH' section.
16587
16588`GL_UNPACK_ALIGNMENT'
16589 Specifies the alignment requirements for the start of each pixel
16590 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16591 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16592 start on double-word boundaries).
16593
16594The following table gives the type, initial value, and range of valid
16595values for each storage parameter that can be set with `glPixelStore'.
16596
16597
16598
16599*PNAME*
16600 *Type*, *Initial Value*, *Valid Range*
16601
16602`GL_PACK_SWAP_BYTES'
16603 boolean , false , true or false
16604
16605`GL_PACK_LSB_FIRST'
16606 boolean , false , true or false
16607
16608`GL_PACK_ROW_LENGTH'
16609 integer , 0 , [0,∞)
16610
16611`GL_PACK_IMAGE_HEIGHT'
16612 integer , 0 , [0,∞)
16613
16614`GL_PACK_SKIP_ROWS'
16615 integer , 0 , [0,∞)
16616
16617`GL_PACK_SKIP_PIXELS'
16618 integer , 0 , [0,∞)
16619
16620`GL_PACK_SKIP_IMAGES'
16621 integer , 0 , [0,∞)
16622
16623`GL_PACK_ALIGNMENT'
16624 integer , 4 , 1, 2, 4, or 8
16625
16626`GL_UNPACK_SWAP_BYTES'
16627 boolean , false , true or false
16628
16629`GL_UNPACK_LSB_FIRST'
16630 boolean , false , true or false
16631
16632`GL_UNPACK_ROW_LENGTH'
16633 integer , 0 , [0,∞)
16634
16635`GL_UNPACK_IMAGE_HEIGHT'
16636 integer , 0 , [0,∞)
16637
16638`GL_UNPACK_SKIP_ROWS'
16639 integer , 0 , [0,∞)
16640
16641`GL_UNPACK_SKIP_PIXELS'
16642 integer , 0 , [0,∞)
16643
16644`GL_UNPACK_SKIP_IMAGES'
16645 integer , 0 , [0,∞)
16646
16647`GL_UNPACK_ALIGNMENT'
16648 integer , 4 , 1, 2, 4, or 8
16649
16650`glPixelStoref' can be used to set any pixel store parameter. If the
16651parameter type is boolean, then if PARAM is 0, the parameter is false;
16652otherwise it is set to true. If PNAME is a integer type parameter, PARAM
16653is rounded to the nearest integer.
16654
16655Likewise, `glPixelStorei' can also be used to set any of the pixel store
16656parameters. Boolean parameters are set to false if PARAM is 0 and true
16657otherwise.
16658
16659`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
16660
16661`GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
16662row skip value is specified, or if alignment is specified as other than
166631, 2, 4, or 8.
16664
16665`GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
16666between the execution of `glBegin' and the corresponding execution of
16667`glEnd'.")
16668
16669(define-gl-procedure
16670 glPixelTransfer
16671 "glPixelTransfer"
16672 (funcsynopsis
16673 (funcprototype
16674 (funcdef "void " (function "glPixelTransferf"))
16675 (paramdef "GLenum " (parameter "pname"))
16676 (paramdef "GLfloat " (parameter "param"))))
16677 "Set pixel transfer modes.
16678
16679PNAME
16680 Specifies the symbolic name of the pixel transfer parameter to be
16681 set. Must be one of the following: `GL_MAP_COLOR',
16682 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
16683 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
16684 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
16685 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
16686
16687 Additionally, if the `ARB_imaging' extension is supported, the
16688 following symbolic names are accepted:
16689 `GL_POST_COLOR_MATRIX_RED_SCALE',
16690 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
16691 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
16692 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
16693 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
16694 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
16695 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
16696 `GL_POST_CONVOLUTION_GREEN_SCALE',
16697 `GL_POST_CONVOLUTION_BLUE_SCALE',
16698 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
16699 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
16700 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
16701
16702PARAM
16703 Specifies the value that PNAME is set to.
16704
16705`glPixelTransfer' sets pixel transfer modes that affect the operation of
16706subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
16707`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
16708`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
16709`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
16710`glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
16711supported, the routines `glColorTable', `glColorSubTable',
16712`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
16713`glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
16714that are specified by pixel transfer modes operate on pixels after they
16715are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
16716`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
16717`glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
16718memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
16719`glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
16720transfer operations happen in the same order, and in the same manner,
16721regardless of the command that resulted in the pixel operation. Pixel
16722storage modes (see `glPixelStore') control the unpacking of pixels being
16723read from client memory and the packing of pixels being written back
16724into client memory.
16725
16726Pixel transfer operations handle four fundamental pixel types: COLOR,
16727COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
16728floating-point values with unspecified mantissa and exponent sizes,
16729scaled such that 0 represents zero intensity and 1 represents full
16730intensity. COLOR INDICES comprise a single fixed-point value, with
16731unspecified precision to the right of the binary point. DEPTH pixels
16732comprise a single floating-point value, with unspecified mantissa and
16733exponent sizes, scaled such that 0.0 represents the minimum depth buffer
16734value, and 1.0 represents the maximum depth buffer value. Finally,
16735STENCIL pixels comprise a single fixed-point value, with unspecified
16736precision to the right of the binary point.
16737
16738The pixel transfer operations performed on the four basic pixel types
16739are as follows:
16740
16741COLOR
16742 Each of the four color components is multiplied by a scale factor,
16743 then added to a bias factor. That is, the red component is
16744 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
16745 green component is multiplied by `GL_GREEN_SCALE', then added to
16746 `GL_GREEN_BIAS'; the blue component is multiplied by
16747 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
16748 component is multiplied by `GL_ALPHA_SCALE', then added to
16749 `GL_ALPHA_BIAS'. After all four color components are scaled and
16750 biased, each is clamped to the range [0,1] . All color, scale, and
16751 bias values are specified with `glPixelTransfer'.
16752
16753 If `GL_MAP_COLOR' is true, each color component is scaled by the
16754 size of the corresponding color-to-color map, then replaced by the
16755 contents of that map indexed by the scaled component. That is, the
16756 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
16757 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
16758 itself. The green component is scaled by
16759 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
16760 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
16761 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
16762 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
16763 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
16764 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
16765 taken from the maps are then clamped to the range [0,1] .
16766 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
16767 the various maps are specified with `glPixelMap'.
16768
16769 If the `ARB_imaging' extension is supported, each of the four color
16770 components may be scaled and biased after transformation by the
16771 color matrix. That is, the red component is multiplied by
16772 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
16773 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
16774 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
16775 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
16776 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
16777 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
16778 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
16779 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
16780 are scaled and biased, each is clamped to the range [0,1] .
16781
16782 Similarly, if the `ARB_imaging' extension is supported, each of the
16783 four color components may be scaled and biased after processing by
16784 the enabled convolution filter. That is, the red component is
16785 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
16786 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
16787 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
16788 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
16789 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
16790 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
16791 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
16792 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
16793 are scaled and biased, each is clamped to the range [0,1] .
16794
16795COLOR INDEX
16796 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
16797 beyond the number of fraction bits carried by the fixed-point index
16798 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
16799 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
16800 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
16801 with `glPixelTransfer'.
16802
16803 From this point, operation diverges depending on the required
16804 format of the resulting pixels. If the resulting pixels are to be
16805 written to a color index buffer, or if they are being read back to
16806 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
16807 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
16808 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
16809 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
16810 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
16811 the index map is specified with `glPixelMap'.
16812
16813 If the resulting pixels are to be written to an RGBA color buffer,
16814 or if they are read back to client memory in a format other than
16815 `GL_COLOR_INDEX', the pixels are converted from indices to colors
16816 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
16817 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16818 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
16819 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
16820 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
16821 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
16822 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
16823 from the maps are then clamped to the range [0,1] . The contents of
16824 the four maps is specified with `glPixelMap'.
16825
16826DEPTH
16827 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
16828 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
16829
16830STENCIL
16831 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
16832 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
16833 each index is masked by 2^N-1 , where N is
16834 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
16835 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
16836
16837The following table gives the type, initial value, and range of valid
16838values for each of the pixel transfer parameters that are set with
16839`glPixelTransfer'.
16840
16841
16842
16843*PNAME*
16844 *Type*, *Initial Value*, *Valid Range*
16845
16846`GL_MAP_COLOR'
16847 boolean , false , true/false
16848
16849`GL_MAP_STENCIL'
16850 boolean , false , true/false
16851
16852`GL_INDEX_SHIFT'
16853 integer , 0 , (-∞,∞)
16854
16855`GL_INDEX_OFFSET'
16856 integer , 0 , (-∞,∞)
16857
16858`GL_RED_SCALE'
16859 float , 1 , (-∞,∞)
16860
16861`GL_GREEN_SCALE'
16862 float , 1 , (-∞,∞)
16863
16864`GL_BLUE_SCALE'
16865 float , 1 , (-∞,∞)
16866
16867`GL_ALPHA_SCALE'
16868 float , 1 , (-∞,∞)
16869
16870`GL_DEPTH_SCALE'
16871 float , 1 , (-∞,∞)
16872
16873`GL_RED_BIAS'
16874 float , 0 , (-∞,∞)
16875
16876`GL_GREEN_BIAS'
16877 float , 0 , (-∞,∞)
16878
16879`GL_BLUE_BIAS'
16880 float , 0 , (-∞,∞)
16881
16882`GL_ALPHA_BIAS'
16883 float , 0 , (-∞,∞)
16884
16885`GL_DEPTH_BIAS'
16886 float , 0 , (-∞,∞)
16887
16888`GL_POST_COLOR_MATRIX_RED_SCALE'
16889 float , 1 , (-∞,∞)
16890
16891`GL_POST_COLOR_MATRIX_GREEN_SCALE'
16892 float , 1 , (-∞,∞)
16893
16894`GL_POST_COLOR_MATRIX_BLUE_SCALE'
16895 float , 1 , (-∞,∞)
16896
16897`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
16898 float , 1 , (-∞,∞)
16899
16900`GL_POST_COLOR_MATRIX_RED_BIAS'
16901 float , 0 , (-∞,∞)
16902
16903`GL_POST_COLOR_MATRIX_GREEN_BIAS'
16904 float , 0 , (-∞,∞)
16905
16906`GL_POST_COLOR_MATRIX_BLUE_BIAS'
16907 float , 0 , (-∞,∞)
16908
16909`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
16910 float , 0 , (-∞,∞)
16911
16912`GL_POST_CONVOLUTION_RED_SCALE'
16913 float , 1 , (-∞,∞)
16914
16915`GL_POST_CONVOLUTION_GREEN_SCALE'
16916 float , 1 , (-∞,∞)
16917
16918`GL_POST_CONVOLUTION_BLUE_SCALE'
16919 float , 1 , (-∞,∞)
16920
16921`GL_POST_CONVOLUTION_ALPHA_SCALE'
16922 float , 1 , (-∞,∞)
16923
16924`GL_POST_CONVOLUTION_RED_BIAS'
16925 float , 0 , (-∞,∞)
16926
16927`GL_POST_CONVOLUTION_GREEN_BIAS'
16928 float , 0 , (-∞,∞)
16929
16930`GL_POST_CONVOLUTION_BLUE_BIAS'
16931 float , 0 , (-∞,∞)
16932
16933`GL_POST_CONVOLUTION_ALPHA_BIAS'
16934 float , 0 , (-∞,∞)
16935
16936`glPixelTransferf' can be used to set any pixel transfer parameter. If
16937the parameter type is boolean, 0 implies false and any other value
16938implies true. If PNAME is an integer parameter, PARAM is rounded to the
16939nearest integer.
16940
16941Likewise, `glPixelTransferi' can be used to set any of the pixel
16942transfer parameters. Boolean parameters are set to false if PARAM is 0
16943and to true otherwise. PARAM is converted to floating point before being
16944assigned to real-valued parameters.
16945
16946`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
16947
16948`GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
16949between the execution of `glBegin' and the corresponding execution of
16950`glEnd'.")
16951
16952(define-gl-procedure
16953 glPixelZoom
16954 "glPixelZoom"
16955 (funcsynopsis
16956 (funcprototype
16957 (funcdef "void " (function "glPixelZoom"))
16958 (paramdef "GLfloat " (parameter "xfactor"))
16959 (paramdef "GLfloat " (parameter "yfactor"))))
16960 "Specify the pixel zoom factors.
16961
16962XFACTOR
16963 YFACTOR
16964
16965 Specify the X and Y zoom factors for pixel write operations.
16966
16967`glPixelZoom' specifies values for the X and Y zoom factors. During the
16968execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
16969current raster position, and a given element is in the M th row and N th
16970column of the pixel rectangle, then pixels whose centers are in the
16971rectangle with corners at
16972
16973(XR+N·XFACTOR , YR+M·YFACTOR )
16974
16975(XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
16976
16977are candidates for replacement. Any pixel whose center lies on the
16978bottom or left edge of this rectangular region is also modified.
16979
16980Pixel zoom factors are not limited to positive values. Negative zoom
16981factors reflect the resulting image about the current raster position.
16982
16983`GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
16984the execution of `glBegin' and the corresponding execution of `glEnd'.")
16985
16986(define-gl-procedure
16987 glPointParameter
16988 "glPointParameter"
16989 (funcsynopsis
16990 (funcprototype
16991 (funcdef "void " (function "glPointParameterf"))
16992 (paramdef "GLenum " (parameter "pname"))
16993 (paramdef "GLfloat " (parameter "param"))))
16994 "Specify point parameters.
16995
16996PNAME
16997 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
16998 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
16999 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
17000
17001PARAM
17002 Specifies the value that PNAME will be set to.
17003
17004The following values are accepted for PNAME:
17005
17006`GL_POINT_SIZE_MIN'
17007
17008
17009 PARAMS is a single floating-point value that specifies the minimum
17010 point size. The default value is 0.0.
17011
17012`GL_POINT_SIZE_MAX'
17013
17014
17015 PARAMS is a single floating-point value that specifies the maximum
17016 point size. The default value is 1.0.
17017
17018`GL_POINT_FADE_THRESHOLD_SIZE'
17019
17020
17021 PARAMS is a single floating-point value that specifies the
17022 threshold value to which point sizes are clamped if they exceed the
17023 specified value. The default value is 1.0.
17024
17025`GL_POINT_DISTANCE_ATTENUATION'
17026
17027
17028 PARAMS is an array of three floating-point values that specify the
17029 coefficients used for scaling the computed point size. The default
17030 values are (1,00) .
17031
17032`GL_POINT_SPRITE_COORD_ORIGIN'
17033
17034
17035 PARAMS is a single enum specifying the point sprite texture
17036 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
17037 default value is `GL_UPPER_LEFT'.
17038
17039`GL_INVALID_VALUE' is generated If the value specified for
17040`GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
17041`GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
17042
17043`GL_INVALID_ENUM' is generated If the value specified for
17044`GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
17045`GL_UPPER_LEFT'.
17046
17047If the value for `GL_POINT_SIZE_MIN' is greater than
17048`GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
17049error is generated.")
17050
17051(define-gl-procedure
17052 glPointSize
17053 "glPointSize"
17054 (funcsynopsis
17055 (funcprototype
17056 (funcdef "void " (function "glPointSize"))
17057 (paramdef "GLfloat " (parameter "size"))))
17058 "Specify the diameter of rasterized points.
17059
17060SIZE
17061 Specifies the diameter of rasterized points. The initial value is
17062 1.
17063
17064`glPointSize' specifies the rasterized diameter of both aliased and
17065antialiased points. Using a point size other than 1 has different
17066effects, depending on whether point antialiasing is enabled. To enable
17067and disable point antialiasing, call `glEnable' and `glDisable' with
17068argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
17069
17070The specified point size is multiplied with a distance attenuation
17071factor and clamped to the specified point size range, and further
17072clamped to the implementation-dependent point size range to produce the
17073derived point size using
17074
17075POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
17076
17077where D is the eye-coordinate distance from the eye to the vertex, and A
17078, B , and C are the distance attenuation coefficients (see
17079`glPointParameter').
17080
17081If multisampling is disabled, the computed point size is used as the
17082point's width.
17083
17084If multisampling is enabled, the point may be faded by modifying the
17085point alpha value (see `glSampleCoverage') instead of allowing the point
17086width to go below a given threshold (see `glPointParameter'). In this
17087case, the width is further modified in the following manner:
17088
17089POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
17090(OTHERWISE),
17091
17092The point alpha value is modified by computing:
17093
17094POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
17095(OTHERWISE),
17096
17097If point antialiasing is disabled, the actual size is determined by
17098rounding the supplied size to the nearest integer. (If the rounding
17099results in the value 0, it is as if the point size were 1.) If the
17100rounded size is odd, then the center point (X , Y ) of the pixel
17101fragment that represents the point is computed as
17102
17103(⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
17104
17105where W subscripts indicate window coordinates. All pixels that lie
17106within the square grid of the rounded size centered at (X , Y ) make up
17107the fragment. If the size is even, the center point is
17108
17109(⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
17110
17111and the rasterized fragment's centers are the half-integer window
17112coordinates within the square of the rounded size centered at (X,Y) .
17113All pixel fragments produced in rasterizing a nonantialiased point are
17114assigned the same associated data, that of the vertex corresponding to
17115the point.
17116
17117If antialiasing is enabled, then point rasterization produces a fragment
17118for each pixel square that intersects the region lying within the circle
17119having diameter equal to the current point size and centered at the
17120point's (X_W,Y_W) . The coverage value for each fragment is the window
17121coordinate area of the intersection of the circular region with the
17122corresponding pixel square. This value is saved and used in the final
17123rasterization step. The data associated with each fragment is the data
17124associated with the point being rasterized.
17125
17126Not all sizes are supported when point antialiasing is enabled. If an
17127unsupported size is requested, the nearest supported size is used. Only
17128size 1 is guaranteed to be supported; others depend on the
17129implementation. To query the range of supported sizes and the size
17130difference between supported sizes within the range, call `glGet' with
17131arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
17132`GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
17133supported ranges and granularity with `glGet' with arguments
17134`GL_ALIASED_POINT_SIZE_RANGE'.
17135
17136`GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
17137
17138`GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
17139the execution of `glBegin' and the corresponding execution of `glEnd'.")
17140
17141(define-gl-procedure
17142 glPolygonMode
17143 "glPolygonMode"
17144 (funcsynopsis
17145 (funcprototype
17146 (funcdef "void " (function "glPolygonMode"))
17147 (paramdef "GLenum " (parameter "face"))
17148 (paramdef "GLenum " (parameter "mode"))))
17149 "Select a polygon rasterization mode.
17150
17151FACE
17152 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
17153 front-facing polygons, `GL_BACK' for back-facing polygons, or
17154 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
17155
17156MODE
17157 Specifies how polygons will be rasterized. Accepted values are
17158 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
17159 `GL_FILL' for both front- and back-facing polygons.
17160
17161`glPolygonMode' controls the interpretation of polygons for
17162rasterization. FACE describes which polygons MODE applies to:
17163front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
17164both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
17165rasterization of polygons. In particular, a polygon's vertices are lit
17166and the polygon is clipped and possibly culled before these modes are
17167applied.
17168
17169Three modes are defined and can be specified in MODE:
17170
17171`GL_POINT'
17172 Polygon vertices that are marked as the start of a boundary edge
17173 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
17174 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
17175 rasterization attributes other than `GL_POLYGON_MODE' have no
17176 effect.
17177
17178`GL_LINE'
17179 Boundary edges of the polygon are drawn as line segments. They are
17180 treated as connected line segments for line stippling; the line
17181 stipple counter and pattern are not reset between segments (see
17182 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
17183 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
17184 rasterization attributes other than `GL_POLYGON_MODE' have no
17185 effect.
17186
17187`GL_FILL'
17188 The interior of the polygon is filled. Polygon attributes such as
17189 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
17190 rasterization of the polygon.
17191
17192`GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
17193value.
17194
17195`GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
17196between the execution of `glBegin' and the corresponding execution of
17197`glEnd'.")
17198
17199(define-gl-procedure
17200 glPolygonOffset
17201 "glPolygonOffset"
17202 (funcsynopsis
17203 (funcprototype
17204 (funcdef "void " (function "glPolygonOffset"))
17205 (paramdef "GLfloat " (parameter "factor"))
17206 (paramdef "GLfloat " (parameter "units"))))
17207 "Set the scale and units used to calculate depth values.
17208
17209FACTOR
17210 Specifies a scale factor that is used to create a variable depth
17211 offset for each polygon. The initial value is 0.
17212
17213UNITS
17214 Is multiplied by an implementation-specific value to create a
17215 constant depth offset. The initial value is 0.
17216
17217When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
17218`GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
17219be offset after it is interpolated from the DEPTH values of the
17220appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
17221where DZ is a measurement of the change in depth relative to the screen
17222area of the polygon, and R is the smallest value that is guaranteed to
17223produce a resolvable offset for a given implementation. The offset is
17224added before the depth test is performed and before the value is written
17225into the depth buffer.
17226
17227`glPolygonOffset' is useful for rendering hidden-line images, for
17228applying decals to surfaces, and for rendering solids with highlighted
17229edges.
17230
17231`GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
17232between the execution of `glBegin' and the corresponding execution of
17233`glEnd'.")
17234
17235(define-gl-procedure
17236 glPolygonStipple
17237 "glPolygonStipple"
17238 (funcsynopsis
17239 (funcprototype
17240 (funcdef "void " (function "glPolygonStipple"))
17241 (paramdef
17242 "const GLubyte * "
17243 (parameter "pattern"))))
17244 "Set the polygon stippling pattern.
17245
17246PATTERN
17247 Specifies a pointer to a 32×32 stipple pattern that will be
17248 unpacked from memory in the same way that `glDrawPixels' unpacks
17249 pixels.
17250
17251Polygon stippling, like line stippling (see `glLineStipple'), masks out
17252certain fragments produced by rasterization, creating a pattern.
17253Stippling is independent of polygon antialiasing.
17254
17255PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
17256just like the pixel data supplied to a `glDrawPixels' call with height
17257and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
17258type of `GL_BITMAP'. That is, the stipple pattern is represented as a
1725932×32 array of 1-bit color indices packed in unsigned bytes.
17260`glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
17261`GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
17262pattern. Pixel transfer operations (shift, offset, pixel map) are not
17263applied to the stipple image, however.
17264
17265If a non-zero named buffer object is bound to the
17266`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
17267pattern is specified, PATTERN is treated as a byte offset into the
17268buffer object's data store.
17269
17270To enable and disable polygon stippling, call `glEnable' and `glDisable'
17271with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
17272disabled. If it's enabled, a rasterized polygon fragment with window
17273coordinates X_W and Y_W is sent to the next stage of the GL if and only
17274if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
172751 (one). When polygon stippling is disabled, it is as if the stipple
17276pattern consists of all 1's.
17277
17278`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17279bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
17280data store is currently mapped.
17281
17282`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17283bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
17284unpacked from the buffer object such that the memory reads required
17285would exceed the data store size.
17286
17287`GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
17288between the execution of `glBegin' and the corresponding execution of
17289`glEnd'.")
17290
17291(define-gl-procedure
17292 glPrioritizeTextures
17293 "glPrioritizeTextures"
17294 (funcsynopsis
17295 (funcprototype
17296 (funcdef
17297 "void "
17298 (function "glPrioritizeTextures"))
17299 (paramdef "GLsizei " (parameter "n"))
17300 (paramdef
17301 "const GLuint * "
17302 (parameter "textures"))
17303 (paramdef
17304 "const GLclampf * "
17305 (parameter "priorities"))))
17306 "Set texture residence priority.
17307
17308N
17309 Specifies the number of textures to be prioritized.
17310
17311TEXTURES
17312 Specifies an array containing the names of the textures to be
17313 prioritized.
17314
17315PRIORITIES
17316 Specifies an array containing the texture priorities. A priority
17317 given in an element of PRIORITIES applies to the texture named by
17318 the corresponding element of TEXTURES.
17319
17320`glPrioritizeTextures' assigns the N texture priorities given in
17321PRIORITIES to the N textures named in TEXTURES.
17322
17323The GL establishes a ``working set'' of textures that are resident in
17324texture memory. These textures may be bound to a texture target much
17325more efficiently than textures that are not resident. By specifying a
17326priority for each texture, `glPrioritizeTextures' allows applications to
17327guide the GL implementation in determining which textures should be
17328resident.
17329
17330The priorities given in PRIORITIES are clamped to the range [0,1] before
17331they are assigned. 0 indicates the lowest priority; textures with
17332priority 0 are least likely to be resident. 1 indicates the highest
17333priority; textures with priority 1 are most likely to be resident.
17334However, textures are not guaranteed to be resident until they are used.
17335
17336`glPrioritizeTextures' silently ignores attempts to prioritize texture 0
17337or any texture name that does not correspond to an existing texture.
17338
17339`glPrioritizeTextures' does not require that any of the textures named
17340by TEXTURES be bound to a texture target. `glTexParameter' may also be
17341used to set a texture's priority, but only if the texture is currently
17342bound. This is the only way to set the priority of a default texture.
17343
17344`GL_INVALID_VALUE' is generated if N is negative.
17345
17346`GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
17347executed between the execution of `glBegin' and the corresponding
17348execution of `glEnd'.")
17349
17350(define-gl-procedure
17351 glPushAttrib
17352 "glPushAttrib"
17353 (funcsynopsis
17354 (funcprototype
17355 (funcdef "void " (function "glPushAttrib"))
17356 (paramdef "GLbitfield " (parameter "mask"))))
17357 "Push and pop the server attribute stack.
17358
17359MASK
17360 Specifies a mask that indicates which attributes to save. Values
17361 for MASK are listed below.
17362
17363`glPushAttrib' takes one argument, a mask that indicates which groups of
17364state variables to save on the attribute stack. Symbolic constants are
17365used to set bits in the mask. MASK is typically constructed by
17366specifying the bitwise-or of several of these constants together. The
17367special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
17368states.
17369
17370The symbolic mask constants and their associated GL state are as follows
17371(the second column lists which attributes are saved):
17372
17373
17374
17375`GL_ACCUM_BUFFER_BIT'
17376 Accumulation buffer clear value
17377
17378`GL_COLOR_BUFFER_BIT'
17379 `GL_ALPHA_TEST' enable bit
17380
17381
17382 Alpha test function and reference value
17383
17384
17385 `GL_BLEND' enable bit
17386
17387
17388 Blending source and destination functions
17389
17390
17391 Constant blend color
17392
17393
17394 Blending equation
17395
17396
17397 `GL_DITHER' enable bit
17398
17399
17400 `GL_DRAW_BUFFER' setting
17401
17402
17403 `GL_COLOR_LOGIC_OP' enable bit
17404
17405
17406 `GL_INDEX_LOGIC_OP' enable bit
17407
17408
17409 Logic op function
17410
17411
17412 Color mode and index mode clear values
17413
17414
17415 Color mode and index mode writemasks
17416
17417`GL_CURRENT_BIT'
17418 Current RGBA color
17419
17420
17421 Current color index
17422
17423
17424 Current normal vector
17425
17426
17427 Current texture coordinates
17428
17429
17430 Current raster position
17431
17432
17433 `GL_CURRENT_RASTER_POSITION_VALID' flag
17434
17435
17436 RGBA color associated with current raster position
17437
17438
17439 Color index associated with current raster position
17440
17441
17442 Texture coordinates associated with current raster position
17443
17444
17445 `GL_EDGE_FLAG' flag
17446
17447`GL_DEPTH_BUFFER_BIT'
17448 `GL_DEPTH_TEST' enable bit
17449
17450
17451 Depth buffer test function
17452
17453
17454 Depth buffer clear value
17455
17456
17457 `GL_DEPTH_WRITEMASK' enable bit
17458
17459`GL_ENABLE_BIT'
17460 `GL_ALPHA_TEST' flag
17461
17462
17463 `GL_AUTO_NORMAL' flag
17464
17465
17466 `GL_BLEND' flag
17467
17468
17469 Enable bits for the user-definable clipping planes
17470
17471
17472 `GL_COLOR_MATERIAL'
17473
17474
17475 `GL_CULL_FACE' flag
17476
17477
17478 `GL_DEPTH_TEST' flag
17479
17480
17481 `GL_DITHER' flag
17482
17483
17484 `GL_FOG' flag
17485
17486
17487 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
17488
17489
17490 `GL_LIGHTING' flag
17491
17492
17493 `GL_LINE_SMOOTH' flag
17494
17495
17496 `GL_LINE_STIPPLE' flag
17497
17498
17499 `GL_COLOR_LOGIC_OP' flag
17500
17501
17502 `GL_INDEX_LOGIC_OP' flag
17503
17504
17505 `GL_MAP1_'X where X is a map type
17506
17507
17508 `GL_MAP2_'X where X is a map type
17509
17510
17511 `GL_MULTISAMPLE' flag
17512
17513
17514 `GL_NORMALIZE' flag
17515
17516
17517 `GL_POINT_SMOOTH' flag
17518
17519
17520 `GL_POLYGON_OFFSET_LINE' flag
17521
17522
17523 `GL_POLYGON_OFFSET_FILL' flag
17524
17525
17526 `GL_POLYGON_OFFSET_POINT' flag
17527
17528
17529 `GL_POLYGON_SMOOTH' flag
17530
17531
17532 `GL_POLYGON_STIPPLE' flag
17533
17534
17535 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17536
17537
17538 `GL_SAMPLE_ALPHA_TO_ONE' flag
17539
17540
17541 `GL_SAMPLE_COVERAGE' flag
17542
17543
17544 `GL_SCISSOR_TEST' flag
17545
17546
17547 `GL_STENCIL_TEST' flag
17548
17549
17550 `GL_TEXTURE_1D' flag
17551
17552
17553 `GL_TEXTURE_2D' flag
17554
17555
17556 `GL_TEXTURE_3D' flag
17557
17558
17559 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
17560
17561`GL_EVAL_BIT'
17562 `GL_MAP1_'X enable bits, where X is a map type
17563
17564
17565 `GL_MAP2_'X enable bits, where X is a map type
17566
17567
17568 1D grid endpoints and divisions
17569
17570
17571 2D grid endpoints and divisions
17572
17573
17574 `GL_AUTO_NORMAL' enable bit
17575
17576`GL_FOG_BIT'
17577 `GL_FOG' enable bit
17578
17579
17580 Fog color
17581
17582
17583 Fog density
17584
17585
17586 Linear fog start
17587
17588
17589 Linear fog end
17590
17591
17592 Fog index
17593
17594
17595 `GL_FOG_MODE' value
17596
17597`GL_HINT_BIT'
17598 `GL_PERSPECTIVE_CORRECTION_HINT' setting
17599
17600
17601 `GL_POINT_SMOOTH_HINT' setting
17602
17603
17604 `GL_LINE_SMOOTH_HINT' setting
17605
17606
17607 `GL_POLYGON_SMOOTH_HINT' setting
17608
17609
17610 `GL_FOG_HINT' setting
17611
17612
17613 `GL_GENERATE_MIPMAP_HINT' setting
17614
17615
17616 `GL_TEXTURE_COMPRESSION_HINT' setting
17617
17618`GL_LIGHTING_BIT'
17619 `GL_COLOR_MATERIAL' enable bit
17620
17621
17622 `GL_COLOR_MATERIAL_FACE' value
17623
17624
17625 Color material parameters that are tracking the current color
17626
17627
17628 Ambient scene color
17629
17630
17631 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
17632
17633
17634 `GL_LIGHT_MODEL_TWO_SIDE' setting
17635
17636
17637 `GL_LIGHTING' enable bit
17638
17639
17640 Enable bit for each light
17641
17642
17643 Ambient, diffuse, and specular intensity for each light
17644
17645
17646 Direction, position, exponent, and cutoff angle for each light
17647
17648
17649 Constant, linear, and quadratic attenuation factors for each light
17650
17651
17652 Ambient, diffuse, specular, and emissive color for each material
17653
17654
17655 Ambient, diffuse, and specular color indices for each material
17656
17657
17658 Specular exponent for each material
17659
17660
17661 `GL_SHADE_MODEL' setting
17662
17663`GL_LINE_BIT'
17664 `GL_LINE_SMOOTH' flag
17665
17666
17667 `GL_LINE_STIPPLE' enable bit
17668
17669
17670 Line stipple pattern and repeat counter
17671
17672
17673 Line width
17674
17675`GL_LIST_BIT'
17676 `GL_LIST_BASE' setting
17677
17678`GL_MULTISAMPLE_BIT'
17679 `GL_MULTISAMPLE' flag
17680
17681
17682 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17683
17684
17685 `GL_SAMPLE_ALPHA_TO_ONE' flag
17686
17687
17688 `GL_SAMPLE_COVERAGE' flag
17689
17690
17691 `GL_SAMPLE_COVERAGE_VALUE' value
17692
17693
17694 `GL_SAMPLE_COVERAGE_INVERT' value
17695
17696`GL_PIXEL_MODE_BIT'
17697 `GL_RED_BIAS' and `GL_RED_SCALE' settings
17698
17699
17700 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
17701
17702
17703 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
17704
17705
17706 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
17707
17708
17709 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
17710
17711
17712 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
17713
17714
17715 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
17716
17717
17718 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
17719
17720
17721 `GL_READ_BUFFER' setting
17722
17723`GL_POINT_BIT'
17724 `GL_POINT_SMOOTH' flag
17725
17726
17727 Point size
17728
17729`GL_POLYGON_BIT'
17730 `GL_CULL_FACE' enable bit
17731
17732
17733 `GL_CULL_FACE_MODE' value
17734
17735
17736 `GL_FRONT_FACE' indicator
17737
17738
17739 `GL_POLYGON_MODE' setting
17740
17741
17742 `GL_POLYGON_SMOOTH' flag
17743
17744
17745 `GL_POLYGON_STIPPLE' enable bit
17746
17747
17748 `GL_POLYGON_OFFSET_FILL' flag
17749
17750
17751 `GL_POLYGON_OFFSET_LINE' flag
17752
17753
17754 `GL_POLYGON_OFFSET_POINT' flag
17755
17756
17757 `GL_POLYGON_OFFSET_FACTOR'
17758
17759
17760 `GL_POLYGON_OFFSET_UNITS'
17761
17762`GL_POLYGON_STIPPLE_BIT'
17763 Polygon stipple image
17764
17765`GL_SCISSOR_BIT'
17766 `GL_SCISSOR_TEST' flag
17767
17768
17769 Scissor box
17770
17771`GL_STENCIL_BUFFER_BIT'
17772 `GL_STENCIL_TEST' enable bit
17773
17774
17775 Stencil function and reference value
17776
17777
17778 Stencil value mask
17779
17780
17781 Stencil fail, pass, and depth buffer pass actions
17782
17783
17784 Stencil buffer clear value
17785
17786
17787 Stencil buffer writemask
17788
17789`GL_TEXTURE_BIT'
17790 Enable bits for the four texture coordinates
17791
17792
17793 Border color for each texture image
17794
17795
17796 Minification function for each texture image
17797
17798
17799 Magnification function for each texture image
17800
17801
17802 Texture coordinates and wrap mode for each texture image
17803
17804
17805 Color and mode for each texture environment
17806
17807
17808 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
17809
17810
17811 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
17812
17813
17814 `glTexGen' plane equations for S, T, R, and Q
17815
17816
17817 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
17818
17819`GL_TRANSFORM_BIT'
17820 Coefficients of the six clipping planes
17821
17822
17823 Enable bits for the user-definable clipping planes
17824
17825
17826 `GL_MATRIX_MODE' value
17827
17828
17829 `GL_NORMALIZE' flag
17830
17831
17832 `GL_RESCALE_NORMAL' flag
17833
17834`GL_VIEWPORT_BIT'
17835 Depth range (near and far)
17836
17837
17838 Viewport origin and extent
17839
17840`glPopAttrib' restores the values of the state variables saved with the
17841last `glPushAttrib' command. Those not saved are left unchanged.
17842
17843It is an error to push attributes onto a full stack or to pop attributes
17844off an empty stack. In either case, the error flag is set and no other
17845change is made to GL state.
17846
17847Initially, the attribute stack is empty.
17848
17849`GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
17850attribute stack is full.
17851
17852`GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
17853attribute stack is empty.
17854
17855`GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
17856is executed between the execution of `glBegin' and the corresponding
17857execution of `glEnd'.")
8925f36f
AW
17858
17859(define-gl-procedure
3c9b6116
AW
17860 glPushClientAttrib
17861 "glPushClientAttrib"
8925f36f
AW
17862 (funcsynopsis
17863 (funcprototype
3c9b6116
AW
17864 (funcdef "void " (function "glPushClientAttrib"))
17865 (paramdef "GLbitfield " (parameter "mask"))))
17866 "Push and pop the client attribute stack.
17867
17868MASK
17869 Specifies a mask that indicates which attributes to save. Values
17870 for MASK are listed below.
17871
17872`glPushClientAttrib' takes one argument, a mask that indicates which
17873groups of client-state variables to save on the client attribute stack.
17874Symbolic constants are used to set bits in the mask. MASK is typically
17875constructed by specifying the bitwise-or of several of these constants
17876together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
17877save all stackable client state.
17878
17879The symbolic mask constants and their associated GL client state are as
17880follows (the second column lists which attributes are saved):
17881
17882`GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
17883`GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
17884
17885`glPopClientAttrib' restores the values of the client-state variables
17886saved with the last `glPushClientAttrib'. Those not saved are left
17887unchanged.
17888
17889It is an error to push attributes onto a full client attribute stack or
17890to pop attributes off an empty stack. In either case, the error flag is
17891set, and no other change is made to GL state.
17892
17893Initially, the client attribute stack is empty.
17894
17895`GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
17896the attribute stack is full.
17897
17898`GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
17899the attribute stack is empty.")
8925f36f
AW
17900
17901(define-gl-procedure
3c9b6116
AW
17902 glPushMatrix
17903 "glPushMatrix"
8925f36f
AW
17904 (funcsynopsis
17905 (funcprototype
3c9b6116
AW
17906 (funcdef "void " (function "glPushMatrix"))
17907 (paramdef (parameter "void"))))
17908 "Push and pop the current matrix stack.
17909
17910There is a stack of matrices for each of the matrix modes. In
17911`GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
17912`GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
17913The current matrix in any mode is the matrix on the top of the stack for
17914that mode.
17915
17916`glPushMatrix' pushes the current matrix stack down by one, duplicating
17917the current matrix. That is, after a `glPushMatrix' call, the matrix on
17918top of the stack is identical to the one below it.
17919
17920`glPopMatrix' pops the current matrix stack, replacing the current
17921matrix with the one below it on the stack.
17922
17923Initially, each of the stacks contains one matrix, an identity matrix.
17924
17925It is an error to push a full matrix stack or to pop a matrix stack that
17926contains only a single matrix. In either case, the error flag is set and
17927no other change is made to GL state.
17928
17929`GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
17930current matrix stack is full.
17931
17932`GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
17933current matrix stack contains only a single matrix.
17934
17935`GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
17936is executed between the execution of `glBegin' and the corresponding
17937execution of `glEnd'.")
8925f36f
AW
17938
17939(define-gl-procedure
3c9b6116
AW
17940 glPushName
17941 "glPushName"
8925f36f
AW
17942 (funcsynopsis
17943 (funcprototype
3c9b6116
AW
17944 (funcdef "void " (function "glPushName"))
17945 (paramdef "GLuint " (parameter "name"))))
17946 "Push and pop the name stack.
17947
17948NAME
17949 Specifies a name that will be pushed onto the name stack.
17950
17951The name stack is used during selection mode to allow sets of rendering
17952commands to be uniquely identified. It consists of an ordered set of
17953unsigned integers and is initially empty.
17954
17955`glPushName' causes NAME to be pushed onto the name stack. `glPopName'
17956pops one name off the top of the stack.
17957
17958The maximum name stack depth is implementation-dependent; call
17959`GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
17960implementation. It is an error to push a name onto a full stack or to
17961pop a name off an empty stack. It is also an error to manipulate the
17962name stack between the execution of `glBegin' and the corresponding
17963execution of `glEnd'. In any of these cases, the error flag is set and
17964no other change is made to GL state.
17965
17966The name stack is always empty while the render mode is not `GL_SELECT'.
17967Calls to `glPushName' or `glPopName' while the render mode is not
17968`GL_SELECT' are ignored.
17969
17970`GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
17971name stack is full.
17972
17973`GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
17974name stack is empty.
17975
17976`GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
17977executed between a call to `glBegin' and the corresponding call to
17978`glEnd'.")
8925f36f
AW
17979
17980(define-gl-procedure
3c9b6116
AW
17981 glRasterPos
17982 "glRasterPos"
8925f36f
AW
17983 (funcsynopsis
17984 (funcprototype
3c9b6116
AW
17985 (funcdef "void " (function "glRasterPos2s"))
17986 (paramdef "GLshort " (parameter "x"))
17987 (paramdef "GLshort " (parameter "y"))))
17988 "Specify the raster position for pixel operations.
17989
17990X
17991 Y
17992
17993 Z
17994
17995 W
17996
17997 Specify the X , Y , Z , and W object coordinates (if present) for
17998 the raster position.
17999
18000The GL maintains a 3D position in window coordinates. This position,
18001called the raster position, is used to position pixel and bitmap write
18002operations. It is maintained with subpixel accuracy. See `glBitmap',
18003`glDrawPixels', and `glCopyPixels'.
18004
18005The current raster position consists of three window coordinates (X , Y
18006, Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
18007bit, and associated color data and texture coordinates. The W coordinate
18008is a clip coordinate, because W is not projected to window coordinates.
18009`glRasterPos4' specifies object coordinates X , Y , Z , and W
18010explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
18011explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
18012argument values for X and Y while implicitly setting Z and W to 0 and 1.
18013
18014The object coordinates presented by `glRasterPos' are treated just like
18015those of a `glVertex' command: They are transformed by the current
18016modelview and projection matrices and passed to the clipping stage. If
18017the vertex is not culled, then it is projected and scaled to window
18018coordinates, which become the new current raster position, and the
18019`GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
18020then the valid bit is cleared and the current raster position and
18021associated color and texture coordinates are undefined.
18022
18023The current raster position also includes some associated color data and
18024texture coordinates. If lighting is enabled, then
18025`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
18026(in color index mode) is set to the color produced by the lighting
18027calculation (see `glLight', `glLightModel', and `glShadeModel'). If
18028lighting is disabled, current color (in RGBA mode, state variable
18029`GL_CURRENT_COLOR') or color index (in color index mode, state variable
18030`GL_CURRENT_INDEX') is used to update the current raster color.
18031`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
18032
18033Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
18034`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
18035generation functions (see `glTexGen'). Finally, the distance from the
18036origin of the eye coordinate system to the vertex as transformed by only
18037the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
18038
18039Initially, the current raster position is (0, 0, 0, 1), the current
18040raster distance is 0, the valid bit is set, the associated RGBA color is
18041(1, 1, 1, 1), the associated color index is 1, and the associated
18042texture coordinates are (0, 0, 0, 1). In RGBA mode,
18043`GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
18044raster RGBA color always maintains its initial value.
18045
18046`GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
18047the execution of `glBegin' and the corresponding execution of `glEnd'.")
18048
18049(define-gl-procedure
18050 glReadBuffer
18051 "glReadBuffer"
18052 (funcsynopsis
18053 (funcprototype
18054 (funcdef "void " (function "glReadBuffer"))
18055 (paramdef "GLenum " (parameter "mode"))))
18056 "Select a color buffer source for pixels.
18057
18058MODE
18059 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
18060 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
18061 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
18062 0 and the value of `GL_AUX_BUFFERS' minus 1.
18063
18064`glReadBuffer' specifies a color buffer as the source for subsequent
18065`glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
18066`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
18067`glCopyPixels' commands. MODE accepts one of twelve or more predefined
18068values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
18069configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
18070the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
18071right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
18072buffer.
18073
18074Nonstereo double-buffered configurations have only a front left and a
18075back left buffer. Single-buffered configurations have a front left and a
18076front right buffer if stereo, and only a front left buffer if nonstereo.
18077It is an error to specify a nonexistent buffer to `glReadBuffer'.
18078
18079MODE is initially `GL_FRONT' in single-buffered configurations and
18080`GL_BACK' in double-buffered configurations.
18081
18082`GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
18083more) accepted values.
18084
18085`GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
18086not exist.
18087
18088`GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
18089between the execution of `glBegin' and the corresponding execution of
18090`glEnd'.")
18091
18092(define-gl-procedure
18093 glReadPixels
18094 "glReadPixels"
18095 (funcsynopsis
18096 (funcprototype
18097 (funcdef "void " (function "glReadPixels"))
18098 (paramdef "GLint " (parameter "x"))
18099 (paramdef "GLint " (parameter "y"))
18100 (paramdef "GLsizei " (parameter "width"))
18101 (paramdef "GLsizei " (parameter "height"))
18102 (paramdef "GLenum " (parameter "format"))
18103 (paramdef "GLenum " (parameter "type"))
18104 (paramdef "GLvoid * " (parameter "data"))))
18105 "Read a block of pixels from the frame buffer.
18106
18107X
18108 Y
18109
18110 Specify the window coordinates of the first pixel that is read from
18111 the frame buffer. This location is the lower left corner of a
18112 rectangular block of pixels.
18113
18114WIDTH
18115 HEIGHT
18116
18117 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
18118 one correspond to a single pixel.
18119
18120FORMAT
18121 Specifies the format of the pixel data. The following symbolic
18122 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
18123 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
18124 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
18125 `GL_LUMINANCE_ALPHA'.
18126
18127TYPE
18128 Specifies the data type of the pixel data. Must be one of
18129 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
18130 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
18131 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18132 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
18133 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18134 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18135 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18136 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
18137
18138DATA
18139 Returns the pixel data.
18140
18141`glReadPixels' returns pixel data from the frame buffer, starting with
18142the pixel whose lower left corner is at location (X, Y), into client
18143memory starting at location DATA. Several parameters control the
18144processing of the pixel data before it is placed into client memory.
18145These parameters are set with three commands: `glPixelStore',
18146`glPixelTransfer', and `glPixelMap'. This reference page describes the
18147effects on `glReadPixels' of most, but not all of the parameters
18148specified by these three commands.
18149
18150If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
18151target (see `glBindBuffer') while a block of pixels is requested, DATA
18152is treated as a byte offset into the buffer object's data store rather
18153than a pointer to client memory.
18154
18155When the `ARB_imaging' extension is supported, the pixel data may be
18156processed by additional operations including color table lookup, color
18157matrix transformations, convolutions, histograms, and minimum and
18158maximum pixel value computations.
18159
18160`glReadPixels' returns values from each pixel with lower left corner at
18161(X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
18162I th pixel in the J th row. Pixels are returned in row order from the
18163lowest to the highest row, left to right in each row.
18164
18165FORMAT specifies the format for the returned pixel values; accepted
18166values are:
18167
18168`GL_COLOR_INDEX'
18169 Color indices are read from the color buffer selected by
18170 `glReadBuffer'. Each index is converted to fixed point, shifted
18171 left or right depending on the value and sign of `GL_INDEX_SHIFT',
18172 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
18173 indices are replaced by their mappings in the table
18174 `GL_PIXEL_MAP_I_TO_I'.
18175
18176`GL_STENCIL_INDEX'
18177 Stencil values are read from the stencil buffer. Each index is
18178 converted to fixed point, shifted left or right depending on the
18179 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
18180 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
18181 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
18182
18183`GL_DEPTH_COMPONENT'
18184 Depth values are read from the depth buffer. Each component is
18185 converted to floating point such that the minimum depth value maps
18186 to 0 and the maximum value maps to 1. Each component is then
18187 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
18188 finally clamped to the range [0,1] .
18189
18190`GL_RED'
18191`GL_GREEN'
18192`GL_BLUE'
18193`GL_ALPHA'
18194`GL_RGB'
18195`GL_BGR'
18196`GL_RGBA'
18197`GL_BGRA'
18198`GL_LUMINANCE'
18199`GL_LUMINANCE_ALPHA'
18200 Processing differs depending on whether color buffers store color
18201 indices or RGBA color components. If color indices are stored, they
18202 are read from the color buffer selected by `glReadBuffer'. Each
18203 index is converted to fixed point, shifted left or right depending
18204 on the value and sign of `GL_INDEX_SHIFT', and added to
18205 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
18206 blue, and alpha values obtained by indexing the tables
18207 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
18208 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
18209 be of size 2^N , but N may be different for different tables.
18210 Before an index is used to look up a value in a table of size 2^N ,
18211 it must be masked against 2^N-1 .
18212
18213 If RGBA color components are stored in the color buffers, they are
18214 read from the color buffer selected by `glReadBuffer'. Each color
18215 component is converted to floating point such that zero intensity
18216 maps to 0.0 and full intensity maps to 1.0. Each component is then
18217 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
18218 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
18219 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
18220 the size of its corresponding table, and is then replaced by its
18221 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
18222 A.
18223
18224 Unneeded data is then discarded. For example, `GL_RED' discards the
18225 green, blue, and alpha components, while `GL_RGB' discards only the
18226 alpha component. `GL_LUMINANCE' computes a single-component value
18227 as the sum of the red, green, and blue components, and
18228 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
18229 value. The final values are clamped to the range [0,1] .
18230
18231The shift, scale, bias, and lookup factors just described are all
18232specified by `glPixelTransfer'. The lookup table contents themselves are
18233specified by `glPixelMap'.
18234
18235Finally, the indices or components are converted to the proper format,
18236as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
18237`GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
18238the mask value given in the following table. If TYPE is `GL_FLOAT', then
18239each integer index is converted to single-precision floating-point
18240format.
18241
18242If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
18243`GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
18244and TYPE is not `GL_FLOAT', each component is multiplied by the
18245multiplier shown in the following table. If type is `GL_FLOAT', then
18246each component is passed as is (or converted to the client's
18247single-precision floating-point format if it is different from the one
18248used by the GL).
18249
18250
18251
18252TYPE
18253 *Index Mask*, *Component Conversion*
18254
18255`GL_UNSIGNED_BYTE'
18256 2^8-1 , (2^8-1,)\u2062C
18257
18258`GL_BYTE'
18259 2^7-1 , (2^8-1,)\u2062C-1,/2
18260
18261`GL_BITMAP'
18262 1 , 1
18263
18264`GL_UNSIGNED_SHORT'
18265 2^16-1 , (2^16-1,)\u2062C
18266
18267`GL_SHORT'
18268 2^15-1 , (2^16-1,)\u2062C-1,/2
18269
18270`GL_UNSIGNED_INT'
18271 2^32-1 , (2^32-1,)\u2062C
18272
18273`GL_INT'
18274 2^31-1 , (2^32-1,)\u2062C-1,/2
18275
18276`GL_FLOAT'
18277 none , C
18278
18279Return values are placed in memory as follows. If FORMAT is
18280`GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
18281`GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
18282returned and the data for the I th pixel in the J th row is placed in
18283location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
18284`GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
18285returns two values for each pixel, with all values corresponding to a
18286single pixel occupying contiguous space in DATA. Storage parameters set
18287by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
18288affect the way that data is written into memory. See `glPixelStore' for
18289a description.
18290
18291`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
18292value.
18293
18294`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
18295`GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
18296
18297`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
18298
18299`GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
18300the color buffers store RGBA color components.
18301
18302`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
18303there is no stencil buffer.
18304
18305`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
18306and there is no depth buffer.
18307
18308`GL_INVALID_OPERATION' is generated if TYPE is one of
18309`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18310`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
18311is not `GL_RGB'.
18312
18313`GL_INVALID_OPERATION' is generated if TYPE is one of
18314`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18315`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18316`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18317`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
18318FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
18319
18320The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
18321`GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
18322`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
18323`GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
18324`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
18325`GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
18326`GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
183271.2 or greater.
18328
18329`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18330bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
18331store is currently mapped.
18332
18333`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18334bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
18335to the buffer object such that the memory writes required would exceed
18336the data store size.
18337
18338`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18339bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
18340divisible into the number of bytes needed to store in memory a datum
18341indicated by TYPE.
8925f36f 18342
3c9b6116
AW
18343`GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
18344between the execution of `glBegin' and the corresponding execution of
18345`glEnd'.")
8925f36f
AW
18346
18347(define-gl-procedure
3c9b6116
AW
18348 glRect
18349 "glRect"
8925f36f
AW
18350 (funcsynopsis
18351 (funcprototype
3c9b6116
AW
18352 (funcdef "void " (function "glRectd"))
18353 (paramdef "GLdouble " (parameter "x1"))
18354 (paramdef "GLdouble " (parameter "y1"))
18355 (paramdef "GLdouble " (parameter "x2"))
18356 (paramdef "GLdouble " (parameter "y2"))))
18357 "Draw a rectangle.
8925f36f 18358
3c9b6116
AW
18359X1
18360 Y1
8925f36f 18361
3c9b6116 18362 Specify one vertex of a rectangle.
8925f36f 18363
3c9b6116
AW
18364X2
18365 Y2
8925f36f 18366
3c9b6116 18367 Specify the opposite vertex of the rectangle.
8925f36f 18368
3c9b6116
AW
18369`glRect' supports efficient specification of rectangles as two corner
18370points. Each rectangle command takes four arguments, organized either as
18371two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
18372each containing an (X,Y) pair. The resulting rectangle is defined in the
18373Z=0 plane.
8925f36f 18374
3c9b6116
AW
18375`glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
18376sequence: Note that if the second vertex is above and to the right of
18377the first vertex, the rectangle is constructed with a counterclockwise
18378winding.
8925f36f 18379
3c9b6116
AW
18380
18381 glBegin(`GL_POLYGON');
18382 glVertex2(X1, Y1);
18383 glVertex2(X2, Y1);
18384 glVertex2(X2, Y2);
18385 glVertex2(X1, Y2);
18386 glEnd();
8925f36f 18387
3c9b6116
AW
18388`GL_INVALID_OPERATION' is generated if `glRect' is executed between the
18389execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
18390
18391(define-gl-procedure
3c9b6116
AW
18392 glRenderMode
18393 "glRenderMode"
8925f36f
AW
18394 (funcsynopsis
18395 (funcprototype
3c9b6116
AW
18396 (funcdef "GLint " (function "glRenderMode"))
18397 (paramdef "GLenum " (parameter "mode"))))
18398 "Set rasterization mode.
8925f36f 18399
3c9b6116
AW
18400MODE
18401 Specifies the rasterization mode. Three values are accepted:
18402 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
18403 `GL_RENDER'.
18404
18405`glRenderMode' sets the rasterization mode. It takes one argument, MODE,
18406which can assume one of three predefined values:
18407
18408`GL_RENDER'
18409 Render mode. Primitives are rasterized, producing pixel fragments,
18410 which are written into the frame buffer. This is the normal mode
18411 and also the default mode.
18412
18413`GL_SELECT'
18414 Selection mode. No pixel fragments are produced, and no change to
18415 the frame buffer contents is made. Instead, a record of the names
18416 of primitives that would have been drawn if the render mode had
18417 been `GL_RENDER' is returned in a select buffer, which must be
18418 created (see `glSelectBuffer') before selection mode is entered.
18419
18420`GL_FEEDBACK'
18421 Feedback mode. No pixel fragments are produced, and no change to
18422 the frame buffer contents is made. Instead, the coordinates and
18423 attributes of vertices that would have been drawn if the render
18424 mode had been `GL_RENDER' is returned in a feedback buffer, which
18425 must be created (see `glFeedbackBuffer') before feedback mode is
18426 entered.
18427
18428The return value of `glRenderMode' is determined by the render mode at
18429the time `glRenderMode' is called, rather than by MODE. The values
18430returned for the three render modes are as follows:
18431
18432`GL_RENDER'
18433 0.
18434
18435`GL_SELECT'
18436 The number of hit records transferred to the select buffer.
18437
18438`GL_FEEDBACK'
18439 The number of values (not vertices) transferred to the feedback
18440 buffer.
18441
18442See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
18443details concerning selection and feedback operation.
18444
18445`GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
18446values.
18447
18448`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
18449the render mode is `GL_SELECT', or if `glRenderMode' is called with
18450argument `GL_SELECT' before `glSelectBuffer' is called at least once.
18451
18452`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
18453while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
18454with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
18455once.
18456
18457`GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
18458between the execution of `glBegin' and the corresponding execution of
18459`glEnd'.")
8925f36f
AW
18460
18461(define-gl-procedure
3c9b6116
AW
18462 glResetHistogram
18463 "glResetHistogram"
8925f36f
AW
18464 (funcsynopsis
18465 (funcprototype
3c9b6116
AW
18466 (funcdef "void " (function "glResetHistogram"))
18467 (paramdef "GLenum " (parameter "target"))))
18468 "Reset histogram table entries to zero.
18469
18470TARGET
18471 Must be `GL_HISTOGRAM'.
18472
18473`glResetHistogram' resets all the elements of the current histogram
18474table to zero.
18475
18476`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
18477
18478`GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
18479between the execution of `glBegin' and the corresponding execution of
18480`glEnd'.")
8925f36f
AW
18481
18482(define-gl-procedure
3c9b6116
AW
18483 glResetMinmax
18484 "glResetMinmax"
8925f36f
AW
18485 (funcsynopsis
18486 (funcprototype
3c9b6116
AW
18487 (funcdef "void " (function "glResetMinmax"))
18488 (paramdef "GLenum " (parameter "target"))))
18489 "Reset minmax table entries to initial values.
18490
18491TARGET
18492 Must be `GL_MINMAX'.
18493
18494`glResetMinmax' resets the elements of the current minmax table to their
18495initial values: the ``maximum'' element receives the minimum possible
18496component values, and the ``minimum'' element receives the maximum
18497possible component values.
18498
18499`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
18500
18501`GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
18502between the execution of `glBegin' and the corresponding execution of
18503`glEnd'.")
8925f36f
AW
18504
18505(define-gl-procedure
3c9b6116
AW
18506 glRotate
18507 "glRotate"
8925f36f
AW
18508 (funcsynopsis
18509 (funcprototype
3c9b6116
AW
18510 (funcdef "void " (function "glRotated"))
18511 (paramdef "GLdouble " (parameter "angle"))
18512 (paramdef "GLdouble " (parameter "x"))
18513 (paramdef "GLdouble " (parameter "y"))
18514 (paramdef "GLdouble " (parameter "z"))))
18515 "Multiply the current matrix by a rotation matrix.
18516
18517ANGLE
18518 Specifies the angle of rotation, in degrees.
18519
18520X
18521 Y
18522
18523 Z
18524
18525 Specify the X, Y, and Z coordinates of a vector, respectively.
18526
18527`glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
18528. The current matrix (see `glMatrixMode') is multiplied by a rotation
18529matrix with the product replacing the current matrix, as if
18530`glMultMatrix' were called with the following matrix as its argument:
18531
18532((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
18533Y^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
18534Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
18535
18536
18537
18538Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
18539will normalize this vector).
18540
18541
18542
18543
18544
18545If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18546objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
18547and `glPopMatrix' to save and restore the unrotated coordinate system.
18548
18549`GL_INVALID_OPERATION' is generated if `glRotate' is executed between
18550the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
18551
18552(define-gl-procedure
3c9b6116
AW
18553 glSampleCoverage
18554 "glSampleCoverage"
8925f36f
AW
18555 (funcsynopsis
18556 (funcprototype
3c9b6116
AW
18557 (funcdef "void " (function "glSampleCoverage"))
18558 (paramdef "GLclampf " (parameter "value"))
18559 (paramdef "GLboolean " (parameter "invert"))))
18560 "Specify multisample coverage parameters.
18561
18562VALUE
18563 Specify a single floating-point sample coverage value. The value is
18564 clamped to the range [0,1] . The initial value is 1.0.
18565
18566INVERT
18567 Specify a single boolean value representing if the coverage masks
18568 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
18569 initial value is `GL_FALSE'.
18570
18571Multisampling samples a pixel multiple times at various
18572implementation-dependent subpixel locations to generate antialiasing
18573effects. Multisampling transparently antialiases points, lines,
18574polygons, bitmaps, and images if it is enabled.
18575
18576VALUE is used in constructing a temporary mask used in determining which
18577samples will be used in resolving the final fragment color. This mask is
18578bitwise-anded with the coverage mask generated from the multisampling
18579computation. If the INVERT flag is set, the temporary mask is inverted
18580(all bits flipped) and then the bitwise-and is computed.
18581
18582If an implementation does not have any multisample buffers available, or
18583multisampling is disabled, rasterization occurs with only a single
18584sample computing a pixel's final RGB color.
18585
18586Provided an implementation supports multisample buffers, and
18587multisampling is enabled, then a pixel's final color is generated by
18588combining several samples per pixel. Each sample contains color, depth,
18589and stencil information, allowing those operations to be performed on
18590each sample.
18591
18592`GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
18593between the execution of `glBegin' and the corresponding execution of
18594`glEnd'.")
8925f36f
AW
18595
18596(define-gl-procedure
3c9b6116
AW
18597 glScale
18598 "glScale"
8925f36f
AW
18599 (funcsynopsis
18600 (funcprototype
3c9b6116
AW
18601 (funcdef "void " (function "glScaled"))
18602 (paramdef "GLdouble " (parameter "x"))
18603 (paramdef "GLdouble " (parameter "y"))
18604 (paramdef "GLdouble " (parameter "z"))))
18605 "Multiply the current matrix by a general scaling matrix.
18606
18607X
18608 Y
18609
18610 Z
18611
18612 Specify scale factors along the X, Y, and Z axes, respectively.
18613
18614`glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
18615three parameters indicate the desired scale factor along each of the
18616three axes.
18617
18618The current matrix (see `glMatrixMode') is multiplied by this scale
18619matrix, and the product replaces the current matrix as if `glMultMatrix'
18620were called with the following matrix as its argument:
18621
18622((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
18623
18624If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18625objects drawn after `glScale' is called are scaled.
18626
18627Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
18628coordinate system.
18629
18630`GL_INVALID_OPERATION' is generated if `glScale' is executed between the
18631execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
18632
18633(define-gl-procedure
3c9b6116
AW
18634 glScissor
18635 "glScissor"
8925f36f
AW
18636 (funcsynopsis
18637 (funcprototype
3c9b6116
AW
18638 (funcdef "void " (function "glScissor"))
18639 (paramdef "GLint " (parameter "x"))
18640 (paramdef "GLint " (parameter "y"))
18641 (paramdef "GLsizei " (parameter "width"))
18642 (paramdef "GLsizei " (parameter "height"))))
18643 "Define the scissor box.
18644
18645X
18646 Y
18647
18648 Specify the lower left corner of the scissor box. Initially (0, 0).
18649
18650WIDTH
18651 HEIGHT
18652
18653 Specify the width and height of the scissor box. When a GL context
18654 is first attached to a window, WIDTH and HEIGHT are set to the
18655 dimensions of that window.
8925f36f 18656
3c9b6116
AW
18657`glScissor' defines a rectangle, called the scissor box, in window
18658coordinates. The first two arguments, X and Y, specify the lower left
18659corner of the box. WIDTH and HEIGHT specify the width and height of the
18660box.
18661
18662To enable and disable the scissor test, call `glEnable' and `glDisable'
18663with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
18664the test is enabled, only pixels that lie within the scissor box can be
18665modified by drawing commands. Window coordinates have integer values at
18666the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
18667modification of only the lower left pixel in the window, and
18668`glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
18669window.
18670
18671When the scissor test is disabled, it is as though the scissor box
18672includes the entire window.
18673
18674`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
18675
18676`GL_INVALID_OPERATION' is generated if `glScissor' is executed between
18677the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
18678
18679(define-gl-procedure
3c9b6116
AW
18680 glSecondaryColorPointer
18681 "glSecondaryColorPointer"
8925f36f
AW
18682 (funcsynopsis
18683 (funcprototype
18684 (funcdef
18685 "void "
3c9b6116
AW
18686 (function "glSecondaryColorPointer"))
18687 (paramdef "GLint " (parameter "size"))
18688 (paramdef "GLenum " (parameter "type"))
18689 (paramdef "GLsizei " (parameter "stride"))
18690 (paramdef
18691 "const GLvoid * "
18692 (parameter "pointer"))))
18693 "Define an array of secondary colors.
8925f36f 18694
3c9b6116
AW
18695SIZE
18696 Specifies the number of components per color. Must be 3.
18697
18698TYPE
18699 Specifies the data type of each color component in the array.
18700 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
18701 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
18702 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
18703
18704STRIDE
18705 Specifies the byte offset between consecutive colors. If STRIDE is
18706 0, the colors are understood to be tightly packed in the array. The
18707 initial value is 0.
18708
18709POINTER
18710 Specifies a pointer to the first component of the first color
18711 element in the array. The initial value is 0.
18712
18713`glSecondaryColorPointer' specifies the location and data format of an
18714array of color components to use when rendering. SIZE specifies the
18715number of components per color, and must be 3. TYPE specifies the data
18716type of each color component, and STRIDE specifies the byte stride from
18717one color to the next, allowing vertices and attributes to be packed
18718into a single array or stored in separate arrays.
18719
18720If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
18721target (see `glBindBuffer') while a secondary color array is specified,
18722POINTER is treated as a byte offset into the buffer object's data store.
18723Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
18724secondary color vertex array client-side state
18725(`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
18726
18727When a secondary color array is specified, SIZE, TYPE, STRIDE, and
18728POINTER are saved as client-side state, in addition to the current
18729vertex array buffer object binding.
18730
18731To enable and disable the secondary color array, call
18732`glEnableClientState' and `glDisableClientState' with the argument
18733`GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
18734used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
18735`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
18736called.
18737
18738`GL_INVALID_VALUE' is generated if SIZE is not 3.
18739
18740`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
18741
18742`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f
AW
18743
18744(define-gl-procedure
3c9b6116
AW
18745 glSecondaryColor
18746 "glSecondaryColor"
8925f36f
AW
18747 (funcsynopsis
18748 (funcprototype
3c9b6116
AW
18749 (funcdef "void " (function "glSecondaryColor3b"))
18750 (paramdef "GLbyte " (parameter "red"))
18751 (paramdef "GLbyte " (parameter "green"))
18752 (paramdef "GLbyte " (parameter "blue"))))
18753 "Set the current secondary color.
18754
18755RED
18756 GREEN
18757
18758 BLUE
18759
18760 Specify new red, green, and blue values for the current secondary
18761 color.
18762
18763The GL stores both a primary four-valued RGBA color and a secondary
18764four-valued RGBA color (where alpha is always set to 0.0) that is
18765associated with every vertex.
18766
18767The secondary color is interpolated and applied to each fragment during
18768rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
18769and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
18770secondary color is assigned the value computed from the specular term of
18771the lighting computation. Both the primary and secondary current colors
18772are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
18773under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
18774the value returned from querying the current secondary color is
18775undefined.
18776
18777`glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
18778take three signed byte, short, or long integers as arguments. When *v*
18779is appended to the name, the color commands can take a pointer to an
18780array of such values.
18781
18782Color values are stored in floating-point format, with unspecified
18783mantissa and exponent sizes. Unsigned integer color components, when
18784specified, are linearly mapped to floating-point values such that the
18785largest representable value maps to 1.0 (full intensity), and 0 maps to
187860.0 (zero intensity). Signed integer color components, when specified,
18787are linearly mapped to floating-point values such that the most positive
18788representable value maps to 1.0, and the most negative representable
18789value maps to -1.0 . (Note that this mapping does not convert 0
18790precisely to 0.0). Floating-point values are mapped directly.
18791
18792Neither floating-point nor signed integer values are clamped to the
18793range [0,1] before the current color is updated. However, color
18794components are clamped to this range before they are interpolated or
18795written into a color buffer.")
8925f36f
AW
18796
18797(define-gl-procedure
3c9b6116
AW
18798 glSelectBuffer
18799 "glSelectBuffer"
8925f36f
AW
18800 (funcsynopsis
18801 (funcprototype
3c9b6116
AW
18802 (funcdef "void " (function "glSelectBuffer"))
18803 (paramdef "GLsizei " (parameter "size"))
18804 (paramdef "GLuint * " (parameter "buffer"))))
18805 "Establish a buffer for selection mode values.
18806
18807SIZE
18808 Specifies the size of BUFFER.
18809
18810BUFFER
18811 Returns the selection data.
18812
18813`glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
18814unsigned integers, and SIZE indicates the size of the array. BUFFER
18815returns values from the name stack (see `glInitNames', `glLoadName',
18816`glPushName') when the rendering mode is `GL_SELECT' (see
18817`glRenderMode'). `glSelectBuffer' must be issued before selection mode
18818is enabled, and it must not be issued while the rendering mode is
18819`GL_SELECT'.
18820
18821A programmer can use selection to determine which primitives are drawn
18822into some region of a window. The region is defined by the current
18823modelview and perspective matrices.
18824
18825In selection mode, no pixel fragments are produced from rasterization.
18826Instead, if a primitive or a raster position intersects the clipping
18827volume defined by the viewing frustum and the user-defined clipping
18828planes, this primitive causes a selection hit. (With polygons, no hit
18829occurs if the polygon is culled.) When a change is made to the name
18830stack, or when `glRenderMode' is called, a hit record is copied to
18831BUFFER if any hits have occurred since the last such event (name stack
18832change or `glRenderMode' call). The hit record consists of the number of
18833names in the name stack at the time of the event, followed by the
18834minimum and maximum depth values of all vertices that hit since the
18835previous event, followed by the name stack contents, bottom name first.
18836
18837Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
18838before being placed in the hit record.
18839
18840An internal index into BUFFER is reset to 0 whenever selection mode is
18841entered. Each time a hit record is copied into BUFFER, the index is
18842incremented to point to the cell just past the end of the block of
18843names\\(emthat is, to the next available cell If the hit record is larger
18844than the number of remaining locations in BUFFER, as much data as can
18845fit is copied, and the overflow flag is set. If the name stack is empty
18846when a hit record is copied, that record consists of 0 followed by the
18847minimum and maximum depth values.
18848
18849To exit selection mode, call `glRenderMode' with an argument other than
18850`GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
18851`GL_SELECT', it returns the number of hit records copied to BUFFER,
18852resets the overflow flag and the selection buffer pointer, and
18853initializes the name stack to be empty. If the overflow bit was set when
18854`glRenderMode' was called, a negative hit record count is returned.
18855
18856`GL_INVALID_VALUE' is generated if SIZE is negative.
18857
18858`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
18859the render mode is `GL_SELECT', or if `glRenderMode' is called with
18860argument `GL_SELECT' before `glSelectBuffer' is called at least once.
18861
18862`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
18863between the execution of `glBegin' and the corresponding execution of
18864`glEnd'.")
8925f36f
AW
18865
18866(define-gl-procedure
3c9b6116
AW
18867 glSeparableFilter2D
18868 "glSeparableFilter2D"
8925f36f
AW
18869 (funcsynopsis
18870 (funcprototype
18871 (funcdef
18872 "void "
3c9b6116 18873 (function "glSeparableFilter2D"))
8925f36f 18874 (paramdef "GLenum " (parameter "target"))
3c9b6116
AW
18875 (paramdef "GLenum " (parameter "internalformat"))
18876 (paramdef "GLsizei " (parameter "width"))
18877 (paramdef "GLsizei " (parameter "height"))
8925f36f
AW
18878 (paramdef "GLenum " (parameter "format"))
18879 (paramdef "GLenum " (parameter "type"))
3c9b6116
AW
18880 (paramdef "const GLvoid * " (parameter "row"))
18881 (paramdef "const GLvoid * " (parameter "column"))))
18882 "Define a separable two-dimensional convolution filter.
8925f36f 18883
3c9b6116
AW
18884TARGET
18885 Must be `GL_SEPARABLE_2D'.
18886
18887INTERNALFORMAT
18888 The internal format of the convolution filter kernel. The allowable
18889 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
18890 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
18891 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
18892 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
18893 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
18894 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
18895 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
18896 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
18897 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
18898 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
18899 `GL_RGBA12', or `GL_RGBA16'.
18900
18901WIDTH
18902 The number of elements in the pixel array referenced by ROW. (This
18903 is the width of the separable filter kernel.)
18904
18905HEIGHT
18906 The number of elements in the pixel array referenced by COLUMN.
18907 (This is the height of the separable filter kernel.)
18908
18909FORMAT
18910 The format of the pixel data in ROW and COLUMN. The allowable
18911 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
18912 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
18913 `GL_LUMINANCE_ALPHA'.
18914
18915TYPE
18916 The type of the pixel data in ROW and COLUMN. Symbolic constants
18917 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
18918 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
18919 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18920 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
18921 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18922 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18923 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18924 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
18925 are accepted.
18926
18927ROW
18928 Pointer to a one-dimensional array of pixel data that is processed
18929 to build the row filter kernel.
18930
18931COLUMN
18932 Pointer to a one-dimensional array of pixel data that is processed
18933 to build the column filter kernel.
18934
18935`glSeparableFilter2D' builds a two-dimensional separable convolution
18936filter kernel from two arrays of pixels.
18937
18938The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
18939FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
18940`glDrawPixels', but processing stops after the final expansion to RGBA
18941is completed.
18942
18943If a non-zero named buffer object is bound to the
18944`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
18945filter is specified, ROW and COLUMN are treated as byte offsets into the
18946buffer object's data store.
18947
18948Next, the R, G, B, and A components of all pixels in both arrays are
18949scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
18950and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
18951parameters. (The scale and bias parameters are set by
18952`glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
18953names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
18954The parameters themselves are vectors of four values that are applied to
18955red, green, blue, and alpha, in that order.) The R, G, B, and A values
18956are not clamped to [0,1] at any time during this process.
18957
18958Each pixel is then converted to the internal format specified by
18959INTERNALFORMAT. This conversion simply maps the component values of the
18960pixel (R, G, B, and A) to the values included in the internal format
18961(red, green, blue, alpha, luminance, and intensity). The mapping is as
18962follows:
18963
18964*Internal Format*
18965 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
18966
18967`GL_LUMINANCE'
18968 , , , , R ,
18969
18970`GL_LUMINANCE_ALPHA'
18971 , , , A , R ,
18972
18973`GL_INTENSITY'
18974 , , , , , R
18975
18976`GL_RGB'
18977 R , G , B , , ,
18978
18979`GL_RGBA'
18980 R , G , B , A , ,
18981
18982The red, green, blue, alpha, luminance, and/or intensity components of
18983the resulting pixels are stored in floating-point rather than integer
18984format. They form two one-dimensional filter kernel images. The row
18985image is indexed by coordinate I starting at zero and increasing from
18986left to right. Each location in the row image is derived from element I
18987of ROW. The column image is indexed by coordinate J starting at zero and
18988increasing from bottom to top. Each location in the column image is
18989derived from element J of COLUMN.
18990
18991Note that after a convolution is performed, the resulting color
18992components are also scaled by their corresponding
18993`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
18994corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
18995the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
18996set by `glPixelTransfer'.
18997
18998`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
18999
19000`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
19001allowable values.
19002
19003`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
19004values.
19005
19006`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
19007values.
19008
19009`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
19010than the maximum supported value. This value may be queried with
19011`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
19012`GL_MAX_CONVOLUTION_WIDTH'.
19013
19014`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
19015than the maximum supported value. This value may be queried with
19016`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
19017`GL_MAX_CONVOLUTION_HEIGHT'.
19018
19019`GL_INVALID_OPERATION' is generated if HEIGHT is one of
19020`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
19021`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
19022is not `GL_RGB'.
19023
19024`GL_INVALID_OPERATION' is generated if HEIGHT is one of
19025`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
19026`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
19027`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
19028`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
19029FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
19030
19031`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19032bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
19033data store is currently mapped.
19034
19035`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19036bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
19037unpacked from the buffer object such that the memory reads required
19038would exceed the data store size.
19039
19040`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19041bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
19042evenly divisible into the number of bytes needed to store in memory a
19043datum indicated by TYPE.
19044
19045`GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
19046between the execution of `glBegin' and the corresponding execution of
19047`glEnd'.")
8925f36f
AW
19048
19049(define-gl-procedure
3c9b6116
AW
19050 glShadeModel
19051 "glShadeModel"
8925f36f
AW
19052 (funcsynopsis
19053 (funcprototype
3c9b6116
AW
19054 (funcdef "void " (function "glShadeModel"))
19055 (paramdef "GLenum " (parameter "mode"))))
19056 "Select flat or smooth shading.
19057
19058MODE
19059 Specifies a symbolic value representing a shading technique.
19060 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
19061 `GL_SMOOTH'.
19062
19063GL primitives can have either flat or smooth shading. Smooth shading,
19064the default, causes the computed colors of vertices to be interpolated
19065as the primitive is rasterized, typically assigning different colors to
19066each resulting pixel fragment. Flat shading selects the computed color
19067of just one vertex and assigns it to all the pixel fragments generated
19068by rasterizing a single primitive. In either case, the computed color of
19069a vertex is the result of lighting if lighting is enabled, or it is the
19070current color at the time the vertex was specified if lighting is
19071disabled.
19072
19073Flat and smooth shading are indistinguishable for points. Starting when
19074`glBegin' is issued and counting vertices and primitives from 1, the GL
19075gives each flat-shaded line segment I the computed color of vertex I+1 ,
19076its second vertex. Counting similarly from 1, the GL gives each
19077flat-shaded polygon the computed color of the vertex listed in the
19078following table. This is the last vertex to specify the polygon in all
19079cases except single polygons, where the first vertex specifies the
19080flat-shaded color.
19081
19082
19083
19084* Primitive Type of Polygon I *
19085 *Vertex*
19086
19087Single polygon (I==1 )
19088 1
19089
19090Triangle strip
19091 I+2
19092
19093Triangle fan
19094 I+2
19095
19096Independent triangle
19097 3\u2062I
19098
19099Quad strip
19100 2\u2062I+2
19101
19102Independent quad
19103 4\u2062I
19104
19105Flat and smooth shading are specified by `glShadeModel' with MODE set to
19106`GL_FLAT' and `GL_SMOOTH', respectively.
19107
19108`GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
19109or `GL_SMOOTH'.
19110
19111`GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
19112between the execution of `glBegin' and the corresponding execution of
19113`glEnd'.")
8925f36f
AW
19114
19115(define-gl-procedure
3c9b6116
AW
19116 glShaderSource
19117 "glShaderSource"
8925f36f
AW
19118 (funcsynopsis
19119 (funcprototype
3c9b6116 19120 (funcdef "void " (function "glShaderSource"))
8925f36f 19121 (paramdef "GLuint " (parameter "shader"))
3c9b6116
AW
19122 (paramdef "GLsizei " (parameter "count"))
19123 (paramdef "const GLchar **" (parameter "string"))
19124 (paramdef "const GLint *" (parameter "length"))))
19125 "Replaces the source code in a shader object.
19126
19127SHADER
19128 Specifies the handle of the shader object whose source code is to
19129 be replaced.
19130
19131COUNT
19132 Specifies the number of elements in the STRING and LENGTH arrays.
19133
19134STRING
19135 Specifies an array of pointers to strings containing the source
19136 code to be loaded into the shader.
19137
19138LENGTH
19139 Specifies an array of string lengths.
19140
19141`glShaderSource' sets the source code in SHADER to the source code in
19142the array of strings specified by STRING. Any source code previously
19143stored in the shader object is completely replaced. The number of
19144strings in the array is specified by COUNT. If LENGTH is `NULL', each
19145string is assumed to be null terminated. If LENGTH is a value other than
19146`NULL', it points to an array containing a string length for each of the
19147corresponding elements of STRING. Each element in the LENGTH array may
19148contain the length of the corresponding string (the null character is
19149not counted as part of the string length) or a value less than 0 to
19150indicate that the string is null terminated. The source code strings are
19151not scanned or parsed at this time; they are simply copied into the
19152specified shader object.
19153
19154`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
19155OpenGL.
19156
19157`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
19158
19159`GL_INVALID_VALUE' is generated if COUNT is less than 0.
19160
19161`GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
19162between the execution of `glBegin' and the corresponding execution of
19163`glEnd'.")
8925f36f
AW
19164
19165(define-gl-procedure
3c9b6116
AW
19166 glStencilFuncSeparate
19167 "glStencilFuncSeparate"
8925f36f
AW
19168 (funcsynopsis
19169 (funcprototype
19170 (funcdef
3c9b6116
AW
19171 "void "
19172 (function "glStencilFuncSeparate"))
19173 (paramdef "GLenum " (parameter "face"))
19174 (paramdef "GLenum " (parameter "func"))
19175 (paramdef "GLint " (parameter "ref"))
19176 (paramdef "GLuint " (parameter "mask"))))
19177 "Set front and/or back function and reference value for stencil testing.
19178
19179FACE
19180 Specifies whether front and/or back stencil state is updated. Three
19181 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
19182 `GL_FRONT_AND_BACK'.
19183
19184FUNC
19185 Specifies the test function. Eight symbolic constants are valid:
19186 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
19187 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
19188 `GL_ALWAYS'.
19189
19190REF
19191 Specifies the reference value for the stencil test. REF is clamped
19192 to the range [0,2^N-1] , where N is the number of bitplanes in the
19193 stencil buffer. The initial value is 0.
19194
19195MASK
19196 Specifies a mask that is ANDed with both the reference value and
19197 the stored stencil value when the test is done. The initial value
19198 is all 1's.
19199
19200Stenciling, like depth-buffering, enables and disables drawing on a
19201per-pixel basis. You draw into the stencil planes using GL drawing
19202primitives, then render geometry and images, using the stencil planes to
19203mask out portions of the screen. Stenciling is typically used in
19204multipass rendering algorithms to achieve special effects, such as
19205decals, outlining, and constructive solid geometry rendering.
19206
19207The stencil test conditionally eliminates a pixel based on the outcome
19208of a comparison between the reference value and the value in the stencil
19209buffer. To enable and disable the test, call `glEnable' and `glDisable'
19210with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
19211of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
19212
19213There can be two separate sets of FUNC, REF, and MASK parameters; one
19214affects back-facing polygons, and the other affects front-facing
19215polygons as well as other non-polygon primitives. `glStencilFunc' sets
19216both front and back stencil state to the same values, as if
19217`glStencilFuncSeparate' were called with FACE set to
19218`GL_FRONT_AND_BACK'.
19219
19220FUNC is a symbolic constant that determines the stencil comparison
19221function. It accepts one of eight values, shown in the following list.
19222REF is an integer reference value that is used in the stencil
19223comparison. It is clamped to the range [0,2^N-1] , where N is the number
19224of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
19225reference value and the stored stencil value, with the ANDed values
19226participating in the comparison.
19227
19228If STENCIL represents the value stored in the corresponding stencil
19229buffer location, the following list shows the effect of each comparison
19230function that can be specified by FUNC. Only if the comparison succeeds
19231is the pixel passed through to the next stage in the rasterization
19232process (see `glStencilOp'). All tests treat STENCIL values as unsigned
19233integers in the range [0,2^N-1] , where N is the number of bitplanes in
19234the stencil buffer.
19235
19236The following values are accepted by FUNC:
19237
19238`GL_NEVER'
19239 Always fails.
19240
19241`GL_LESS'
19242 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
19243
19244`GL_LEQUAL'
19245 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
19246
19247`GL_GREATER'
19248 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
19249
19250`GL_GEQUAL'
19251 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
19252
19253`GL_EQUAL'
19254 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
19255
19256`GL_NOTEQUAL'
19257 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
19258
19259`GL_ALWAYS'
19260 Always passes.
19261
19262`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
19263values.
19264
19265`GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
19266executed between the execution of `glBegin' and the corresponding
19267execution of `glEnd'.")
8925f36f
AW
19268
19269(define-gl-procedure
3c9b6116
AW
19270 glStencilFunc
19271 "glStencilFunc"
8925f36f
AW
19272 (funcsynopsis
19273 (funcprototype
3c9b6116
AW
19274 (funcdef "void " (function "glStencilFunc"))
19275 (paramdef "GLenum " (parameter "func"))
19276 (paramdef "GLint " (parameter "ref"))
19277 (paramdef "GLuint " (parameter "mask"))))
19278 "Set front and back function and reference value for stencil testing.
19279
19280FUNC
19281 Specifies the test function. Eight symbolic constants are valid:
19282 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
19283 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
19284 `GL_ALWAYS'.
19285
19286REF
19287 Specifies the reference value for the stencil test. REF is clamped
19288 to the range [0,2^N-1] , where N is the number of bitplanes in the
19289 stencil buffer. The initial value is 0.
19290
19291MASK
19292 Specifies a mask that is ANDed with both the reference value and
19293 the stored stencil value when the test is done. The initial value
19294 is all 1's.
19295
19296Stenciling, like depth-buffering, enables and disables drawing on a
19297per-pixel basis. Stencil planes are first drawn into using GL drawing
19298primitives, then geometry and images are rendered using the stencil
19299planes to mask out portions of the screen. Stenciling is typically used
19300in multipass rendering algorithms to achieve special effects, such as
19301decals, outlining, and constructive solid geometry rendering.
19302
19303The stencil test conditionally eliminates a pixel based on the outcome
19304of a comparison between the reference value and the value in the stencil
19305buffer. To enable and disable the test, call `glEnable' and `glDisable'
19306with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
19307of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
19308
19309There can be two separate sets of FUNC, REF, and MASK parameters; one
19310affects back-facing polygons, and the other affects front-facing
19311polygons as well as other non-polygon primitives. `glStencilFunc' sets
19312both front and back stencil state to the same values. Use
19313`glStencilFuncSeparate' to set front and back stencil state to different
19314values.
19315
19316FUNC is a symbolic constant that determines the stencil comparison
19317function. It accepts one of eight values, shown in the following list.
19318REF is an integer reference value that is used in the stencil
19319comparison. It is clamped to the range [0,2^N-1] , where N is the number
19320of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
19321reference value and the stored stencil value, with the ANDed values
19322participating in the comparison.
19323
19324If STENCIL represents the value stored in the corresponding stencil
19325buffer location, the following list shows the effect of each comparison
19326function that can be specified by FUNC. Only if the comparison succeeds
19327is the pixel passed through to the next stage in the rasterization
19328process (see `glStencilOp'). All tests treat STENCIL values as unsigned
19329integers in the range [0,2^N-1] , where N is the number of bitplanes in
19330the stencil buffer.
19331
19332The following values are accepted by FUNC:
19333
19334`GL_NEVER'
19335 Always fails.
19336
19337`GL_LESS'
19338 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
19339
19340`GL_LEQUAL'
19341 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
19342
19343`GL_GREATER'
19344 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
19345
19346`GL_GEQUAL'
19347 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
19348
19349`GL_EQUAL'
19350 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
19351
19352`GL_NOTEQUAL'
19353 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
19354
19355`GL_ALWAYS'
19356 Always passes.
19357
19358`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
19359values.
19360
19361`GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
19362between the execution of `glBegin' and the corresponding execution of
19363`glEnd'.")
8925f36f
AW
19364
19365(define-gl-procedure
3c9b6116
AW
19366 glStencilMaskSeparate
19367 "glStencilMaskSeparate"
8925f36f
AW
19368 (funcsynopsis
19369 (funcprototype
3c9b6116
AW
19370 (funcdef
19371 "void "
19372 (function "glStencilMaskSeparate"))
19373 (paramdef "GLenum " (parameter "face"))
19374 (paramdef "GLuint " (parameter "mask"))))
19375 "Control the front and/or back writing of individual bits in the stencil
19376planes.
19377
19378FACE
19379 Specifies whether the front and/or back stencil writemask is
19380 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
19381 and `GL_FRONT_AND_BACK'.
19382
19383MASK
19384 Specifies a bit mask to enable and disable writing of individual
19385 bits in the stencil planes. Initially, the mask is all 1's.
19386
19387`glStencilMaskSeparate' controls the writing of individual bits in the
19388stencil planes. The least significant N bits of MASK, where N is the
19389number of bits in the stencil buffer, specify a mask. Where a 1 appears
19390in the mask, it's possible to write to the corresponding bit in the
19391stencil buffer. Where a 0 appears, the corresponding bit is
19392write-protected. Initially, all bits are enabled for writing.
19393
19394There can be two separate MASK writemasks; one affects back-facing
19395polygons, and the other affects front-facing polygons as well as other
19396non-polygon primitives. `glStencilMask' sets both front and back stencil
19397writemasks to the same values, as if `glStencilMaskSeparate' were called
19398with FACE set to `GL_FRONT_AND_BACK'.
19399
19400`GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
19401executed between the execution of `glBegin' and the corresponding
19402execution of `glEnd'.")
8925f36f
AW
19403
19404(define-gl-procedure
3c9b6116
AW
19405 glStencilMask
19406 "glStencilMask"
8925f36f
AW
19407 (funcsynopsis
19408 (funcprototype
3c9b6116
AW
19409 (funcdef "void " (function "glStencilMask"))
19410 (paramdef "GLuint " (parameter "mask"))))
19411 "Control the front and back writing of individual bits in the stencil
19412planes.
19413
19414MASK
19415 Specifies a bit mask to enable and disable writing of individual
19416 bits in the stencil planes. Initially, the mask is all 1's.
19417
19418`glStencilMask' controls the writing of individual bits in the stencil
19419planes. The least significant N bits of MASK, where N is the number of
19420bits in the stencil buffer, specify a mask. Where a 1 appears in the
19421mask, it's possible to write to the corresponding bit in the stencil
19422buffer. Where a 0 appears, the corresponding bit is write-protected.
19423Initially, all bits are enabled for writing.
19424
19425There can be two separate MASK writemasks; one affects back-facing
19426polygons, and the other affects front-facing polygons as well as other
19427non-polygon primitives. `glStencilMask' sets both front and back stencil
19428writemasks to the same values. Use `glStencilMaskSeparate' to set front
19429and back stencil writemasks to different values.
19430
19431`GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
19432between the execution of `glBegin' and the corresponding execution of
19433`glEnd'.")
8925f36f
AW
19434
19435(define-gl-procedure
3c9b6116
AW
19436 glStencilOpSeparate
19437 "glStencilOpSeparate"
8925f36f
AW
19438 (funcsynopsis
19439 (funcprototype
19440 (funcdef
19441 "void "
3c9b6116
AW
19442 (function "glStencilOpSeparate"))
19443 (paramdef "GLenum " (parameter "face"))
19444 (paramdef "GLenum " (parameter "sfail"))
19445 (paramdef "GLenum " (parameter "dpfail"))
19446 (paramdef "GLenum " (parameter "dppass"))))
19447 "Set front and/or back stencil test actions.
19448
19449FACE
19450 Specifies whether front and/or back stencil state is updated. Three
19451 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
19452 `GL_FRONT_AND_BACK'.
19453
19454SFAIL
19455 Specifies the action to take when the stencil test fails. Eight
19456 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19457 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19458 and `GL_INVERT'. The initial value is `GL_KEEP'.
19459
19460DPFAIL
19461 Specifies the stencil action when the stencil test passes, but the
19462 depth test fails. DPFAIL accepts the same symbolic constants as
19463 SFAIL. The initial value is `GL_KEEP'.
19464
19465DPPASS
19466 Specifies the stencil action when both the stencil test and the
19467 depth test pass, or when the stencil test passes and either there
19468 is no depth buffer or depth testing is not enabled. DPPASS accepts
19469 the same symbolic constants as SFAIL. The initial value is
19470 `GL_KEEP'.
19471
19472Stenciling, like depth-buffering, enables and disables drawing on a
19473per-pixel basis. You draw into the stencil planes using GL drawing
19474primitives, then render geometry and images, using the stencil planes to
19475mask out portions of the screen. Stenciling is typically used in
19476multipass rendering algorithms to achieve special effects, such as
19477decals, outlining, and constructive solid geometry rendering.
19478
19479The stencil test conditionally eliminates a pixel based on the outcome
19480of a comparison between the value in the stencil buffer and a reference
19481value. To enable and disable the test, call `glEnable' and `glDisable'
19482with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19483`glStencilFuncSeparate'.
19484
19485There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19486one affects back-facing polygons, and the other affects front-facing
19487polygons as well as other non-polygon primitives. `glStencilOp' sets
19488both front and back stencil state to the same values, as if
19489`glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
19490
19491`glStencilOpSeparate' takes three arguments that indicate what happens
19492to the stored stencil value while stenciling is enabled. If the stencil
19493test fails, no change is made to the pixel's color or depth buffers, and
19494SFAIL specifies what happens to the stencil buffer contents. The
19495following eight actions are possible.
19496
19497`GL_KEEP'
19498 Keeps the current value.
19499
19500`GL_ZERO'
19501 Sets the stencil buffer value to 0.
19502
19503`GL_REPLACE'
19504 Sets the stencil buffer value to REF, as specified by
19505 `glStencilFunc'.
19506
19507`GL_INCR'
19508 Increments the current stencil buffer value. Clamps to the maximum
19509 representable unsigned value.
19510
19511`GL_INCR_WRAP'
19512 Increments the current stencil buffer value. Wraps stencil buffer
19513 value to zero when incrementing the maximum representable unsigned
19514 value.
19515
19516`GL_DECR'
19517 Decrements the current stencil buffer value. Clamps to 0.
19518
19519`GL_DECR_WRAP'
19520 Decrements the current stencil buffer value. Wraps stencil buffer
19521 value to the maximum representable unsigned value when decrementing
19522 a stencil buffer value of zero.
19523
19524`GL_INVERT'
19525 Bitwise inverts the current stencil buffer value.
19526
19527Stencil buffer values are treated as unsigned integers. When incremented
19528and decremented, values are clamped to 0 and 2^N-1 , where N is the
19529value returned by querying `GL_STENCIL_BITS'.
19530
19531The other two arguments to `glStencilOpSeparate' specify stencil buffer
19532actions that depend on whether subsequent depth buffer tests succeed
19533(DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
19534using the same eight symbolic constants as SFAIL. Note that DPFAIL is
19535ignored when there is no depth buffer, or when the depth buffer is not
19536enabled. In these cases, SFAIL and DPPASS specify stencil action when
19537the stencil test fails and passes, respectively.
19538
19539`GL_INVALID_ENUM' is generated if FACE is any value other than
19540`GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
19541
19542`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
19543other than the eight defined constant values.
19544
19545`GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
19546between the execution of `glBegin' and the corresponding execution of
19547`glEnd'.")
8925f36f
AW
19548
19549(define-gl-procedure
3c9b6116
AW
19550 glStencilOp
19551 "glStencilOp"
8925f36f
AW
19552 (funcsynopsis
19553 (funcprototype
3c9b6116
AW
19554 (funcdef "void " (function "glStencilOp"))
19555 (paramdef "GLenum " (parameter "sfail"))
19556 (paramdef "GLenum " (parameter "dpfail"))
19557 (paramdef "GLenum " (parameter "dppass"))))
19558 "Set front and back stencil test actions.
19559
19560SFAIL
19561 Specifies the action to take when the stencil test fails. Eight
19562 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19563 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19564 and `GL_INVERT'. The initial value is `GL_KEEP'.
19565
19566DPFAIL
19567 Specifies the stencil action when the stencil test passes, but the
19568 depth test fails. DPFAIL accepts the same symbolic constants as
19569 SFAIL. The initial value is `GL_KEEP'.
19570
19571DPPASS
19572 Specifies the stencil action when both the stencil test and the
19573 depth test pass, or when the stencil test passes and either there
19574 is no depth buffer or depth testing is not enabled. DPPASS accepts
19575 the same symbolic constants as SFAIL. The initial value is
19576 `GL_KEEP'.
19577
19578Stenciling, like depth-buffering, enables and disables drawing on a
19579per-pixel basis. You draw into the stencil planes using GL drawing
19580primitives, then render geometry and images, using the stencil planes to
19581mask out portions of the screen. Stenciling is typically used in
19582multipass rendering algorithms to achieve special effects, such as
19583decals, outlining, and constructive solid geometry rendering.
19584
19585The stencil test conditionally eliminates a pixel based on the outcome
19586of a comparison between the value in the stencil buffer and a reference
19587value. To enable and disable the test, call `glEnable' and `glDisable'
19588with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19589`glStencilFuncSeparate'.
19590
19591There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19592one affects back-facing polygons, and the other affects front-facing
19593polygons as well as other non-polygon primitives. `glStencilOp' sets
19594both front and back stencil state to the same values. Use
19595`glStencilOpSeparate' to set front and back stencil state to different
19596values.
19597
19598`glStencilOp' takes three arguments that indicate what happens to the
19599stored stencil value while stenciling is enabled. If the stencil test
19600fails, no change is made to the pixel's color or depth buffers, and
19601SFAIL specifies what happens to the stencil buffer contents. The
19602following eight actions are possible.
19603
19604`GL_KEEP'
19605 Keeps the current value.
19606
19607`GL_ZERO'
19608 Sets the stencil buffer value to 0.
19609
19610`GL_REPLACE'
19611 Sets the stencil buffer value to REF, as specified by
19612 `glStencilFunc'.
19613
19614`GL_INCR'
19615 Increments the current stencil buffer value. Clamps to the maximum
19616 representable unsigned value.
19617
19618`GL_INCR_WRAP'
19619 Increments the current stencil buffer value. Wraps stencil buffer
19620 value to zero when incrementing the maximum representable unsigned
19621 value.
19622
19623`GL_DECR'
19624 Decrements the current stencil buffer value. Clamps to 0.
19625
19626`GL_DECR_WRAP'
19627 Decrements the current stencil buffer value. Wraps stencil buffer
19628 value to the maximum representable unsigned value when decrementing
19629 a stencil buffer value of zero.
19630
19631`GL_INVERT'
19632 Bitwise inverts the current stencil buffer value.
19633
19634Stencil buffer values are treated as unsigned integers. When incremented
19635and decremented, values are clamped to 0 and 2^N-1 , where N is the
19636value returned by querying `GL_STENCIL_BITS'.
19637
19638The other two arguments to `glStencilOp' specify stencil buffer actions
19639that depend on whether subsequent depth buffer tests succeed (DPPASS) or
19640fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
19641same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
19642there is no depth buffer, or when the depth buffer is not enabled. In
19643these cases, SFAIL and DPPASS specify stencil action when the stencil
19644test fails and passes, respectively.
19645
19646`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
19647other than the eight defined constant values.
19648
19649`GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
19650the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
19651
19652(define-gl-procedure
3c9b6116
AW
19653 glTexCoordPointer
19654 "glTexCoordPointer"
8925f36f
AW
19655 (funcsynopsis
19656 (funcprototype
3c9b6116
AW
19657 (funcdef "void " (function "glTexCoordPointer"))
19658 (paramdef "GLint " (parameter "size"))
19659 (paramdef "GLenum " (parameter "type"))
19660 (paramdef "GLsizei " (parameter "stride"))
19661 (paramdef
19662 "const GLvoid * "
19663 (parameter "pointer"))))
19664 "Define an array of texture coordinates.
19665
19666SIZE
19667 Specifies the number of coordinates per array element. Must be 1,
19668 2, 3, or 4. The initial value is 4.
19669
19670TYPE
19671 Specifies the data type of each texture coordinate. Symbolic
19672 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
19673 accepted. The initial value is `GL_FLOAT'.
19674
19675STRIDE
19676 Specifies the byte offset between consecutive texture coordinate
19677 sets. If STRIDE is 0, the array elements are understood to be
19678 tightly packed. The initial value is 0.
19679
19680POINTER
19681 Specifies a pointer to the first coordinate of the first texture
19682 coordinate set in the array. The initial value is 0.
19683
19684`glTexCoordPointer' specifies the location and data format of an array
19685of texture coordinates to use when rendering. SIZE specifies the number
19686of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
19687TYPE specifies the data type of each texture coordinate, and STRIDE
19688specifies the byte stride from one texture coordinate set to the next,
19689allowing vertices and attributes to be packed into a single array or
19690stored in separate arrays. (Single-array storage may be more efficient
19691on some implementations; see `glInterleavedArrays'.)
19692
19693If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
19694target (see `glBindBuffer') while a texture coordinate array is
19695specified, POINTER is treated as a byte offset into the buffer object's
19696data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
19697is saved as texture coordinate vertex array client-side state
19698(`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
19699
19700When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
19701POINTER are saved as client-side state, in addition to the current
19702vertex array buffer object binding.
19703
19704To enable and disable a texture coordinate array, call
19705`glEnableClientState' and `glDisableClientState' with the argument
19706`GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
19707used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
19708`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
19709called.
19710
19711`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
19712
19713`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
19714
19715`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f
AW
19716
19717(define-gl-procedure
3c9b6116
AW
19718 glTexCoord
19719 "glTexCoord"
8925f36f
AW
19720 (funcsynopsis
19721 (funcprototype
3c9b6116
AW
19722 (funcdef "void " (function "glTexCoord1s"))
19723 (paramdef "GLshort " (parameter "s"))))
19724 "Set the current texture coordinates.
19725
19726S
19727 T
19728
19729 R
19730
19731 Q
19732
19733 Specify S, T, R, and Q texture coordinates. Not all parameters are
19734 present in all forms of the command.
19735
19736`glTexCoord' specifies texture coordinates in one, two, three, or four
19737dimensions. `glTexCoord1' sets the current texture coordinates to
19738(S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
19739`glTexCoord3' specifies the texture coordinates as (S,TR1) , and
19740`glTexCoord4' defines all four components explicitly as (S,TRQ) .
19741
19742The current texture coordinates are part of the data that is associated
19743with each vertex and with the current raster position. Initially, the
19744values for S, T, R, and Q are (0, 0, 0, 1).")
8925f36f
AW
19745
19746(define-gl-procedure
3c9b6116
AW
19747 glTexEnv
19748 "glTexEnv"
8925f36f
AW
19749 (funcsynopsis
19750 (funcprototype
3c9b6116
AW
19751 (funcdef "void " (function "glTexEnvf"))
19752 (paramdef "GLenum " (parameter "target"))
8925f36f 19753 (paramdef "GLenum " (parameter "pname"))
3c9b6116
AW
19754 (paramdef "GLfloat " (parameter "param"))))
19755 "Set texture environment parameters.
19756
19757TARGET
19758 Specifies a texture environment. May be `GL_TEXTURE_ENV',
19759 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
19760
19761PNAME
19762 Specifies the symbolic name of a single-valued texture environment
19763 parameter. May be either `GL_TEXTURE_ENV_MODE',
19764 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
19765 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19766 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
19767 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
19768 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
19769 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
19770
19771PARAM
19772 Specifies a single symbolic constant, one of `GL_ADD',
19773 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
19774 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
19775 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
19776 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
19777 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
19778 sprite texture coordinate replacement, a single floating-point
19779 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
19780 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
19781
19782A texture environment specifies how texture values are interpreted when
19783a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
19784PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
19785PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
19786`GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
19787`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19788`GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
19789
19790If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
19791symbolic name of a texture function. Six texture functions may be
19792specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
19793`GL_REPLACE', or `GL_COMBINE'.
19794
19795The following table shows the correspondence of filtered texture values
19796R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
19797A_S are used by the texture functions described below.
19798
19799
19800
19801Texture Base Internal Format
19802 `C'_S , `A'_S
19803
19804`GL_ALPHA'
19805 (0, 0, 0) , A_T
19806
19807`GL_LUMINANCE'
19808 ( L_T , L_T , L_T ) , 1
19809
19810`GL_LUMINANCE_ALPHA'
19811 ( L_T , L_T , L_T ) , A_T
19812
19813`GL_INTENSITY'
19814 ( I_T , I_T , I_T ) , I_T
19815
19816`GL_RGB'
19817 ( R_T , G_T , B_T ) , 1
19818
19819`GL_RGBA'
19820 ( R_T , G_T , B_T ) , A_T
19821
19822A texture function acts on the fragment to be textured using the texture
19823image value that applies to the fragment (see `glTexParameter') and
19824produces an RGBA color for that fragment. The following table shows how
19825the RGBA color is produced for each of the first five texture functions
19826that can be chosen. C is a triple of color values (RGB) and A is the
19827associated alpha value. RGBA values extracted from a texture image are
19828in the range [0,1]. The subscript P refers to the color computed from
19829the previous texture stage (or the incoming fragment if processing
19830texture stage 0), the subscript S to the texture source color, the
19831subscript C to the texture environment color, and the subscript V
19832indicates a value produced by the texture function.
19833
19834
19835
19836Texture Base Internal Format
19837 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
19838 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
19839
19840`GL_ALPHA'
19841 C_V= , C_P , C_P , undefined , C_P , C_P
19842
19843
19844 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
19845
19846`GL_LUMINANCE'
19847 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19848
19849(or 1)
19850 A_V= , A_P , A_P , , A_P , A_P
19851
19852`GL_LUMINANCE_ALPHA'
19853 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19854
19855(or 2)
19856 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
19857
19858`GL_INTENSITY'
19859 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19860
19861
19862 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
19863
19864`GL_RGB'
19865 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19866
19867(or 3)
19868 A_V= , A_P , A_P , A_P , A_P , A_P
19869
19870`GL_RGBA'
19871 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
19872 , C_P+C_S
19873
19874(or 4)
19875 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
19876
19877If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
19878of the texture function depends on the values of `GL_COMBINE_RGB' and
19879`GL_COMBINE_ALPHA'.
19880
19881The following describes how the texture sources, as specified by
19882`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19883`GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
19884texture color. In the following tables, `GL_SRC0_c' is represented by
19885ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
19886represented by ARG2 .
19887
19888`GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
19889`GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
19890`GL_DOT3_RGBA'.
19891
19892
19893
19894*`GL_COMBINE_RGB'*
19895 *Texture Function*
19896
19897`GL_REPLACE'
19898 ARG0
19899
19900`GL_MODULATE'
19901 ARG0×ARG1
19902
19903`GL_ADD'
19904 ARG0+ARG1
19905
19906`GL_ADD_SIGNED'
19907 ARG0+ARG1-0.5
19908
19909`GL_INTERPOLATE'
19910 ARG0×ARG2+ARG1×(1-ARG2,)
19911
19912`GL_SUBTRACT'
19913 ARG0-ARG1
19914
19915`GL_DOT3_RGB' or `GL_DOT3_RGBA'
19916 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
19917 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
19918
19919The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
19920each of the 3 (RGB) or 4 (RGBA) components on output.
19921
19922Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
19923`GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
19924following table describes how alpha values are combined:
19925
19926
19927
19928*`GL_COMBINE_ALPHA'*
19929 *Texture Function*
19930
19931`GL_REPLACE'
19932 ARG0
19933
19934`GL_MODULATE'
19935 ARG0×ARG1
19936
19937`GL_ADD'
19938 ARG0+ARG1
19939
19940`GL_ADD_SIGNED'
19941 ARG0+ARG1-0.5
19942
19943`GL_INTERPOLATE'
19944 ARG0×ARG2+ARG1×(1-ARG2,)
19945
19946`GL_SUBTRACT'
19947 ARG0-ARG1
19948
19949In the following tables, the value C_S represents the color sampled from
19950the currently bound texture, C_C represents the constant
19951texture-environment color, C_F represents the primary color of the
19952incoming fragment, and C_P represents the color computed from the
19953previous texture stage or C_F if processing texture stage 0. Likewise,
19954A_S , A_C , A_F , and A_P represent the respective alpha values.
19955
19956The following table describes the values assigned to ARG0 , ARG1 , and
19957ARG2 based upon the RGB sources and operands:
19958
19959
19960
19961*`GL_SRCn_RGB'*
19962 *`GL_OPERANDn_RGB'*, *Argument Value*
19963
19964`GL_TEXTURE'
19965 `GL_SRC_COLOR', C_S,
19966
19967
19968 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
19969
19970
19971 `GL_SRC_ALPHA', A_S,
19972
19973
19974 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
19975
19976`GL_TEXTUREn'
19977 `GL_SRC_COLOR', C_S,
19978
19979
19980 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
19981
19982
19983 `GL_SRC_ALPHA', A_S,
19984
19985
19986 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
19987
19988`GL_CONSTANT'
19989 `GL_SRC_COLOR', C_C,
19990
19991
19992 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
19993
19994
19995 `GL_SRC_ALPHA', A_C,
19996
19997
19998 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
19999
20000`GL_PRIMARY_COLOR'
20001 `GL_SRC_COLOR', C_F,
20002
8925f36f 20003
3c9b6116 20004 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
8925f36f 20005
8925f36f 20006
3c9b6116 20007 `GL_SRC_ALPHA', A_F,
8925f36f 20008
8925f36f 20009
3c9b6116 20010 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
8925f36f 20011
3c9b6116
AW
20012`GL_PREVIOUS'
20013 `GL_SRC_COLOR', C_P,
8925f36f 20014
8925f36f 20015
3c9b6116 20016 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
8925f36f 20017
8925f36f 20018
3c9b6116 20019 `GL_SRC_ALPHA', A_P,
8925f36f 20020
8925f36f 20021
3c9b6116 20022 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
8925f36f 20023
3c9b6116
AW
20024For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
20025respectively, produced from texture stage N .
8925f36f 20026
3c9b6116
AW
20027The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
20028based upon the alpha sources and operands:
8925f36f 20029
8925f36f 20030
8925f36f 20031
3c9b6116
AW
20032*`GL_SRCn_ALPHA'*
20033 *`GL_OPERANDn_ALPHA'*, *Argument Value*
8925f36f 20034
3c9b6116
AW
20035`GL_TEXTURE'
20036 `GL_SRC_ALPHA', A_S,
8925f36f 20037
8925f36f 20038
3c9b6116 20039 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 20040
3c9b6116
AW
20041`GL_TEXTUREn'
20042 `GL_SRC_ALPHA', A_S,
8925f36f 20043
8925f36f 20044
3c9b6116 20045 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 20046
3c9b6116
AW
20047`GL_CONSTANT'
20048 `GL_SRC_ALPHA', A_C,
8925f36f 20049
8925f36f 20050
3c9b6116 20051 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
8925f36f 20052
3c9b6116
AW
20053`GL_PRIMARY_COLOR'
20054 `GL_SRC_ALPHA', A_F,
8925f36f 20055
8925f36f 20056
3c9b6116
AW
20057 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
20058
20059`GL_PREVIOUS'
20060 `GL_SRC_ALPHA', A_P,
20061
20062
20063 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
20064
20065The RGB and alpha results of the texture function are multipled by the
20066values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
20067to the range [0,1] .
20068
20069If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
20070holds an RGBA color consisting of four values. Integer color components
20071are interpreted linearly such that the most positive integer maps to
200721.0, and the most negative integer maps to -1.0. The values are clamped
20073to the range [0,1] when they are specified. C_C takes these four values.
20074
20075If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
20076texture level-of-detail parameter, that selects which mipmap, or mipmaps
20077depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
20078
20079`GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
20080`GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
8925f36f 20081
3c9b6116
AW
20082If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
20083boolean value specified is used to either enable or disable point sprite
20084texture coordinate replacement. The default value is `GL_FALSE'.
8925f36f 20085
3c9b6116
AW
20086`GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
20087accepted defined values, or when PARAMS should have a defined constant
20088value (based on the value of PNAME) and does not.
20089
20090`GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
20091or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
20092
20093`GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
20094the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
20095
20096(define-gl-procedure
3c9b6116
AW
20097 glTexGen
20098 "glTexGen"
8925f36f
AW
20099 (funcsynopsis
20100 (funcprototype
3c9b6116
AW
20101 (funcdef "void " (function "glTexGeni"))
20102 (paramdef "GLenum " (parameter "coord"))
8925f36f 20103 (paramdef "GLenum " (parameter "pname"))
3c9b6116
AW
20104 (paramdef "GLint " (parameter "param"))))
20105 "Control the generation of texture coordinates.
8925f36f 20106
3c9b6116
AW
20107COORD
20108 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
20109 `GL_R', or `GL_Q'.
8925f36f 20110
3c9b6116
AW
20111PNAME
20112 Specifies the symbolic name of the texture-coordinate generation
20113 function. Must be `GL_TEXTURE_GEN_MODE'.
8925f36f 20114
3c9b6116
AW
20115PARAM
20116 Specifies a single-valued texture generation parameter, one of
20117 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
20118 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
8925f36f 20119
3c9b6116
AW
20120`glTexGen' selects a texture-coordinate generation function or supplies
20121coefficients for one of the functions. COORD names one of the (S, T, R,
20122Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
20123`GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
20124`GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
20125`GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
20126`GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
20127or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
20128`GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
20129texture generation function.
8925f36f 20130
3c9b6116 20131If the texture generation function is `GL_OBJECT_LINEAR', the function
8925f36f 20132
3c9b6116 20133G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
8925f36f 20134
3c9b6116
AW
20135is used, where G is the value computed for the coordinate named in
20136COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
20137and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
20138This function can be used, for example, to texture-map terrain using sea
20139level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
20140altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
20141coordinate generation function as its distance from sea level; that
20142altitude can then be used to index the texture image to map white snow
20143onto peaks and green grass onto foothills.
8925f36f 20144
3c9b6116
AW
20145If the texture generation function is `GL_EYE_LINEAR', the function
20146
20147G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
20148
20149is used, where
20150
20151(P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
20152
20153and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
20154, P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
20155modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
20156or singular, texture coordinates generated by the resulting function may
20157be inaccurate or undefined.
20158
20159Note that the values in PARAMS define a reference plane in eye
20160coordinates. The modelview matrix that is applied to them may not be the
20161same one in effect when the polygon vertices are transformed. This
20162function establishes a field of texture coordinates that can produce
20163dynamic contour lines on moving objects.
20164
20165If the texture generation function is `GL_SPHERE_MAP' and COORD is
20166either `GL_S' or `GL_T', S and T texture coordinates are generated as
20167follows. Let U be the unit vector pointing from the origin to the
20168polygon vertex (in eye coordinates). Let N sup prime be the current
20169normal, after transformation to eye coordinates. Let
20170
20171F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
20172
20173F=U-2\u2062N^″\u2062N^″,^T\u2062U
20174
20175Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
20176to the S and T texture coordinates are
20177
20178S=F_X/M+1/2
20179
20180T=F_Y/M+1/2
20181
20182To enable or disable a texture-coordinate generation function, call
20183`glEnable' or `glDisable' with one of the symbolic texture-coordinate
20184names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
20185`GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
20186coordinate is computed according to the generating function associated
20187with that coordinate. When disabled, subsequent vertices take the
20188specified texture coordinate from the current set of texture
20189coordinates. Initially, all texture generation functions are set to
20190`GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
201910), both T plane equations are (0, 1, 0, 0), and all R and Q plane
20192equations are (0, 0, 0, 0).
20193
20194When the `ARB_multitexture' extension is supported, `glTexGen' sets the
20195texture generation parameters for the currently active texture unit,
20196selected with `glActiveTexture'.
20197
20198`GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
20199defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
20200an accepted defined value.
20201
20202`GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
20203PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
20204
20205`GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
20206the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
20207
20208(define-gl-procedure
3c9b6116
AW
20209 glTexImage1D
20210 "glTexImage1D"
8925f36f
AW
20211 (funcsynopsis
20212 (funcprototype
3c9b6116
AW
20213 (funcdef "void " (function "glTexImage1D"))
20214 (paramdef "GLenum " (parameter "target"))
20215 (paramdef "GLint " (parameter "level"))
20216 (paramdef "GLint " (parameter "internalFormat"))
20217 (paramdef "GLsizei " (parameter "width"))
20218 (paramdef "GLint " (parameter "border"))
20219 (paramdef "GLenum " (parameter "format"))
8925f36f 20220 (paramdef "GLenum " (parameter "type"))
3c9b6116
AW
20221 (paramdef "const GLvoid * " (parameter "data"))))
20222 "Specify a one-dimensional texture image.
8925f36f 20223
3c9b6116
AW
20224TARGET
20225 Specifies the target texture. Must be `GL_TEXTURE_1D' or
20226 `GL_PROXY_TEXTURE_1D'.
8925f36f 20227
3c9b6116
AW
20228LEVEL
20229 Specifies the level-of-detail number. Level 0 is the base image
20230 level. Level N is the Nth mipmap reduction image.
8925f36f 20231
3c9b6116
AW
20232INTERNALFORMAT
20233 Specifies the number of color components in the texture. Must be 1,
20234 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20235 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20236 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20237 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20238 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
20239 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
20240 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
20241 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
20242 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20243 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20244 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20245 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20246 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20247 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20248 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20249 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20250 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20251 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20252 `GL_SRGB8_ALPHA8'.
8925f36f 20253
3c9b6116
AW
20254WIDTH
20255 Specifies the width of the texture image including the border if
20256 any. If the GL version does not support non-power-of-two sizes,
20257 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20258 implementations support texture images that are at least 64 texels
20259 wide. The height of the 1D texture image is 1.
8925f36f 20260
3c9b6116
AW
20261BORDER
20262 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20263
3c9b6116
AW
20264FORMAT
20265 Specifies the format of the pixel data. The following symbolic
20266 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20267 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20268 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20269
3c9b6116
AW
20270TYPE
20271 Specifies the data type of the pixel data. The following symbolic
20272 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20273 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20274 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20275 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20276 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20277 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20278 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20279 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
20280
20281DATA
20282 Specifies a pointer to the image data in memory.
20283
20284Texturing maps a portion of a specified texture image onto each
20285graphical primitive for which texturing is enabled. To enable and
20286disable one-dimensional texturing, call `glEnable' and `glDisable' with
20287argument `GL_TEXTURE_1D'.
20288
20289Texture images are defined with `glTexImage1D'. The arguments describe
20290the parameters of the texture image, such as width, width of the border,
20291level-of-detail number (see `glTexParameter'), and the internal
20292resolution and format used to store the image. The last three arguments
20293describe how the image is represented in memory; they are identical to
20294the pixel formats used for `glDrawPixels'.
20295
20296If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
20297of the texture image state is recalculated, checked for consistency, and
20298checked against the implementation's capabilities. If the implementation
20299cannot handle a texture of the requested texture size, it sets all of
20300the image state to 0, but does not generate an error (see `glGetError').
20301To query for an entire mipmap array, use an image array level greater
20302than or equal to 1.
20303
20304If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
20305signed or unsigned bytes, shorts, or longs, or single-precision
20306floating-point values, depending on TYPE. These values are grouped into
20307sets of one, two, three, or four values, depending on FORMAT, to form
20308elements. If TYPE is `GL_BITMAP', the data is considered as a string of
20309unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
20310treated as eight 1-bit elements, with bit ordering determined by
20311`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
20312
20313If a non-zero named buffer object is bound to the
20314`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
20315image is specified, DATA is treated as a byte offset into the buffer
20316object's data store.
20317
20318The first element corresponds to the left end of the texture array.
20319Subsequent elements progress left-to-right through the remaining texels
20320in the texture array. The final element corresponds to the right end of
20321the texture array.
20322
20323FORMAT determines the composition of each element in DATA. It can assume
20324one of these symbolic values:
20325
20326`GL_COLOR_INDEX'
20327 Each element is a single value, a color index. The GL converts it
20328 to fixed point (with an unspecified number of zero bits to the
20329 right of the binary point), shifted left or right depending on the
20330 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
20331 (see `glPixelTransfer'). The resulting index is converted to a set
20332 of color components using the `GL_PIXEL_MAP_I_TO_R',
20333 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
20334 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
20335
20336`GL_RED'
20337 Each element is a single red component. The GL converts it to
20338 floating point and assembles it into an RGBA element by attaching 0
20339 for green and blue, and 1 for alpha. Each component is then
20340 multiplied by the signed scale factor `GL_c_SCALE', added to the
20341 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20342 `glPixelTransfer').
20343
20344`GL_GREEN'
20345 Each element is a single green component. The GL converts it to
20346 floating point and assembles it into an RGBA element by attaching 0
20347 for red and blue, and 1 for alpha. Each component is then
20348 multiplied by the signed scale factor `GL_c_SCALE', added to the
20349 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20350 `glPixelTransfer').
20351
20352`GL_BLUE'
20353 Each element is a single blue component. The GL converts it to
20354 floating point and assembles it into an RGBA element by attaching 0
20355 for red and green, and 1 for alpha. Each component is then
20356 multiplied by the signed scale factor `GL_c_SCALE', added to the
20357 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20358 `glPixelTransfer').
20359
20360`GL_ALPHA'
20361 Each element is a single alpha component. The GL converts it to
20362 floating point and assembles it into an RGBA element by attaching 0
20363 for red, green, and blue. Each component is then multiplied by the
20364 signed scale factor `GL_c_SCALE', added to the signed bias
20365 `GL_c_BIAS', and clamped to the range [0,1] (see
20366 `glPixelTransfer').
20367
20368`GL_INTENSITY'
20369 Each element is a single intensity value. The GL converts it to
20370 floating point, then assembles it into an RGBA element by
20371 replicating the intensity value three times for red, green, blue,
20372 and alpha. Each component is then multiplied by the signed scale
20373 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20374 clamped to the range [0,1] (see `glPixelTransfer').
20375
20376`GL_RGB'
20377`GL_BGR'
20378 Each element is an RGB triple. The GL converts it to floating point
20379 and assembles it into an RGBA element by attaching 1 for alpha.
20380 Each component is then multiplied by the signed scale factor
20381 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20382 the range [0,1] (see `glPixelTransfer').
20383
20384`GL_RGBA'
20385`GL_BGRA'
20386 Each element contains all four components. Each component is
20387 multiplied by the signed scale factor `GL_c_SCALE', added to the
20388 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20389 `glPixelTransfer').
20390
20391`GL_LUMINANCE'
20392 Each element is a single luminance value. The GL converts it to
20393 floating point, then assembles it into an RGBA element by
20394 replicating the luminance value three times for red, green, and
20395 blue and attaching 1 for alpha. Each component is then multiplied
20396 by the signed scale factor `GL_c_SCALE', added to the signed bias
20397 `GL_c_BIAS', and clamped to the range [0,1] (see
20398 `glPixelTransfer').
20399
20400`GL_LUMINANCE_ALPHA'
20401 Each element is a luminance/alpha pair. The GL converts it to
20402 floating point, then assembles it into an RGBA element by
20403 replicating the luminance value three times for red, green, and
20404 blue. Each component is then multiplied by the signed scale factor
20405 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20406 the range [0,1] (see `glPixelTransfer').
20407
20408`GL_DEPTH_COMPONENT'
20409 Each element is a single depth value. The GL converts it to
20410 floating point, multiplies by the signed scale factor
20411 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
20412 to the range [0,1] (see `glPixelTransfer').
20413
20414Refer to the `glDrawPixels' reference page for a description of the
20415acceptable values for the TYPE parameter.
20416
20417If an application wants to store the texture at a certain resolution or
20418in a certain format, it can request the resolution and format with
20419INTERNALFORMAT. The GL will choose an internal representation that
20420closely approximates that requested by INTERNALFORMAT, but it may not
20421match exactly. (The representations specified by `GL_LUMINANCE',
20422`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20423numeric values 1, 2, 3, and 4 may also be used to specify the above
20424representations.)
20425
20426If the INTERNALFORMAT parameter is one of the generic compressed
20427formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20428`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20429`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20430internal format with the symbolic constant for a specific internal
20431format and compress the texture before storage. If no corresponding
20432internal format is available, or the GL can not compress that image for
20433any reason, the internal format is instead replaced with a corresponding
20434base internal format.
20435
20436If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20437`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20438`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20439treated as if the red, green, blue, or luminance components are encoded
20440in the sRGB color space. Any alpha component is left unchanged. The
20441conversion from the sRGB encoded component C_S to a linear component C_L
20442is:
20443
20444C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20445C_S>0.04045)
20446
20447Assume C_S is the sRGB component in the range [0,1].
20448
20449Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
20450The implementation will update and recompute its best match for the
20451requested storage resolution and format. To then query this state, call
20452`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
20453state is set to 0.
20454
20455A one-component texture image uses only the red component of the RGBA
20456color from DATA. A two-component image uses the R and A values. A
20457three-component image uses the R, G, and B values. A four-component
20458image uses all of the RGBA components.
20459
20460Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
20461during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
20462\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
20463generate a boolean result. See `glTexParameter' for details on texture
20464comparison.
20465
20466`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
20467`GL_PROXY_TEXTURE_1D'.
20468
20469`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
20470constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
20471
20472`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20473
20474`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20475`GL_COLOR_INDEX'.
20476
20477`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8925f36f 20478
3c9b6116
AW
20479`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20480LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8925f36f 20481
3c9b6116
AW
20482`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20483one of the accepted resolution and format symbolic constants.
8925f36f 20484
3c9b6116
AW
20485`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
204862 + `GL_MAX_TEXTURE_SIZE'.
8925f36f 20487
3c9b6116
AW
20488`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20489supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
20490some integer value of N.
8925f36f 20491
3c9b6116 20492`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
8925f36f 20493
3c9b6116
AW
20494`GL_INVALID_OPERATION' is generated if TYPE is one of
20495`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20496`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20497is not `GL_RGB'.
8925f36f 20498
3c9b6116
AW
20499`GL_INVALID_OPERATION' is generated if TYPE is one of
20500`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20501`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20502`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20503`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20504FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 20505
3c9b6116
AW
20506`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
20507and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
20508`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
8925f36f 20509
3c9b6116
AW
20510`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
20511`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20512`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
8925f36f 20513
3c9b6116
AW
20514`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20515bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
20516data store is currently mapped.
8925f36f 20517
3c9b6116
AW
20518`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20519bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
20520unpacked from the buffer object such that the memory reads required
20521would exceed the data store size.
8925f36f 20522
3c9b6116
AW
20523`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20524bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
20525divisible into the number of bytes needed to store in memory a datum
20526indicated by TYPE.
20527
20528`GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
20529between the execution of `glBegin' and the corresponding execution of
20530`glEnd'.")
8925f36f
AW
20531
20532(define-gl-procedure
3c9b6116
AW
20533 glTexImage2D
20534 "glTexImage2D"
8925f36f
AW
20535 (funcsynopsis
20536 (funcprototype
3c9b6116
AW
20537 (funcdef "void " (function "glTexImage2D"))
20538 (paramdef "GLenum " (parameter "target"))
20539 (paramdef "GLint " (parameter "level"))
20540 (paramdef "GLint " (parameter "internalFormat"))
8925f36f
AW
20541 (paramdef "GLsizei " (parameter "width"))
20542 (paramdef "GLsizei " (parameter "height"))
3c9b6116 20543 (paramdef "GLint " (parameter "border"))
8925f36f
AW
20544 (paramdef "GLenum " (parameter "format"))
20545 (paramdef "GLenum " (parameter "type"))
3c9b6116
AW
20546 (paramdef "const GLvoid * " (parameter "data"))))
20547 "Specify a two-dimensional texture image.
8925f36f 20548
3c9b6116
AW
20549TARGET
20550 Specifies the target texture. Must be `GL_TEXTURE_2D',
20551 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
20552 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
20553 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
20554 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
8925f36f 20555
3c9b6116
AW
20556LEVEL
20557 Specifies the level-of-detail number. Level 0 is the base image
20558 level. Level N is the Nth mipmap reduction image.
8925f36f 20559
3c9b6116
AW
20560INTERNALFORMAT
20561 Specifies the number of color components in the texture. Must be 1,
20562 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20563 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20564 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20565 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20566 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
20567 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
20568 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
20569 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
20570 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20571 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20572 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20573 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20574 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20575 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20576 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20577 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20578 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20579 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20580 `GL_SRGB8_ALPHA8'.
8925f36f 20581
3c9b6116
AW
20582WIDTH
20583 Specifies the width of the texture image including the border if
20584 any. If the GL version does not support non-power-of-two sizes,
20585 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20586 implementations support texture images that are at least 64 texels
20587 wide.
8925f36f 20588
3c9b6116
AW
20589HEIGHT
20590 Specifies the height of the texture image including the border if
20591 any. If the GL version does not support non-power-of-two sizes,
20592 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
20593 implementations support texture images that are at least 64 texels
20594 high.
8925f36f 20595
3c9b6116
AW
20596BORDER
20597 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20598
3c9b6116
AW
20599FORMAT
20600 Specifies the format of the pixel data. The following symbolic
20601 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20602 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20603 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20604
3c9b6116
AW
20605TYPE
20606 Specifies the data type of the pixel data. The following symbolic
20607 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20608 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20609 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20610 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20611 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20612 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20613 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20614 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 20615
3c9b6116
AW
20616DATA
20617 Specifies a pointer to the image data in memory.
8925f36f 20618
3c9b6116
AW
20619Texturing maps a portion of a specified texture image onto each
20620graphical primitive for which texturing is enabled. To enable and
20621disable two-dimensional texturing, call `glEnable' and `glDisable' with
20622argument `GL_TEXTURE_2D'. To enable and disable texturing using
20623cube-mapped texture, call `glEnable' and `glDisable' with argument
20624`GL_TEXTURE_CUBE_MAP'.
20625
20626To define texture images, call `glTexImage2D'. The arguments describe
20627the parameters of the texture image, such as height, width, width of the
20628border, level-of-detail number (see `glTexParameter'), and number of
20629color components provided. The last three arguments describe how the
20630image is represented in memory; they are identical to the pixel formats
20631used for `glDrawPixels'.
20632
20633If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
20634data is read from DATA, but all of the texture image state is
20635recalculated, checked for consistency, and checked against the
20636implementation's capabilities. If the implementation cannot handle a
20637texture of the requested texture size, it sets all of the image state to
206380, but does not generate an error (see `glGetError'). To query for an
20639entire mipmap array, use an image array level greater than or equal to
206401.
20641
20642If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
20643targets, data is read from DATA as a sequence of signed or unsigned
20644bytes, shorts, or longs, or single-precision floating-point values,
20645depending on TYPE. These values are grouped into sets of one, two,
20646three, or four values, depending on FORMAT, to form elements. If TYPE is
20647`GL_BITMAP', the data is considered as a string of unsigned bytes (and
20648FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
206491-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
20650(see `glPixelStore').
20651
20652If a non-zero named buffer object is bound to the
20653`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
20654image is specified, DATA is treated as a byte offset into the buffer
20655object's data store.
20656
20657The first element corresponds to the lower left corner of the texture
20658image. Subsequent elements progress left-to-right through the remaining
20659texels in the lowest row of the texture image, and then in successively
20660higher rows of the texture image. The final element corresponds to the
20661upper right corner of the texture image.
20662
20663FORMAT determines the composition of each element in DATA. It can assume
20664one of these symbolic values:
20665
20666`GL_COLOR_INDEX'
20667 Each element is a single value, a color index. The GL converts it
20668 to fixed point (with an unspecified number of zero bits to the
20669 right of the binary point), shifted left or right depending on the
20670 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
20671 (see `glPixelTransfer'). The resulting index is converted to a set
20672 of color components using the `GL_PIXEL_MAP_I_TO_R',
20673 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
20674 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
20675
20676`GL_RED'
20677 Each element is a single red component. The GL converts it to
20678 floating point and assembles it into an RGBA element by attaching 0
20679 for green and blue, and 1 for alpha. Each component is then
20680 multiplied by the signed scale factor `GL_c_SCALE', added to the
20681 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20682 `glPixelTransfer').
20683
20684`GL_GREEN'
20685 Each element is a single green component. The GL converts it to
20686 floating point and assembles it into an RGBA element by attaching 0
20687 for red and blue, and 1 for alpha. Each component is then
20688 multiplied by the signed scale factor `GL_c_SCALE', added to the
20689 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20690 `glPixelTransfer').
20691
20692`GL_BLUE'
20693 Each element is a single blue component. The GL converts it to
20694 floating point and assembles it into an RGBA element by attaching 0
20695 for red and green, and 1 for alpha. Each component is then
20696 multiplied by the signed scale factor `GL_c_SCALE', added to the
20697 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20698 `glPixelTransfer').
20699
20700`GL_ALPHA'
20701 Each element is a single alpha component. The GL converts it to
20702 floating point and assembles it into an RGBA element by attaching 0
20703 for red, green, and blue. Each component is then multiplied by the
20704 signed scale factor `GL_c_SCALE', added to the signed bias
20705 `GL_c_BIAS', and clamped to the range [0,1] (see
20706 `glPixelTransfer').
20707
20708`GL_INTENSITY'
20709 Each element is a single intensity value. The GL converts it to
20710 floating point, then assembles it into an RGBA element by
20711 replicating the intensity value three times for red, green, blue,
20712 and alpha. Each component is then multiplied by the signed scale
20713 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20714 clamped to the range [0,1] (see `glPixelTransfer').
20715
20716`GL_RGB'
20717`GL_BGR'
20718 Each element is an RGB triple. The GL converts it to floating point
20719 and assembles it into an RGBA element by attaching 1 for alpha.
20720 Each component is then multiplied by the signed scale factor
20721 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20722 the range [0,1] (see `glPixelTransfer').
20723
20724`GL_RGBA'
20725`GL_BGRA'
20726 Each element contains all four components. Each component is
20727 multiplied by the signed scale factor `GL_c_SCALE', added to the
20728 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20729 `glPixelTransfer').
20730
20731`GL_LUMINANCE'
20732 Each element is a single luminance value. The GL converts it to
20733 floating point, then assembles it into an RGBA element by
20734 replicating the luminance value three times for red, green, and
20735 blue and attaching 1 for alpha. Each component is then multiplied
20736 by the signed scale factor `GL_c_SCALE', added to the signed bias
20737 `GL_c_BIAS', and clamped to the range [0,1] (see
20738 `glPixelTransfer').
20739
20740`GL_LUMINANCE_ALPHA'
20741 Each element is a luminance/alpha pair. The GL converts it to
20742 floating point, then assembles it into an RGBA element by
20743 replicating the luminance value three times for red, green, and
20744 blue. Each component is then multiplied by the signed scale factor
20745 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20746 the range [0,1] (see `glPixelTransfer').
20747
20748`GL_DEPTH_COMPONENT'
20749 Each element is a single depth value. The GL converts it to
20750 floating point, multiplies by the signed scale factor
20751 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
20752 to the range [0,1] (see `glPixelTransfer').
20753
20754Refer to the `glDrawPixels' reference page for a description of the
20755acceptable values for the TYPE parameter.
20756
20757If an application wants to store the texture at a certain resolution or
20758in a certain format, it can request the resolution and format with
20759INTERNALFORMAT. The GL will choose an internal representation that
20760closely approximates that requested by INTERNALFORMAT, but it may not
20761match exactly. (The representations specified by `GL_LUMINANCE',
20762`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20763numeric values 1, 2, 3, and 4 may also be used to specify the above
20764representations.)
20765
20766If the INTERNALFORMAT parameter is one of the generic compressed
20767formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20768`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20769`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20770internal format with the symbolic constant for a specific internal
20771format and compress the texture before storage. If no corresponding
20772internal format is available, or the GL can not compress that image for
20773any reason, the internal format is instead replaced with a corresponding
20774base internal format.
20775
20776If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20777`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20778`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20779treated as if the red, green, blue, or luminance components are encoded
20780in the sRGB color space. Any alpha component is left unchanged. The
20781conversion from the sRGB encoded component C_S to a linear component C_L
20782is:
20783
20784C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20785C_S>0.04045)
20786
20787Assume C_S is the sRGB component in the range [0,1].
20788
20789Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
20790try out a resolution and format. The implementation will update and
20791recompute its best match for the requested storage resolution and
20792format. To then query this state, call `glGetTexLevelParameter'. If the
20793texture cannot be accommodated, texture state is set to 0.
20794
20795A one-component texture image uses only the red component of the RGBA
20796color extracted from DATA. A two-component image uses the R and A
20797values. A three-component image uses the R, G, and B values. A
20798four-component image uses all of the RGBA components.
20799
20800Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
20801during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
20802\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
20803generate a boolean result. See `glTexParameter' for details on texture
20804comparison.
20805
20806`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
20807`GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
20808`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
20809`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
20810`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
20811
20812`GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
20813image targets and the width and height parameters are not equal.
20814
20815`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20816
20817`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20818`GL_COLOR_INDEX'.
20819
20820`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
20821greater than 2 + `GL_MAX_TEXTURE_SIZE'.
20822
20823`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
20824
20825`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20826LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
20827
20828`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20829one of the accepted resolution and format symbolic constants.
20830
20831`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
20832greater than 2 + `GL_MAX_TEXTURE_SIZE'.
20833
20834`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20835supported and the WIDTH or HEIGHT cannot be represented as
208362^K+2\u2061(BORDER,) for some integer value of K.
20837
20838`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
20839
20840`GL_INVALID_OPERATION' is generated if TYPE is one of
20841`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20842`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20843is not `GL_RGB'.
20844
20845`GL_INVALID_OPERATION' is generated if TYPE is one of
20846`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20847`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20848`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20849`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20850FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 20851
3c9b6116
AW
20852`GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
20853`GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
20854`GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20855`GL_DEPTH_COMPONENT32'.
20856
20857`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
20858and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
20859`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
20860
20861`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
20862`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20863`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
20864
20865`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20866bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
20867data store is currently mapped.
20868
20869`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20870bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
20871unpacked from the buffer object such that the memory reads required
20872would exceed the data store size.
20873
20874`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20875bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
20876divisible into the number of bytes needed to store in memory a datum
20877indicated by TYPE.
20878
20879`GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
20880between the execution of `glBegin' and the corresponding execution of
20881`glEnd'.")
8925f36f
AW
20882
20883(define-gl-procedure
3c9b6116
AW
20884 glTexImage3D
20885 "glTexImage3D"
8925f36f
AW
20886 (funcsynopsis
20887 (funcprototype
3c9b6116 20888 (funcdef "void " (function "glTexImage3D"))
8925f36f 20889 (paramdef "GLenum " (parameter "target"))
3c9b6116
AW
20890 (paramdef "GLint " (parameter "level"))
20891 (paramdef "GLint " (parameter "internalFormat"))
8925f36f
AW
20892 (paramdef "GLsizei " (parameter "width"))
20893 (paramdef "GLsizei " (parameter "height"))
3c9b6116
AW
20894 (paramdef "GLsizei " (parameter "depth"))
20895 (paramdef "GLint " (parameter "border"))
8925f36f
AW
20896 (paramdef "GLenum " (parameter "format"))
20897 (paramdef "GLenum " (parameter "type"))
3c9b6116
AW
20898 (paramdef "const GLvoid * " (parameter "data"))))
20899 "Specify a three-dimensional texture image.
8925f36f 20900
3c9b6116
AW
20901TARGET
20902 Specifies the target texture. Must be `GL_TEXTURE_3D' or
20903 `GL_PROXY_TEXTURE_3D'.
8925f36f 20904
3c9b6116
AW
20905LEVEL
20906 Specifies the level-of-detail number. Level 0 is the base image
20907 level. Level N is the N^TH mipmap reduction image.
8925f36f 20908
3c9b6116
AW
20909INTERNALFORMAT
20910 Specifies the number of color components in the texture. Must be 1,
20911 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20912 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20913 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20914 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20915 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
20916 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
20917 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20918 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20919 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20920 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20921 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20922 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20923 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20924 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20925 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20926 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20927 `GL_SRGB8_ALPHA8'.
8925f36f 20928
3c9b6116
AW
20929WIDTH
20930 Specifies the width of the texture image including the border if
20931 any. If the GL version does not support non-power-of-two sizes,
20932 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20933 implementations support 3D texture images that are at least 16
20934 texels wide.
8925f36f 20935
3c9b6116
AW
20936HEIGHT
20937 Specifies the height of the texture image including the border if
20938 any. If the GL version does not support non-power-of-two sizes,
20939 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
20940 implementations support 3D texture images that are at least 16
20941 texels high.
8925f36f 20942
3c9b6116
AW
20943DEPTH
20944 Specifies the depth of the texture image including the border if
20945 any. If the GL version does not support non-power-of-two sizes,
20946 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
20947 implementations support 3D texture images that are at least 16
20948 texels deep.
8925f36f 20949
3c9b6116
AW
20950BORDER
20951 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20952
3c9b6116
AW
20953FORMAT
20954 Specifies the format of the pixel data. The following symbolic
20955 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20956 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20957 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20958
3c9b6116
AW
20959TYPE
20960 Specifies the data type of the pixel data. The following symbolic
20961 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20962 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20963 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20964 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20965 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20966 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20967 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20968 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 20969
3c9b6116
AW
20970DATA
20971 Specifies a pointer to the image data in memory.
20972
20973Texturing maps a portion of a specified texture image onto each
20974graphical primitive for which texturing is enabled. To enable and
20975disable three-dimensional texturing, call `glEnable' and `glDisable'
20976with argument `GL_TEXTURE_3D'.
20977
20978To define texture images, call `glTexImage3D'. The arguments describe
20979the parameters of the texture image, such as height, width, depth, width
20980of the border, level-of-detail number (see `glTexParameter'), and number
20981of color components provided. The last three arguments describe how the
20982image is represented in memory; they are identical to the pixel formats
20983used for `glDrawPixels'.
20984
20985If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
20986of the texture image state is recalculated, checked for consistency, and
20987checked against the implementation's capabilities. If the implementation
20988cannot handle a texture of the requested texture size, it sets all of
20989the image state to 0, but does not generate an error (see `glGetError').
20990To query for an entire mipmap array, use an image array level greater
20991than or equal to 1.
20992
20993If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
20994signed or unsigned bytes, shorts, or longs, or single-precision
20995floating-point values, depending on TYPE. These values are grouped into
20996sets of one, two, three, or four values, depending on FORMAT, to form
20997elements. If TYPE is `GL_BITMAP', the data is considered as a string of
20998unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
20999treated as eight 1-bit elements, with bit ordering determined by
21000`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
21001
21002If a non-zero named buffer object is bound to the
21003`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21004image is specified, DATA is treated as a byte offset into the buffer
21005object's data store.
21006
21007The first element corresponds to the lower left corner of the texture
21008image. Subsequent elements progress left-to-right through the remaining
21009texels in the lowest row of the texture image, and then in successively
21010higher rows of the texture image. The final element corresponds to the
21011upper right corner of the texture image.
21012
21013FORMAT determines the composition of each element in DATA. It can assume
21014one of these symbolic values:
21015
21016`GL_COLOR_INDEX'
21017 Each element is a single value, a color index. The GL converts it
21018 to fixed point (with an unspecified number of zero bits to the
21019 right of the binary point), shifted left or right depending on the
21020 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
21021 (see `glPixelTransfer'). The resulting index is converted to a set
21022 of color components using the `GL_PIXEL_MAP_I_TO_R',
21023 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
21024 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
21025
21026`GL_RED'
21027 Each element is a single red component. The GL converts it to
21028 floating point and assembles it into an RGBA element by attaching 0
21029 for green and blue, and 1 for alpha. Each component is then
21030 multiplied by the signed scale factor `GL_c_SCALE', added to the
21031 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21032 `glPixelTransfer').
21033
21034`GL_GREEN'
21035 Each element is a single green component. The GL converts it to
21036 floating point and assembles it into an RGBA element by attaching 0
21037 for red and blue, and 1 for alpha. Each component is then
21038 multiplied by the signed scale factor `GL_c_SCALE', added to the
21039 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21040 `glPixelTransfer').
21041
21042`GL_BLUE'
21043 Each element is a single blue component. The GL converts it to
21044 floating point and assembles it into an RGBA element by attaching 0
21045 for red and green, and 1 for alpha. Each component is then
21046 multiplied by the signed scale factor `GL_c_SCALE', added to the
21047 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21048 `glPixelTransfer').
21049
21050`GL_ALPHA'
21051 Each element is a single alpha component. The GL converts it to
21052 floating point and assembles it into an RGBA element by attaching 0
21053 for red, green, and blue. Each component is then multiplied by the
21054 signed scale factor `GL_c_SCALE', added to the signed bias
21055 `GL_c_BIAS', and clamped to the range [0,1] (see
21056 `glPixelTransfer').
21057
21058`GL_INTENSITY'
21059 Each element is a single intensity value. The GL converts it to
21060 floating point, then assembles it into an RGBA element by
21061 replicating the intensity value three times for red, green, blue,
21062 and alpha. Each component is then multiplied by the signed scale
21063 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
21064 clamped to the range [0,1] (see `glPixelTransfer').
21065
21066`GL_RGB'
21067`GL_BGR'
21068 Each element is an RGB triple. The GL converts it to floating point
21069 and assembles it into an RGBA element by attaching 1 for alpha.
21070 Each component is then multiplied by the signed scale factor
21071 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21072 the range [0,1] (see `glPixelTransfer').
21073
21074`GL_RGBA'
21075`GL_BGRA'
21076 Each element contains all four components. Each component is
21077 multiplied by the signed scale factor `GL_c_SCALE', added to the
21078 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21079 `glPixelTransfer').
21080
21081`GL_LUMINANCE'
21082 Each element is a single luminance value. The GL converts it to
21083 floating point, then assembles it into an RGBA element by
21084 replicating the luminance value three times for red, green, and
21085 blue and attaching 1 for alpha. Each component is then multiplied
21086 by the signed scale factor `GL_c_SCALE', added to the signed bias
21087 `GL_c_BIAS', and clamped to the range [0,1] (see
21088 `glPixelTransfer').
21089
21090`GL_LUMINANCE_ALPHA'
21091 Each element is a luminance/alpha pair. The GL converts it to
21092 floating point, then assembles it into an RGBA element by
21093 replicating the luminance value three times for red, green, and
21094 blue. Each component is then multiplied by the signed scale factor
21095 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21096 the range [0,1] (see `glPixelTransfer').
21097
21098Refer to the `glDrawPixels' reference page for a description of the
21099acceptable values for the TYPE parameter.
21100
21101If an application wants to store the texture at a certain resolution or
21102in a certain format, it can request the resolution and format with
21103INTERNALFORMAT. The GL will choose an internal representation that
21104closely approximates that requested by INTERNALFORMAT, but it may not
21105match exactly. (The representations specified by `GL_LUMINANCE',
21106`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
21107numeric values 1, 2, 3, and 4 may also be used to specify the above
21108representations.)
21109
21110If the INTERNALFORMAT parameter is one of the generic compressed
21111formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
21112`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
21113`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
21114internal format with the symbolic constant for a specific internal
21115format and compress the texture before storage. If no corresponding
21116internal format is available, or the GL can not compress that image for
21117any reason, the internal format is instead replaced with a corresponding
21118base internal format.
21119
21120If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
21121`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
21122`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
21123treated as if the red, green, blue, or luminance components are encoded
21124in the sRGB color space. Any alpha component is left unchanged. The
21125conversion from the sRGB encoded component C_S to a linear component C_L
21126is:
21127
21128C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
21129C_S>0.04045)
21130
21131Assume C_S is the sRGB component in the range [0,1].
21132
21133Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
21134The implementation will update and recompute its best match for the
21135requested storage resolution and format. To then query this state, call
21136`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
21137state is set to 0.
21138
21139A one-component texture image uses only the red component of the RGBA
21140color extracted from DATA. A two-component image uses the R and A
21141values. A three-component image uses the R, G, and B values. A
21142four-component image uses all of the RGBA components.
21143
21144`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
21145`GL_PROXY_TEXTURE_3D'.
21146
21147`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21148constant. Format constants other than `GL_STENCIL_INDEX' and
21149`GL_DEPTH_COMPONENT' are accepted.
21150
21151`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21152
21153`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21154`GL_COLOR_INDEX'.
21155
21156`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21157
21158`GL_INVALID_VALUE' may be generated if LEVEL is greater than
21159LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21160
21161`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
21162one of the accepted resolution and format symbolic constants.
21163
21164`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
211650 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
21166
21167`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
21168supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
211692^K+2\u2061(BORDER,) for some integer value of K.
21170
21171`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
21172
21173`GL_INVALID_OPERATION' is generated if TYPE is one of
21174`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21175`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21176is not `GL_RGB'.
21177
21178`GL_INVALID_OPERATION' is generated if TYPE is one of
21179`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21180`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21181`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21182`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21183FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21184
21185`GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
21186`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
21187`GL_DEPTH_COMPONENT32'.
21188
21189`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21190bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21191data store is currently mapped.
21192
21193`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21194bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21195unpacked from the buffer object such that the memory reads required
21196would exceed the data store size.
21197
21198`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21199bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21200divisible into the number of bytes needed to store in memory a datum
21201indicated by TYPE.
21202
21203`GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
21204between the execution of `glBegin' and the corresponding execution of
21205`glEnd'.")
8925f36f
AW
21206
21207(define-gl-procedure
3c9b6116
AW
21208 glTexParameter
21209 "glTexParameter"
8925f36f
AW
21210 (funcsynopsis
21211 (funcprototype
3c9b6116 21212 (funcdef "void " (function "glTexParameterf"))
8925f36f
AW
21213 (paramdef "GLenum " (parameter "target"))
21214 (paramdef "GLenum " (parameter "pname"))
21215 (paramdef "GLfloat " (parameter "param"))))
3c9b6116 21216 "Set texture parameters.
8925f36f 21217
3c9b6116
AW
21218TARGET
21219 Specifies the target texture, which must be either `GL_TEXTURE_1D',
21220 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
8925f36f 21221
3c9b6116
AW
21222PNAME
21223 Specifies the symbolic name of a single-valued texture parameter.
21224 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
21225 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
21226 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
21227 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
21228 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
21229 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
21230 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
21231
21232PARAM
21233 Specifies the value of PNAME.
21234
21235Texture mapping is a technique that applies an image onto an object's
21236surface as if the image were a decal or cellophane shrink-wrap. The
21237image is created in texture space, with an (S , T ) coordinate system. A
21238texture is a one- or two-dimensional image and a set of parameters that
21239determine how samples are derived from the image.
21240
21241`glTexParameter' assigns the value or values in PARAMS to the texture
21242parameter specified as PNAME. TARGET defines the target texture, either
21243`GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
21244symbols are accepted in PNAME:
21245
21246`GL_TEXTURE_MIN_FILTER'
21247 The texture minifying function is used whenever the pixel being
21248 textured maps to an area greater than one texture element. There
21249 are six defined minifying functions. Two of them use the nearest
21250 one or nearest four texture elements to compute the texture value.
21251 The other four use mipmaps.
21252
21253 A mipmap is an ordered set of arrays representing the same image at
21254 progressively lower resolutions. If the texture has dimensions
21255 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
21256 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
21257 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
21258 the previous mipmap, until either K=0 or L=0 . At that point,
21259 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
21260 final mipmap, which has dimension 1×1 . To define the mipmaps, call
21261 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
21262 or `glCopyTexImage2D' with the LEVEL argument indicating the order
21263 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
21264 the final 1×1 mipmap.
21265
21266 PARAMS supplies a function for minifying the texture as one of the
21267 following:
21268
21269 As more texture elements are sampled in the minification process,
21270 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
21271 and `GL_LINEAR' minification functions can be faster than the other
21272 four, they sample only one or four texture elements to determine
21273 the texture value of the pixel being rendered and can produce moire
21274 patterns or ragged transitions. The initial value of
21275 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
21276
21277`GL_TEXTURE_MAG_FILTER'
21278 The texture magnification function is used when the pixel being
21279 textured maps to an area less than or equal to one texture element.
21280 It sets the texture magnification function to either `GL_NEAREST'
21281 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
21282 `GL_LINEAR', but it can produce textured images with sharper edges
21283 because the transition between texture elements is not as smooth.
21284 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
21285
21286`GL_NEAREST'
21287 Returns the value of the texture element that is nearest (in
21288 Manhattan distance) to the center of the pixel being textured.
21289
21290`GL_LINEAR'
21291 Returns the weighted average of the four texture elements that are
21292 closest to the center of the pixel being textured. These can
21293 include border texture elements, depending on the values of
21294 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
21295 mapping.
21296
21297`GL_NEAREST_MIPMAP_NEAREST'
21298 Chooses the mipmap that most closely matches the size of the pixel
21299 being textured and uses the `GL_NEAREST' criterion (the texture
21300 element nearest to the center of the pixel) to produce a texture
21301 value.
21302
21303`GL_LINEAR_MIPMAP_NEAREST'
21304 Chooses the mipmap that most closely matches the size of the pixel
21305 being textured and uses the `GL_LINEAR' criterion (a weighted
21306 average of the four texture elements that are closest to the center
21307 of the pixel) to produce a texture value.
21308
21309`GL_NEAREST_MIPMAP_LINEAR'
21310 Chooses the two mipmaps that most closely match the size of the
21311 pixel being textured and uses the `GL_NEAREST' criterion (the
21312 texture element nearest to the center of the pixel) to produce a
21313 texture value from each mipmap. The final texture value is a
21314 weighted average of those two values.
21315
21316`GL_LINEAR_MIPMAP_LINEAR'
21317 Chooses the two mipmaps that most closely match the size of the
21318 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
21319 average of the four texture elements that are closest to the center
21320 of the pixel) to produce a texture value from each mipmap. The
21321 final texture value is a weighted average of those two values.
21322
21323`GL_NEAREST'
21324 Returns the value of the texture element that is nearest (in
21325 Manhattan distance) to the center of the pixel being textured.
21326
21327`GL_LINEAR'
21328 Returns the weighted average of the four texture elements that are
21329 closest to the center of the pixel being textured. These can
21330 include border texture elements, depending on the values of
21331 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
21332 mapping.
21333
21334
21335
21336`GL_TEXTURE_MIN_LOD'
21337 Sets the minimum level-of-detail parameter. This floating-point
21338 value limits the selection of highest resolution mipmap (lowest
21339 mipmap level). The initial value is -1000.
21340
21341
21342
21343`GL_TEXTURE_MAX_LOD'
21344 Sets the maximum level-of-detail parameter. This floating-point
21345 value limits the selection of the lowest resolution mipmap (highest
21346 mipmap level). The initial value is 1000.
21347
21348
21349
21350`GL_TEXTURE_BASE_LEVEL'
21351 Specifies the index of the lowest defined mipmap level. This is an
21352 integer value. The initial value is 0.
21353
21354
21355
21356`GL_TEXTURE_MAX_LEVEL'
21357 Sets the index of the highest defined mipmap level. This is an
21358 integer value. The initial value is 1000.
21359
21360
21361
21362`GL_TEXTURE_WRAP_S'
21363 Sets the wrap parameter for texture coordinate S to either
21364 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21365 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
21366 coordinates to be clamped to the range [0,1] and is useful for
21367 preventing wrapping artifacts when mapping a single image onto an
21368 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
21369 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
21370 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
21371 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
21372 the size of the texture in the direction of clamping. `GL_REPEAT'
21373 causes the integer part of the S coordinate to be ignored; the GL
21374 uses only the fractional part, thereby creating a repeating
21375 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
21376 the fractional part of the texture coordinate if the integer part
21377 of S is even; if the integer part of S is odd, then the S texture
21378 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
21379 fractional part of S . Border texture elements are accessed only if
21380 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
21381 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
21382
21383
21384
21385`GL_TEXTURE_WRAP_T'
21386 Sets the wrap parameter for texture coordinate T to either
21387 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21388 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21389 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
21390 `GL_REPEAT'.
21391
21392`GL_TEXTURE_WRAP_R'
21393 Sets the wrap parameter for texture coordinate R to either
21394 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21395 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21396 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
21397 `GL_REPEAT'.
21398
21399`GL_TEXTURE_BORDER_COLOR'
21400 Sets a border color. PARAMS contains four values that comprise the
21401 RGBA color of the texture border. Integer color components are
21402 interpreted linearly such that the most positive integer maps to
21403 1.0, and the most negative integer maps to -1.0. The values are
21404 clamped to the range [0,1] when they are specified. Initially, the
21405 border color is (0, 0, 0, 0).
21406
21407`GL_TEXTURE_PRIORITY'
21408 Specifies the texture residence priority of the currently bound
21409 texture. Permissible values are in the range [0,1] . See
21410 `glPrioritizeTextures' and `glBindTexture' for more information.
21411
21412`GL_TEXTURE_COMPARE_MODE'
21413 Specifies the texture comparison mode for currently bound depth
21414 textures. That is, a texture whose internal format is
21415 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
21416
21417`GL_TEXTURE_COMPARE_FUNC'
21418 Specifies the comparison operator used when
21419 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
21420 Permissible values are: where R is the current interpolated texture
21421 coordinate, and D_T is the depth texture value sampled from the
21422 currently bound depth texture. RESULT is assigned to the either the
21423 luminance, intensity, or alpha (as specified by
21424 `GL_DEPTH_TEXTURE_MODE'.)
21425
21426`GL_DEPTH_TEXTURE_MODE'
21427 Specifies a single symbolic constant indicating how depth values
21428 should be treated during filtering and texture application.
21429 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
21430 The initial value is `GL_LUMINANCE'.
21431
21432`GL_GENERATE_MIPMAP'
21433 Specifies a boolean value that indicates if all levels of a mipmap
21434 array should be automatically updated when any modification to the
21435 base level mipmap is done. The initial value is `GL_FALSE'.
21436
21437`GL_COMPARE_R_TO_TEXTURE'
21438 Specifies that the interpolated and clamped R texture coordinate
21439 should be compared to the value in the currently bound depth
21440 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
21441 details of how the comparison is evaluated. The result of the
21442 comparison is assigned to luminance, intensity, or alpha (as
21443 specified by `GL_DEPTH_TEXTURE_MODE').
21444
21445`GL_NONE'
21446 Specifies that the luminance, intensity, or alpha (as specified by
21447 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
21448 from the currently bound depth texture.
21449
21450*Texture Comparison Function*
21451 *Computed result*
21452
21453`GL_LEQUAL'
21454 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
21455
21456`GL_GEQUAL'
21457 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
21458
21459`GL_LESS'
21460 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
21461
21462`GL_GREATER'
21463 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
8925f36f 21464
3c9b6116
AW
21465`GL_EQUAL'
21466 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
8925f36f 21467
3c9b6116
AW
21468`GL_NOTEQUAL'
21469 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
8925f36f 21470
3c9b6116
AW
21471`GL_ALWAYS'
21472 RESULT=`1.0'
21473
21474`GL_NEVER'
21475 RESULT=`0.0'
21476
21477`GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
21478accepted defined values.
21479
21480`GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
21481value (based on the value of PNAME) and does not.
21482
21483`GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
21484between the execution of `glBegin' and the corresponding execution of
21485`glEnd'.")
8925f36f
AW
21486
21487(define-gl-procedure
21488 glTexSubImage1D
21489 "glTexSubImage1D"
21490 (funcsynopsis
21491 (funcprototype
21492 (funcdef "void " (function "glTexSubImage1D"))
21493 (paramdef "GLenum " (parameter "target"))
21494 (paramdef "GLint " (parameter "level"))
21495 (paramdef "GLint " (parameter "xoffset"))
21496 (paramdef "GLsizei " (parameter "width"))
21497 (paramdef "GLenum " (parameter "format"))
21498 (paramdef "GLenum " (parameter "type"))
21499 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
21500 "Specify a one-dimensional texture subimage.
21501
21502TARGET
21503 Specifies the target texture. Must be `GL_TEXTURE_1D'.
21504
21505LEVEL
21506 Specifies the level-of-detail number. Level 0 is the base image
21507 level. Level N is the Nth mipmap reduction image.
21508
21509XOFFSET
21510 Specifies a texel offset in the x direction within the texture
21511 array.
21512
21513WIDTH
21514 Specifies the width of the texture subimage.
21515
21516FORMAT
21517 Specifies the format of the pixel data. The following symbolic
21518 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21519 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21520 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21521
21522TYPE
21523 Specifies the data type of the pixel data. The following symbolic
21524 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21525 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21526 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21527 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21528 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21529 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21530 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21531 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21532
21533DATA
21534 Specifies a pointer to the image data in memory.
21535
21536Texturing maps a portion of a specified texture image onto each
21537graphical primitive for which texturing is enabled. To enable or disable
21538one-dimensional texturing, call `glEnable' and `glDisable' with argument
21539`GL_TEXTURE_1D'.
21540
21541`glTexSubImage1D' redefines a contiguous subregion of an existing
21542one-dimensional texture image. The texels referenced by DATA replace the
21543portion of the existing texture array with x indices XOFFSET and
21544XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
21545outside the range of the texture array as it was originally specified.
21546It is not an error to specify a subtexture with width of 0, but such a
21547specification has no effect.
21548
21549If a non-zero named buffer object is bound to the
21550`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21551image is specified, DATA is treated as a byte offset into the buffer
21552object's data store.
21553
21554`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
21555values.
21556
21557`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21558constant.
21559
21560`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21561
21562`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21563`GL_COLOR_INDEX'.
21564
21565`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21566
21567`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21568where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21569
21570`GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
21571(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
21572the width of the `GL_TEXTURE_BORDER' of the texture image being
21573modified. Note that W includes twice the border width.
21574
21575`GL_INVALID_VALUE' is generated if WIDTH is less than 0.
21576
21577`GL_INVALID_OPERATION' is generated if the texture array has not been
21578defined by a previous `glTexImage1D' operation.
21579
21580`GL_INVALID_OPERATION' is generated if TYPE is one of
21581`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21582`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21583is not `GL_RGB'.
21584
21585`GL_INVALID_OPERATION' is generated if TYPE is one of
21586`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21587`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21588`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21589`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21590FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21591
21592`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21593bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21594data store is currently mapped.
21595
21596`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21597bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21598unpacked from the buffer object such that the memory reads required
21599would exceed the data store size.
21600
21601`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21602bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21603divisible into the number of bytes needed to store in memory a datum
21604indicated by TYPE.
21605
21606`GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
21607between the execution of `glBegin' and the corresponding execution of
21608`glEnd'.")
8925f36f
AW
21609
21610(define-gl-procedure
21611 glTexSubImage2D
21612 "glTexSubImage2D"
21613 (funcsynopsis
21614 (funcprototype
21615 (funcdef "void " (function "glTexSubImage2D"))
21616 (paramdef "GLenum " (parameter "target"))
21617 (paramdef "GLint " (parameter "level"))
21618 (paramdef "GLint " (parameter "xoffset"))
21619 (paramdef "GLint " (parameter "yoffset"))
21620 (paramdef "GLsizei " (parameter "width"))
21621 (paramdef "GLsizei " (parameter "height"))
21622 (paramdef "GLenum " (parameter "format"))
21623 (paramdef "GLenum " (parameter "type"))
21624 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
21625 "Specify a two-dimensional texture subimage.
21626
21627TARGET
21628 Specifies the target texture. Must be `GL_TEXTURE_2D',
21629 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
21630 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
21631 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
21632 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
21633
21634LEVEL
21635 Specifies the level-of-detail number. Level 0 is the base image
21636 level. Level N is the Nth mipmap reduction image.
21637
21638XOFFSET
21639 Specifies a texel offset in the x direction within the texture
21640 array.
21641
21642YOFFSET
21643 Specifies a texel offset in the y direction within the texture
21644 array.
21645
21646WIDTH
21647 Specifies the width of the texture subimage.
21648
21649HEIGHT
21650 Specifies the height of the texture subimage.
21651
21652FORMAT
21653 Specifies the format of the pixel data. The following symbolic
21654 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21655 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21656 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21657
21658TYPE
21659 Specifies the data type of the pixel data. The following symbolic
21660 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21661 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21662 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21663 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21664 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21665 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21666 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21667 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21668
21669DATA
21670 Specifies a pointer to the image data in memory.
21671
21672Texturing maps a portion of a specified texture image onto each
21673graphical primitive for which texturing is enabled. To enable and
21674disable two-dimensional texturing, call `glEnable' and `glDisable' with
21675argument `GL_TEXTURE_2D'.
21676
21677`glTexSubImage2D' redefines a contiguous subregion of an existing
21678two-dimensional texture image. The texels referenced by DATA replace the
21679portion of the existing texture array with x indices XOFFSET and
21680XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
21681, inclusive. This region may not include any texels outside the range of
21682the texture array as it was originally specified. It is not an error to
21683specify a subtexture with zero width or height, but such a specification
21684has no effect.
21685
21686If a non-zero named buffer object is bound to the
21687`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21688image is specified, DATA is treated as a byte offset into the buffer
21689object's data store.
21690
21691`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
21692`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
21693`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
21694`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
21695
21696`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21697constant.
21698
21699`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21700
21701`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21702`GL_COLOR_INDEX'.
21703
21704`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21705
21706`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21707where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21708
21709`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
21710, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
21711`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
21712width of the texture image being modified. Note that W and H include
21713twice the border width.
21714
21715`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
21716
21717`GL_INVALID_OPERATION' is generated if the texture array has not been
21718defined by a previous `glTexImage2D' operation.
21719
21720`GL_INVALID_OPERATION' is generated if TYPE is one of
21721`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21722`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21723is not `GL_RGB'.
21724
21725`GL_INVALID_OPERATION' is generated if TYPE is one of
21726`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21727`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21728`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21729`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21730FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21731
21732`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21733bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21734data store is currently mapped.
21735
21736`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21737bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21738unpacked from the buffer object such that the memory reads required
21739would exceed the data store size.
21740
21741`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21742bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21743divisible into the number of bytes needed to store in memory a datum
21744indicated by TYPE.
21745
21746`GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
21747between the execution of `glBegin' and the corresponding execution of
21748`glEnd'.")
8925f36f
AW
21749
21750(define-gl-procedure
21751 glTexSubImage3D
21752 "glTexSubImage3D"
21753 (funcsynopsis
21754 (funcprototype
21755 (funcdef "void " (function "glTexSubImage3D"))
21756 (paramdef "GLenum " (parameter "target"))
21757 (paramdef "GLint " (parameter "level"))
21758 (paramdef "GLint " (parameter "xoffset"))
21759 (paramdef "GLint " (parameter "yoffset"))
21760 (paramdef "GLint " (parameter "zoffset"))
21761 (paramdef "GLsizei " (parameter "width"))
21762 (paramdef "GLsizei " (parameter "height"))
21763 (paramdef "GLsizei " (parameter "depth"))
21764 (paramdef "GLenum " (parameter "format"))
21765 (paramdef "GLenum " (parameter "type"))
21766 (paramdef "const GLvoid * " (parameter "data"))))
3c9b6116
AW
21767 "Specify a three-dimensional texture subimage.
21768
21769TARGET
21770 Specifies the target texture. Must be `GL_TEXTURE_3D'.
21771
21772LEVEL
21773 Specifies the level-of-detail number. Level 0 is the base image
21774 level. Level N is the Nth mipmap reduction image.
21775
21776XOFFSET
21777 Specifies a texel offset in the x direction within the texture
21778 array.
21779
21780YOFFSET
21781 Specifies a texel offset in the y direction within the texture
21782 array.
21783
21784ZOFFSET
21785 Specifies a texel offset in the z direction within the texture
21786 array.
21787
21788WIDTH
21789 Specifies the width of the texture subimage.
21790
21791HEIGHT
21792 Specifies the height of the texture subimage.
21793
21794DEPTH
21795 Specifies the depth of the texture subimage.
21796
21797FORMAT
21798 Specifies the format of the pixel data. The following symbolic
21799 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21800 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21801 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21802
21803TYPE
21804 Specifies the data type of the pixel data. The following symbolic
21805 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21806 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21807 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21808 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21809 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21810 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21811 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21812 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21813
21814DATA
21815 Specifies a pointer to the image data in memory.
21816
21817Texturing maps a portion of a specified texture image onto each
21818graphical primitive for which texturing is enabled. To enable and
21819disable three-dimensional texturing, call `glEnable' and `glDisable'
21820with argument `GL_TEXTURE_3D'.
21821
21822`glTexSubImage3D' redefines a contiguous subregion of an existing
21823three-dimensional texture image. The texels referenced by DATA replace
21824the portion of the existing texture array with x indices XOFFSET and
21825XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
21826inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
21827region may not include any texels outside the range of the texture array
21828as it was originally specified. It is not an error to specify a
21829subtexture with zero width, height, or depth but such a specification
21830has no effect.
21831
21832If a non-zero named buffer object is bound to the
21833`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21834image is specified, DATA is treated as a byte offset into the buffer
21835object's data store.
21836
21837`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
21838
21839`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21840constant.
21841
21842`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21843
21844`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21845`GL_COLOR_INDEX'.
21846
21847`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21848
21849`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21850where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21851
21852`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
21853, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
21854(ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
21855`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
21856width of the texture image being modified. Note that W , H , and D
21857include twice the border width.
21858
21859`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
218600.
21861
21862`GL_INVALID_OPERATION' is generated if the texture array has not been
21863defined by a previous `glTexImage3D' operation.
21864
21865`GL_INVALID_OPERATION' is generated if TYPE is one of
21866`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21867`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21868is not `GL_RGB'.
21869
21870`GL_INVALID_OPERATION' is generated if TYPE is one of
21871`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21872`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21873`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21874`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21875FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21876
21877`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21878bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21879data store is currently mapped.
21880
21881`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21882bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21883unpacked from the buffer object such that the memory reads required
21884would exceed the data store size.
21885
21886`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21887bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21888divisible into the number of bytes needed to store in memory a datum
21889indicated by TYPE.
21890
21891`GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
21892between the execution of `glBegin' and the corresponding execution of
21893`glEnd'.")
8925f36f
AW
21894
21895(define-gl-procedure
21896 glTranslate
21897 "glTranslate"
21898 (funcsynopsis
21899 (funcprototype
21900 (funcdef "void " (function "glTranslated"))
21901 (paramdef "GLdouble " (parameter "x"))
21902 (paramdef "GLdouble " (parameter "y"))
21903 (paramdef "GLdouble " (parameter "z"))))
3c9b6116
AW
21904 "Multiply the current matrix by a translation matrix.
21905
21906X
21907 Y
21908
21909 Z
21910
21911 Specify the X, Y, and Z coordinates of a translation vector.
21912
21913`glTranslate' produces a translation by (X,YZ) . The current matrix (see
21914`glMatrixMode') is multiplied by this translation matrix, with the
21915product replacing the current matrix, as if `glMultMatrix' were called
21916with the following matrix for its argument:
21917
21918((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
21919
21920
21921
21922If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
21923objects drawn after a call to `glTranslate' are translated.
21924
21925Use `glPushMatrix' and `glPopMatrix' to save and restore the
21926untranslated coordinate system.
21927
21928`GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
21929the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
21930
21931(define-gl-procedure
21932 glUniform1f
21933 "glUniform1f"
21934 (funcsynopsis
21935 (funcprototype
21936 (funcdef "void " (function "glUniform1f"))
21937 (paramdef "GLint " (parameter "location"))
21938 (paramdef "GLfloat " (parameter "v0")))
21939 (funcprototype
21940 (funcdef "void " (function "glUniform2f"))
21941 (paramdef "GLint " (parameter "location"))
21942 (paramdef "GLfloat " (parameter "v0"))
21943 (paramdef "GLfloat " (parameter "v1")))
21944 (funcprototype
21945 (funcdef "void " (function "glUniform3f"))
21946 (paramdef "GLint " (parameter "location"))
21947 (paramdef "GLfloat " (parameter "v0"))
21948 (paramdef "GLfloat " (parameter "v1"))
21949 (paramdef "GLfloat " (parameter "v2")))
21950 (funcprototype
21951 (funcdef "void " (function "glUniform4f"))
21952 (paramdef "GLint " (parameter "location"))
21953 (paramdef "GLfloat " (parameter "v0"))
21954 (paramdef "GLfloat " (parameter "v1"))
21955 (paramdef "GLfloat " (parameter "v2"))
21956 (paramdef "GLfloat " (parameter "v3")))
21957 (funcprototype
21958 (funcdef "void " (function "glUniform1i"))
21959 (paramdef "GLint " (parameter "location"))
21960 (paramdef "GLint " (parameter "v0")))
21961 (funcprototype
21962 (funcdef "void " (function "glUniform2i"))
21963 (paramdef "GLint " (parameter "location"))
21964 (paramdef "GLint " (parameter "v0"))
21965 (paramdef "GLint " (parameter "v1")))
21966 (funcprototype
21967 (funcdef "void " (function "glUniform3i"))
21968 (paramdef "GLint " (parameter "location"))
21969 (paramdef "GLint " (parameter "v0"))
21970 (paramdef "GLint " (parameter "v1"))
21971 (paramdef "GLint " (parameter "v2")))
21972 (funcprototype
21973 (funcdef "void " (function "glUniform4i"))
21974 (paramdef "GLint " (parameter "location"))
21975 (paramdef "GLint " (parameter "v0"))
21976 (paramdef "GLint " (parameter "v1"))
21977 (paramdef "GLint " (parameter "v2"))
21978 (paramdef "GLint " (parameter "v3"))))
3c9b6116
AW
21979 "Specify the value of a uniform variable for the current program object.
21980
21981LOCATION
21982 Specifies the location of the uniform variable to be modified.
21983
21984V0, V1, V2, V3
21985 Specifies the new values to be used for the specified uniform
21986 variable.
21987
21988`glUniform' modifies the value of a uniform variable or a uniform
21989variable array. The location of the uniform variable to be modified is
21990specified by LOCATION, which should be a value returned by
21991`glGetUniformLocation'. `glUniform' operates on the program object that
21992was made part of current state by calling `glUseProgram'.
21993
21994The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
21995the uniform variable specified by LOCATION using the values passed as
21996arguments. The number specified in the command should match the number
21997of components in the data type of the specified uniform variable (e.g.,
21998`1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
21999`f' indicates that floating-point values are being passed; the suffix
22000`i' indicates that integer values are being passed, and this type should
22001also match the data type of the specified uniform variable. The `i'
22002variants of this function should be used to provide values for uniform
22003variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
22004`f' variants should be used to provide values for uniform variables of
22005type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
22006`f' variants may be used to provide values for uniform variables of type
22007bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
22008be set to false if the input value is 0 or 0.0f, and it will be set to
22009true otherwise.
22010
22011All active uniform variables defined in a program object are initialized
22012to 0 when the program object is linked successfully. They retain the
22013values assigned to them by a call to `glUniform ' until the next
22014successful link operation occurs on the program object, when they are
22015once again initialized to 0.
22016
22017The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
22018uniform variable or a uniform variable array. These commands pass a
22019count and a pointer to the values to be loaded into a uniform variable
22020or a uniform variable array. A count of 1 should be used if modifying
22021the value of a single uniform variable, and a count of 1 or greater can
22022be used to modify an entire array or part of an array. When loading N
22023elements starting at an arbitrary position M in a uniform variable
22024array, elements M + N - 1 in the array will be replaced with the new
22025values. If M + N - 1 is larger than the size of the uniform variable
22026array, values for all array elements beyond the end of the array will be
22027ignored. The number specified in the name of the command indicates the
22028number of components for each element in VALUE, and it should match the
22029number of components in the data type of the specified uniform variable
22030(e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
22031data type specified in the name of the command must match the data type
22032for the specified uniform variable as described previously for
22033`glUniform{1|2|3|4}{f|i}'.
22034
22035For uniform variable arrays, each element of the array is considered to
22036be of the type indicated in the name of the command (e.g., `glUniform3f'
22037or `glUniform3fv' can be used to load a uniform variable array of type
22038vec3). The number of elements of the uniform variable array to be
22039modified is specified by COUNT
22040
22041The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
22042to modify a matrix or an array of matrices. The numbers in the command
22043name are interpreted as the dimensionality of the matrix. The number `2'
22044indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
22045× 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
22046(i.e., 16 values). Non-square matrix dimensionality is explicit, with
22047the first number representing the number of columns and the second
22048number representing the number of rows. For example, `2x4' indicates a 2
22049× 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
22050`GL_FALSE', each matrix is assumed to be supplied in column major order.
22051If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
22052major order. The COUNT argument indicates the number of matrices to be
22053passed. A count of 1 should be used if modifying the value of a single
22054matrix, and a count greater than 1 can be used to modify an array of
22055matrices.
22056
22057`GL_INVALID_OPERATION' is generated if there is no current program
22058object.
22059
22060`GL_INVALID_OPERATION' is generated if the size of the uniform variable
22061declared in the shader does not match the size indicated by the
22062`glUniform' command.
22063
22064`GL_INVALID_OPERATION' is generated if one of the integer variants of
22065this function is used to load a uniform variable of type float, vec2,
22066vec3, vec4, or an array of these, or if one of the floating-point
22067variants of this function is used to load a uniform variable of type
22068int, ivec2, ivec3, or ivec4, or an array of these.
22069
22070`GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
22071location for the current program object and LOCATION is not equal to -1.
22072
22073`GL_INVALID_VALUE' is generated if COUNT is less than 0.
22074
22075`GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
22076indicated uniform variable is not an array variable.
22077
22078`GL_INVALID_OPERATION' is generated if a sampler is loaded using a
22079command other than `glUniform1i' and `glUniform1iv'.
22080
22081`GL_INVALID_OPERATION' is generated if `glUniform' is executed between
22082the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
22083
22084(define-gl-procedure
22085 glUseProgram
22086 "glUseProgram"
22087 (funcsynopsis
22088 (funcprototype
22089 (funcdef "void " (function "glUseProgram"))
22090 (paramdef "GLuint " (parameter "program"))))
3c9b6116
AW
22091 "Installs a program object as part of current rendering state.
22092
22093PROGRAM
22094 Specifies the handle of the program object whose executables are to
22095 be used as part of current rendering state.
22096
22097`glUseProgram' installs the program object specified by PROGRAM as part
22098of current rendering state. One or more executables are created in a
22099program object by successfully attaching shader objects to it with
22100`glAttachShader', successfully compiling the shader objects with
22101`glCompileShader', and successfully linking the program object with
22102`glLinkProgram'.
22103
22104A program object will contain an executable that will run on the vertex
22105processor if it contains one or more shader objects of type
22106`GL_VERTEX_SHADER' that have been successfully compiled and linked.
22107Similarly, a program object will contain an executable that will run on
22108the fragment processor if it contains one or more shader objects of type
22109`GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
22110
22111Successfully installing an executable on a programmable processor will
22112cause the corresponding fixed functionality of OpenGL to be disabled.
22113Specifically, if an executable is installed on the vertex processor, the
22114OpenGL fixed functionality will be disabled as follows.
22115
22116 * The projection matrix is not applied to vertex coordinates.
22117
22118 * The texture matrices are not applied to texture coordinates.
22119
22120 * Normals are not transformed to eye coordinates.
22121
22122 * Normals are not rescaled or normalized.
22123
22124 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
22125 performed.
22126
22127 * Texture coordinates are not generated automatically.
22128
22129 * Per-vertex lighting is not performed.
22130
22131 * Color material computations are not performed.
22132
22133 * Color index lighting is not performed.
22134
22135 * This list also applies when setting the current raster position.
22136
22137The executable that is installed on the vertex processor is expected to
22138implement any or all of the desired functionality from the preceding
22139list. Similarly, if an executable is installed on the fragment
22140processor, the OpenGL fixed functionality will be disabled as follows.
22141
22142 * Texture application is not applied.
22143
22144 * Color sum is not applied.
22145
22146 * Fog is not applied.
22147
22148Again, the fragment shader that is installed is expected to implement
22149any or all of the desired functionality from the preceding list.
22150
22151While a program object is in use, applications are free to modify
22152attached shader objects, compile attached shader objects, attach
22153additional shader objects, and detach or delete shader objects. None of
22154these operations will affect the executables that are part of the
22155current state. However, relinking the program object that is currently
22156in use will install the program object as part of the current rendering
22157state if the link operation was successful (see `glLinkProgram' ). If
22158the program object currently in use is relinked unsuccessfully, its link
22159status will be set to `GL_FALSE', but the executables and associated
22160state will remain part of the current state until a subsequent call to
22161`glUseProgram' removes it from use. After it is removed from use, it
22162cannot be made part of current state until it has been successfully
22163relinked.
22164
22165If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
22166does not contain shader objects of type `GL_FRAGMENT_SHADER', an
22167executable will be installed on the vertex processor, but fixed
22168functionality will be used for fragment processing. Similarly, if
22169PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
22170not contain shader objects of type `GL_VERTEX_SHADER', an executable
22171will be installed on the fragment processor, but fixed functionality
22172will be used for vertex processing. If PROGRAM is 0, the programmable
22173processors will be disabled, and fixed functionality will be used for
22174both vertex and fragment processing.
22175
22176`GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
22177generated by OpenGL.
22178
22179`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
22180
22181`GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
22182current state.
22183
22184`GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
22185between the execution of `glBegin' and the corresponding execution of
22186`glEnd'.")
8925f36f
AW
22187
22188(define-gl-procedure
22189 glValidateProgram
22190 "glValidateProgram"
22191 (funcsynopsis
22192 (funcprototype
22193 (funcdef "void " (function "glValidateProgram"))
22194 (paramdef "GLuint " (parameter "program"))))
3c9b6116
AW
22195 "Validates a program object.
22196
22197PROGRAM
22198 Specifies the handle of the program object to be validated.
22199
22200`glValidateProgram' checks to see whether the executables contained in
22201PROGRAM can execute given the current OpenGL state. The information
22202generated by the validation process will be stored in PROGRAM's
22203information log. The validation information may consist of an empty
22204string, or it may be a string containing information about how the
22205current program object interacts with the rest of current OpenGL state.
22206This provides a way for OpenGL implementers to convey more information
22207about why the current program is inefficient, suboptimal, failing to
22208execute, and so on.
22209
22210The status of the validation operation will be stored as part of the
22211program object's state. This value will be set to `GL_TRUE' if the
22212validation succeeded, and `GL_FALSE' otherwise. It can be queried by
22213calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
22214If validation is successful, PROGRAM is guaranteed to execute given the
22215current state. Otherwise, PROGRAM is guaranteed to not execute.
22216
22217This function is typically useful only during application development.
22218The informational string stored in the information log is completely
22219implementation dependent; therefore, an application should not expect
22220different OpenGL implementations to produce identical information
22221strings.
22222
22223`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
22224OpenGL.
22225
22226`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
22227
22228`GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
22229between the execution of `glBegin' and the corresponding execution of
22230`glEnd'.")
8925f36f
AW
22231
22232(define-gl-procedure
22233 glVertexAttribPointer
22234 "glVertexAttribPointer"
22235 (funcsynopsis
22236 (funcprototype
22237 (funcdef
22238 "void "
22239 (function "glVertexAttribPointer"))
22240 (paramdef "GLuint " (parameter "index"))
22241 (paramdef "GLint " (parameter "size"))
22242 (paramdef "GLenum " (parameter "type"))
22243 (paramdef "GLboolean " (parameter "normalized"))
22244 (paramdef "GLsizei " (parameter "stride"))
22245 (paramdef
22246 "const GLvoid * "
22247 (parameter "pointer"))))
3c9b6116
AW
22248 "Define an array of generic vertex attribute data.
22249
22250INDEX
22251 Specifies the index of the generic vertex attribute to be modified.
22252
22253SIZE
22254 Specifies the number of components per generic vertex attribute.
22255 Must be 1, 2, 3, or 4. The initial value is 4.
22256
22257TYPE
22258 Specifies the data type of each component in the array. Symbolic
22259 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
22260 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
22261 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
22262
22263NORMALIZED
22264 Specifies whether fixed-point data values should be normalized
22265 (`GL_TRUE') or converted directly as fixed-point values
22266 (`GL_FALSE') when they are accessed.
22267
22268STRIDE
22269 Specifies the byte offset between consecutive generic vertex
22270 attributes. If STRIDE is 0, the generic vertex attributes are
22271 understood to be tightly packed in the array. The initial value is
22272 0.
22273
22274POINTER
22275 Specifies a pointer to the first component of the first generic
22276 vertex attribute in the array. The initial value is 0.
22277
22278`glVertexAttribPointer' specifies the location and data format of the
22279array of generic vertex attributes at index INDEX to use when rendering.
22280SIZE specifies the number of components per attribute and must be 1, 2,
222813, or 4. TYPE specifies the data type of each component, and STRIDE
22282specifies the byte stride from one attribute to the next, allowing
22283vertices and attributes to be packed into a single array or stored in
22284separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
22285stored in an integer format are to be mapped to the range [-1,1] (for
22286signed values) or [0,1] (for unsigned values) when they are accessed and
22287converted to floating point. Otherwise, values will be converted to
22288floats directly without normalization.
22289
22290If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
22291target (see `glBindBuffer') while a generic vertex attribute array is
22292specified, POINTER is treated as a byte offset into the buffer object's
22293data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
22294is saved as generic vertex attribute array client-side state
22295(`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
22296
22297When a generic vertex attribute array is specified, SIZE, TYPE,
22298NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
22299addition to the current vertex array buffer object binding.
22300
22301To enable and disable a generic vertex attribute array, call
22302`glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
22303If enabled, the generic vertex attribute array is used when
22304`glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
22305`glMultiDrawElements', or `glDrawRangeElements' is called.
22306
22307`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
22308`GL_MAX_VERTEX_ATTRIBS'.
22309
22310`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
22311
22312`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
22313
22314`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f
AW
22315
22316(define-gl-procedure
22317 glVertexAttrib
22318 "glVertexAttrib"
22319 (funcsynopsis
22320 (funcprototype
22321 (funcdef "void " (function "glVertexAttrib1f"))
22322 (paramdef "GLuint " (parameter "index"))
22323 (paramdef "GLfloat " (parameter "v0")))
22324 (funcprototype
22325 (funcdef "void " (function "glVertexAttrib1s"))
22326 (paramdef "GLuint " (parameter "index"))
22327 (paramdef "GLshort " (parameter "v0")))
22328 (funcprototype
22329 (funcdef "void " (function "glVertexAttrib1d"))
22330 (paramdef "GLuint " (parameter "index"))
22331 (paramdef "GLdouble " (parameter "v0")))
22332 (funcprototype
22333 (funcdef "void " (function "glVertexAttrib2f"))
22334 (paramdef "GLuint " (parameter "index"))
22335 (paramdef "GLfloat " (parameter "v0"))
22336 (paramdef "GLfloat " (parameter "v1")))
22337 (funcprototype
22338 (funcdef "void " (function "glVertexAttrib2s"))
22339 (paramdef "GLuint " (parameter "index"))
22340 (paramdef "GLshort " (parameter "v0"))
22341 (paramdef "GLshort " (parameter "v1")))
22342 (funcprototype
22343 (funcdef "void " (function "glVertexAttrib2d"))
22344 (paramdef "GLuint " (parameter "index"))
22345 (paramdef "GLdouble " (parameter "v0"))
22346 (paramdef "GLdouble " (parameter "v1")))
22347 (funcprototype
22348 (funcdef "void " (function "glVertexAttrib3f"))
22349 (paramdef "GLuint " (parameter "index"))
22350 (paramdef "GLfloat " (parameter "v0"))
22351 (paramdef "GLfloat " (parameter "v1"))
22352 (paramdef "GLfloat " (parameter "v2")))
22353 (funcprototype
22354 (funcdef "void " (function "glVertexAttrib3s"))
22355 (paramdef "GLuint " (parameter "index"))
22356 (paramdef "GLshort " (parameter "v0"))
22357 (paramdef "GLshort " (parameter "v1"))
22358 (paramdef "GLshort " (parameter "v2")))
22359 (funcprototype
22360 (funcdef "void " (function "glVertexAttrib3d"))
22361 (paramdef "GLuint " (parameter "index"))
22362 (paramdef "GLdouble " (parameter "v0"))
22363 (paramdef "GLdouble " (parameter "v1"))
22364 (paramdef "GLdouble " (parameter "v2")))
22365 (funcprototype
22366 (funcdef "void " (function "glVertexAttrib4f"))
22367 (paramdef "GLuint " (parameter "index"))
22368 (paramdef "GLfloat " (parameter "v0"))
22369 (paramdef "GLfloat " (parameter "v1"))
22370 (paramdef "GLfloat " (parameter "v2"))
22371 (paramdef "GLfloat " (parameter "v3")))
22372 (funcprototype
22373 (funcdef "void " (function "glVertexAttrib4s"))
22374 (paramdef "GLuint " (parameter "index"))
22375 (paramdef "GLshort " (parameter "v0"))
22376 (paramdef "GLshort " (parameter "v1"))
22377 (paramdef "GLshort " (parameter "v2"))
22378 (paramdef "GLshort " (parameter "v3")))
22379 (funcprototype
22380 (funcdef "void " (function "glVertexAttrib4d"))
22381 (paramdef "GLuint " (parameter "index"))
22382 (paramdef "GLdouble " (parameter "v0"))
22383 (paramdef "GLdouble " (parameter "v1"))
22384 (paramdef "GLdouble " (parameter "v2"))
22385 (paramdef "GLdouble " (parameter "v3")))
22386 (funcprototype
22387 (funcdef "void " (function "glVertexAttrib4Nub"))
22388 (paramdef "GLuint " (parameter "index"))
22389 (paramdef "GLubyte " (parameter "v0"))
22390 (paramdef "GLubyte " (parameter "v1"))
22391 (paramdef "GLubyte " (parameter "v2"))
22392 (paramdef "GLubyte " (parameter "v3"))))
3c9b6116
AW
22393 "Specifies the value of a generic vertex attribute.
22394
22395INDEX
22396 Specifies the index of the generic vertex attribute to be modified.
22397
22398V0, V1, V2, V3
22399 Specifies the new values to be used for the specified vertex
22400 attribute.
22401
22402OpenGL defines a number of standard vertex attributes that applications
22403can modify with standard API entry points (color, normal, texture
22404coordinates, etc.). The `glVertexAttrib' family of entry points allows
22405an application to pass generic vertex attributes in numbered locations.
22406
22407Generic attributes are defined as four-component values that are
22408organized into an array. The first entry of this array is numbered 0,
22409and the size of the array is specified by the implementation-dependent
22410constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
22411be modified with a `glVertexAttrib' call that specifies the index of the
22412element to be modified and a value for that element.
22413
22414These commands can be used to specify one, two, three, or all four
22415components of the generic vertex attribute specified by INDEX. A `1' in
22416the name of the command indicates that only one value is passed, and it
22417will be used to modify the first component of the generic vertex
22418attribute. The second and third components will be set to 0, and the
22419fourth component will be set to 1. Similarly, a `2' in the name of the
22420command indicates that values are provided for the first two components,
22421the third component will be set to 0, and the fourth component will be
22422set to 1. A `3' in the name of the command indicates that values are
22423provided for the first three components and the fourth component will be
22424set to 1, whereas a `4' in the name indicates that values are provided
22425for all four components.
22426
22427The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
22428the arguments are of type short, float, int, double, unsigned byte,
22429unsigned short, or unsigned int. When `v' is appended to the name, the
22430commands can take a pointer to an array of such values. The commands
22431containing `N' indicate that the arguments will be passed as fixed-point
22432values that are scaled to a normalized range according to the component
22433conversion rules defined by the OpenGL specification. Signed values are
22434understood to represent fixed-point values in the range [-1,1], and
22435unsigned values are understood to represent fixed-point values in the
22436range [0,1].
22437
22438OpenGL Shading Language attribute variables are allowed to be of type
22439mat2, mat3, or mat4. Attributes of these types may be loaded using the
22440`glVertexAttrib' entry points. Matrices must be loaded into successive
22441generic attribute slots in column major order, with one column of the
22442matrix in each generic attribute slot.
22443
22444A user-defined attribute variable declared in a vertex shader can be
22445bound to a generic attribute index by calling `glBindAttribLocation'.
22446This allows an application to use more descriptive variable names in a
22447vertex shader. A subsequent change to the specified generic vertex
22448attribute will be immediately reflected as a change to the corresponding
22449attribute variable in the vertex shader.
22450
22451The binding between a generic vertex attribute index and a user-defined
22452attribute variable in a vertex shader is part of the state of a program
22453object, but the current value of the generic vertex attribute is not.
22454The value of each generic vertex attribute is part of current state,
22455just like standard vertex attributes, and it is maintained even if a
22456different program object is used.
22457
22458An application may freely modify generic vertex attributes that are not
22459bound to a named vertex shader attribute variable. These values are
22460simply maintained as part of current state and will not be accessed by
22461the vertex shader. If a generic vertex attribute bound to an attribute
22462variable in a vertex shader is not updated while the vertex shader is
22463executing, the vertex shader will repeatedly use the current value for
22464the generic vertex attribute.
22465
22466The generic vertex attribute with index 0 is the same as the vertex
22467position attribute previously defined by OpenGL. A `glVertex2',
22468`glVertex3', or `glVertex4' command is completely equivalent to the
22469corresponding `glVertexAttrib' command with an index argument of 0. A
22470vertex shader can access generic vertex attribute 0 by using the
22471built-in attribute variable GL_VERTEX. There are no current values for
22472generic vertex attribute 0. This is the only generic vertex attribute
22473with this property; calls to set other standard vertex attributes can be
22474freely mixed with calls to set any of the other generic vertex
22475attributes.
22476
22477`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
22478`GL_MAX_VERTEX_ATTRIBS'.")
8925f36f
AW
22479
22480(define-gl-procedure
22481 glVertexPointer
22482 "glVertexPointer"
22483 (funcsynopsis
22484 (funcprototype
22485 (funcdef "void " (function "glVertexPointer"))
22486 (paramdef "GLint " (parameter "size"))
22487 (paramdef "GLenum " (parameter "type"))
22488 (paramdef "GLsizei " (parameter "stride"))
22489 (paramdef
22490 "const GLvoid * "
22491 (parameter "pointer"))))
3c9b6116
AW
22492 "Define an array of vertex data.
22493
22494SIZE
22495 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
22496 The initial value is 4.
22497
22498TYPE
22499 Specifies the data type of each coordinate in the array. Symbolic
22500 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
22501 accepted. The initial value is `GL_FLOAT'.
22502
22503STRIDE
22504 Specifies the byte offset between consecutive vertices. If STRIDE
22505 is 0, the vertices are understood to be tightly packed in the
22506 array. The initial value is 0.
22507
22508POINTER
22509 Specifies a pointer to the first coordinate of the first vertex in
22510 the array. The initial value is 0.
22511
22512`glVertexPointer' specifies the location and data format of an array of
22513vertex coordinates to use when rendering. SIZE specifies the number of
22514coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
22515type of each coordinate, and STRIDE specifies the byte stride from one
22516vertex to the next, allowing vertices and attributes to be packed into a
22517single array or stored in separate arrays. (Single-array storage may be
22518more efficient on some implementations; see `glInterleavedArrays'.)
22519
22520If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
22521target (see `glBindBuffer') while a vertex array is specified, POINTER
22522is treated as a byte offset into the buffer object's data store. Also,
22523the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
22524array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
22525
22526When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
22527saved as client-side state, in addition to the current vertex array
22528buffer object binding.
22529
22530To enable and disable the vertex array, call `glEnableClientState' and
22531`glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
22532the vertex array is used when `glArrayElement', `glDrawArrays',
22533`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
22534`glDrawRangeElements' is called.
22535
22536`GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
22537
22538`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
22539
22540`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f
AW
22541
22542(define-gl-procedure
22543 glVertex
22544 "glVertex"
22545 (funcsynopsis
22546 (funcprototype
22547 (funcdef "void " (function "glVertex2s"))
22548 (paramdef "GLshort " (parameter "x"))
22549 (paramdef "GLshort " (parameter "y"))))
3c9b6116
AW
22550 "Specify a vertex.
22551
22552X
22553 Y
22554
22555 Z
22556
22557 W
22558
22559 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
22560 are present in all forms of the command.
22561
22562`glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
22563point, line, and polygon vertices. The current color, normal, texture
22564coordinates, and fog coordinate are associated with the vertex when
22565`glVertex' is called.
22566
22567When only X and Y are specified, Z defaults to 0 and W defaults to 1.
22568When X , Y , and Z are specified, W defaults to 1.")
8925f36f
AW
22569
22570(define-gl-procedure
22571 glViewport
22572 "glViewport"
22573 (funcsynopsis
22574 (funcprototype
22575 (funcdef "void " (function "glViewport"))
22576 (paramdef "GLint " (parameter "x"))
22577 (paramdef "GLint " (parameter "y"))
22578 (paramdef "GLsizei " (parameter "width"))
22579 (paramdef "GLsizei " (parameter "height"))))
3c9b6116
AW
22580 "Set the viewport.
22581
22582X
22583 Y
22584
22585 Specify the lower left corner of the viewport rectangle, in pixels.
22586 The initial value is (0,0).
22587
22588WIDTH
22589 HEIGHT
22590
22591 Specify the width and height of the viewport. When a GL context is
22592 first attached to a window, WIDTH and HEIGHT are set to the
22593 dimensions of that window.
22594
22595`glViewport' specifies the affine transformation of X and Y from
22596normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
22597normalized device coordinates. Then the window coordinates (X_W,Y_W) are
22598computed as follows:
22599
22600X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
22601
22602Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
22603
22604Viewport width and height are silently clamped to a range that depends
22605on the implementation. To query this range, call `glGet' with argument
22606`GL_MAX_VIEWPORT_DIMS'.
22607
22608`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
22609
22610`GL_INVALID_OPERATION' is generated if `glViewport' is executed between
22611the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f
AW
22612
22613(define-gl-procedure
22614 glWindowPos
22615 "glWindowPos"
22616 (funcsynopsis
22617 (funcprototype
22618 (funcdef "void " (function "glWindowPos2s"))
22619 (paramdef "GLshort " (parameter "x"))
22620 (paramdef "GLshort " (parameter "y"))))
3c9b6116
AW
22621 "Specify the raster position in window coordinates for pixel operations.
22622
22623X
22624 Y
22625
22626 Z
22627
22628 Specify the X , Y , Z coordinates for the raster position.
22629
22630The GL maintains a 3D position in window coordinates. This position,
22631called the raster position, is used to position pixel and bitmap write
22632operations. It is maintained with subpixel accuracy. See `glBitmap',
22633`glDrawPixels', and `glCopyPixels'.
22634
22635`glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
22636set to 0. `glWindowPos3' specifies all three coordinates. The W
22637coordinate of the current raster position is always set to 1.0.
22638
22639`glWindowPos' directly updates the X and Y coordinates of the current
22640raster position with the values specified. That is, the values are
22641neither transformed by the current modelview and projection matrices,
22642nor by the viewport-to-window transform. The Z coordinate of the current
22643raster position is updated in the following manner:
22644
22645Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
22646
22647
22648
22649where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
22650far value. See `glDepthRange'.
22651
22652The specified coordinates are not clip-tested, causing the raster
22653position to always be valid.
22654
8925f36f 22655The current raster position also includes some associated color data and
3c9b6116
AW
22656texture coordinates. If lighting is enabled, then
22657`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
8925f36f 22658(in color index mode) is set to the color produced by the lighting
3c9b6116
AW
22659calculation (see `glLight', `glLightModel', and `glShadeModel'). If
22660lighting is disabled, current color (in RGBA mode, state variable
22661`GL_CURRENT_COLOR') or color index (in color index mode, state variable
22662`GL_CURRENT_INDEX') is used to update the current raster color.
22663`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
22664
22665Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
22666`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
22667generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
22668is set to the `GL_CURRENT_FOG_COORD'.
22669
22670
22671
22672`GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
22673the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 22674