include more low-level bindings
[clinton/guile-figl.git] / figl / gl / low-level.scm
CommitLineData
8925f36f
AW
1;;; figl -*- mode: scheme; coding: utf-8 -*-
2;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
3;;;
4;;; Figl is free software: you can redistribute it and/or modify it
5;;; under the terms of the GNU Lesser General Public License as
6;;; published by the Free Software Foundation, either version 3 of the
7;;; License, or (at your option) any later version.
8;;;
9;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12;;; Public License for more details.
13;;;
14;;; You should have received a copy of the GNU Lesser General Public
15;;; License along with this program. If not, see
16;;; <http://www.gnu.org/licenses/>.
17;;;
18;;; Derived from upstream OpenGL documentation.
19;;;
8925f36f
AW
20;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
21;;; under the SGI Free Software B License. For details, see
22;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
23;;;
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
7ec693ed 44 (figl gl low-level)
8925f36f 45 #:use-module
25072f02 46 (figl gl runtime)
7ec693ed
AW
47 #:use-module
48 (figl gl types)
8925f36f
AW
49 #:export
50 (glAccum
51 glActiveTexture
52 glAlphaFunc
53 glAreTexturesResident
54 glArrayElement
55 glAttachShader
56 glBeginQuery
bb894c9d 57 glEndQuery
8925f36f 58 glBegin
bb894c9d 59 glEnd
8925f36f
AW
60 glBindAttribLocation
61 glBindBuffer
62 glBindTexture
63 glBitmap
64 glBlendColor
65 glBlendEquationSeparate
66 glBlendEquation
67 glBlendFuncSeparate
68 glBlendFunc
69 glBufferData
70 glBufferSubData
71 glCallLists
72 glCallList
73 glClearAccum
74 glClearColor
75 glClearDepth
76 glClearIndex
77 glClearStencil
78 glClear
79 glClientActiveTexture
80 glClipPlane
81 glColorMask
82 glColorMaterial
83 glColorPointer
84 glColorSubTable
b002944d
AW
85 glColorTableParameterfv
86 glColorTableParameteriv
8925f36f 87 glColorTable
bb894c9d 88 glColor3i
ca09631c 89 glColor3f
bb894c9d
AW
90 glColor3ui
91 glColor4i
ca09631c 92 glColor4f
bb894c9d 93 glColor4ui
8925f36f
AW
94 glCompileShader
95 glCompressedTexImage1D
96 glCompressedTexImage2D
97 glCompressedTexImage3D
98 glCompressedTexSubImage1D
99 glCompressedTexSubImage2D
100 glCompressedTexSubImage3D
101 glConvolutionFilter1D
102 glConvolutionFilter2D
bb894c9d
AW
103 glConvolutionParameterf
104 glConvolutionParameteri
8925f36f
AW
105 glCopyColorSubTable
106 glCopyColorTable
107 glCopyConvolutionFilter1D
108 glCopyConvolutionFilter2D
109 glCopyPixels
110 glCopyTexImage1D
111 glCopyTexImage2D
112 glCopyTexSubImage1D
113 glCopyTexSubImage2D
114 glCopyTexSubImage3D
115 glCreateProgram
116 glCreateShader
117 glCullFace
118 glDeleteBuffers
119 glDeleteLists
120 glDeleteProgram
121 glDeleteQueries
122 glDeleteShader
123 glDeleteTextures
124 glDepthFunc
125 glDepthMask
126 glDepthRange
127 glDetachShader
128 glDrawArrays
129 glDrawBuffers
130 glDrawBuffer
131 glDrawElements
132 glDrawPixels
133 glDrawRangeElements
134 glEdgeFlagPointer
135 glEdgeFlag
136 glEnableClientState
bb894c9d 137 glDisableClientState
8925f36f 138 glEnableVertexAttribArray
bb894c9d 139 glDisableVertexAttribArray
8925f36f 140 glEnable
bb894c9d 141 glDisable
ca09631c
AW
142 glEvalCoord1f
143 glEvalCoord2f
bb894c9d
AW
144 glEvalMesh1
145 glEvalMesh2
146 glEvalPoint1
147 glEvalPoint2
8925f36f
AW
148 glFeedbackBuffer
149 glFinish
150 glFlush
151 glFogCoordPointer
ca09631c 152 glFogCoordf
bb894c9d
AW
153 glFogf
154 glFogi
8925f36f
AW
155 glFrontFace
156 glFrustum
157 glGenBuffers
158 glGenLists
159 glGenQueries
160 glGenTextures
161 glGetActiveAttrib
162 glGetActiveUniform
163 glGetAttachedShaders
164 glGetAttribLocation
b002944d
AW
165 glGetBufferParameteriv
166 glGetBufferPointerv
8925f36f
AW
167 glGetBufferSubData
168 glGetClipPlane
b002944d
AW
169 glGetColorTableParameterfv
170 glGetColorTableParameteriv
8925f36f
AW
171 glGetColorTable
172 glGetCompressedTexImage
173 glGetConvolutionFilter
b002944d
AW
174 glGetConvolutionParameterfv
175 glGetConvolutionParameteriv
8925f36f 176 glGetError
b002944d
AW
177 glGetHistogramParameterfv
178 glGetHistogramParameteriv
8925f36f 179 glGetHistogram
b002944d
AW
180 glGetLightfv
181 glGetLightiv
182 glGetMapfv
183 glGetMapiv
184 glGetMaterialfv
185 glGetMaterialiv
186 glGetMinmaxParameterfv
187 glGetMinmaxParameteriv
8925f36f 188 glGetMinmax
b002944d
AW
189 glGetPixelMapfv
190 glGetPixelMapuiv
191 glGetPointerv
8925f36f
AW
192 glGetPolygonStipple
193 glGetProgramInfoLog
b002944d
AW
194 glGetProgramiv
195 glGetQueryiv
196 glGetQueryObjectiv
197 glGetQueryObjectuiv
8925f36f
AW
198 glGetSeparableFilter
199 glGetShaderInfoLog
200 glGetShaderSource
b002944d 201 glGetShaderiv
8925f36f 202 glGetString
b002944d
AW
203 glGetTexEnvfv
204 glGetTexEnviv
205 glGetTexGenfv
206 glGetTexGeniv
8925f36f 207 glGetTexImage
b002944d
AW
208 glGetTexLevelParameterfv
209 glGetTexLevelParameteriv
210 glGetTexParameterfv
211 glGetTexParameteriv
8925f36f 212 glGetUniformLocation
b002944d
AW
213 glGetUniformfv
214 glGetUniformiv
215 glGetVertexAttribPointerv
216 glGetVertexAttribfv
217 glGetVertexAttribiv
218 glGetBooleanv
219 glGetDoublev
220 glGetFloatv
221 glGetIntegerv
8925f36f
AW
222 glHint
223 glHistogram
224 glIndexMask
225 glIndexPointer
bb894c9d 226 glIndexi
ca09631c 227 glIndexf
bb894c9d 228 glIndexub
8925f36f
AW
229 glInitNames
230 glInterleavedArrays
231 glIsBuffer
232 glIsEnabled
233 glIsList
234 glIsProgram
235 glIsQuery
236 glIsShader
237 glIsTexture
bb894c9d
AW
238 glLightModelf
239 glLightModeli
240 glLightf
241 glLighti
8925f36f
AW
242 glLineStipple
243 glLineWidth
244 glLinkProgram
245 glListBase
246 glLoadIdentity
ca09631c 247 glLoadMatrixf
8925f36f 248 glLoadName
ca09631c 249 glLoadTransposeMatrixf
8925f36f 250 glLogicOp
ca09631c
AW
251 glMap1f
252 glMap2f
8925f36f 253 glMapBuffer
bb894c9d 254 glUnmapBuffer
ca09631c
AW
255 glMapGrid1f
256 glMapGrid2f
bb894c9d
AW
257 glMaterialf
258 glMateriali
8925f36f
AW
259 glMatrixMode
260 glMinmax
261 glMultiDrawArrays
262 glMultiDrawElements
bb894c9d 263 glMultiTexCoord1i
ca09631c 264 glMultiTexCoord1f
bb894c9d 265 glMultiTexCoord2i
ca09631c 266 glMultiTexCoord2f
bb894c9d 267 glMultiTexCoord3i
ca09631c 268 glMultiTexCoord3f
bb894c9d 269 glMultiTexCoord4i
ca09631c
AW
270 glMultiTexCoord4f
271 glMultMatrixf
272 glMultTransposeMatrixf
8925f36f 273 glNewList
bb894c9d 274 glEndList
8925f36f 275 glNormalPointer
ca09631c 276 glNormal3f
bb894c9d 277 glNormal3i
8925f36f
AW
278 glOrtho
279 glPassThrough
b002944d
AW
280 glPixelMapfv
281 glPixelMapuiv
bb894c9d
AW
282 glPixelStoref
283 glPixelStorei
284 glPixelTransferf
285 glPixelTransferi
8925f36f 286 glPixelZoom
bb894c9d
AW
287 glPointParameterf
288 glPointParameteri
8925f36f
AW
289 glPointSize
290 glPolygonMode
291 glPolygonOffset
292 glPolygonStipple
293 glPrioritizeTextures
294 glPushAttrib
bb894c9d 295 glPopAttrib
8925f36f 296 glPushClientAttrib
bb894c9d 297 glPopClientAttrib
8925f36f 298 glPushMatrix
bb894c9d 299 glPopMatrix
8925f36f 300 glPushName
bb894c9d
AW
301 glPopName
302 glRasterPos2i
ca09631c 303 glRasterPos2f
bb894c9d 304 glRasterPos3i
ca09631c 305 glRasterPos3f
bb894c9d 306 glRasterPos4i
ca09631c 307 glRasterPos4f
8925f36f
AW
308 glReadBuffer
309 glReadPixels
ca09631c 310 glRectf
bb894c9d 311 glRecti
8925f36f
AW
312 glRenderMode
313 glResetHistogram
314 glResetMinmax
ca09631c 315 glRotatef
8925f36f 316 glSampleCoverage
ca09631c 317 glScalef
8925f36f
AW
318 glScissor
319 glSecondaryColorPointer
bb894c9d 320 glSecondaryColor3i
ca09631c 321 glSecondaryColor3f
bb894c9d 322 glSecondaryColor3ui
8925f36f
AW
323 glSelectBuffer
324 glSeparableFilter2D
325 glShadeModel
326 glShaderSource
327 glStencilFuncSeparate
328 glStencilFunc
329 glStencilMaskSeparate
330 glStencilMask
331 glStencilOpSeparate
332 glStencilOp
333 glTexCoordPointer
bb894c9d 334 glTexCoord1i
ca09631c 335 glTexCoord1f
bb894c9d 336 glTexCoord2i
ca09631c 337 glTexCoord2f
bb894c9d 338 glTexCoord3i
ca09631c 339 glTexCoord3f
bb894c9d 340 glTexCoord4i
ca09631c 341 glTexCoord4f
bb894c9d
AW
342 glTexEnvf
343 glTexEnvi
344 glTexGeni
ca09631c 345 glTexGenf
8925f36f
AW
346 glTexImage1D
347 glTexImage2D
348 glTexImage3D
bb894c9d
AW
349 glTexParameterf
350 glTexParameteri
8925f36f
AW
351 glTexSubImage1D
352 glTexSubImage2D
353 glTexSubImage3D
ca09631c 354 glTranslatef
8925f36f 355 glUniform1f
bb894c9d
AW
356 glUniform2f
357 glUniform3f
358 glUniform4f
359 glUniform1i
360 glUniform2i
361 glUniform3i
362 glUniform4i
b002944d
AW
363 glUniformMatrix2fv
364 glUniformMatrix3fv
365 glUniformMatrix4fv
366 glUniformMatrix2x3fv
367 glUniformMatrix3x2fv
368 glUniformMatrix2x4fv
369 glUniformMatrix4x2fv
370 glUniformMatrix3x4fv
371 glUniformMatrix4x3fv
8925f36f
AW
372 glUseProgram
373 glValidateProgram
374 glVertexAttribPointer
ca09631c 375 glVertexAttrib1f
bb894c9d 376 glVertexAttrib1s
ca09631c 377 glVertexAttrib2f
bb894c9d 378 glVertexAttrib2s
ca09631c 379 glVertexAttrib3f
bb894c9d 380 glVertexAttrib3s
ca09631c 381 glVertexAttrib4f
bb894c9d 382 glVertexAttrib4s
bb894c9d 383 glVertexAttrib4Nub
b002944d
AW
384 glVertexAttrib4iv
385 glVertexAttrib4uiv
386 glVertexAttrib4Niv
387 glVertexAttrib4Nuiv
8925f36f 388 glVertexPointer
bb894c9d 389 glVertex2i
ca09631c 390 glVertex2f
bb894c9d 391 glVertex3i
ca09631c 392 glVertex3f
bb894c9d 393 glVertex4i
ca09631c 394 glVertex4f
8925f36f 395 glViewport
bb894c9d 396 glWindowPos2i
ca09631c 397 glWindowPos2f
bb894c9d 398 glWindowPos3i
ca09631c 399 glWindowPos3f))
8925f36f 400
25072f02 401(define-gl-procedures
bb894c9d 402 ((glAccum (op GLenum) (value GLfloat) -> void))
3c9b6116
AW
403 "Operate on the accumulation buffer.
404
405OP
406 Specifies the accumulation buffer operation. Symbolic constants
407 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
408 accepted.
409
410VALUE
411 Specifies a floating-point value used in the accumulation buffer
412 operation. OP determines how VALUE is used.
413
414The accumulation buffer is an extended-range color buffer. Images are
415not rendered into it. Rather, images rendered into one of the color
416buffers are added to the contents of the accumulation buffer after
417rendering. Effects such as antialiasing (of points, lines, and
418polygons), motion blur, and depth of field can be created by
419accumulating images generated with different transformation matrices.
420
421Each pixel in the accumulation buffer consists of red, green, blue, and
422alpha values. The number of bits per component in the accumulation
423buffer depends on the implementation. You can examine this number by
424calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
425`GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
426Regardless of the number of bits per component, the range of values
427stored by each component is [-1,1] . The accumulation buffer pixels are
428mapped one-to-one with frame buffer pixels.
429
430`glAccum' operates on the accumulation buffer. The first argument, OP,
431is a symbolic constant that selects an accumulation buffer operation.
432The second argument, VALUE, is a floating-point value to be used in that
433operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
434`GL_ADD', `GL_MULT', and `GL_RETURN'.
435
436All accumulation buffer operations are limited to the area of the
437current scissor box and applied identically to the red, green, blue, and
438alpha components of each pixel. If a `glAccum' operation results in a
439value outside the range [-1,1] , the contents of an accumulation buffer
440pixel component are undefined.
441
442The operations are as follows:
443
444`GL_ACCUM'
445 Obtains R, G, B, and A values from the buffer currently selected
446 for reading (see `glReadBuffer'). Each component value is divided
447 by 2^N-1 , where N is the number of bits allocated to each color
448 component in the currently selected buffer. The result is a
449 floating-point value in the range [0,1] , which is multiplied by
450 VALUE and added to the corresponding pixel component in the
451 accumulation buffer, thereby updating the accumulation buffer.
452
453`GL_LOAD'
454 Similar to `GL_ACCUM', except that the current value in the
455 accumulation buffer is not used in the calculation of the new
456 value. That is, the R, G, B, and A values from the currently
457 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
458 then stored in the corresponding accumulation buffer cell,
459 overwriting the current value.
460
461`GL_ADD'
462 Adds VALUE to each R, G, B, and A in the accumulation buffer.
463
464`GL_MULT'
465 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
466 and returns the scaled component to its corresponding accumulation
467 buffer location.
468
469`GL_RETURN'
470 Transfers accumulation buffer values to the color buffer or buffers
471 currently selected for writing. Each R, G, B, and A component is
472 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
473 range [0,2^N-1] , and stored in the corresponding display buffer
474 cell. The only fragment operations that are applied to this
475 transfer are pixel ownership, scissor, dithering, and color
476 writemasks.
477
478To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
479A values to set it to, then call `glClear' with the accumulation buffer
480enabled.
481
482`GL_INVALID_ENUM' is generated if OP is not an accepted value.
483
484`GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
485
486`GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
487execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 488
25072f02 489(define-gl-procedures
bb894c9d 490 ((glActiveTexture (texture GLenum) -> void))
3c9b6116
AW
491 "Select active texture unit.
492
493TEXTURE
494 Specifies which texture unit to make active. The number of texture
495 units is implementation dependent, but must be at least two.
496 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
497 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
498 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
499 `GL_TEXTURE0'.
500
501`glActiveTexture' selects which texture unit subsequent texture state
502calls will affect. The number of texture units an implementation
503supports is implementation dependent, but must be at least 2.
504
505Vertex arrays are client-side GL resources, which are selected by the
506`glClientActiveTexture' routine.
507
508`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
509where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
510(`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
8925f36f 511
25072f02 512(define-gl-procedures
bb894c9d
AW
513 ((glAlphaFunc
514 (func GLenum)
515 (ref GLclampf)
516 ->
517 void))
3c9b6116
AW
518 "Specify the alpha test function.
519
520FUNC
521 Specifies the alpha comparison function. Symbolic constants
522 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
523 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
524 initial value is `GL_ALWAYS'.
525
526REF
527 Specifies the reference value that incoming alpha values are
528 compared to. This value is clamped to the range [0,1] , where 0
529 represents the lowest possible alpha value and 1 the highest
530 possible value. The initial reference value is 0.
531
532The alpha test discards fragments depending on the outcome of a
533comparison between an incoming fragment's alpha value and a constant
534reference value. `glAlphaFunc' specifies the reference value and the
535comparison function. The comparison is performed only if alpha testing
536is enabled. By default, it is not enabled. (See `glEnable' and
537`glDisable' of `GL_ALPHA_TEST'.)
538
539FUNC and REF specify the conditions under which the pixel is drawn. The
540incoming alpha value is compared to REF using the function specified by
541FUNC. If the value passes the comparison, the incoming fragment is drawn
542if it also passes subsequent stencil and depth buffer tests. If the
543value fails the comparison, no change is made to the frame buffer at
544that pixel location. The comparison functions are as follows:
545
546`GL_NEVER'
547 Never passes.
548
549`GL_LESS'
550 Passes if the incoming alpha value is less than the reference
551 value.
552
553`GL_EQUAL'
554 Passes if the incoming alpha value is equal to the reference value.
555
556`GL_LEQUAL'
557 Passes if the incoming alpha value is less than or equal to the
558 reference value.
559
560`GL_GREATER'
561 Passes if the incoming alpha value is greater than the reference
562 value.
563
564`GL_NOTEQUAL'
565 Passes if the incoming alpha value is not equal to the reference
566 value.
567
568`GL_GEQUAL'
569 Passes if the incoming alpha value is greater than or equal to the
570 reference value.
571
572`GL_ALWAYS'
573 Always passes (initial value).
574
575`glAlphaFunc' operates on all pixel write operations, including those
576resulting from the scan conversion of points, lines, polygons, and
577bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
578affect screen clear operations.
579
580`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
581
582`GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
583the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 584
25072f02 585(define-gl-procedures
bb894c9d
AW
586 ((glAreTexturesResident
587 (n GLsizei)
00239761
AW
588 (textures const-GLuint-*)
589 (residences GLboolean-*)
bb894c9d
AW
590 ->
591 GLboolean))
3c9b6116
AW
592 "Determine if textures are loaded in texture memory.
593
594N
595 Specifies the number of textures to be queried.
596
597TEXTURES
598 Specifies an array containing the names of the textures to be
599 queried.
600
601RESIDENCES
602 Specifies an array in which the texture residence status is
603 returned. The residence status of a texture named by an element of
604 TEXTURES is returned in the corresponding element of RESIDENCES.
605
606GL establishes a ``working set'' of textures that are resident in
607texture memory. These textures can be bound to a texture target much
608more efficiently than textures that are not resident.
609
610`glAreTexturesResident' queries the texture residence status of the N
611textures named by the elements of TEXTURES. If all the named textures
612are resident, `glAreTexturesResident' returns `GL_TRUE', and the
613contents of RESIDENCES are undisturbed. If not all the named textures
614are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
615status is returned in the N elements of RESIDENCES. If an element of
616RESIDENCES is `GL_TRUE', then the texture named by the corresponding
617element of TEXTURES is resident.
618
619The residence status of a single bound texture may also be queried by
620calling `glGetTexParameter' with the TARGET argument set to the target
621to which the texture is bound, and the PNAME argument set to
622`GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
623a default texture can be queried.
624
625`GL_INVALID_VALUE' is generated if N is negative.
626
627`GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
628not name a texture. In that case, the function returns `GL_FALSE' and
629the contents of RESIDENCES is indeterminate.
630
631`GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
632executed between the execution of `glBegin' and the corresponding
633execution of `glEnd'.")
8925f36f 634
25072f02 635(define-gl-procedures
bb894c9d 636 ((glArrayElement (i GLint) -> void))
3c9b6116
AW
637 "Render a vertex using the specified vertex array element.
638
639I
640 Specifies an index into the enabled vertex data arrays.
641
642`glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
643specify vertex and attribute data for point, line, and polygon
644primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
645called, a single vertex is drawn, using vertex and attribute data taken
646from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
647enabled, no drawing occurs but the attributes corresponding to the
648enabled arrays are modified.
649
650Use `glArrayElement' to construct primitives by indexing vertex data,
651rather than by streaming through arrays of data in first-to-last order.
652Because each call specifies only a single vertex, it is possible to
653explicitly specify per-primitive attributes such as a single normal for
654each triangle.
655
656Changes made to array data between the execution of `glBegin' and the
657corresponding execution of `glEnd' may affect calls to `glArrayElement'
658that are made within the same `glBegin'/`glEnd' period in nonsequential
659ways. That is, a call to `glArrayElement' that precedes a change to
660array data may access the changed data, and a call that follows a change
661to array data may access original data.
662
663`GL_INVALID_VALUE' may be generated if I is negative.
664
665`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
666bound to an enabled array and the buffer object's data store is
667currently mapped.")
8925f36f 668
25072f02 669(define-gl-procedures
bb894c9d
AW
670 ((glAttachShader
671 (program GLuint)
672 (shader GLuint)
673 ->
674 void))
3c9b6116
AW
675 "Attaches a shader object to a program object.
676
677PROGRAM
678 Specifies the program object to which a shader object will be
679 attached.
680
681SHADER
682 Specifies the shader object that is to be attached.
683
684In order to create an executable, there must be a way to specify the
685list of things that will be linked together. Program objects provide
686this mechanism. Shaders that are to be linked together in a program
687object must first be attached to that program object. `glAttachShader'
688attaches the shader object specified by SHADER to the program object
689specified by PROGRAM. This indicates that SHADER will be included in
690link operations that will be performed on PROGRAM.
691
692All operations that can be performed on a shader object are valid
693whether or not the shader object is attached to a program object. It is
694permissible to attach a shader object to a program object before source
695code has been loaded into the shader object or before the shader object
696has been compiled. It is permissible to attach multiple shader objects
697of the same type because each may contain a portion of the complete
698shader. It is also permissible to attach a shader object to more than
699one program object. If a shader object is deleted while it is attached
700to a program object, it will be flagged for deletion, and deletion will
701not occur until `glDetachShader' is called to detach it from all program
702objects to which it is attached.
703
704`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
705value generated by OpenGL.
706
707`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
708
709`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
710
711`GL_INVALID_OPERATION' is generated if SHADER is already attached to
712PROGRAM.
713
714`GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
715between the execution of `glBegin' and the corresponding execution of
716`glEnd'.")
8925f36f 717
25072f02 718(define-gl-procedures
bb894c9d
AW
719 ((glBeginQuery
720 (target GLenum)
721 (id GLuint)
722 ->
723 void)
724 (glEndQuery (target GLenum) -> void))
3c9b6116
AW
725 "Delimit the boundaries of a query object.
726
727TARGET
728 Specifies the target type of query object established between
729 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
730 constant must be `GL_SAMPLES_PASSED'.
731
732ID
733 Specifies the name of a query object.
734
735`glBeginQuery' and `glEndQuery' delimit the boundaries of a query
736object. If a query object with name ID does not yet exist it is created.
737
738When `glBeginQuery' is executed, the query object's samples-passed
739counter is reset to 0. Subsequent rendering will increment the counter
740once for every sample that passes the depth test. When `glEndQuery' is
741executed, the samples-passed counter is assigned to the query object's
742result value. This value can be queried by calling `glGetQueryObject'
743with PNAME`GL_QUERY_RESULT'.
744
745Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
746the rendering delimited by the query object has completed and the result
747is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
748the result is immediately available or if the rendering is not yet
749complete.
750
751`GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
752
753`GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
754a query object of the same TARGET is already active.
755
756`GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
757query object of the same TARGET is not active.
758
759`GL_INVALID_OPERATION' is generated if ID is 0.
760
761`GL_INVALID_OPERATION' is generated if ID is the name of an already
762active query object.
763
764`GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
765executed between the execution of `glBegin' and the corresponding
766execution of `glEnd'.")
8925f36f 767
25072f02 768(define-gl-procedures
bb894c9d 769 ((glBegin (mode GLenum) -> void) (glEnd -> void))
3c9b6116
AW
770 "Delimit the vertices of a primitive or a group of like primitives.
771
772MODE
773 Specifies the primitive or primitives that will be created from
774 vertices presented between `glBegin' and the subsequent `glEnd'.
775 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
776 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
777 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
778 `GL_QUAD_STRIP', and `GL_POLYGON'.
779
780`glBegin' and `glEnd' delimit the vertices that define a primitive or a
781group of like primitives. `glBegin' accepts a single argument that
782specifies in which of ten ways the vertices are interpreted. Taking N as
783an integer count starting at one, and N as the total number of vertices
784specified, the interpretations are as follows:
785
786`GL_POINTS'
787 Treats each vertex as a single point. Vertex N defines point N . N
788 points are drawn.
789
790`GL_LINES'
791 Treats each pair of vertices as an independent line segment.
792 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
793
794`GL_LINE_STRIP'
795 Draws a connected group of line segments from the first vertex to
796 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
797
798`GL_LINE_LOOP'
799 Draws a connected group of line segments from the first vertex to
800 the last, then back to the first. Vertices N and N+1 define line N
801 . The last line, however, is defined by vertices N and 1 . N lines
802 are drawn.
803
804`GL_TRIANGLES'
805 Treats each triplet of vertices as an independent triangle.
806 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
807 are drawn.
808
809`GL_TRIANGLE_STRIP'
810 Draws a connected group of triangles. One triangle is defined for
811 each vertex presented after the first two vertices. For odd N ,
812 vertices N , N+1 , and N+2 define triangle N . For even N ,
813 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
814 drawn.
815
816`GL_TRIANGLE_FAN'
817 Draws a connected group of triangles. One triangle is defined for
818 each vertex presented after the first two vertices. Vertices 1 ,
819 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
820
821`GL_QUADS'
822 Treats each group of four vertices as an independent quadrilateral.
823 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
824 N/4 quadrilaterals are drawn.
825
826`GL_QUAD_STRIP'
827 Draws a connected group of quadrilaterals. One quadrilateral is
828 defined for each pair of vertices presented after the first pair.
829 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
830 N/2-1 quadrilaterals are drawn. Note that the order in which
831 vertices are used to construct a quadrilateral from strip data is
832 different from that used with independent data.
833
834`GL_POLYGON'
835 Draws a single, convex polygon. Vertices 1 through N define this
836 polygon.
837
838Only a subset of GL commands can be used between `glBegin' and `glEnd'.
839The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
840`glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
841`glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
842`glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
843`glCallList' or `glCallLists' to execute display lists that include only
844the preceding commands. If any other GL command is executed between
845`glBegin' and `glEnd', the error flag is set and the command is ignored.
846
847Regardless of the value chosen for MODE, there is no limit to the number
848of vertices that can be defined between `glBegin' and `glEnd'. Lines,
849triangles, quadrilaterals, and polygons that are incompletely specified
850are not drawn. Incomplete specification results when either too few
851vertices are provided to specify even a single primitive or when an
852incorrect multiple of vertices is specified. The incomplete primitive is
853ignored; the rest are drawn.
854
855The minimum specification of vertices for each primitive is as follows:
8561 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
857and 3 for a polygon. Modes that require a certain multiple of vertices
858are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
859`GL_QUAD_STRIP' (2).
860
861`GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
862
863`GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
864`glBegin' and the corresponding execution of `glEnd'.
865
866`GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
867preceded by a `glBegin'.
868
869`GL_INVALID_OPERATION' is generated if a command other than `glVertex',
870`glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
871`glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
872`glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
873`glCallList', or `glCallLists' is executed between the execution of
874`glBegin' and the corresponding execution `glEnd'.
875
876Execution of `glEnableClientState', `glDisableClientState',
877`glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
878`glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
879`glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
880`glInterleavedArrays', or `glPixelStore' is not allowed after a call to
881`glBegin' and before the corresponding call to `glEnd', but an error may
882or may not be generated.")
8925f36f 883
25072f02 884(define-gl-procedures
bb894c9d
AW
885 ((glBindAttribLocation
886 (program GLuint)
887 (index GLuint)
00239761 888 (name const-GLchar-*)
bb894c9d
AW
889 ->
890 void))
3c9b6116
AW
891 "Associates a generic vertex attribute index with a named attribute
892variable.
893
894PROGRAM
895 Specifies the handle of the program object in which the association
896 is to be made.
897
898INDEX
899 Specifies the index of the generic vertex attribute to be bound.
900
901NAME
902 Specifies a null terminated string containing the name of the
903 vertex shader attribute variable to which INDEX is to be bound.
904
905`glBindAttribLocation' is used to associate a user-defined attribute
906variable in the program object specified by PROGRAM with a generic
907vertex attribute index. The name of the user-defined attribute variable
908is passed as a null terminated string in NAME. The generic vertex
909attribute index to be bound to this variable is specified by INDEX. When
910PROGRAM is made part of current state, values provided via the generic
911vertex attribute INDEX will modify the value of the user-defined
912attribute variable specified by NAME.
913
914If NAME refers to a matrix attribute variable, INDEX refers to the first
915column of the matrix. Other matrix columns are then automatically bound
916to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
917a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
918type mat4.
919
920This command makes it possible for vertex shaders to use descriptive
921names for attribute variables rather than generic variables that are
922numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
923generic attribute index are part of current state, just like standard
924vertex attributes such as color, normal, and vertex position. If a
925different program object is made current by calling `glUseProgram', the
926generic vertex attributes are tracked in such a way that the same values
927will be observed by attributes in the new program object that are also
928bound to INDEX.
929
930Attribute variable name-to-generic attribute index bindings for a
931program object can be explicitly assigned at any time by calling
932`glBindAttribLocation'. Attribute bindings do not go into effect until
933`glLinkProgram' is called. After a program object has been linked
934successfully, the index values for generic attributes remain fixed (and
935their values can be queried) until the next link command occurs.
936
937Applications are not allowed to bind any of the standard OpenGL vertex
938attributes using this command, as they are bound automatically when
939needed. Any attribute binding that occurs after the program object has
940been linked will not take effect until the next time the program object
941is linked.
942
943`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
944`GL_MAX_VERTEX_ATTRIBS'.
945
946`GL_INVALID_OPERATION' is generated if NAME starts with the reserved
947prefix \"gl_\".
948
949`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
950OpenGL.
951
952`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
953
954`GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
955executed between the execution of `glBegin' and the corresponding
956execution of `glEnd'.")
8925f36f 957
25072f02 958(define-gl-procedures
bb894c9d
AW
959 ((glBindBuffer
960 (target GLenum)
961 (buffer GLuint)
962 ->
963 void))
3c9b6116
AW
964 "Bind a named buffer object.
965
966TARGET
967 Specifies the target to which the buffer object is bound. The
968 symbolic constant must be `GL_ARRAY_BUFFER',
969 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
970 `GL_PIXEL_UNPACK_BUFFER'.
971
972BUFFER
973 Specifies the name of a buffer object.
974
975`glBindBuffer' lets you create or use a named buffer object. Calling
976`glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
977`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
978`GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
979object binds the buffer object name to the target. When a buffer object
980is bound to a target, the previous binding for that target is
981automatically broken.
982
983Buffer object names are unsigned integers. The value zero is reserved,
984but there is no default buffer object for each buffer object target.
985Instead, BUFFER set to zero effectively unbinds any buffer object
986previously bound, and restores client memory usage for that buffer
987object target. Buffer object names and the corresponding buffer object
988contents are local to the shared display-list space (see
989`glXCreateContext') of the current GL rendering context; two rendering
990contexts share buffer object names only if they also share display
991lists.
992
993You may use `glGenBuffers' to generate a set of new buffer object names.
994
995The state of a buffer object immediately after it is first bound is an
996unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
997`GL_STATIC_DRAW' usage.
998
999While a non-zero buffer object name is bound, GL operations on the
1000target to which it is bound affect the bound buffer object, and queries
1001of the target to which it is bound return state from the bound buffer
1002object. While buffer object name zero is bound, as in the initial state,
1003attempts to modify or query state on the target to which it is bound
1004generates an `GL_INVALID_OPERATION' error.
1005
1006When vertex array pointer state is changed, for example by a call to
1007`glNormalPointer', the current buffer object binding
1008(`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
1009state for the vertex array type being changed, for example
1010`GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
1011bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
1012parameter that is traditionally interpreted as a pointer to client-side
1013memory is instead interpreted as an offset within the buffer object
1014measured in basic machine units.
1015
1016While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
1017target, the indices parameter of `glDrawElements',
1018`glDrawRangeElements', or `glMultiDrawElements' that is traditionally
1019interpreted as a pointer to client-side memory is instead interpreted as
1020an offset within the buffer object measured in basic machine units.
1021
1022While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
1023target, the following commands are affected: `glGetCompressedTexImage',
1024`glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
1025`glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
1026`glGetTexImage', and `glReadPixels'. The pointer parameter that is
1027traditionally interpreted as a pointer to client-side memory where the
1028pixels are to be packed is instead interpreted as an offset within the
1029buffer object measured in basic machine units.
1030
1031While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
1032target, the following commands are affected: `glBitmap',
1033`glColorSubTable', `glColorTable', `glCompressedTexImage1D',
1034`glCompressedTexImage2D', `glCompressedTexImage3D',
1035`glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
1036`glCompressedTexSubImage3D', `glConvolutionFilter1D',
1037`glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
1038`glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
1039`glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
1040and `glTexSubImage3D'. The pointer parameter that is traditionally
1041interpreted as a pointer to client-side memory from which the pixels are
1042to be unpacked is instead interpreted as an offset within the buffer
1043object measured in basic machine units.
1044
1045A buffer object binding created with `glBindBuffer' remains active until
1046a different buffer object name is bound to the same target, or until the
1047bound buffer object is deleted with `glDeleteBuffers'.
1048
1049Once created, a named buffer object may be re-bound to any target as
1050often as needed. However, the GL implementation may make choices about
1051how to optimize the storage of a buffer object based on its initial
1052binding target.
1053
1054`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1055values.
1056
1057`GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
1058between the execution of `glBegin' and the corresponding execution of
1059`glEnd'.")
8925f36f 1060
25072f02 1061(define-gl-procedures
bb894c9d
AW
1062 ((glBindTexture
1063 (target GLenum)
1064 (texture GLuint)
1065 ->
1066 void))
3c9b6116
AW
1067 "Bind a named texture to a texturing target.
1068
1069TARGET
1070 Specifies the target to which the texture is bound. Must be either
1071 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1072 `GL_TEXTURE_CUBE_MAP'.
1073
1074TEXTURE
1075 Specifies the name of a texture.
1076
1077`glBindTexture' lets you create or use a named texture. Calling
1078`glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1079`GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1080the new texture binds the texture name to the target. When a texture is
1081bound to a target, the previous binding for that target is automatically
1082broken.
1083
8925f36f 1084Texture names are unsigned integers. The value zero is reserved to
3c9b6116
AW
1085represent the default texture for each texture target. Texture names and
1086the corresponding texture contents are local to the shared display-list
1087space (see `glXCreateContext') of the current GL rendering context; two
1088rendering contexts share texture names only if they also share display
1089lists.
1090
1091You may use `glGenTextures' to generate a set of new texture names.
1092
1093When a texture is first bound, it assumes the specified target: A
1094texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1095a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1096texture, a texture first bound to `GL_TEXTURE_3D' becomes
1097three-dimensional texture, and a texture first bound to
1098`GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1099one-dimensional texture immediately after it is first bound is
1100equivalent to the state of the default `GL_TEXTURE_1D' at GL
1101initialization, and similarly for two- and three-dimensional textures
1102and cube-mapped textures.
1103
8925f36f 1104While a texture is bound, GL operations on the target to which it is
3c9b6116
AW
1105bound affect the bound texture, and queries of the target to which it is
1106bound return state from the bound texture. If texture mapping is active
1107on the target to which a texture is bound, the bound texture is used. In
1108effect, the texture targets become aliases for the textures currently
1109bound to them, and the texture name zero refers to the default textures
1110that were bound to them at initialization.
1111
1112A texture binding created with `glBindTexture' remains active until a
1113different texture is bound to the same target, or until the bound
1114texture is deleted with `glDeleteTextures'.
1115
1116Once created, a named texture may be re-bound to its same original
1117target as often as needed. It is usually much faster to use
1118`glBindTexture' to bind an existing named texture to one of the texture
1119targets than it is to reload the texture image using `glTexImage1D',
1120`glTexImage2D', or `glTexImage3D'. For additional control over
1121performance, use `glPrioritizeTextures'.
1122
1123`glBindTexture' is included in display lists.
1124
1125`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1126values.
1127
1128`GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1129with a target that doesn't match that of TARGET.
1130
1131`GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1132between the execution of `glBegin' and the corresponding execution of
1133`glEnd'.")
8925f36f 1134
25072f02 1135(define-gl-procedures
bb894c9d
AW
1136 ((glBitmap
1137 (width GLsizei)
1138 (height GLsizei)
1139 (xorig GLfloat)
1140 (yorig GLfloat)
1141 (xmove GLfloat)
1142 (ymove GLfloat)
00239761 1143 (bitmap const-GLubyte-*)
bb894c9d
AW
1144 ->
1145 void))
3c9b6116
AW
1146 "Draw a bitmap.
1147
1148WIDTH
1149 HEIGHT
1150
1151 Specify the pixel width and height of the bitmap image.
1152
1153XORIG
1154 YORIG
1155
1156 Specify the location of the origin in the bitmap image. The origin
1157 is measured from the lower left corner of the bitmap, with right
1158 and up being the positive axes.
1159
1160XMOVE
1161 YMOVE
1162
1163 Specify the X and Y offsets to be added to the current raster
1164 position after the bitmap is drawn.
1165
1166BITMAP
1167 Specifies the address of the bitmap image.
1168
1169A bitmap is a binary image. When drawn, the bitmap is positioned
1170relative to the current raster position, and frame buffer pixels
1171corresponding to 1's in the bitmap are written using the current raster
1172color or index. Frame buffer pixels corresponding to 0's in the bitmap
1173are not modified.
1174
1175`glBitmap' takes seven arguments. The first pair specifies the width and
1176height of the bitmap image. The second pair specifies the location of
1177the bitmap origin relative to the lower left corner of the bitmap image.
1178The third pair of arguments specifies X and Y offsets to be added to the
1179current raster position after the bitmap has been drawn. The final
1180argument is a pointer to the bitmap image itself.
1181
1182If a non-zero named buffer object is bound to the
1183`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1184image is specified, BITMAP is treated as a byte offset into the buffer
1185object's data store.
1186
1187The bitmap image is interpreted like image data for the `glDrawPixels'
1188command, with WIDTH and HEIGHT corresponding to the width and height
1189arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1190set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1191interpretation of bitmap image data; modes specified using
1192`glPixelTransfer' do not.
1193
1194If the current raster position is invalid, `glBitmap' is ignored.
1195Otherwise, the lower left corner of the bitmap image is positioned at
1196the window coordinates
1197
1198X_W=⌊X_R-X_O,⌋
1199
1200Y_W=⌊Y_R-Y_O,⌋
1201
1202where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1203origin. Fragments are then generated for each pixel corresponding to a 1
1204(one) in the bitmap image. These fragments are generated using the
1205current raster Z coordinate, color or color index, and current raster
1206texture coordinates. They are then treated just as if they had been
1207generated by a point, line, or polygon, including texture mapping,
1208fogging, and all per-fragment operations such as alpha and depth
1209testing.
1210
1211After the bitmap has been drawn, the X and Y coordinates of the current
1212raster position are offset by XMOVE and YMOVE. No change is made to the
1213Z coordinate of the current raster position, or to the current raster
1214color, texture coordinates, or index.
1215
1216`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1217
1218`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1219bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1220data store is currently mapped.
1221
1222`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1223bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1224unpacked from the buffer object such that the memory reads required
1225would exceed the data store size.
1226
1227`GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1228the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 1229
25072f02 1230(define-gl-procedures
bb894c9d
AW
1231 ((glBlendColor
1232 (red GLclampf)
1233 (green GLclampf)
1234 (blue GLclampf)
1235 (alpha GLclampf)
1236 ->
1237 void))
3c9b6116
AW
1238 "Set the blend color.
1239
1240RED
1241 GREEN
1242
1243 BLUE
1244
1245 ALPHA
1246
1247 specify the components of `GL_BLEND_COLOR'
1248
1249The `GL_BLEND_COLOR' may be used to calculate the source and destination
1250blending factors. The color components are clamped to the range [0,1]
1251before being stored. See `glBlendFunc' for a complete description of the
1252blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
12530).
1254
1255`GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1256between the execution of `glBegin' and the corresponding execution of
1257`glEnd'.")
8925f36f 1258
25072f02 1259(define-gl-procedures
bb894c9d
AW
1260 ((glBlendEquationSeparate
1261 (modeRGB GLenum)
1262 (modeAlpha GLenum)
1263 ->
1264 void))
3c9b6116
AW
1265 "Set the RGB blend equation and the alpha blend equation separately.
1266
1267MODERGB
1268 specifies the RGB blend equation, how the red, green, and blue
1269 components of the source and destination colors are combined. It
1270 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1271 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1272
1273MODEALPHA
1274 specifies the alpha blend equation, how the alpha component of the
1275 source and destination colors are combined. It must be
1276 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1277 `GL_MIN', `GL_MAX'.
1278
1279The blend equations determines how a new pixel (the ''source'' color) is
1280combined with a pixel already in the framebuffer (the ''destination''
1281color). This function specifies one blend equation for the RGB-color
1282components and one blend equation for the alpha component.
1283
8925f36f 1284The blend equations use the source and destination blend factors
3c9b6116
AW
1285specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1286`glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1287blend factors.
1288
1289In the equations that follow, source and destination color components
1290are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1291The result color is referred to as (R_R,G_RB_RA_R) . The source and
1292destination blend factors are denoted (S_R,S_GS_BS_A) and
1293(D_R,D_GD_BD_A) , respectively. For these equations all color components
1294are understood to have values in the range [0,1] .
1295
1296*Mode*
1297 *RGB Components*, *Alpha Component*
1298
1299`GL_FUNC_ADD'
1300 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 ,
1301 AR=A_S\u2062S_A+A_D\u2062D_A
1302
1303`GL_FUNC_SUBTRACT'
1304 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 ,
1305 AR=A_S\u2062S_A-A_D\u2062D_A
1306
1307`GL_FUNC_REVERSE_SUBTRACT'
1308 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 ,
1309 AR=A_D\u2062D_A-A_S\u2062S_A
1310
1311`GL_MIN'
1312 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1313 AR=MIN\u2061(A_S,A_D)
1314
1315`GL_MAX'
1316 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1317 AR=MAX\u2061(A_S,A_D)
1318
1319The results of these equations are clamped to the range [0,1] .
1320
1321The `GL_MIN' and `GL_MAX' equations are useful for applications that
1322analyze image data (image thresholding against a constant color, for
1323example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1324transparency, among other things.
1325
1326Initially, both the RGB blend equation and the alpha blend equation are
1327set to `GL_FUNC_ADD'.
1328
1329
1330
1331`GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1332of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1333`GL_MAX', or `GL_MIN'.
1334
1335`GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1336executed between the execution of `glBegin' and the corresponding
1337execution of `glEnd'.")
8925f36f 1338
25072f02 1339(define-gl-procedures
bb894c9d 1340 ((glBlendEquation (mode GLenum) -> void))
3c9b6116
AW
1341 "Specify the equation used for both the RGB blend equation and the Alpha
1342blend equation.
1343
1344MODE
1345 specifies how source and destination colors are combined. It must
1346 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1347 `GL_MIN', `GL_MAX'.
1348
1349The blend equations determine how a new pixel (the ''source'' color) is
1350combined with a pixel already in the framebuffer (the ''destination''
1351color). This function sets both the RGB blend equation and the alpha
1352blend equation to a single equation.
1353
1354These equations use the source and destination blend factors specified
1355by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1356`glBlendFuncSeparate' for a description of the various blend factors.
1357
1358In the equations that follow, source and destination color components
1359are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1360The result color is referred to as (R_R,G_RB_RA_R) . The source and
1361destination blend factors are denoted (S_R,S_GS_BS_A) and
1362(D_R,D_GD_BD_A) , respectively. For these equations all color components
1363are understood to have values in the range [0,1] .
1364
1365*Mode*
1366 *RGB Components*, *Alpha Component*
1367
1368`GL_FUNC_ADD'
1369 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 ,
1370 AR=A_S\u2062S_A+A_D\u2062D_A
1371
1372`GL_FUNC_SUBTRACT'
1373 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 ,
1374 AR=A_S\u2062S_A-A_D\u2062D_A
1375
1376`GL_FUNC_REVERSE_SUBTRACT'
1377 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 ,
1378 AR=A_D\u2062D_A-A_S\u2062S_A
1379
1380`GL_MIN'
1381 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1382 AR=MIN\u2061(A_S,A_D)
1383
1384`GL_MAX'
1385 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1386 AR=MAX\u2061(A_S,A_D)
1387
1388The results of these equations are clamped to the range [0,1] .
1389
1390The `GL_MIN' and `GL_MAX' equations are useful for applications that
1391analyze image data (image thresholding against a constant color, for
1392example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1393transparency, among other things.
1394
1395Initially, both the RGB blend equation and the alpha blend equation are
1396set to `GL_FUNC_ADD'.
1397
1398
1399
1400`GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1401`GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1402
1403`GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1404between the execution of `glBegin' and the corresponding execution of
1405`glEnd'.")
8925f36f 1406
25072f02 1407(define-gl-procedures
bb894c9d
AW
1408 ((glBlendFuncSeparate
1409 (srcRGB GLenum)
1410 (dstRGB GLenum)
1411 (srcAlpha GLenum)
1412 (dstAlpha GLenum)
1413 ->
1414 void))
3c9b6116
AW
1415 "Specify pixel arithmetic for RGB and alpha components separately.
1416
1417SRCRGB
1418 Specifies how the red, green, and blue blending factors are
1419 computed. The following symbolic constants are accepted: `GL_ZERO',
1420 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1421 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1422 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1423 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1424 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1425 initial value is `GL_ONE'.
1426
1427DSTRGB
1428 Specifies how the red, green, and blue destination blending factors
1429 are computed. The following symbolic constants are accepted:
1430 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1431 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1432 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1433 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1434 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1435 value is `GL_ZERO'.
1436
1437SRCALPHA
1438 Specified how the alpha source blending factor is computed. The
1439 same symbolic constants are accepted as for SRCRGB. The initial
1440 value is `GL_ONE'.
1441
1442DSTALPHA
1443 Specified how the alpha destination blending factor is computed.
1444 The same symbolic constants are accepted as for DSTRGB. The initial
1445 value is `GL_ZERO'.
1446
1447In RGBA mode, pixels can be drawn using a function that blends the
1448incoming (source) RGBA values with the RGBA values that are already in
1449the frame buffer (the destination values). Blending is initially
1450disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1451enable and disable blending.
1452
1453`glBlendFuncSeparate' defines the operation of blending when it is
1454enabled. SRCRGB specifies which method is used to scale the source
1455RGB-color components. DSTRGB specifies which method is used to scale the
1456destination RGB-color components. Likewise, SRCALPHA specifies which
1457method is used to scale the source alpha color component, and DSTALPHA
1458specifies which method is used to scale the destination alpha component.
1459The possible methods are described in the following table. Each method
1460defines four scale factors, one each for red, green, blue, and alpha.
1461
1462In the table and in subsequent equations, source and destination color
1463components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1464color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1465They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1466, where
1467
1468K_C=2^M_C,-1
1469
1470and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1471bitplanes.
1472
1473Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1474and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1475
1476
1477
1478*Parameter*
1479 *RGB Factor*, *Alpha Factor*
1480
1481`GL_ZERO'
1482 (0,00) , 0
1483
1484`GL_ONE'
1485 (1,11) , 1
1486
1487`GL_SRC_COLOR'
1488 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1489
1490`GL_ONE_MINUS_SRC_COLOR'
1491 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1492
1493`GL_DST_COLOR'
1494 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1495
1496`GL_ONE_MINUS_DST_COLOR'
1497 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1498
1499`GL_SRC_ALPHA'
1500 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1501
1502`GL_ONE_MINUS_SRC_ALPHA'
1503 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1504
1505`GL_DST_ALPHA'
1506 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1507
1508`GL_ONE_MINUS_DST_ALPHA'
1509 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1510
1511`GL_CONSTANT_COLOR'
1512 (R_C,G_CB_C) , A_C
1513
1514`GL_ONE_MINUS_CONSTANT_COLOR'
1515 (1,11)-(R_C,G_CB_C) , 1-A_C
1516
1517`GL_CONSTANT_ALPHA'
1518 (A_C,A_CA_C) , A_C
1519
1520`GL_ONE_MINUS_CONSTANT_ALPHA'
1521 (1,11)-(A_C,A_CA_C) , 1-A_C
1522
1523`GL_SRC_ALPHA_SATURATE'
1524 (I,II) , 1
1525
1526In the table,
1527
1528I=MIN\u2061(A_S,1-A_D,)
1529
1530To determine the blended RGBA values of a pixel when drawing in RGBA
1531mode, the system uses the following equations:
1532
1533R_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)
1534B_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)
1535
1536Despite the apparent precision of the above equations, blending
1537arithmetic is not exactly specified, because blending operates with
1538imprecise integer color values. However, a blend factor that should be
1539equal to 1 is guaranteed not to modify its multiplicand, and a blend
1540factor equal to 0 reduces its multiplicand to 0. For example, when
1541SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1542equal to K_A , the equations reduce to simple replacement:
1543
1544R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1545
1546
1547
1548`GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1549accepted value.
1550
1551`GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1552between the execution of `glBegin' and the corresponding execution of
1553`glEnd'.")
8925f36f 1554
25072f02 1555(define-gl-procedures
bb894c9d
AW
1556 ((glBlendFunc
1557 (sfactor GLenum)
1558 (dfactor GLenum)
1559 ->
1560 void))
3c9b6116 1561 "Specify pixel arithmetic.
8925f36f 1562
3c9b6116
AW
1563SFACTOR
1564 Specifies how the red, green, blue, and alpha source blending
1565 factors are computed. The following symbolic constants are
1566 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1567 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1568 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1569 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1570 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1571 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1572 initial value is `GL_ONE'.
8925f36f 1573
3c9b6116
AW
1574DFACTOR
1575 Specifies how the red, green, blue, and alpha destination blending
1576 factors are computed. The following symbolic constants are
1577 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1578 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1579 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1580 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1581 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1582 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
8925f36f 1583
3c9b6116
AW
1584In RGBA mode, pixels can be drawn using a function that blends the
1585incoming (source) RGBA values with the RGBA values that are already in
1586the frame buffer (the destination values). Blending is initially
1587disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1588enable and disable blending.
1589
1590`glBlendFunc' defines the operation of blending when it is enabled.
1591SFACTOR specifies which method is used to scale the source color
1592components. DFACTOR specifies which method is used to scale the
1593destination color components. The possible methods are described in the
1594following table. Each method defines four scale factors, one each for
1595red, green, blue, and alpha. In the table and in subsequent equations,
1596source and destination color components are referred to as
1597(R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1598`glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1599to have integer values between 0 and (K_R,K_GK_BK_A) , where
1600
1601K_C=2^M_C,-1
1602
1603and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1604bitplanes.
1605
1606Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1607and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1608(F_R,F_GF_BF_A) , represent either source or destination factors. All
1609scale factors have range [0,1] .
1610
1611
1612
1613*Parameter*
1614 * (F_R,F_GF_BF_A) *
1615
1616`GL_ZERO'
1617 (0,000)
1618
1619`GL_ONE'
1620 (1,111)
1621
1622`GL_SRC_COLOR'
1623 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1624
1625`GL_ONE_MINUS_SRC_COLOR'
1626 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1627
1628`GL_DST_COLOR'
1629 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1630
1631`GL_ONE_MINUS_DST_COLOR'
1632 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1633
1634`GL_SRC_ALPHA'
1635 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1636
1637`GL_ONE_MINUS_SRC_ALPHA'
1638 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1639
1640`GL_DST_ALPHA'
1641 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1642
1643`GL_ONE_MINUS_DST_ALPHA'
1644 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1645
1646`GL_CONSTANT_COLOR'
1647 (R_C,G_CB_CA_C)
1648
1649`GL_ONE_MINUS_CONSTANT_COLOR'
1650 (1,111)-(R_C,G_CB_CA_C)
1651
1652`GL_CONSTANT_ALPHA'
1653 (A_C,A_CA_CA_C)
1654
1655`GL_ONE_MINUS_CONSTANT_ALPHA'
1656 (1,111)-(A_C,A_CA_CA_C)
1657
1658`GL_SRC_ALPHA_SATURATE'
1659 (I,II1)
1660
1661In the table,
1662
1663I=MIN\u2061(A_S,K_A-A_D)/K_A
1664
1665To determine the blended RGBA values of a pixel when drawing in RGBA
1666mode, the system uses the following equations:
1667
1668R_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)
1669B_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)
1670
1671Despite the apparent precision of the above equations, blending
1672arithmetic is not exactly specified, because blending operates with
1673imprecise integer color values. However, a blend factor that should be
1674equal to 1 is guaranteed not to modify its multiplicand, and a blend
1675factor equal to 0 reduces its multiplicand to 0. For example, when
1676SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1677is equal to K_A , the equations reduce to simple replacement:
1678
1679R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1680
1681
1682
1683`GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1684accepted value.
1685
1686`GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1687the execution of `glBegin' and the corresponding execution of `glEnd'.")
1688
25072f02 1689(define-gl-procedures
bb894c9d
AW
1690 ((glBufferData
1691 (target GLenum)
1692 (size GLsizeiptr)
00239761 1693 (data const-GLvoid-*)
bb894c9d
AW
1694 (usage GLenum)
1695 ->
1696 void))
3c9b6116
AW
1697 "Creates and initializes a buffer object's data store.
1698
1699TARGET
1700 Specifies the target buffer object. The symbolic constant must be
1701 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1702 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1703
1704SIZE
1705 Specifies the size in bytes of the buffer object's new data store.
1706
1707DATA
1708 Specifies a pointer to data that will be copied into the data store
1709 for initialization, or `NULL' if no data is to be copied.
1710
1711USAGE
1712 Specifies the expected usage pattern of the data store. The
1713 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1714 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1715 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1716 `GL_DYNAMIC_COPY'.
1717
1718`glBufferData' creates a new data store for the buffer object currently
1719bound to TARGET. Any pre-existing data store is deleted. The new data
1720store is created with the specified SIZE in bytes and USAGE. If DATA is
1721not `NULL', the data store is initialized with data from this pointer.
1722In its initial state, the new data store is not mapped, it has a `NULL'
1723mapped pointer, and its mapped access is `GL_READ_WRITE'.
1724
1725USAGE is a hint to the GL implementation as to how a buffer object's
1726data store will be accessed. This enables the GL implementation to make
1727more intelligent decisions that may significantly impact buffer object
1728performance. It does not, however, constrain the actual usage of the
1729data store. USAGE can be broken down into two parts: first, the
1730frequency of access (modification and usage), and second, the nature of
1731that access. The frequency of access may be one of these:
1732
1733STREAM
1734 The data store contents will be modified once and used at most a
1735 few times.
1736
1737STATIC
1738 The data store contents will be modified once and used many times.
1739
1740DYNAMIC
1741 The data store contents will be modified repeatedly and used many
1742 times.
1743
1744The nature of access may be one of these:
1745
1746DRAW
1747 The data store contents are modified by the application, and used
1748 as the source for GL drawing and image specification commands.
1749
1750READ
1751 The data store contents are modified by reading data from the GL,
1752 and used to return that data when queried by the application.
1753
1754COPY
1755 The data store contents are modified by reading data from the GL,
1756 and used as the source for GL drawing and image specification
1757 commands.
1758
1759`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1760`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1761`GL_PIXEL_UNPACK_BUFFER'.
1762
1763`GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1764`GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1765`GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1766`GL_DYNAMIC_COPY'.
1767
1768`GL_INVALID_VALUE' is generated if SIZE is negative.
1769
1770`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1771is bound to TARGET.
1772
1773`GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
1774store with the specified SIZE.
1775
1776`GL_INVALID_OPERATION' is generated if `glBufferData' is executed
1777between the execution of `glBegin' and the corresponding execution of
1778`glEnd'.")
1779
25072f02 1780(define-gl-procedures
bb894c9d
AW
1781 ((glBufferSubData
1782 (target GLenum)
1783 (offset GLintptr)
1784 (size GLsizeiptr)
00239761 1785 (data const-GLvoid-*)
bb894c9d
AW
1786 ->
1787 void))
3c9b6116
AW
1788 "Updates a subset of a buffer object's data store.
1789
1790TARGET
1791 Specifies the target buffer object. The symbolic constant must be
1792 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1793 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1794
1795OFFSET
1796 Specifies the offset into the buffer object's data store where data
1797 replacement will begin, measured in bytes.
1798
1799SIZE
1800 Specifies the size in bytes of the data store region being
1801 replaced.
1802
1803DATA
1804 Specifies a pointer to the new data that will be copied into the
1805 data store.
1806
1807`glBufferSubData' redefines some or all of the data store for the buffer
1808object currently bound to TARGET. Data starting at byte offset OFFSET
1809and extending for SIZE bytes is copied to the data store from the memory
1810pointed to by DATA. An error is thrown if OFFSET and SIZE together
1811define a range beyond the bounds of the buffer object's data store.
1812
1813`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1814`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1815`GL_PIXEL_UNPACK_BUFFER'.
1816
1817`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
1818together they define a region of memory that extends beyond the buffer
1819object's allocated data store.
1820
1821`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
1822is bound to TARGET.
1823
1824`GL_INVALID_OPERATION' is generated if the buffer object being updated
1825is mapped.
1826
1827`GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
1828between the execution of `glBegin' and the corresponding execution of
1829`glEnd'.")
1830
25072f02 1831(define-gl-procedures
bb894c9d
AW
1832 ((glCallLists
1833 (n GLsizei)
1834 (type GLenum)
00239761 1835 (lists const-GLvoid-*)
bb894c9d
AW
1836 ->
1837 void))
3c9b6116
AW
1838 "Execute a list of display lists.
1839
1840N
1841 Specifies the number of display lists to be executed.
1842
1843TYPE
1844 Specifies the type of values in LISTS. Symbolic constants
1845 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
1846 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
1847 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
1848
1849LISTS
1850 Specifies the address of an array of name offsets in the display
1851 list. The pointer type is void because the offsets can be bytes,
1852 shorts, ints, or floats, depending on the value of TYPE.
1853
1854`glCallLists' causes each display list in the list of names passed as
1855LISTS to be executed. As a result, the commands saved in each display
1856list are executed in order, just as if they were called without using a
1857display list. Names of display lists that have not been defined are
1858ignored.
1859
1860`glCallLists' provides an efficient means for executing more than one
1861display list. TYPE allows lists with various name formats to be
1862accepted. The formats are as follows:
1863
1864`GL_BYTE'
1865 LISTS is treated as an array of signed bytes, each in the range
1866 -128 through 127.
1867
1868`GL_UNSIGNED_BYTE'
1869 LISTS is treated as an array of unsigned bytes, each in the range 0
1870 through 255.
1871
1872`GL_SHORT'
1873 LISTS is treated as an array of signed two-byte integers, each in
1874 the range -32768 through 32767.
1875
1876`GL_UNSIGNED_SHORT'
1877 LISTS is treated as an array of unsigned two-byte integers, each in
1878 the range 0 through 65535.
1879
1880`GL_INT'
1881 LISTS is treated as an array of signed four-byte integers.
1882
1883`GL_UNSIGNED_INT'
1884 LISTS is treated as an array of unsigned four-byte integers.
1885
1886`GL_FLOAT'
1887 LISTS is treated as an array of four-byte floating-point values.
1888
1889`GL_2_BYTES'
1890 LISTS is treated as an array of unsigned bytes. Each pair of bytes
1891 specifies a single display-list name. The value of the pair is
1892 computed as 256 times the unsigned value of the first byte plus the
1893 unsigned value of the second byte.
1894
1895`GL_3_BYTES'
1896 LISTS is treated as an array of unsigned bytes. Each triplet of
1897 bytes specifies a single display-list name. The value of the
1898 triplet is computed as 65536 times the unsigned value of the first
1899 byte, plus 256 times the unsigned value of the second byte, plus
1900 the unsigned value of the third byte.
1901
1902`GL_4_BYTES'
1903 LISTS is treated as an array of unsigned bytes. Each quadruplet of
1904 bytes specifies a single display-list name. The value of the
1905 quadruplet is computed as 16777216 times the unsigned value of the
1906 first byte, plus 65536 times the unsigned value of the second byte,
1907 plus 256 times the unsigned value of the third byte, plus the
1908 unsigned value of the fourth byte.
1909
1910The list of display-list names is not null-terminated. Rather, N
1911specifies how many names are to be taken from LISTS.
1912
1913An additional level of indirection is made available with the
1914`glListBase' command, which specifies an unsigned offset that is added
1915to each display-list name specified in LISTS before that display list is
1916executed.
1917
1918`glCallLists' can appear inside a display list. To avoid the possibility
1919of infinite recursion resulting from display lists calling one another,
1920a limit is placed on the nesting level of display lists during
1921display-list execution. This limit must be at least 64, and it depends
1922on the implementation.
1923
1924GL state is not saved and restored across a call to `glCallLists'. Thus,
1925changes made to GL state during the execution of the display lists
1926remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
1927`glPushMatrix', and `glPopMatrix' to preserve GL state across
1928`glCallLists' calls.
1929
1930`GL_INVALID_VALUE' is generated if N is negative.
1931
1932`GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
1933`GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
1934`GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
8925f36f 1935
25072f02 1936(define-gl-procedures
bb894c9d 1937 ((glCallList (list GLuint) -> void))
3c9b6116
AW
1938 "Execute a display list.
1939
1940LIST
1941 Specifies the integer name of the display list to be executed.
1942
1943`glCallList' causes the named display list to be executed. The commands
1944saved in the display list are executed in order, just as if they were
1945called without using a display list. If LIST has not been defined as a
1946display list, `glCallList' is ignored.
1947
1948`glCallList' can appear inside a display list. To avoid the possibility
1949of infinite recursion resulting from display lists calling one another,
1950a limit is placed on the nesting level of display lists during
1951display-list execution. This limit is at least 64, and it depends on the
1952implementation.
1953
1954GL state is not saved and restored across a call to `glCallList'. Thus,
1955changes made to GL state during the execution of a display list remain
1956after execution of the display list is completed. Use `glPushAttrib',
1957`glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
1958across `glCallList' calls.")
8925f36f 1959
25072f02 1960(define-gl-procedures
bb894c9d
AW
1961 ((glClearAccum
1962 (red GLfloat)
1963 (green GLfloat)
1964 (blue GLfloat)
1965 (alpha GLfloat)
1966 ->
1967 void))
3c9b6116
AW
1968 "Specify clear values for the accumulation buffer.
1969
1970RED
1971 GREEN
1972
1973 BLUE
1974
1975 ALPHA
1976
1977 Specify the red, green, blue, and alpha values used when the
1978 accumulation buffer is cleared. The initial values are all 0.
1979
1980`glClearAccum' specifies the red, green, blue, and alpha values used by
1981`glClear' to clear the accumulation buffer.
1982
1983Values specified by `glClearAccum' are clamped to the range [-1,1] .
1984
1985`GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
1986between the execution of `glBegin' and the corresponding execution of
1987`glEnd'.")
8925f36f 1988
25072f02 1989(define-gl-procedures
bb894c9d
AW
1990 ((glClearColor
1991 (red GLclampf)
1992 (green GLclampf)
1993 (blue GLclampf)
1994 (alpha GLclampf)
1995 ->
1996 void))
3c9b6116
AW
1997 "Specify clear values for the color buffers.
1998
1999RED
2000 GREEN
2001
2002 BLUE
2003
2004 ALPHA
2005
2006 Specify the red, green, blue, and alpha values used when the color
2007 buffers are cleared. The initial values are all 0.
2008
2009`glClearColor' specifies the red, green, blue, and alpha values used by
2010`glClear' to clear the color buffers. Values specified by `glClearColor'
2011are clamped to the range [0,1] .
2012
2013`GL_INVALID_OPERATION' is generated if `glClearColor' is executed
2014between the execution of `glBegin' and the corresponding execution of
2015`glEnd'.")
8925f36f 2016
25072f02 2017(define-gl-procedures
bb894c9d 2018 ((glClearDepth (depth GLclampd) -> void))
3c9b6116
AW
2019 "Specify the clear value for the depth buffer.
2020
2021DEPTH
2022 Specifies the depth value used when the depth buffer is cleared.
2023 The initial value is 1.
2024
2025`glClearDepth' specifies the depth value used by `glClear' to clear the
2026depth buffer. Values specified by `glClearDepth' are clamped to the
2027range [0,1] .
2028
2029`GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
2030between the execution of `glBegin' and the corresponding execution of
2031`glEnd'.")
8925f36f 2032
25072f02 2033(define-gl-procedures
bb894c9d 2034 ((glClearIndex (c GLfloat) -> void))
3c9b6116
AW
2035 "Specify the clear value for the color index buffers.
2036
2037C
2038 Specifies the index used when the color index buffers are cleared.
2039 The initial value is 0.
2040
2041`glClearIndex' specifies the index used by `glClear' to clear the color
2042index buffers. C is not clamped. Rather, C is converted to a fixed-point
2043value with unspecified precision to the right of the binary point. The
2044integer part of this value is then masked with 2^M-1 , where M is the
2045number of bits in a color index stored in the frame buffer.
2046
2047`GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
2048between the execution of `glBegin' and the corresponding execution of
2049`glEnd'.")
8925f36f 2050
25072f02 2051(define-gl-procedures
bb894c9d 2052 ((glClearStencil (s GLint) -> void))
3c9b6116
AW
2053 "Specify the clear value for the stencil buffer.
2054
2055S
2056 Specifies the index used when the stencil buffer is cleared. The
2057 initial value is 0.
2058
2059`glClearStencil' specifies the index used by `glClear' to clear the
2060stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2061in the stencil buffer.
2062
2063`GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2064between the execution of `glBegin' and the corresponding execution of
2065`glEnd'.")
8925f36f 2066
25072f02 2067(define-gl-procedures
bb894c9d 2068 ((glClear (mask GLbitfield) -> void))
3c9b6116
AW
2069 "Clear buffers to preset values.
2070
2071MASK
2072 Bitwise OR of masks that indicate the buffers to be cleared. The
2073 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2074 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2075
2076`glClear' sets the bitplane area of the window to values previously
2077selected by `glClearColor', `glClearIndex', `glClearDepth',
2078`glClearStencil', and `glClearAccum'. Multiple color buffers can be
2079cleared simultaneously by selecting more than one buffer at a time using
2080`glDrawBuffer'.
2081
2082The pixel ownership test, the scissor test, dithering, and the buffer
2083writemasks affect the operation of `glClear'. The scissor box bounds the
2084cleared region. Alpha function, blend function, logical operation,
2085stenciling, texture mapping, and depth-buffering are ignored by
2086`glClear'.
2087
2088`glClear' takes a single argument that is the bitwise OR of several
2089values indicating which buffer is to be cleared.
2090
2091The values are as follows:
2092
2093`GL_COLOR_BUFFER_BIT'
2094 Indicates the buffers currently enabled for color writing.
2095
2096`GL_DEPTH_BUFFER_BIT'
2097 Indicates the depth buffer.
2098
2099`GL_ACCUM_BUFFER_BIT'
2100 Indicates the accumulation buffer.
2101
2102`GL_STENCIL_BUFFER_BIT'
2103 Indicates the stencil buffer.
2104
8925f36f 2105The value to which each buffer is cleared depends on the setting of the
3c9b6116
AW
2106clear value for that buffer.
2107
2108`GL_INVALID_VALUE' is generated if any bit other than the four defined
2109bits is set in MASK.
2110
2111`GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2112execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2113
25072f02 2114(define-gl-procedures
bb894c9d 2115 ((glClientActiveTexture (texture GLenum) -> void))
3c9b6116
AW
2116 "Select active texture unit.
2117
2118TEXTURE
2119 Specifies which texture unit to make active. The number of texture
2120 units is implementation dependent, but must be at least two.
2121 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2122 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2123 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2124
2125`glClientActiveTexture' selects the vertex array client state parameters
2126to be modified by `glTexCoordPointer', and enabled or disabled with
2127`glEnableClientState' or `glDisableClientState', respectively, when
2128called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2129
2130`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2131where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
8925f36f 2132
25072f02 2133(define-gl-procedures
00239761
AW
2134 ((glClipPlane
2135 (plane GLenum)
2136 (equation const-GLdouble-*)
2137 ->
2138 void))
3c9b6116
AW
2139 "Specify a plane against which all geometry is clipped.
2140
2141PLANE
2142 Specifies which clipping plane is being positioned. Symbolic names
2143 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2144 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2145
2146EQUATION
2147 Specifies the address of an array of four double-precision
2148 floating-point values. These values are interpreted as a plane
2149 equation.
2150
8925f36f 2151Geometry is always clipped against the boundaries of a six-plane frustum
3c9b6116
AW
2152in X, Y, and Z. `glClipPlane' allows the specification of additional
2153planes, not necessarily perpendicular to the X, Y, or Z axis, against
2154which all geometry is clipped. To determine the maximum number of
2155additional clipping planes, call `glGetIntegerv' with argument
2156`GL_MAX_CLIP_PLANES'. All implementations support at least six such
2157clipping planes. Because the resulting clipping region is the
2158intersection of the defined half-spaces, it is always convex.
2159
2160`glClipPlane' specifies a half-space using a four-component plane
2161equation. When `glClipPlane' is called, EQUATION is transformed by the
2162inverse of the modelview matrix and stored in the resulting eye
2163coordinates. Subsequent changes to the modelview matrix have no effect
2164on the stored plane-equation components. If the dot product of the eye
2165coordinates of a vertex with the stored plane equation components is
2166positive or zero, the vertex is IN with respect to that clipping plane.
2167Otherwise, it is OUT.
2168
2169To enable and disable clipping planes, call `glEnable' and `glDisable'
2170with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2171
2172All clipping planes are initially defined as (0, 0, 0, 0) in eye
2173coordinates and are disabled.
2174
2175`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2176
2177`GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2178the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2179
25072f02 2180(define-gl-procedures
bb894c9d
AW
2181 ((glColorMask
2182 (red GLboolean)
2183 (green GLboolean)
2184 (blue GLboolean)
2185 (alpha GLboolean)
2186 ->
2187 void))
3c9b6116
AW
2188 "Enable and disable writing of frame buffer color components.
2189
2190RED
2191 GREEN
2192
2193 BLUE
2194
2195 ALPHA
2196
2197 Specify whether red, green, blue, and alpha can or cannot be
2198 written into the frame buffer. The initial values are all
2199 `GL_TRUE', indicating that the color components can be written.
2200
2201`glColorMask' specifies whether the individual color components in the
2202frame buffer can or cannot be written. If RED is `GL_FALSE', for
2203example, no change is made to the red component of any pixel in any of
2204the color buffers, regardless of the drawing operation attempted.
2205
2206Changes to individual bits of components cannot be controlled. Rather,
2207changes are either enabled or disabled for entire color components.
2208
2209`GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2210the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2211
25072f02 2212(define-gl-procedures
bb894c9d
AW
2213 ((glColorMaterial
2214 (face GLenum)
2215 (mode GLenum)
2216 ->
2217 void))
3c9b6116
AW
2218 "Cause a material color to track the current color.
2219
2220FACE
2221 Specifies whether front, back, or both front and back material
2222 parameters should track the current color. Accepted values are
2223 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2224 is `GL_FRONT_AND_BACK'.
2225
2226MODE
2227 Specifies which of several material parameters track the current
2228 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2229 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2230 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2231
2232`glColorMaterial' specifies which material parameters track the current
2233color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2234parameters specified by MODE, of the material or materials specified by
2235FACE, track the current color at all times.
2236
2237To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2238`glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2239initially disabled.
2240
2241`GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2242
2243`GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2244between the execution of `glBegin' and the corresponding execution of
2245`glEnd'.")
8925f36f 2246
25072f02 2247(define-gl-procedures
bb894c9d
AW
2248 ((glColorPointer
2249 (size GLint)
2250 (type GLenum)
2251 (stride GLsizei)
00239761 2252 (pointer const-GLvoid-*)
bb894c9d
AW
2253 ->
2254 void))
3c9b6116
AW
2255 "Define an array of colors.
2256
2257SIZE
2258 Specifies the number of components per color. Must be 3 or 4. The
2259 initial value is 4.
2260
2261TYPE
2262 Specifies the data type of each color component in the array.
2263 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2264 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2265 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2266
2267STRIDE
2268 Specifies the byte offset between consecutive colors. If STRIDE is
2269 0, the colors are understood to be tightly packed in the array. The
2270 initial value is 0.
2271
2272POINTER
2273 Specifies a pointer to the first component of the first color
2274 element in the array. The initial value is 0.
2275
2276`glColorPointer' specifies the location and data format of an array of
2277color components to use when rendering. SIZE specifies the number of
2278components per color, and must be 3 or 4. TYPE specifies the data type
2279of each color component, and STRIDE specifies the byte stride from one
2280color to the next, allowing vertices and attributes to be packed into a
2281single array or stored in separate arrays. (Single-array storage may be
2282more efficient on some implementations; see `glInterleavedArrays'.)
2283
2284If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2285target (see `glBindBuffer') while a color array is specified, POINTER is
2286treated as a byte offset into the buffer object's data store. Also, the
2287buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2288vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2289
2290When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2291saved as client-side state, in addition to the current vertex array
2292buffer object binding.
2293
2294To enable and disable the color array, call `glEnableClientState' and
2295`glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2296the color array is used when `glDrawArrays', `glMultiDrawArrays',
2297`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2298`glArrayElement' is called.
2299
2300`GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2301
2302`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2303
2304`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 2305
25072f02 2306(define-gl-procedures
bb894c9d
AW
2307 ((glColorSubTable
2308 (target GLenum)
2309 (start GLsizei)
2310 (count GLsizei)
2311 (format GLenum)
2312 (type GLenum)
00239761 2313 (data const-GLvoid-*)
bb894c9d
AW
2314 ->
2315 void))
3c9b6116
AW
2316 "Respecify a portion of a color table.
2317
2318TARGET
2319 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2320 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2321
2322START
2323 The starting index of the portion of the color table to be
2324 replaced.
2325
2326COUNT
2327 The number of table entries to replace.
2328
2329FORMAT
2330 The format of the pixel data in DATA. The allowable values are
2331 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2332 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2333
2334TYPE
2335 The type of the pixel data in DATA. The allowable values are
2336 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2337 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2338 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2339 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2340 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2341 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2342 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2343 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2344
2345DATA
2346 Pointer to a one-dimensional array of pixel data that is processed
2347 to replace the specified region of the color table.
2348
2349`glColorSubTable' is used to respecify a contiguous portion of a color
2350table previously defined using `glColorTable'. The pixels referenced by
2351DATA replace the portion of the existing table from indices START to
2352START+COUNT-1 , inclusive. This region may not include any entries
2353outside the range of the color table as it was originally specified. It
2354is not an error to specify a subtexture with width of 0, but such a
2355specification has no effect.
2356
2357If a non-zero named buffer object is bound to the
2358`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2359a color table is respecified, DATA is treated as a byte offset into the
2360buffer object's data store.
2361
2362`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2363values.
2364
2365`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2366values.
2367
2368`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2369values.
2370
2371`GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2372
2373`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2374bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2375data store is currently mapped.
2376
2377`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2378bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2379unpacked from the buffer object such that the memory reads required
2380would exceed the data store size.
2381
2382`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2383bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2384divisible into the number of bytes needed to store in memory a datum
2385indicated by TYPE.
2386
2387`GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2388between the execution of `glBegin' and the corresponding execution of
2389`glEnd'.")
8925f36f 2390
b002944d
AW
2391(define-gl-procedures
2392 ((glColorTableParameterfv
2393 (target GLenum)
2394 (pname GLenum)
2395 (params const-GLfloat-*)
2396 ->
2397 void)
2398 (glColorTableParameteriv
2399 (target GLenum)
2400 (pname GLenum)
2401 (params const-GLint-*)
2402 ->
2403 void))
2404 "Set color lookup table parameters.
2405
2406TARGET
2407 The target color table. Must be `GL_COLOR_TABLE',
2408 `GL_POST_CONVOLUTION_COLOR_TABLE', or
2409 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2410
2411PNAME
2412 The symbolic name of a texture color lookup table parameter. Must
2413 be one of `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS'.
2414
2415PARAMS
2416 A pointer to an array where the values of the parameters are
2417 stored.
2418
2419`glColorTableParameter' is used to specify the scale factors and bias
2420terms applied to color components when they are loaded into a color
2421table. TARGET indicates which color table the scale and bias terms apply
2422to; it must be set to `GL_COLOR_TABLE',
2423`GL_POST_CONVOLUTION_COLOR_TABLE', or
2424`GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2425
2426PNAME must be `GL_COLOR_TABLE_SCALE' to set the scale factors. In this
2427case, PARAMS points to an array of four values, which are the scale
2428factors for red, green, blue, and alpha, in that order.
2429
2430PNAME must be `GL_COLOR_TABLE_BIAS' to set the bias terms. In this case,
2431PARAMS points to an array of four values, which are the bias terms for
2432red, green, blue, and alpha, in that order.
2433
2434The color tables themselves are specified by calling `glColorTable'.
2435
2436`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
2437value.
2438
2439`GL_INVALID_OPERATION' is generated if `glColorTableParameter' is
2440executed between the execution of `glBegin' and the corresponding
2441execution of `glEnd'.")
2442
25072f02 2443(define-gl-procedures
bb894c9d
AW
2444 ((glColorTable
2445 (target GLenum)
2446 (internalformat GLenum)
2447 (width GLsizei)
2448 (format GLenum)
2449 (type GLenum)
00239761 2450 (data const-GLvoid-*)
bb894c9d
AW
2451 ->
2452 void))
3c9b6116 2453 "Define a color lookup table.
8925f36f 2454
3c9b6116
AW
2455TARGET
2456 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2457 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2458 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2459 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8925f36f 2460
3c9b6116
AW
2461INTERNALFORMAT
2462 The internal format of the color table. The allowable values are
2463 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2464 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2465 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2466 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2467 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2468 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2469 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2470 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2471 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2472 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
8925f36f 2473
3c9b6116
AW
2474WIDTH
2475 The number of entries in the color lookup table specified by DATA.
8925f36f 2476
3c9b6116
AW
2477FORMAT
2478 The format of the pixel data in DATA. The allowable values are
2479 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2480 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8925f36f 2481
3c9b6116
AW
2482TYPE
2483 The type of the pixel data in DATA. The allowable values are
2484 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2485 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2486 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2487 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2488 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2489 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2490 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2491 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2492
2493DATA
2494 Pointer to a one-dimensional array of pixel data that is processed
2495 to build the color table.
2496
2497`glColorTable' may be used in two ways: to test the actual size and
2498color resolution of a lookup table given a particular set of parameters,
2499or to load the contents of a color lookup table. Use the targets
2500`GL_PROXY_*' for the first case and the other targets for the second
2501case.
2502
2503If a non-zero named buffer object is bound to the
2504`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2505is specified, DATA is treated as a byte offset into the buffer object's
2506data store.
2507
2508If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2509`GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2510table from an array of pixels. The pixel array specified by WIDTH,
2511FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2512`glDrawPixels' were called, but processing stops after the final
2513expansion to RGBA is completed.
2514
2515The four scale parameters and the four bias parameters that are defined
2516for the table are then used to scale and bias the R, G, B, and A
2517components of each pixel. (Use `glColorTableParameter' to set these
2518scale and bias parameters.)
2519
2520Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2521pixel is then converted to the internal format specified by
2522INTERNALFORMAT. This conversion simply maps the component values of the
2523pixel (R, G, B, and A) to the values included in the internal format
2524(red, green, blue, alpha, luminance, and intensity). The mapping is as
2525follows:
2526
2527
2528
2529*Internal Format*
2530 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2531
2532`GL_ALPHA'
2533 , , , A , ,
2534
2535`GL_LUMINANCE'
2536 , , , , R ,
2537
2538`GL_LUMINANCE_ALPHA'
2539 , , , A , R ,
2540
2541`GL_INTENSITY'
2542 , , , , , R
2543
2544`GL_RGB'
2545 R , G , B , , ,
2546
2547`GL_RGBA'
2548 R , G , B , A , ,
2549
2550Finally, the red, green, blue, alpha, luminance, and/or intensity
2551components of the resulting pixels are stored in the color table. They
2552form a one-dimensional table with indices in the range [0,WIDTH-1] .
2553
2554If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2555values of the proxy color table's state variables
2556`GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2557`GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2558`GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2559`GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2560There is no effect on the image or state of any actual color table. If
2561the specified color table is too large to be supported, then all the
2562proxy state variables listed above are set to zero. Otherwise, the color
2563table could be supported by `glColorTable' using the corresponding
2564non-proxy target, and the proxy state variables are set as if that
2565target were being defined.
2566
2567The proxy state variables can be retrieved by calling
2568`glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2569the application to decide if a particular `glColorTable' command would
2570succeed, and to determine what the resulting color table attributes
2571would be.
2572
2573If a color table is enabled, and its width is non-zero, then its
2574contents are used to replace a subset of the components of each RGBA
2575pixel group, based on the internal format of the table.
2576
2577Each pixel group has color components (R, G, B, A) that are in the range
2578[0.0,1.0] . The color components are rescaled to the size of the color
2579lookup table to form an index. Then a subset of the components based on
2580the internal format of the table are replaced by the table entry
2581selected by that index. If the color components and contents of the
2582table are represented as follows:
2583
2584
2585
2586*Representation*
2587 *Meaning*
2588
2589`r'
2590 Table index computed from `R'
2591
2592`g'
2593 Table index computed from `G'
2594
2595`b'
2596 Table index computed from `B'
2597
2598`a'
2599 Table index computed from `A'
2600
2601`L[i]'
2602 Luminance value at table index `i'
2603
2604`I[i]'
2605 Intensity value at table index `i'
2606
2607`R[i]'
2608 Red value at table index `i'
2609
2610`G[i]'
2611 Green value at table index `i'
2612
2613`B[i]'
2614 Blue value at table index `i'
2615
2616`A[i]'
2617 Alpha value at table index `i'
2618
2619then the result of color table lookup is as follows:
2620
2621
2622
2623**
2624 *Resulting Texture Components*
2625
2626*Table Internal Format*
2627 *R*, *G*, *B*, *A*
2628
2629`GL_ALPHA'
2630 `R', `G', `B', `A[a]'
2631
2632`GL_LUMINANCE'
2633 `L[r]', `L[g]', `L[b]', `At'
2634
2635`GL_LUMINANCE_ALPHA'
2636 `L[r]', `L[g]', `L[b]', `A[a]'
2637
2638`GL_INTENSITY'
2639 `I[r]', `I[g]', `I[b]', `I[a]'
2640
2641`GL_RGB'
2642 `R[r]', `G[g]', `B[b]', `A'
2643
2644`GL_RGBA'
2645 `R[r]', `G[g]', `B[b]', `A[a]'
2646
2647When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2648map operation (if it is enabled) are mapped by the color lookup table
2649before being passed to the convolution operation. The colors resulting
2650from the convolution operation are modified by the post convolution
2651color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2652These modified colors are then sent to the color matrix operation.
2653Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2654resulting from the color matrix operation are mapped by the post color
2655matrix color lookup table before being used by the histogram operation.
2656
2657
2658
2659`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2660values.
2661
2662`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2663allowable values.
2664
2665`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2666values.
2667
2668`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2669values.
2670
2671`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2672
2673`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2674large to be supported by the implementation, and TARGET is not a
2675`GL_PROXY_*' target.
2676
2677`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2678bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2679data store is currently mapped.
2680
2681`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2682bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2683unpacked from the buffer object such that the memory reads required
2684would exceed the data store size.
2685
2686`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2687bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2688divisible into the number of bytes needed to store in memory a datum
2689indicated by TYPE.
2690
2691`GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2692between the execution of `glBegin' and the corresponding execution of
2693`glEnd'.")
2694
25072f02 2695(define-gl-procedures
bb894c9d
AW
2696 ((glColor3i
2697 (red GLint)
2698 (green GLint)
2699 (blue GLint)
2700 ->
2701 void)
ca09631c
AW
2702 (glColor3f
2703 (red GLfloat)
2704 (green GLfloat)
2705 (blue GLfloat)
bb894c9d
AW
2706 ->
2707 void)
2708 (glColor3ui
2709 (red GLuint)
2710 (green GLuint)
2711 (blue GLuint)
2712 ->
2713 void)
2714 (glColor4i
2715 (red GLint)
2716 (green GLint)
2717 (blue GLint)
2718 (alpha GLint)
2719 ->
2720 void)
ca09631c
AW
2721 (glColor4f
2722 (red GLfloat)
2723 (green GLfloat)
2724 (blue GLfloat)
2725 (alpha GLfloat)
bb894c9d
AW
2726 ->
2727 void)
2728 (glColor4ui
2729 (red GLuint)
2730 (green GLuint)
2731 (blue GLuint)
2732 (alpha GLuint)
2733 ->
2734 void))
3c9b6116
AW
2735 "Set the current color.
2736
2737RED
2738 GREEN
2739
2740 BLUE
2741
2742 Specify new red, green, and blue values for the current color.
2743
2744ALPHA
2745 Specifies a new alpha value for the current color. Included only in
2746 the four-argument `glColor4' commands.
2747
2748The GL stores both a current single-valued color index and a current
2749four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
2750`glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
2751variants specify new red, green, and blue values explicitly and set the
2752current alpha value to 1.0 (full intensity) implicitly. `glColor4'
2753variants specify all four color components explicitly.
2754
2755`glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
2756`glColor4i' take three or four signed byte, short, or long integers as
2757arguments. When *v* is appended to the name, the color commands can take
2758a pointer to an array of such values.
2759
2760Current color values are stored in floating-point format, with
2761unspecified mantissa and exponent sizes. Unsigned integer color
2762components, when specified, are linearly mapped to floating-point values
2763such that the largest representable value maps to 1.0 (full intensity),
2764and 0 maps to 0.0 (zero intensity). Signed integer color components,
2765when specified, are linearly mapped to floating-point values such that
2766the most positive representable value maps to 1.0, and the most negative
2767representable value maps to -1.0 . (Note that this mapping does not
2768convert 0 precisely to 0.0.) Floating-point values are mapped directly.
2769
2770Neither floating-point nor signed integer values are clamped to the
2771range [0,1] before the current color is updated. However, color
2772components are clamped to this range before they are interpolated or
2773written into a color buffer.")
2774
25072f02 2775(define-gl-procedures
bb894c9d 2776 ((glCompileShader (shader GLuint) -> void))
3c9b6116
AW
2777 "Compiles a shader object.
2778
2779SHADER
2780 Specifies the shader object to be compiled.
2781
2782`glCompileShader' compiles the source code strings that have been stored
2783in the shader object specified by SHADER.
2784
2785The compilation status will be stored as part of the shader object's
2786state. This value will be set to `GL_TRUE' if the shader was compiled
2787without errors and is ready for use, and `GL_FALSE' otherwise. It can be
2788queried by calling `glGetShader' with arguments SHADER and
2789`GL_COMPILE_STATUS'.
2790
2791Compilation of a shader can fail for a number of reasons as specified by
2792the OpenGL Shading Language Specification. Whether or not the
2793compilation was successful, information about the compilation can be
2794obtained from the shader object's information log by calling
2795`glGetShaderInfoLog'.
2796
2797`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
2798OpenGL.
2799
2800`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
2801
2802`GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
2803between the execution of `glBegin' and the corresponding execution of
2804`glEnd'.")
2805
25072f02 2806(define-gl-procedures
bb894c9d
AW
2807 ((glCompressedTexImage1D
2808 (target GLenum)
2809 (level GLint)
2810 (internalformat GLenum)
2811 (width GLsizei)
2812 (border GLint)
2813 (imageSize GLsizei)
00239761 2814 (data const-GLvoid-*)
bb894c9d
AW
2815 ->
2816 void))
3c9b6116
AW
2817 "Specify a one-dimensional texture image in a compressed format.
2818
2819TARGET
2820 Specifies the target texture. Must be `GL_TEXTURE_1D' or
2821 `GL_PROXY_TEXTURE_1D'.
2822
2823LEVEL
2824 Specifies the level-of-detail number. Level 0 is the base image
2825 level. Level N is the Nth mipmap reduction image.
2826
2827INTERNALFORMAT
2828 Specifies the format of the compressed image data stored at address
2829 DATA.
2830
2831WIDTH
2832 Specifies the width of the texture image including the border if
2833 any. If the GL version does not support non-power-of-two sizes,
2834 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2835 implementations support texture images that are at least 64 texels
2836 wide. The height of the 1D texture image is 1.
2837
2838BORDER
2839 Specifies the width of the border. Must be either 0 or 1.
2840
2841IMAGESIZE
2842 Specifies the number of unsigned bytes of image data starting at
2843 the address specified by DATA.
2844
2845DATA
2846 Specifies a pointer to the compressed image data in memory.
2847
2848Texturing maps a portion of a specified texture image onto each
2849graphical primitive for which texturing is enabled. To enable and
2850disable one-dimensional texturing, call `glEnable' and `glDisable' with
2851argument `GL_TEXTURE_1D'.
2852
2853`glCompressedTexImage1D' loads a previously defined, and retrieved,
2854compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
2855(see `glTexImage1D').
2856
2857If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
2858of the texture image state is recalculated, checked for consistency, and
2859checked against the implementation's capabilities. If the implementation
2860cannot handle a texture of the requested texture size, it sets all of
2861the image state to 0, but does not generate an error (see `glGetError').
2862To query for an entire mipmap array, use an image array level greater
2863than or equal to 1.
2864
2865INTERNALFORMAT must be extension-specified compressed-texture format.
2866When a texture is loaded with `glTexImage1D' using a generic compressed
2867texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
2868its extensions supporting compressed textures. In order to load the
2869compressed texture image using `glCompressedTexImage1D', query the
2870compressed texture image's size and format using
2871`glGetTexLevelParameter'.
2872
2873If a non-zero named buffer object is bound to the
2874`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2875image is specified, DATA is treated as a byte offset into the buffer
2876object's data store.
2877
2878`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2879compressed internal formats: `GL_COMPRESSED_ALPHA',
2880`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2881`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2882
2883`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
2884format, dimensions, and contents of the specified compressed image data.
2885
2886`GL_INVALID_OPERATION' is generated if parameter combinations are not
2887supported by the specific compressed internal format as specified in the
2888specific texture compression extension.
2889
2890`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2891bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2892data store is currently mapped.
2893
2894`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2895bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2896unpacked from the buffer object such that the memory reads required
2897would exceed the data store size.
2898
2899`GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
2900executed between the execution of `glBegin' and the corresponding
2901execution of `glEnd'.
2902
2903Undefined results, including abnormal program termination, are generated
2904if DATA is not encoded in a manner consistent with the extension
2905specification defining the internal compression format.")
2906
25072f02 2907(define-gl-procedures
bb894c9d
AW
2908 ((glCompressedTexImage2D
2909 (target GLenum)
2910 (level GLint)
2911 (internalformat GLenum)
2912 (width GLsizei)
2913 (height GLsizei)
2914 (border GLint)
2915 (imageSize GLsizei)
00239761 2916 (data const-GLvoid-*)
bb894c9d
AW
2917 ->
2918 void))
3c9b6116
AW
2919 "Specify a two-dimensional texture image in a compressed format.
2920
2921TARGET
2922 Specifies the target texture. Must be `GL_TEXTURE_2D',
2923 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
2924 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
2925 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
2926 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
2927
2928LEVEL
2929 Specifies the level-of-detail number. Level 0 is the base image
2930 level. Level N is the Nth mipmap reduction image.
2931
2932INTERNALFORMAT
2933 Specifies the format of the compressed image data stored at address
2934 DATA.
2935
2936WIDTH
2937 Specifies the width of the texture image including the border if
2938 any. If the GL version does not support non-power-of-two sizes,
2939 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
2940 implementations support 2D texture images that are at least 64
2941 texels wide and cube-mapped texture images that are at least 16
2942 texels wide.
2943
2944HEIGHT
2945 Specifies the height of the texture image including the border if
2946 any. If the GL version does not support non-power-of-two sizes,
2947 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
2948 implementations support 2D texture images that are at least 64
2949 texels high and cube-mapped texture images that are at least 16
2950 texels high.
2951
2952BORDER
2953 Specifies the width of the border. Must be either 0 or 1.
2954
2955IMAGESIZE
2956 Specifies the number of unsigned bytes of image data starting at
2957 the address specified by DATA.
2958
2959DATA
2960 Specifies a pointer to the compressed image data in memory.
2961
2962Texturing maps a portion of a specified texture image onto each
2963graphical primitive for which texturing is enabled. To enable and
2964disable two-dimensional texturing, call `glEnable' and `glDisable' with
2965argument `GL_TEXTURE_2D'. To enable and disable texturing using
2966cube-mapped textures, call `glEnable' and `glDisable' with argument
2967`GL_TEXTURE_CUBE_MAP'.
2968
2969`glCompressedTexImage2D' loads a previously defined, and retrieved,
2970compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
2971(see `glTexImage2D').
2972
2973If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
2974of the texture image state is recalculated, checked for consistency, and
2975checked against the implementation's capabilities. If the implementation
2976cannot handle a texture of the requested texture size, it sets all of
2977the image state to 0, but does not generate an error (see `glGetError').
2978To query for an entire mipmap array, use an image array level greater
2979than or equal to 1.
2980
2981INTERNALFORMAT must be an extension-specified compressed-texture format.
2982When a texture is loaded with `glTexImage2D' using a generic compressed
2983texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
2984its extensions supporting compressed textures. In order to load the
2985compressed texture image using `glCompressedTexImage2D', query the
2986compressed texture image's size and format using
2987`glGetTexLevelParameter'.
2988
2989If a non-zero named buffer object is bound to the
2990`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
2991image is specified, DATA is treated as a byte offset into the buffer
2992object's data store.
2993
2994`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
2995compressed internal formats: `GL_COMPRESSED_ALPHA',
2996`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
2997`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
2998
2999`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3000format, dimensions, and contents of the specified compressed image data.
3001
3002`GL_INVALID_OPERATION' is generated if parameter combinations are not
3003supported by the specific compressed internal format as specified in the
3004specific texture compression extension.
3005
3006`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3007bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3008data store is currently mapped.
3009
3010`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3011bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3012unpacked from the buffer object such that the memory reads required
3013would exceed the data store size.
3014
3015`GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
3016executed between the execution of `glBegin' and the corresponding
3017execution of `glEnd'.
3018
3019Undefined results, including abnormal program termination, are generated
3020if DATA is not encoded in a manner consistent with the extension
3021specification defining the internal compression format.")
3022
25072f02 3023(define-gl-procedures
bb894c9d
AW
3024 ((glCompressedTexImage3D
3025 (target GLenum)
3026 (level GLint)
3027 (internalformat GLenum)
3028 (width GLsizei)
3029 (height GLsizei)
3030 (depth GLsizei)
3031 (border GLint)
3032 (imageSize GLsizei)
00239761 3033 (data const-GLvoid-*)
bb894c9d
AW
3034 ->
3035 void))
3c9b6116
AW
3036 "Specify a three-dimensional texture image in a compressed format.
3037
3038TARGET
3039 Specifies the target texture. Must be `GL_TEXTURE_3D' or
3040 `GL_PROXY_TEXTURE_3D'.
3041
3042LEVEL
3043 Specifies the level-of-detail number. Level 0 is the base image
3044 level. Level N is the Nth mipmap reduction image.
3045
3046INTERNALFORMAT
3047 Specifies the format of the compressed image data stored at address
3048 DATA.
3049
3050WIDTH
3051 Specifies the width 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 wide.
3056
3057HEIGHT
3058 Specifies the height 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 high.
3063
3064DEPTH
3065 Specifies the depth of the texture image including the border if
3066 any. If the GL version does not support non-power-of-two sizes,
3067 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3068 implementations support 3D texture images that are at least 16
3069 texels deep.
3070
3071BORDER
3072 Specifies the width of the border. Must be either 0 or 1.
3073
3074IMAGESIZE
3075 Specifies the number of unsigned bytes of image data starting at
3076 the address specified by DATA.
3077
3078DATA
3079 Specifies a pointer to the compressed image data in memory.
3080
3081Texturing maps a portion of a specified texture image onto each
3082graphical primitive for which texturing is enabled. To enable and
3083disable three-dimensional texturing, call `glEnable' and `glDisable'
3084with argument `GL_TEXTURE_3D'.
3085
3086`glCompressedTexImage3D' loads a previously defined, and retrieved,
3087compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
3088(see `glTexImage3D').
3089
3090If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
3091of the texture image state is recalculated, checked for consistency, and
3092checked against the implementation's capabilities. If the implementation
3093cannot handle a texture of the requested texture size, it sets all of
3094the image state to 0, but does not generate an error (see `glGetError').
3095To query for an entire mipmap array, use an image array level greater
3096than or equal to 1.
3097
3098INTERNALFORMAT must be an extension-specified compressed-texture format.
3099When a texture is loaded with `glTexImage2D' using a generic compressed
3100texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
3101its extensions supporting compressed textures. In order to load the
3102compressed texture image using `glCompressedTexImage3D', query the
3103compressed texture image's size and format using
3104`glGetTexLevelParameter'.
3105
3106If a non-zero named buffer object is bound to the
3107`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3108image is specified, DATA is treated as a byte offset into the buffer
3109object's data store.
3110
3111`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3112compressed internal formats: `GL_COMPRESSED_ALPHA',
3113`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3114`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3115
3116`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3117format, dimensions, and contents of the specified compressed image data.
3118
3119`GL_INVALID_OPERATION' is generated if parameter combinations are not
3120supported by the specific compressed internal format as specified in the
3121specific texture compression extension.
3122
3123`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3124bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3125data store is currently mapped.
3126
3127`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3128bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3129unpacked from the buffer object such that the memory reads required
3130would exceed the data store size.
3131
3132`GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3133executed between the execution of `glBegin' and the corresponding
3134execution of `glEnd'.
3135
3136Undefined results, including abnormal program termination, are generated
3137if DATA is not encoded in a manner consistent with the extension
3138specification defining the internal compression format.")
8925f36f 3139
25072f02 3140(define-gl-procedures
bb894c9d
AW
3141 ((glCompressedTexSubImage1D
3142 (target GLenum)
3143 (level GLint)
3144 (xoffset GLint)
3145 (width GLsizei)
3146 (format GLenum)
3147 (imageSize GLsizei)
00239761 3148 (data const-GLvoid-*)
bb894c9d
AW
3149 ->
3150 void))
3c9b6116
AW
3151 "Specify a one-dimensional texture subimage in a compressed format.
3152
3153TARGET
3154 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3155
3156LEVEL
3157 Specifies the level-of-detail number. Level 0 is the base image
3158 level. Level N is the Nth mipmap reduction image.
3159
3160XOFFSET
3161 Specifies a texel offset in the x direction within the texture
3162 array.
3163
3164WIDTH
3165 Specifies the width of the texture subimage.
3166
3167FORMAT
3168 Specifies the format of the compressed image data stored at address
3169 DATA.
3170
3171IMAGESIZE
3172 Specifies the number of unsigned bytes of image data starting at
3173 the address specified by DATA.
3174
3175DATA
3176 Specifies a pointer to the compressed image data in memory.
3177
3178Texturing maps a portion of a specified texture image onto each
3179graphical primitive for which texturing is enabled. To enable and
3180disable one-dimensional texturing, call `glEnable' and `glDisable' with
3181argument `GL_TEXTURE_1D'.
3182
3183`glCompressedTexSubImage1D' redefines a contiguous subregion of an
3184existing one-dimensional texture image. The texels referenced by DATA
3185replace the portion of the existing texture array with x indices XOFFSET
3186and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3187outside the range of the texture array as it was originally specified.
3188It is not an error to specify a subtexture with width of 0, but such a
3189specification has no effect.
3190
3191FORMAT must be an extension-specified compressed-texture format. The
3192FORMAT of the compressed texture image is selected by the GL
3193implementation that compressed it (see `glTexImage1D'), and should be
3194queried at the time the texture was compressed with
3195`glGetTexLevelParameter'.
3196
3197If a non-zero named buffer object is bound to the
3198`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3199image is specified, DATA is treated as a byte offset into the buffer
3200object's data store.
3201
3202`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3203compressed internal formats: `GL_COMPRESSED_ALPHA',
3204`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3205`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3206`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3207`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3208`GL_COMPRESSED_SRGB_ALPHA'.
3209
3210`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3211format, dimensions, and contents of the specified compressed image data.
3212
3213`GL_INVALID_OPERATION' is generated if parameter combinations are not
3214supported by the specific compressed internal format as specified in the
3215specific texture compression extension.
3216
3217`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3218bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3219data store is currently mapped.
3220
3221`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3222bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3223unpacked from the buffer object such that the memory reads required
3224would exceed the data store size.
3225
3226`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3227executed between the execution of `glBegin' and the corresponding
3228execution of `glEnd'.
3229
3230Undefined results, including abnormal program termination, are generated
3231if DATA is not encoded in a manner consistent with the extension
3232specification defining the internal compression format.")
8925f36f 3233
25072f02 3234(define-gl-procedures
bb894c9d
AW
3235 ((glCompressedTexSubImage2D
3236 (target GLenum)
3237 (level GLint)
3238 (xoffset GLint)
3239 (yoffset GLint)
3240 (width GLsizei)
3241 (height GLsizei)
3242 (format GLenum)
3243 (imageSize GLsizei)
00239761 3244 (data const-GLvoid-*)
bb894c9d
AW
3245 ->
3246 void))
3c9b6116
AW
3247 "Specify a two-dimensional texture subimage in a compressed format.
3248
3249TARGET
3250 Specifies the target texture. Must be `GL_TEXTURE_2D',
3251 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3252 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3253 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3254 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3255
3256LEVEL
3257 Specifies the level-of-detail number. Level 0 is the base image
3258 level. Level N is the Nth mipmap reduction image.
3259
3260XOFFSET
3261 Specifies a texel offset in the x direction within the texture
3262 array.
3263
3264YOFFSET
3265 Specifies a texel offset in the y direction within the texture
3266 array.
3267
3268WIDTH
3269 Specifies the width of the texture subimage.
3270
3271HEIGHT
3272 Specifies the height of the texture subimage.
3273
3274FORMAT
3275 Specifies the format of the compressed image data stored at address
3276 DATA.
3277
3278IMAGESIZE
3279 Specifies the number of unsigned bytes of image data starting at
3280 the address specified by DATA.
3281
3282DATA
3283 Specifies a pointer to the compressed image data in memory.
3284
3285Texturing maps a portion of a specified texture image onto each
3286graphical primitive for which texturing is enabled. To enable and
3287disable two-dimensional texturing, call `glEnable' and `glDisable' with
3288argument `GL_TEXTURE_2D'. To enable and disable texturing using
3289cube-mapped texture, call `glEnable' and `glDisable' with argument
3290`GL_TEXTURE_CUBE_MAP'.
3291
3292`glCompressedTexSubImage2D' redefines a contiguous subregion of an
3293existing two-dimensional texture image. The texels referenced by DATA
3294replace the portion of the existing texture array with x indices XOFFSET
3295and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3296inclusive. This region may not include any texels outside the range of
3297the texture array as it was originally specified. It is not an error to
3298specify a subtexture with width of 0, but such a specification has no
3299effect.
3300
3301FORMAT must be an extension-specified compressed-texture format. The
3302FORMAT of the compressed texture image is selected by the GL
3303implementation that compressed it (see `glTexImage2D') and should be
3304queried at the time the texture was compressed with
3305`glGetTexLevelParameter'.
3306
3307If a non-zero named buffer object is bound to the
3308`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3309image is specified, DATA is treated as a byte offset into the buffer
3310object's data store.
3311
3312`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3313compressed internal formats: `GL_COMPRESSED_ALPHA',
3314`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3315`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3316`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3317`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3318`GL_COMPRESSED_SRGB_ALPHA'.
3319
3320`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3321format, dimensions, and contents of the specified compressed image data.
3322
3323`GL_INVALID_OPERATION' is generated if parameter combinations are not
3324supported by the specific compressed internal format as specified in the
3325specific texture compression extension.
3326
3327`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3328bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3329data store is currently mapped.
3330
3331`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3332bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3333unpacked from the buffer object such that the memory reads required
3334would exceed the data store size.
3335
3336`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3337executed between the execution of `glBegin' and the corresponding
3338execution of `glEnd'.
3339
3340Undefined results, including abnormal program termination, are generated
3341if DATA is not encoded in a manner consistent with the extension
3342specification defining the internal compression format.")
8925f36f 3343
25072f02 3344(define-gl-procedures
bb894c9d
AW
3345 ((glCompressedTexSubImage3D
3346 (target GLenum)
3347 (level GLint)
3348 (xoffset GLint)
3349 (yoffset GLint)
3350 (zoffset GLint)
3351 (width GLsizei)
3352 (height GLsizei)
3353 (depth GLsizei)
3354 (format GLenum)
3355 (imageSize GLsizei)
00239761 3356 (data const-GLvoid-*)
bb894c9d
AW
3357 ->
3358 void))
3c9b6116
AW
3359 "Specify a three-dimensional texture subimage in a compressed format.
3360
3361TARGET
3362 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3363
3364LEVEL
3365 Specifies the level-of-detail number. Level 0 is the base image
3366 level. Level N is the Nth mipmap reduction image.
3367
3368XOFFSET
3369 Specifies a texel offset in the x direction within the texture
3370 array.
3371
3372YOFFSET
3373 Specifies a texel offset in the y direction within the texture
3374 array.
3375
3376WIDTH
3377 Specifies the width of the texture subimage.
3378
3379HEIGHT
3380 Specifies the height of the texture subimage.
3381
3382DEPTH
3383 Specifies the depth of the texture subimage.
3384
3385FORMAT
3386 Specifies the format of the compressed image data stored at address
3387 DATA.
3388
3389IMAGESIZE
3390 Specifies the number of unsigned bytes of image data starting at
3391 the address specified by DATA.
3392
3393DATA
3394 Specifies a pointer to the compressed image data in memory.
3395
3396Texturing maps a portion of a specified texture image onto each
3397graphical primitive for which texturing is enabled. To enable and
3398disable three-dimensional texturing, call `glEnable' and `glDisable'
3399with argument `GL_TEXTURE_3D'.
3400
3401`glCompressedTexSubImage3D' redefines a contiguous subregion of an
3402existing three-dimensional texture image. The texels referenced by DATA
3403replace the portion of the existing texture array with x indices XOFFSET
3404and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3405and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3406may not include any texels outside the range of the texture array as it
3407was originally specified. It is not an error to specify a subtexture
3408with width of 0, but such a specification has no effect.
3409
3410FORMAT must be an extension-specified compressed-texture format. The
3411FORMAT of the compressed texture image is selected by the GL
3412implementation that compressed it (see `glTexImage3D') and should be
3413queried at the time the texture was compressed with
3414`glGetTexLevelParameter'.
3415
3416If a non-zero named buffer object is bound to the
3417`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3418image is specified, DATA is treated as a byte offset into the buffer
3419object's data store.
3420
3421`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3422compressed internal formats: `GL_COMPRESSED_ALPHA',
3423`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3424`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3425`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3426`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3427`GL_COMPRESSED_SRGB_ALPHA'.
3428
3429`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3430format, dimensions, and contents of the specified compressed image data.
3431
3432`GL_INVALID_OPERATION' is generated if parameter combinations are not
3433supported by the specific compressed internal format as specified in the
3434specific texture compression extension.
3435
3436`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3437bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3438data store is currently mapped.
3439
3440`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3441bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3442unpacked from the buffer object such that the memory reads required
3443would exceed the data store size.
3444
3445`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3446executed between the execution of `glBegin' and the corresponding
3447execution of `glEnd'.
3448
3449Undefined results, including abnormal program termination, are generated
3450if DATA is not encoded in a manner consistent with the extension
3451specification defining the internal compression format.")
8925f36f 3452
25072f02 3453(define-gl-procedures
bb894c9d
AW
3454 ((glConvolutionFilter1D
3455 (target GLenum)
3456 (internalformat GLenum)
3457 (width GLsizei)
3458 (format GLenum)
3459 (type GLenum)
00239761 3460 (data const-GLvoid-*)
bb894c9d
AW
3461 ->
3462 void))
3c9b6116 3463 "Define a one-dimensional convolution filter.
8925f36f 3464
3c9b6116
AW
3465TARGET
3466 Must be `GL_CONVOLUTION_1D'.
3467
3468INTERNALFORMAT
3469 The internal format of the convolution filter kernel. The allowable
3470 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3471 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3472 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3473 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3474 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3475 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3476 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3477 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3478 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3479 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3480 `GL_RGBA12', or `GL_RGBA16'.
3481
3482WIDTH
3483 The width of the pixel array referenced by DATA.
3484
3485FORMAT
3486 The format of the pixel data in DATA. The allowable values are
3487 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3488 `GL_RGB', and `GL_RGBA'.
3489
3490TYPE
3491 The type of the pixel data in DATA. Symbolic constants
3492 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3493 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3494 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3495 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3496 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3497 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3498 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3499 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3500 are accepted.
3501
3502DATA
3503 Pointer to a one-dimensional array of pixel data that is processed
3504 to build the convolution filter kernel.
3505
3506`glConvolutionFilter1D' builds a one-dimensional convolution filter
3507kernel from an array of pixels.
3508
3509The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3510from memory and processed just as if `glDrawPixels' were called, but
3511processing stops after the final expansion to RGBA is completed.
3512
3513If a non-zero named buffer object is bound to the
3514`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3515filter is specified, DATA is treated as a byte offset into the buffer
3516object's data store.
3517
3518The R, G, B, and A components of each pixel are next scaled by the four
35191D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3520`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3521are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3522and the names `GL_CONVOLUTION_FILTER_SCALE' and
3523`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3524four values that are applied to red, green, blue, and alpha, in that
3525order.) The R, G, B, and A values are not clamped to [0,1] at any time
3526during this process.
3527
3528Each pixel is then converted to the internal format specified by
3529INTERNALFORMAT. This conversion simply maps the component values of the
3530pixel (R, G, B, and A) to the values included in the internal format
3531(red, green, blue, alpha, luminance, and intensity). The mapping is as
3532follows:
3533
3534
3535
3536*Internal Format*
3537 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3538
3539`GL_ALPHA'
3540 , , , A , ,
3541
3542`GL_LUMINANCE'
3543 , , , , R ,
3544
3545`GL_LUMINANCE_ALPHA'
3546 , , , A , R ,
3547
3548`GL_INTENSITY'
3549 , , , , , R
3550
3551`GL_RGB'
3552 R , G , B , , ,
3553
3554`GL_RGBA'
3555 R , G , B , A , ,
3556
3557The red, green, blue, alpha, luminance, and/or intensity components of
3558the resulting pixels are stored in floating-point rather than integer
3559format. They form a one-dimensional filter kernel image indexed with
3560coordinate I such that I starts at 0 and increases from left to right.
3561Kernel location I is derived from the Ith pixel, counting from 0.
3562
3563Note that after a convolution is performed, the resulting color
3564components are also scaled by their corresponding
3565`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3566corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3567the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3568set by `glPixelTransfer'.
3569
3570`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3571
3572`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3573allowable values.
3574
3575`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3576values.
3577
3578`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3579values.
3580
3581`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3582than the maximum supported value. This value may be queried with
3583`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3584`GL_MAX_CONVOLUTION_WIDTH'.
3585
3586`GL_INVALID_OPERATION' is generated if FORMAT is one of
3587`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3588`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3589not `GL_RGB'.
3590
3591`GL_INVALID_OPERATION' is generated if FORMAT is one of
3592`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3593`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3594`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3595`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3596TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3597
3598`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3599bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3600data store is currently mapped.
3601
3602`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3603bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3604unpacked from the buffer object such that the memory reads required
3605would exceed the data store size.
3606
3607`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3608bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3609divisible into the number of bytes needed to store in memory a datum
3610indicated by TYPE.
3611
3612`GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3613executed between the execution of `glBegin' and the corresponding
3614execution of `glEnd'.")
3615
25072f02 3616(define-gl-procedures
bb894c9d
AW
3617 ((glConvolutionFilter2D
3618 (target GLenum)
3619 (internalformat GLenum)
3620 (width GLsizei)
3621 (height GLsizei)
3622 (format GLenum)
3623 (type GLenum)
00239761 3624 (data const-GLvoid-*)
bb894c9d
AW
3625 ->
3626 void))
3c9b6116
AW
3627 "Define a two-dimensional convolution filter.
3628
3629TARGET
3630 Must be `GL_CONVOLUTION_2D'.
3631
3632INTERNALFORMAT
3633 The internal format of the convolution filter kernel. The allowable
3634 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3635 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3636 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3637 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3638 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3639 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3640 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3641 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3642 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3643 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3644 `GL_RGBA12', or `GL_RGBA16'.
3645
3646WIDTH
3647 The width of the pixel array referenced by DATA.
3648
3649HEIGHT
3650 The height of the pixel array referenced by DATA.
3651
3652FORMAT
3653 The format of the pixel data in DATA. The allowable values are
3654 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3655 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3656
3657TYPE
3658 The type of the pixel data in DATA. Symbolic constants
3659 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3660 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3661 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3662 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3663 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3664 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3665 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3666 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3667 are accepted.
3668
3669DATA
3670 Pointer to a two-dimensional array of pixel data that is processed
3671 to build the convolution filter kernel.
3672
3673`glConvolutionFilter2D' builds a two-dimensional convolution filter
3674kernel from an array of pixels.
3675
3676The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3677extracted from memory and processed just as if `glDrawPixels' were
3678called, but processing stops after the final expansion to RGBA is
3679completed.
3680
3681If a non-zero named buffer object is bound to the
3682`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3683filter is specified, DATA is treated as a byte offset into the buffer
3684object's data store.
3685
8925f36f 3686The R, G, B, and A components of each pixel are next scaled by the four
3c9b6116
AW
36872D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
3688`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3689are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
3690and the names `GL_CONVOLUTION_FILTER_SCALE' and
3691`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3692four values that are applied to red, green, blue, and alpha, in that
3693order.) The R, G, B, and A values are not clamped to [0,1] at any time
3694during this process.
3695
3696Each pixel is then converted to the internal format specified by
3697INTERNALFORMAT. This conversion simply maps the component values of the
3698pixel (R, G, B, and A) to the values included in the internal format
3699(red, green, blue, alpha, luminance, and intensity). The mapping is as
3700follows:
3701
3702
3703
3704*Internal Format*
3705 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3706
3707`GL_ALPHA'
3708 , , , A , ,
3709
3710`GL_LUMINANCE'
3711 , , , , R ,
3712
3713`GL_LUMINANCE_ALPHA'
3714 , , , A , R ,
3715
3716`GL_INTENSITY'
3717 , , , , , R
3718
3719`GL_RGB'
3720 R , G , B , , ,
3721
3722`GL_RGBA'
3723 R , G , B , A , ,
3724
8925f36f 3725The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
3726the resulting pixels are stored in floating-point rather than integer
3727format. They form a two-dimensional filter kernel image indexed with
3728coordinates I and J such that I starts at zero and increases from left
3729to right, and J starts at zero and increases from bottom to top. Kernel
3730location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
3731
8925f36f 3732Note that after a convolution is performed, the resulting color
3c9b6116
AW
3733components are also scaled by their corresponding
3734`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3735corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3736the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3737set by `glPixelTransfer'.
3738
3739`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
3740
3741`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3742allowable values.
3743
3744`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3745values.
3746
3747`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3748values.
3749
3750`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3751than the maximum supported value. This value may be queried with
3752`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3753`GL_MAX_CONVOLUTION_WIDTH'.
3754
3755`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
3756than the maximum supported value. This value may be queried with
3757`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
3758`GL_MAX_CONVOLUTION_HEIGHT'.
3759
3760`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3761`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3762`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
3763is not `GL_RGB'.
3764
3765`GL_INVALID_OPERATION' is generated if HEIGHT is one of
3766`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3767`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3768`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3769`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3770FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3771
3772`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3773bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3774data store is currently mapped.
3775
3776`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3777bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3778unpacked from the buffer object such that the memory reads required
3779would exceed the data store size.
3780
3781`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3782bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3783divisible into the number of bytes needed to store in memory a datum
3784indicated by TYPE.
3785
3786`GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
3787executed between the execution of `glBegin' and the corresponding
3788execution of `glEnd'.")
8925f36f 3789
25072f02 3790(define-gl-procedures
bb894c9d
AW
3791 ((glConvolutionParameterf
3792 (target GLenum)
3793 (pname GLenum)
3794 (params GLfloat)
3795 ->
3796 void)
3797 (glConvolutionParameteri
3798 (target GLenum)
3799 (pname GLenum)
3800 (params GLint)
3801 ->
3802 void))
3c9b6116
AW
3803 "Set convolution parameters.
3804
3805TARGET
3806 The target for the convolution parameter. Must be one of
3807 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
3808
3809PNAME
3810 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
3811
3812PARAMS
3813 The parameter value. Must be one of `GL_REDUCE',
3814 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
3815
3816
3817
3818`glConvolutionParameter' sets the value of a convolution parameter.
3819
3820TARGET selects the convolution filter to be affected:
3821`GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
38221D, 2D, or separable 2D filter, respectively.
3823
3824PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
3825and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
3826convolution filter kernel; see `glConvolutionFilter1D',
3827`glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
3828cases, PARAMSv is an array of four values to be applied to red, green,
3829blue, and alpha values, respectively. The initial value for
3830`GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
3831`GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
3832
3833A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
3834border mode. The accepted modes are:
3835
3836`GL_REDUCE'
3837 The image resulting from convolution is smaller than the source
3838 image. If the filter width is WF and height is HF , and the source
3839 image width is WS and height is HS , then the convolved image width
3840 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
3841 would generate an image with zero or negative width and/or height,
3842 the output is simply null, with no error generated.) The
3843 coordinates of the image resulting from convolution are zero
3844 through WS-WF in width and zero through HS-HF in height.
3845
3846`GL_CONSTANT_BORDER'
3847 The image resulting from convolution is the same size as the source
3848 image, and processed as if the source image were surrounded by
3849 pixels with their color specified by the
3850 `GL_CONVOLUTION_BORDER_COLOR'.
3851
3852`GL_REPLICATE_BORDER'
3853 The image resulting from convolution is the same size as the source
3854 image, and processed as if the outermost pixel on the border of the
3855 source image were replicated.
3856
3857`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
3858values.
3859
3860`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
3861values.
3862
3863`GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
3864and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
3865`GL_REPLICATE_BORDER'.
3866
3867`GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
3868executed between the execution of `glBegin' and the corresponding
3869execution of `glEnd'.")
8925f36f 3870
25072f02 3871(define-gl-procedures
bb894c9d
AW
3872 ((glCopyColorSubTable
3873 (target GLenum)
3874 (start GLsizei)
3875 (x GLint)
3876 (y GLint)
3877 (width GLsizei)
3878 ->
3879 void))
3c9b6116
AW
3880 "Respecify a portion of a color table.
3881
3882TARGET
3883 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
3884 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3885
3886START
3887 The starting index of the portion of the color table to be
3888 replaced.
3889
3890X
3891 Y
3892
3893 The window coordinates of the left corner of the row of pixels to
3894 be copied.
3895
3896WIDTH
3897 The number of table entries to replace.
3898
3899`glCopyColorSubTable' is used to respecify a contiguous portion of a
3900color table previously defined using `glColorTable'. The pixels copied
3901from the framebuffer replace the portion of the existing table from
3902indices START to START+X-1 , inclusive. This region may not include any
3903entries outside the range of the color table, as was originally
3904specified. It is not an error to specify a subtexture with width of 0,
3905but such a specification has no effect.
3906
3907`GL_INVALID_VALUE' is generated if TARGET is not a previously defined
3908color table.
3909
3910`GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
3911values.
3912
3913`GL_INVALID_VALUE' is generated if START+X>WIDTH .
3914
3915`GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
3916between the execution of `glBegin' and the corresponding execution of
3917`glEnd'.")
8925f36f 3918
25072f02 3919(define-gl-procedures
bb894c9d
AW
3920 ((glCopyColorTable
3921 (target GLenum)
3922 (internalformat GLenum)
3923 (x GLint)
3924 (y GLint)
3925 (width GLsizei)
3926 ->
3927 void))
3c9b6116
AW
3928 "Copy pixels into a color table.
3929
3930TARGET
3931 The color table target. Must be `GL_COLOR_TABLE',
3932 `GL_POST_CONVOLUTION_COLOR_TABLE', or
3933 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
3934
3935INTERNALFORMAT
3936 The internal storage format of the texture image. Must be one of
3937 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
3938 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
3939 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
3940 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
3941 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
3942 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
3943 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
3944 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
3945 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
3946 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
3947 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
3948
3949X
3950 The x coordinate of the lower-left corner of the pixel rectangle to
3951 be transferred to the color table.
3952
3953Y
3954 The y coordinate of the lower-left corner of the pixel rectangle to
3955 be transferred to the color table.
3956
3957WIDTH
3958 The width of the pixel rectangle.
3959
3960`glCopyColorTable' loads a color table with pixels from the current
3961`GL_READ_BUFFER' (rather than from main memory, as is the case for
3962`glColorTable').
3963
3964The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
3965having width WIDTH and height 1 is loaded into the color table. If any
3966pixels within this region are outside the window that is associated with
3967the GL context, the values obtained for those pixels are undefined.
3968
3969The pixels in the rectangle are processed just as if `glReadPixels' were
3970called, with INTERNALFORMAT set to RGBA, but processing stops after the
3971final conversion to RGBA.
3972
8925f36f 3973The four scale parameters and the four bias parameters that are defined
3c9b6116
AW
3974for the table are then used to scale and bias the R, G, B, and A
3975components of each pixel. The scale and bias parameters are set by
3976calling `glColorTableParameter'.
3977
3978Next, the R, G, B, and A values are clamped to the range [0,1] . Each
3979pixel is then converted to the internal format specified by
3980INTERNALFORMAT. This conversion simply maps the component values of the
3981pixel (R, G, B, and A) to the values included in the internal format
3982(red, green, blue, alpha, luminance, and intensity). The mapping is as
3983follows:
3984
3985
3986
3987*Internal Format*
3988 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3989
3990`GL_ALPHA'
3991 , , , A , ,
3992
3993`GL_LUMINANCE'
3994 , , , , R ,
3995
3996`GL_LUMINANCE_ALPHA'
3997 , , , A , R ,
3998
3999`GL_INTENSITY'
4000 , , , , , R
4001
4002`GL_RGB'
4003 R , G , B , , ,
4004
4005`GL_RGBA'
4006 R , G , B , A , ,
4007
4008Finally, the red, green, blue, alpha, luminance, and/or intensity
4009components of the resulting pixels are stored in the color table. They
4010form a one-dimensional table with indices in the range [0,WIDTH-1] .
4011
4012
4013
4014`GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
4015values.
4016
4017`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
4018
4019`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
4020allowable values.
4021
4022`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
4023large to be supported by the implementation.
4024
4025`GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
4026between the execution of `glBegin' and the corresponding execution of
4027`glEnd'.")
8925f36f 4028
25072f02 4029(define-gl-procedures
bb894c9d
AW
4030 ((glCopyConvolutionFilter1D
4031 (target GLenum)
4032 (internalformat GLenum)
4033 (x GLint)
4034 (y GLint)
4035 (width GLsizei)
4036 ->
4037 void))
3c9b6116
AW
4038 "Copy pixels into a one-dimensional convolution filter.
4039
4040TARGET
4041 Must be `GL_CONVOLUTION_1D'.
4042
4043INTERNALFORMAT
4044 The internal format of the convolution filter kernel. The allowable
4045 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4046 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4047 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4048 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4049 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4050 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4051 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4052 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4053 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4054 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4055 `GL_RGBA12', or `GL_RGBA16'.
4056
4057X
4058 Y
4059
4060 The window space coordinates of the lower-left coordinate of the
4061 pixel array to copy.
4062
4063WIDTH
4064 The width of the pixel array to copy.
4065
4066`glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
4067kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4068main memory, as is the case for `glConvolutionFilter1D').
4069
4070The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4071width WIDTH and height 1 is used to define the convolution filter. If
4072any pixels within this region are outside the window that is associated
4073with the GL context, the values obtained for those pixels are undefined.
4074
4075The pixels in the rectangle are processed exactly as if `glReadPixels'
4076had been called with FORMAT set to RGBA, but the process stops just
4077before final conversion. The R, G, B, and A components of each pixel are
4078next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4079biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4080scale and bias parameters are set by `glConvolutionParameter' using the
4081`GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4082and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4083of four values that are applied to red, green, blue, and alpha, in that
4084order.) The R, G, B, and A values are not clamped to [0,1] at any time
4085during this process.
4086
4087Each pixel is then converted to the internal format specified by
4088INTERNALFORMAT. This conversion simply maps the component values of the
4089pixel (R, G, B, and A) to the values included in the internal format
4090(red, green, blue, alpha, luminance, and intensity). The mapping is as
4091follows:
4092
4093
4094
4095*Internal Format*
4096 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4097
4098`GL_ALPHA'
4099 , , , A , ,
4100
4101`GL_LUMINANCE'
4102 , , , , R ,
4103
4104`GL_LUMINANCE_ALPHA'
4105 , , , A , R ,
4106
4107`GL_INTENSITY'
4108 , , , , , R
4109
4110`GL_RGB'
4111 R , G , B , , ,
4112
4113`GL_RGBA'
4114 R , G , B , A , ,
4115
8925f36f 4116The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4117the resulting pixels are stored in floating-point rather than integer
4118format.
4119
8925f36f 4120Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4121lower I filter image coordinates.
4122
8925f36f 4123Note that after a convolution is performed, the resulting color
3c9b6116
AW
4124components are also scaled by their corresponding
4125`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4126corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4127the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4128set by `glPixelTransfer'.
4129
4130`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4131
4132`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4133allowable values.
4134
4135`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4136than the maximum supported value. This value may be queried with
4137`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4138`GL_MAX_CONVOLUTION_WIDTH'.
4139
4140`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4141executed between the execution of `glBegin' and the corresponding
4142execution of `glEnd'.")
8925f36f 4143
25072f02 4144(define-gl-procedures
bb894c9d
AW
4145 ((glCopyConvolutionFilter2D
4146 (target GLenum)
4147 (internalformat GLenum)
4148 (x GLint)
4149 (y GLint)
4150 (width GLsizei)
4151 (height GLsizei)
4152 ->
4153 void))
3c9b6116
AW
4154 "Copy pixels into a two-dimensional convolution filter.
4155
4156TARGET
4157 Must be `GL_CONVOLUTION_2D'.
4158
4159INTERNALFORMAT
4160 The internal format of the convolution filter kernel. The allowable
4161 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4162 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4163 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4164 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4165 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4166 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4167 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4168 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4169 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4170 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4171 `GL_RGBA12', or `GL_RGBA16'.
4172
4173X
4174 Y
4175
4176 The window space coordinates of the lower-left coordinate of the
4177 pixel array to copy.
4178
4179WIDTH
4180 The width of the pixel array to copy.
4181
4182HEIGHT
4183 The height of the pixel array to copy.
4184
4185`glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4186kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4187main memory, as is the case for `glConvolutionFilter2D').
4188
4189The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4190width WIDTH and height HEIGHT is used to define the convolution filter.
4191If any pixels within this region are outside the window that is
4192associated with the GL context, the values obtained for those pixels are
4193undefined.
4194
4195The pixels in the rectangle are processed exactly as if `glReadPixels'
4196had been called with FORMAT set to RGBA, but the process stops just
4197before final conversion. The R, G, B, and A components of each pixel are
4198next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4199biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4200scale and bias parameters are set by `glConvolutionParameter' using the
4201`GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4202and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4203of four values that are applied to red, green, blue, and alpha, in that
4204order.) The R, G, B, and A values are not clamped to [0,1] at any time
4205during this process.
4206
4207Each pixel is then converted to the internal format specified by
4208INTERNALFORMAT. This conversion simply maps the component values of the
4209pixel (R, G, B, and A) to the values included in the internal format
4210(red, green, blue, alpha, luminance, and intensity). The mapping is as
4211follows:
4212
4213
4214
4215*Internal Format*
4216 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4217
4218`GL_ALPHA'
4219 , , , A , ,
4220
4221`GL_LUMINANCE'
4222 , , , , R ,
4223
4224`GL_LUMINANCE_ALPHA'
4225 , , , A , R ,
4226
4227`GL_INTENSITY'
4228 , , , , , R
4229
4230`GL_RGB'
4231 R , G , B , , ,
4232
4233`GL_RGBA'
4234 R , G , B , A , ,
4235
8925f36f 4236The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4237the resulting pixels are stored in floating-point rather than integer
4238format.
4239
8925f36f 4240Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4241lower I filter image coordinates, and lower y screen coordinates
4242correspond to lower J filter image coordinates.
4243
8925f36f 4244Note that after a convolution is performed, the resulting color
3c9b6116
AW
4245components are also scaled by their corresponding
4246`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4247corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4248the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4249set by `glPixelTransfer'.
4250
4251`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4252
4253`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4254allowable values.
4255
4256`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4257than the maximum supported value. This value may be queried with
4258`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4259`GL_MAX_CONVOLUTION_WIDTH'.
4260
4261`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4262than the maximum supported value. This value may be queried with
4263`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4264`GL_MAX_CONVOLUTION_HEIGHT'.
4265
4266`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4267executed between the execution of `glBegin' and the corresponding
4268execution of `glEnd'.")
8925f36f 4269
25072f02 4270(define-gl-procedures
bb894c9d
AW
4271 ((glCopyPixels
4272 (x GLint)
4273 (y GLint)
4274 (width GLsizei)
4275 (height GLsizei)
4276 (type GLenum)
4277 ->
4278 void))
3c9b6116
AW
4279 "Copy pixels in the frame buffer.
4280
4281X
4282 Y
4283
4284 Specify the window coordinates of the lower left corner of the
4285 rectangular region of pixels to be copied.
4286
4287WIDTH
4288 HEIGHT
4289
4290 Specify the dimensions of the rectangular region of pixels to be
4291 copied. Both must be nonnegative.
4292
4293TYPE
4294 Specifies whether color values, depth values, or stencil values are
4295 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4296 `GL_STENCIL' are accepted.
4297
4298`glCopyPixels' copies a screen-aligned rectangle of pixels from the
4299specified frame buffer location to a region relative to the current
4300raster position. Its operation is well defined only if the entire pixel
4301source region is within the exposed portion of the window. Results of
4302copies from outside the window, or from regions of the window that are
4303not exposed, are hardware dependent and undefined.
4304
4305X and Y specify the window coordinates of the lower left corner of the
4306rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4307of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4308be negative.
4309
4310Several parameters control the processing of the pixel data while it is
4311being copied. These parameters are set with three commands:
4312`glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4313describes the effects on `glCopyPixels' of most, but not all, of the
4314parameters specified by these three commands.
4315
4316`glCopyPixels' copies values from each pixel with the lower left-hand
4317corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4318to be the I th pixel in the J th row. Pixels are copied in row order
4319from the lowest to the highest row, left to right in each row.
4320
4321TYPE specifies whether color, depth, or stencil data is to be copied.
4322The details of the transfer for each data type are as follows:
4323
4324`GL_COLOR'
4325 Indices or RGBA colors are read from the buffer currently specified
4326 as the read source buffer (see `glReadBuffer'). If the GL is in
4327 color index mode, each index that is read from this buffer is
4328 converted to a fixed-point format with an unspecified number of
4329 bits to the right of the binary point. Each index is then shifted
4330 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4331 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4332 case, zero bits fill otherwise unspecified bit locations in the
4333 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4334 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4335 Whether the lookup replacement of the index is done or not, the
4336 integer part of the index is then ANDed with 2^B-1 , where B is the
4337 number of bits in a color index buffer.
4338
4339 If the GL is in RGBA mode, the red, green, blue, and alpha
4340 components of each pixel that is read are converted to an internal
4341 floating-point format with unspecified precision. The conversion
4342 maps the largest representable component value to 1.0, and
4343 component value 0 to 0.0. The resulting floating-point color values
4344 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4345 C is RED, GREEN, BLUE, and ALPHA for the respective color
4346 components. The results are clamped to the range [0,1]. If
4347 `GL_MAP_COLOR' is true, each color component is scaled by the size
4348 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4349 that it references in that table. C is R, G, B, or A.
4350
4351 If the `ARB_imaging' extension is supported, the color values may
4352 be additionally processed by color-table lookups, color-matrix
4353 transformations, and convolution filters.
4354
4355 The GL then converts the resulting indices or RGBA colors to
4356 fragments by attaching the current raster position Z coordinate and
4357 texture coordinates to each pixel, then assigning window
4358 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4359 position, and the pixel was the I th pixel in the J th row. These
4360 pixel fragments are then treated just like the fragments generated
4361 by rasterizing points, lines, or polygons. Texture mapping, fog,
4362 and all the fragment operations are applied before the fragments
4363 are written to the frame buffer.
4364
4365`GL_DEPTH'
4366 Depth values are read from the depth buffer and converted directly
4367 to an internal floating-point format with unspecified precision.
4368 The resulting floating-point depth value is then multiplied by
4369 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4370 clamped to the range [0,1].
4371
4372 The GL then converts the resulting depth components to fragments by
4373 attaching the current raster position color or color index and
4374 texture coordinates to each pixel, then assigning window
4375 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4376 position, and the pixel was the I th pixel in the J th row. These
4377 pixel fragments are then treated just like the fragments generated
4378 by rasterizing points, lines, or polygons. Texture mapping, fog,
4379 and all the fragment operations are applied before the fragments
4380 are written to the frame buffer.
4381
4382`GL_STENCIL'
4383 Stencil indices are read from the stencil buffer and converted to
4384 an internal fixed-point format with an unspecified number of bits
4385 to the right of the binary point. Each fixed-point index is then
4386 shifted left by `GL_INDEX_SHIFT' bits, and added to
4387 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4388 the right. In either case, zero bits fill otherwise unspecified bit
4389 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4390 replaced with the value that it references in lookup table
4391 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4392 is done or not, the integer part of the index is then ANDed with
4393 2^B-1 , where B is the number of bits in the stencil buffer. The
4394 resulting stencil indices are then written to the stencil buffer
4395 such that the index read from the I th location of the J th row is
4396 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4397 raster position. Only the pixel ownership test, the scissor test,
4398 and the stencil writemask affect these write operations.
4399
8925f36f 4400The rasterization described thus far assumes pixel zoom factors of 1.0.
3c9b6116
AW
4401If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4402pixels are converted to fragments as follows. If (X_R,Y_R) is the
4403current raster position, and a given pixel is in the I th location in
4404the J th row of the source pixel rectangle, then fragments are generated
4405for pixels whose centers are in the rectangle with corners at
4406
4407(X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4408
4409and
4410
4411(X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4412
4413where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4414`GL_ZOOM_Y'.
4415
4416`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4417
4418`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4419
4420`GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4421no depth buffer.
4422
4423`GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4424no stencil buffer.
4425
4426`GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4427between the execution of `glBegin' and the corresponding execution of
4428`glEnd'.")
8925f36f 4429
25072f02 4430(define-gl-procedures
bb894c9d
AW
4431 ((glCopyTexImage1D
4432 (target GLenum)
4433 (level GLint)
4434 (internalformat GLenum)
4435 (x GLint)
4436 (y GLint)
4437 (width GLsizei)
4438 (border GLint)
4439 ->
4440 void))
3c9b6116
AW
4441 "Copy pixels into a 1D texture image.
4442
4443TARGET
4444 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4445
4446LEVEL
4447 Specifies the level-of-detail number. Level 0 is the base image
4448 level. Level N is the Nth mipmap reduction image.
4449
4450INTERNALFORMAT
4451 Specifies the internal format of the texture. Must be one of the
4452 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4453 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4454 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4455 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4456 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4457 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4458 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4459 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4460 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4461 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4462 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4463 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4464 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4465 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4466 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4467 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4468 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4469 `GL_SRGB8_ALPHA8'.
4470
4471X
4472 Y
4473
4474 Specify the window coordinates of the left corner of the row of
4475 pixels to be copied.
4476
4477WIDTH
4478 Specifies the width of the texture image. Must be 0 or
4479 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4480 image is 1.
4481
4482BORDER
4483 Specifies the width of the border. Must be either 0 or 1.
4484
4485`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4486from the current `GL_READ_BUFFER'.
4487
4488The screen-aligned pixel row with left corner at (X,Y) and with a length
4489of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4490specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4491texture array.
4492
4493The pixels in the row are processed exactly as if `glCopyPixels' had
4494been called, but the process stops just before final conversion. At this
4495point all pixel component values are clamped to the range [0,1] and then
4496converted to the texture's internal format for storage in the texel
4497array.
4498
4499Pixel ordering is such that lower X screen coordinates correspond to
4500lower texture coordinates.
4501
4502If any of the pixels within the specified row of the current
4503`GL_READ_BUFFER' are outside the window associated with the current
4504rendering context, then the values obtained for those pixels are
4505undefined.
4506
4507`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4508from the current `GL_READ_BUFFER'.
4509
4510When INTERNALFORMAT is one of the sRGB types, the GL does not
4511automatically convert the source pixels to the sRGB color space. In this
4512case, the `glPixelMap' function can be used to accomplish the
4513conversion.
4514
4515`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4516values.
4517
4518`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4519
4520`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4521where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4522
4523`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4524value.
4525
4526`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
45272 + `GL_MAX_TEXTURE_SIZE'.
4528
4529`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4530supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4531some integer value of N.
4532
4533`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4534
4535`GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4536between the execution of `glBegin' and the corresponding execution of
4537`glEnd'.
4538
4539`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4540`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4541`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4542
25072f02 4543(define-gl-procedures
bb894c9d
AW
4544 ((glCopyTexImage2D
4545 (target GLenum)
4546 (level GLint)
4547 (internalformat GLenum)
4548 (x GLint)
4549 (y GLint)
4550 (width GLsizei)
4551 (height GLsizei)
4552 (border GLint)
4553 ->
4554 void))
3c9b6116
AW
4555 "Copy pixels into a 2D texture image.
4556
4557TARGET
4558 Specifies the target texture. Must be `GL_TEXTURE_2D',
4559 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4560 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4561 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4562 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4563
4564LEVEL
4565 Specifies the level-of-detail number. Level 0 is the base image
4566 level. Level N is the Nth mipmap reduction image.
4567
4568INTERNALFORMAT
4569 Specifies the internal format of the texture. Must be one of the
4570 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4571 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4572 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4573 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4574 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4575 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4576 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4577 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4578 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4579 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4580 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4581 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4582 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4583 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4584 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4585 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4586 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4587 `GL_SRGB8_ALPHA8'.
4588
4589X
4590 Y
4591
4592 Specify the window coordinates of the lower left corner of the
4593 rectangular region of pixels to be copied.
4594
4595WIDTH
4596 Specifies the width of the texture image. Must be 0 or
4597 2^N+2\u2061(BORDER,) for some integer N .
4598
4599HEIGHT
4600 Specifies the height of the texture image. Must be 0 or
4601 2^M+2\u2061(BORDER,) for some integer M .
4602
4603BORDER
4604 Specifies the width of the border. Must be either 0 or 1.
4605
4606`glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4607texture image with pixels from the current `GL_READ_BUFFER'.
4608
4609The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4610with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4611defines the texture array at the mipmap level specified by LEVEL.
4612INTERNALFORMAT specifies the internal format of the texture array.
4613
4614The pixels in the rectangle are processed exactly as if `glCopyPixels'
4615had been called, but the process stops just before final conversion. At
4616this point all pixel component values are clamped to the range [0,1] and
4617then converted to the texture's internal format for storage in the texel
4618array.
4619
4620Pixel ordering is such that lower X and Y screen coordinates correspond
4621to lower S and T texture coordinates.
4622
4623If any of the pixels within the specified rectangle of the current
4624`GL_READ_BUFFER' are outside the window associated with the current
4625rendering context, then the values obtained for those pixels are
4626undefined.
4627
4628When INTERNALFORMAT is one of the sRGB types, the GL does not
4629automatically convert the source pixels to the sRGB color space. In this
4630case, the `glPixelMap' function can be used to accomplish the
4631conversion.
4632
4633`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4634`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4635`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4636`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4637
4638`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4639
4640`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4641where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4642
4643`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
46442 + `GL_MAX_TEXTURE_SIZE'.
4645
4646`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4647supported and the WIDTH or DEPTH cannot be represented as
46482^K+2\u2061(BORDER,) for some integer K .
4649
4650`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4651
4652`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4653format.
4654
4655`GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4656between the execution of `glBegin' and the corresponding execution of
4657`glEnd'.
4658
4659`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4660`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4661`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4662
25072f02 4663(define-gl-procedures
bb894c9d
AW
4664 ((glCopyTexSubImage1D
4665 (target GLenum)
4666 (level GLint)
4667 (xoffset GLint)
4668 (x GLint)
4669 (y GLint)
4670 (width GLsizei)
4671 ->
4672 void))
3c9b6116
AW
4673 "Copy a one-dimensional texture subimage.
4674
4675TARGET
4676 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4677
4678LEVEL
4679 Specifies the level-of-detail number. Level 0 is the base image
4680 level. Level N is the Nth mipmap reduction image.
4681
4682XOFFSET
4683 Specifies the texel offset within the texture array.
4684
4685X
4686 Y
4687
4688 Specify the window coordinates of the left corner of the row of
4689 pixels to be copied.
4690
4691WIDTH
4692 Specifies the width of the texture subimage.
4693
4694`glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
4695image with pixels from the current `GL_READ_BUFFER' (rather than from
4696main memory, as is the case for `glTexSubImage1D').
4697
4698The screen-aligned pixel row with left corner at (X,\\ Y), and with
4699length WIDTH replaces the portion of the texture array with x indices
4700XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
4701texture array may not include any texels outside the texture array as it
4702was originally specified.
4703
4704The pixels in the row are processed exactly as if `glCopyPixels' had
4705been called, but the process stops just before final conversion. At this
4706point, all pixel component values are clamped to the range [0,1] and
4707then converted to the texture's internal format for storage in the texel
4708array.
4709
4710It is not an error to specify a subtexture with zero width, but such a
4711specification has no effect. If any of the pixels within the specified
4712row of the current `GL_READ_BUFFER' are outside the read window
4713associated with the current rendering context, then the values obtained
4714for those pixels are undefined.
4715
4716No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
4717the specified texture array or to texel values outside the specified
4718subregion.
4719
4720`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
4721
4722`GL_INVALID_OPERATION' is generated if the texture array has not been
4723defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
4724
4725`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4726
4727`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4728the returned value of `GL_MAX_TEXTURE_SIZE'.
4729
4730`GL_INVALID_VALUE' is generated if XOFFSET<-B , or
4731(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
4732`GL_TEXTURE_BORDER' of the texture image being modified. Note that W
4733includes twice the border width.")
8925f36f 4734
25072f02 4735(define-gl-procedures
bb894c9d
AW
4736 ((glCopyTexSubImage2D
4737 (target GLenum)
4738 (level GLint)
4739 (xoffset GLint)
4740 (yoffset GLint)
4741 (x GLint)
4742 (y GLint)
4743 (width GLsizei)
4744 (height GLsizei)
4745 ->
4746 void))
3c9b6116
AW
4747 "Copy a two-dimensional texture subimage.
4748
4749TARGET
4750 Specifies the target texture. Must be `GL_TEXTURE_2D',
4751 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4752 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4753 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4754 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4755
4756LEVEL
4757 Specifies the level-of-detail number. Level 0 is the base image
4758 level. Level N is the Nth mipmap reduction image.
4759
4760XOFFSET
4761 Specifies a texel offset in the x direction within the texture
4762 array.
4763
4764YOFFSET
4765 Specifies a texel offset in the y direction within the texture
4766 array.
4767
4768X
4769 Y
4770
4771 Specify the window coordinates of the lower left corner of the
4772 rectangular region of pixels to be copied.
4773
4774WIDTH
4775 Specifies the width of the texture subimage.
4776
4777HEIGHT
4778 Specifies the height of the texture subimage.
4779
4780`glCopyTexSubImage2D' replaces a rectangular portion of a
4781two-dimensional texture image or cube-map texture image with pixels from
4782the current `GL_READ_BUFFER' (rather than from main memory, as is the
4783case for `glTexSubImage2D').
4784
4785The screen-aligned pixel rectangle with lower left corner at (X,Y) and
4786with width WIDTH and height HEIGHT replaces the portion of the texture
4787array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4788indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
4789level specified by LEVEL.
4790
4791The pixels in the rectangle are processed exactly as if `glCopyPixels'
4792had been called, but the process stops just before final conversion. At
4793this point, all pixel component values are clamped to the range [0,1]
4794and then converted to the texture's internal format for storage in the
4795texel array.
4796
4797The destination rectangle in the texture array may not include any
4798texels outside the texture array as it was originally specified. It is
4799not an error to specify a subtexture with zero width or height, but such
4800a specification has no effect.
4801
4802If any of the pixels within the specified rectangle of the current
4803`GL_READ_BUFFER' are outside the read window associated with the current
4804rendering context, then the values obtained for those pixels are
4805undefined.
4806
4807No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
4808parameters of the specified texture array or to texel values outside the
4809specified subregion.
4810
4811`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4812`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4813`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4814`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4815
4816`GL_INVALID_OPERATION' is generated if the texture array has not been
4817defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
4818
4819`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4820
4821`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4822the returned value of `GL_MAX_TEXTURE_SIZE'.
4823
4824`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4825, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
4826`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
4827`GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
4828H include twice the border width.
4829
4830`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
4831between the execution of `glBegin' and the corresponding execution of
4832`glEnd'.")
8925f36f 4833
25072f02 4834(define-gl-procedures
bb894c9d
AW
4835 ((glCopyTexSubImage3D
4836 (target GLenum)
4837 (level GLint)
4838 (xoffset GLint)
4839 (yoffset GLint)
4840 (zoffset GLint)
4841 (x GLint)
4842 (y GLint)
4843 (width GLsizei)
4844 (height GLsizei)
4845 ->
4846 void))
3c9b6116
AW
4847 "Copy a three-dimensional texture subimage.
4848
4849TARGET
4850 Specifies the target texture. Must be `GL_TEXTURE_3D'
4851
4852LEVEL
4853 Specifies the level-of-detail number. Level 0 is the base image
4854 level. Level N is the Nth mipmap reduction image.
4855
4856XOFFSET
4857 Specifies a texel offset in the x direction within the texture
4858 array.
4859
4860YOFFSET
4861 Specifies a texel offset in the y direction within the texture
4862 array.
4863
4864ZOFFSET
4865 Specifies a texel offset in the z direction within the texture
4866 array.
4867
4868X
4869 Y
4870
4871 Specify the window coordinates of the lower left corner of the
4872 rectangular region of pixels to be copied.
4873
4874WIDTH
4875 Specifies the width of the texture subimage.
4876
4877HEIGHT
4878 Specifies the height of the texture subimage.
4879
4880`glCopyTexSubImage3D' replaces a rectangular portion of a
4881three-dimensional texture image with pixels from the current
4882`GL_READ_BUFFER' (rather than from main memory, as is the case for
4883`glTexSubImage3D').
4884
4885The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
4886with width WIDTH and height HEIGHT replaces the portion of the texture
4887array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
4888indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
4889and at the mipmap level specified by LEVEL.
4890
4891The pixels in the rectangle are processed exactly as if `glCopyPixels'
4892had been called, but the process stops just before final conversion. At
4893this point, all pixel component values are clamped to the range [0,1]
4894and then converted to the texture's internal format for storage in the
4895texel array.
4896
4897The destination rectangle in the texture array may not include any
4898texels outside the texture array as it was originally specified. It is
4899not an error to specify a subtexture with zero width or height, but such
4900a specification has no effect.
4901
4902If any of the pixels within the specified rectangle of the current
4903`GL_READ_BUFFER' are outside the read window associated with the current
4904rendering context, then the values obtained for those pixels are
4905undefined.
4906
4907No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
4908parameters of the specified texture array or to texel values outside the
4909specified subregion.
4910
4911`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
4912
4913`GL_INVALID_OPERATION' is generated if the texture array has not been
4914defined by a previous `glTexImage3D' operation.
4915
4916`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4917
4918`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
4919the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
4920
4921`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
4922, YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
4923(ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
4924`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
4925`GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
4926, and D include twice the border width.
4927
4928`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
4929between the execution of `glBegin' and the corresponding execution of
4930`glEnd'.")
8925f36f 4931
25072f02 4932(define-gl-procedures
bb894c9d 4933 ((glCreateProgram -> GLuint))
3c9b6116
AW
4934 "Creates a program object.
4935
4936`glCreateProgram' creates an empty program object and returns a non-zero
4937value by which it can be referenced. A program object is an object to
4938which shader objects can be attached. This provides a mechanism to
4939specify the shader objects that will be linked to create a program. It
4940also provides a means for checking the compatibility of the shaders that
4941will be used to create a program (for instance, checking the
4942compatibility between a vertex shader and a fragment shader). When no
4943longer needed as part of a program object, shader objects can be
4944detached.
4945
4946One or more executables are created in a program object by successfully
4947attaching shader objects to it with `glAttachShader', successfully
4948compiling the shader objects with `glCompileShader', and successfully
4949linking the program object with `glLinkProgram'. These executables are
4950made part of current state when `glUseProgram' is called. Program
4951objects can be deleted by calling `glDeleteProgram'. The memory
4952associated with the program object will be deleted when it is no longer
4953part of current rendering state for any context.
4954
4955This function returns 0 if an error occurs creating the program object.
4956
4957`GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
4958between the execution of `glBegin' and the corresponding execution of
4959`glEnd'.")
8925f36f 4960
25072f02 4961(define-gl-procedures
bb894c9d 4962 ((glCreateShader (shaderType GLenum) -> GLuint))
3c9b6116
AW
4963 "Creates a shader object.
4964
4965SHADERTYPE
4966 Specifies the type of shader to be created. Must be either
4967 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
4968
4969`glCreateShader' creates an empty shader object and returns a non-zero
4970value by which it can be referenced. A shader object is used to maintain
4971the source code strings that define a shader. SHADERTYPE indicates the
4972type of shader to be created. Two types of shaders are supported. A
4973shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
4974the programmable vertex processor and replace the fixed functionality
4975vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
4976shader that is intended to run on the programmable fragment processor
4977and replace the fixed functionality fragment processing in OpenGL.
4978
4979When created, a shader object's `GL_SHADER_TYPE' parameter is set to
4980either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
4981value of SHADERTYPE.
4982
4983This function returns 0 if an error occurs creating the shader object.
4984
4985`GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
4986
4987`GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
4988between the execution of `glBegin' and the corresponding execution of
4989`glEnd'.")
8925f36f 4990
25072f02 4991(define-gl-procedures
bb894c9d 4992 ((glCullFace (mode GLenum) -> void))
3c9b6116
AW
4993 "Specify whether front- or back-facing facets can be culled.
4994
4995MODE
4996 Specifies whether front- or back-facing facets are candidates for
4997 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
4998 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
4999
5000`glCullFace' specifies whether front- or back-facing facets are culled
5001(as specified by MODE) when facet culling is enabled. Facet culling is
5002initially disabled. To enable and disable facet culling, call the
5003`glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
5004Facets include triangles, quadrilaterals, polygons, and rectangles.
5005
5006`glFrontFace' specifies which of the clockwise and counterclockwise
5007facets are front-facing and back-facing. See `glFrontFace'.
5008
5009`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5010
5011`GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
5012the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5013
25072f02 5014(define-gl-procedures
00239761
AW
5015 ((glDeleteBuffers
5016 (n GLsizei)
5017 (buffers const-GLuint-*)
5018 ->
5019 void))
3c9b6116
AW
5020 "Delete named buffer objects.
5021
5022N
5023 Specifies the number of buffer objects to be deleted.
5024
5025BUFFERS
5026 Specifies an array of buffer objects to be deleted.
5027
5028`glDeleteBuffers' deletes N buffer objects named by the elements of the
5029array BUFFERS. After a buffer object is deleted, it has no contents, and
5030its name is free for reuse (for example by `glGenBuffers'). If a buffer
5031object that is currently bound is deleted, the binding reverts to 0 (the
5032absence of any buffer object, which reverts to client memory usage).
5033
5034`glDeleteBuffers' silently ignores 0's and names that do not correspond
5035to existing buffer objects.
5036
5037`GL_INVALID_VALUE' is generated if N is negative.
5038
5039`GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
5040between the execution of `glBegin' and the corresponding execution of
5041`glEnd'.")
8925f36f 5042
25072f02 5043(define-gl-procedures
bb894c9d
AW
5044 ((glDeleteLists
5045 (list GLuint)
5046 (range GLsizei)
5047 ->
5048 void))
3c9b6116
AW
5049 "Delete a contiguous group of display lists.
5050
5051LIST
5052 Specifies the integer name of the first display list to delete.
5053
5054RANGE
5055 Specifies the number of display lists to delete.
5056
5057`glDeleteLists' causes a contiguous group of display lists to be
5058deleted. LIST is the name of the first display list to be deleted, and
5059RANGE is the number of display lists to delete. All display lists D with
5060LIST<=D<=LIST+RANGE-1 are deleted.
5061
5062All storage locations allocated to the specified display lists are
5063freed, and the names are available for reuse at a later time. Names
5064within the range that do not have an associated display list are
5065ignored. If RANGE is 0, nothing happens.
5066
5067`GL_INVALID_VALUE' is generated if RANGE is negative.
5068
5069`GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
5070between the execution of `glBegin' and the corresponding execution of
5071`glEnd'.")
8925f36f 5072
25072f02 5073(define-gl-procedures
bb894c9d 5074 ((glDeleteProgram (program GLuint) -> void))
3c9b6116
AW
5075 "Deletes a program object.
5076
5077PROGRAM
5078 Specifies the program object to be deleted.
5079
5080`glDeleteProgram' frees the memory and invalidates the name associated
5081with the program object specified by PROGRAM. This command effectively
5082undoes the effects of a call to `glCreateProgram'.
5083
5084If a program object is in use as part of current rendering state, it
5085will be flagged for deletion, but it will not be deleted until it is no
5086longer part of current state for any rendering context. If a program
5087object to be deleted has shader objects attached to it, those shader
5088objects will be automatically detached but not deleted unless they have
5089already been flagged for deletion by a previous call to
5090`glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
5091
5092To determine whether a program object has been flagged for deletion,
5093call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
5094
5095`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
5096OpenGL.
5097
5098`GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
5099between the execution of `glBegin' and the corresponding execution of
5100`glEnd'.")
8925f36f 5101
25072f02 5102(define-gl-procedures
00239761
AW
5103 ((glDeleteQueries
5104 (n GLsizei)
5105 (ids const-GLuint-*)
5106 ->
5107 void))
3c9b6116
AW
5108 "Delete named query objects.
5109
5110N
5111 Specifies the number of query objects to be deleted.
5112
5113IDS
5114 Specifies an array of query objects to be deleted.
5115
5116`glDeleteQueries' deletes N query objects named by the elements of the
5117array IDS. After a query object is deleted, it has no contents, and its
5118name is free for reuse (for example by `glGenQueries').
5119
5120`glDeleteQueries' silently ignores 0's and names that do not correspond
5121to existing query objects.
5122
5123`GL_INVALID_VALUE' is generated if N is negative.
5124
5125`GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5126between the execution of `glBegin' and the corresponding execution of
5127`glEnd'.")
8925f36f 5128
25072f02 5129(define-gl-procedures
bb894c9d 5130 ((glDeleteShader (shader GLuint) -> void))
3c9b6116
AW
5131 "Deletes a shader object.
5132
5133SHADER
5134 Specifies the shader object to be deleted.
5135
5136`glDeleteShader' frees the memory and invalidates the name associated
5137with the shader object specified by SHADER. This command effectively
5138undoes the effects of a call to `glCreateShader'.
5139
5140If a shader object to be deleted is attached to a program object, it
5141will be flagged for deletion, but it will not be deleted until it is no
5142longer attached to any program object, for any rendering context (i.e.,
5143it must be detached from wherever it was attached before it will be
5144deleted). A value of 0 for SHADER will be silently ignored.
5145
5146To determine whether an object has been flagged for deletion, call
5147`glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5148
5149`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5150OpenGL.
5151
5152`GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5153between the execution of `glBegin' and the corresponding execution of
5154`glEnd'.")
8925f36f 5155
25072f02 5156(define-gl-procedures
bb894c9d
AW
5157 ((glDeleteTextures
5158 (n GLsizei)
00239761 5159 (textures const-GLuint-*)
bb894c9d
AW
5160 ->
5161 void))
3c9b6116
AW
5162 "Delete named textures.
5163
5164N
5165 Specifies the number of textures to be deleted.
5166
5167TEXTURES
5168 Specifies an array of textures to be deleted.
5169
5170`glDeleteTextures' deletes N textures named by the elements of the array
5171TEXTURES. After a texture is deleted, it has no contents or
5172dimensionality, and its name is free for reuse (for example by
5173`glGenTextures'). If a texture that is currently bound is deleted, the
5174binding reverts to 0 (the default texture).
5175
5176`glDeleteTextures' silently ignores 0's and names that do not correspond
5177to existing textures.
5178
5179`GL_INVALID_VALUE' is generated if N is negative.
5180
5181`GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5182between the execution of `glBegin' and the corresponding execution of
5183`glEnd'.")
8925f36f 5184
25072f02 5185(define-gl-procedures
bb894c9d 5186 ((glDepthFunc (func GLenum) -> void))
3c9b6116
AW
5187 "Specify the value used for depth buffer comparisons.
5188
5189FUNC
5190 Specifies the depth comparison function. Symbolic constants
5191 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5192 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5193 initial value is `GL_LESS'.
5194
5195`glDepthFunc' specifies the function used to compare each incoming pixel
5196depth value with the depth value present in the depth buffer. The
5197comparison is performed only if depth testing is enabled. (See
5198`glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5199
5200FUNC specifies the conditions under which the pixel will be drawn. The
5201comparison functions are as follows:
5202
5203`GL_NEVER'
5204 Never passes.
5205
5206`GL_LESS'
5207 Passes if the incoming depth value is less than the stored depth
5208 value.
5209
5210`GL_EQUAL'
5211 Passes if the incoming depth value is equal to the stored depth
5212 value.
5213
5214`GL_LEQUAL'
5215 Passes if the incoming depth value is less than or equal to the
5216 stored depth value.
5217
5218`GL_GREATER'
5219 Passes if the incoming depth value is greater than the stored depth
5220 value.
5221
5222`GL_NOTEQUAL'
5223 Passes if the incoming depth value is not equal to the stored depth
5224 value.
5225
5226`GL_GEQUAL'
5227 Passes if the incoming depth value is greater than or equal to the
5228 stored depth value.
5229
5230`GL_ALWAYS'
5231 Always passes.
5232
5233The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5234disabled. If depth testing is disabled or if no depth buffer exists, it
5235is as if the depth test always passes.
5236
5237`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5238
5239`GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5240the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5241
25072f02 5242(define-gl-procedures
bb894c9d 5243 ((glDepthMask (flag GLboolean) -> void))
3c9b6116
AW
5244 "Enable or disable writing into the depth buffer.
5245
5246FLAG
5247 Specifies whether the depth buffer is enabled for writing. If FLAG
5248 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5249 enabled. Initially, depth buffer writing is enabled.
5250
5251`glDepthMask' specifies whether the depth buffer is enabled for writing.
5252If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5253is enabled. Initially, depth buffer writing is enabled.
5254
5255`GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5256the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5257
25072f02 5258(define-gl-procedures
bb894c9d
AW
5259 ((glDepthRange
5260 (nearVal GLclampd)
5261 (farVal GLclampd)
5262 ->
5263 void))
3c9b6116
AW
5264 "Specify mapping of depth values from normalized device coordinates to
5265window coordinates.
5266
5267NEARVAL
5268 Specifies the mapping of the near clipping plane to window
5269 coordinates. The initial value is 0.
5270
5271FARVAL
5272 Specifies the mapping of the far clipping plane to window
5273 coordinates. The initial value is 1.
5274
5275After clipping and division by W, depth coordinates range from -1 to 1,
5276corresponding to the near and far clipping planes. `glDepthRange'
5277specifies a linear mapping of the normalized depth coordinates in this
5278range to window depth coordinates. Regardless of the actual depth buffer
5279implementation, window coordinate depth values are treated as though
5280they range from 0 through 1 (like color components). Thus, the values
5281accepted by `glDepthRange' are both clamped to this range before they
5282are accepted.
5283
5284The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5285With this mapping, the depth buffer range is fully utilized.
5286
5287`GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5288between the execution of `glBegin' and the corresponding execution of
5289`glEnd'.")
8925f36f 5290
25072f02 5291(define-gl-procedures
bb894c9d
AW
5292 ((glDetachShader
5293 (program GLuint)
5294 (shader GLuint)
5295 ->
5296 void))
3c9b6116
AW
5297 "Detaches a shader object from a program object to which it is attached.
5298
5299PROGRAM
5300 Specifies the program object from which to detach the shader
5301 object.
5302
5303SHADER
5304 Specifies the shader object to be detached.
5305
5306`glDetachShader' detaches the shader object specified by SHADER from the
5307program object specified by PROGRAM. This command can be used to undo
5308the effect of the command `glAttachShader'.
5309
5310If SHADER has already been flagged for deletion by a call to
5311`glDeleteShader' and it is not attached to any other program object, it
5312will be deleted after it has been detached.
5313
5314`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5315that was not generated by OpenGL.
5316
5317`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5318
5319`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5320
5321`GL_INVALID_OPERATION' is generated if SHADER is not attached to
5322PROGRAM.
5323
5324`GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5325between the execution of `glBegin' and the corresponding execution of
5326`glEnd'.")
8925f36f 5327
25072f02 5328(define-gl-procedures
bb894c9d
AW
5329 ((glDrawArrays
5330 (mode GLenum)
5331 (first GLint)
5332 (count GLsizei)
5333 ->
5334 void))
3c9b6116
AW
5335 "Render primitives from array data.
5336
5337MODE
5338 Specifies what kind of primitives to render. Symbolic constants
5339 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5340 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5341 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5342
5343FIRST
5344 Specifies the starting index in the enabled arrays.
5345
5346COUNT
5347 Specifies the number of indices to be rendered.
5348
5349`glDrawArrays' specifies multiple geometric primitives with very few
5350subroutine calls. Instead of calling a GL procedure to pass each
5351individual vertex, normal, texture coordinate, edge flag, or color, you
5352can prespecify separate arrays of vertices, normals, and colors and use
5353them to construct a sequence of primitives with a single call to
5354`glDrawArrays'.
5355
5356When `glDrawArrays' is called, it uses COUNT sequential elements from
5357each enabled array to construct a sequence of geometric primitives,
5358beginning with element FIRST. MODE specifies what kind of primitives are
5359constructed and how the array elements construct those primitives. If
5360`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5361
5362Vertex attributes that are modified by `glDrawArrays' have an
5363unspecified value after `glDrawArrays' returns. For example, if
5364`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5365after `glDrawArrays' executes. Attributes that aren't modified remain
5366well defined.
5367
5368`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5369
5370`GL_INVALID_VALUE' is generated if COUNT is negative.
5371
5372`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5373bound to an enabled array and the buffer object's data store is
5374currently mapped.
5375
5376`GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5377between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5378
25072f02 5379(define-gl-procedures
00239761
AW
5380 ((glDrawBuffers
5381 (n GLsizei)
5382 (bufs const-GLenum-*)
5383 ->
5384 void))
3c9b6116
AW
5385 "Specifies a list of color buffers to be drawn into.
5386
5387N
5388 Specifies the number of buffers in BUFS.
5389
5390BUFS
5391 Points to an array of symbolic constants specifying the buffers
5392 into which fragment colors or data values will be written.
5393
5394`glDrawBuffers' defines an array of buffers into which fragment color
5395values or fragment data will be written. If no fragment shader is
5396active, rendering operations will generate only one fragment color per
5397fragment and it will be written into each of the buffers specified by
5398BUFS. If a fragment shader is active and it writes a value to the output
5399variable `gl_FragColor', then that value will be written into each of
5400the buffers specified by BUFS. If a fragment shader is active and it
5401writes a value to one or more elements of the output array variable
5402`gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5403into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5404will be written into the second buffer specified by BUFS, and so on up
5405to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5406beyond is implicitly set to be `GL_NONE'.
5407
5408The symbolic constants contained in BUFS may be any of the following:
5409
5410`GL_NONE'
5411 The fragment color/data value is not written into any color buffer.
5412
5413`GL_FRONT_LEFT'
5414 The fragment color/data value is written into the front left color
5415 buffer.
5416
5417`GL_FRONT_RIGHT'
5418 The fragment color/data value is written into the front right color
5419 buffer.
5420
5421`GL_BACK_LEFT'
5422 The fragment color/data value is written into the back left color
5423 buffer.
5424
5425`GL_BACK_RIGHT'
5426 The fragment color/data value is written into the back right color
5427 buffer.
5428
5429`GL_AUXi'
5430 The fragment color/data value is written into auxiliary buffer `i'.
5431
5432Except for `GL_NONE', the preceding symbolic constants may not appear
5433more than once in BUFS. The maximum number of draw buffers supported is
5434implementation dependent and can be queried by calling `glGet' with the
5435argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5436queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5437
5438`GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5439accepted value.
5440
5441`GL_INVALID_ENUM' is generated if N is less than 0.
5442
5443`GL_INVALID_OPERATION' is generated if a symbolic constant other than
5444`GL_NONE' appears more than once in BUFS.
5445
5446`GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5447than `GL_NONE' ) indicates a color buffer that does not exist in the
5448current GL context.
5449
5450`GL_INVALID_VALUE' is generated if N is greater than
5451`GL_MAX_DRAW_BUFFERS'.
5452
5453`GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5454between the execution of `glBegin' and the corresponding execution of
5455`glEnd'.")
8925f36f 5456
25072f02 5457(define-gl-procedures
bb894c9d 5458 ((glDrawBuffer (mode GLenum) -> void))
3c9b6116
AW
5459 "Specify which color buffers are to be drawn into.
5460
5461MODE
5462 Specifies up to four color buffers to be drawn into. Symbolic
5463 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5464 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5465 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5466 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5467 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5468 number of available aux buffers.) The initial value is `GL_FRONT'
5469 for single-buffered contexts, and `GL_BACK' for double-buffered
5470 contexts.
5471
5472When colors are written to the frame buffer, they are written into the
5473color buffers specified by `glDrawBuffer'. The specifications are as
5474follows:
5475
5476`GL_NONE'
5477 No color buffers are written.
5478
5479`GL_FRONT_LEFT'
5480 Only the front left color buffer is written.
5481
5482`GL_FRONT_RIGHT'
5483 Only the front right color buffer is written.
5484
5485`GL_BACK_LEFT'
5486 Only the back left color buffer is written.
5487
5488`GL_BACK_RIGHT'
5489 Only the back right color buffer is written.
5490
5491`GL_FRONT'
5492 Only the front left and front right color buffers are written. If
5493 there is no front right color buffer, only the front left color
5494 buffer is written.
5495
5496`GL_BACK'
5497 Only the back left and back right color buffers are written. If
5498 there is no back right color buffer, only the back left color
5499 buffer is written.
5500
5501`GL_LEFT'
5502 Only the front left and back left color buffers are written. If
5503 there is no back left color buffer, only the front left color
5504 buffer is written.
5505
5506`GL_RIGHT'
5507 Only the front right and back right color buffers are written. If
5508 there is no back right color buffer, only the front right color
5509 buffer is written.
5510
5511`GL_FRONT_AND_BACK'
5512 All the front and back color buffers (front left, front right, back
5513 left, back right) are written. If there are no back color buffers,
5514 only the front left and front right color buffers are written. If
5515 there are no right color buffers, only the front left and back left
5516 color buffers are written. If there are no right or back color
5517 buffers, only the front left color buffer is written.
5518
5519`GL_AUX'I
5520 Only auxiliary color buffer I is written.
5521
5522If more than one color buffer is selected for drawing, then blending or
5523logical operations are computed and applied independently for each color
5524buffer and can produce different results in each buffer.
5525
5526Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5527include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5528include only FRONT buffers, and double-buffered contexts include both
5529FRONT and BACK buffers. The context is selected at GL initialization.
5530
5531`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5532
5533`GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5534MODE exists.
5535
5536`GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5537between the execution of `glBegin' and the corresponding execution of
5538`glEnd'.")
8925f36f 5539
25072f02 5540(define-gl-procedures
bb894c9d
AW
5541 ((glDrawElements
5542 (mode GLenum)
5543 (count GLsizei)
5544 (type GLenum)
00239761 5545 (indices const-GLvoid-*)
bb894c9d
AW
5546 ->
5547 void))
3c9b6116
AW
5548 "Render primitives from array data.
5549
5550MODE
5551 Specifies what kind of primitives to render. Symbolic constants
5552 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5553 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5554 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5555
5556COUNT
5557 Specifies the number of elements to be rendered.
5558
5559TYPE
5560 Specifies the type of the values in INDICES. Must be one of
5561 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5562
5563INDICES
5564 Specifies a pointer to the location where the indices are stored.
5565
5566`glDrawElements' specifies multiple geometric primitives with very few
5567subroutine calls. Instead of calling a GL function to pass each
5568individual vertex, normal, texture coordinate, edge flag, or color, you
5569can prespecify separate arrays of vertices, normals, and so on, and use
5570them to construct a sequence of primitives with a single call to
5571`glDrawElements'.
5572
5573When `glDrawElements' is called, it uses COUNT sequential elements from
5574an enabled array, starting at INDICES to construct a sequence of
5575geometric primitives. MODE specifies what kind of primitives are
5576constructed and how the array elements construct these primitives. If
5577more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5578not enabled, no geometric primitives are constructed.
5579
5580Vertex attributes that are modified by `glDrawElements' have an
5581unspecified value after `glDrawElements' returns. For example, if
5582`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5583after `glDrawElements' executes. Attributes that aren't modified
5584maintain their previous values.
5585
5586`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5587
5588`GL_INVALID_VALUE' is generated if COUNT is negative.
5589
5590`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5591bound to an enabled array or the element array and the buffer object's
5592data store is currently mapped.
5593
5594`GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5595between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5596
25072f02 5597(define-gl-procedures
bb894c9d
AW
5598 ((glDrawPixels
5599 (width GLsizei)
5600 (height GLsizei)
5601 (format GLenum)
5602 (type GLenum)
00239761 5603 (data const-GLvoid-*)
bb894c9d
AW
5604 ->
5605 void))
3c9b6116 5606 "Write a block of pixels to the frame buffer.
8925f36f 5607
3c9b6116
AW
5608WIDTH
5609 HEIGHT
8925f36f 5610
3c9b6116
AW
5611 Specify the dimensions of the pixel rectangle to be written into
5612 the frame buffer.
8925f36f 5613
3c9b6116
AW
5614FORMAT
5615 Specifies the format of the pixel data. Symbolic constants
5616 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5617 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5618 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5619 accepted.
8925f36f 5620
3c9b6116
AW
5621TYPE
5622 Specifies the data type for DATA. Symbolic constants
5623 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5624 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5625 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5626 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5627 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5628 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5629 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5630 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5631 are accepted.
8925f36f 5632
3c9b6116
AW
5633DATA
5634 Specifies a pointer to the pixel data.
8925f36f 5635
3c9b6116
AW
5636`glDrawPixels' reads pixel data from memory and writes it into the frame
5637buffer relative to the current raster position, provided that the raster
5638position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5639raster position; use `glGet' with argument
5640`GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5641position is valid, and `glGet' with argument
5642`GL_CURRENT_RASTER_POSITION' to query the raster position.
8925f36f 5643
3c9b6116
AW
5644Several parameters define the encoding of pixel data in memory and
5645control the processing of the pixel data before it is placed in the
5646frame buffer. These parameters are set with four commands:
5647`glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5648reference page describes the effects on `glDrawPixels' of many, but not
5649all, of the parameters specified by these four commands.
8925f36f 5650
3c9b6116
AW
5651Data is read from DATA as a sequence of signed or unsigned bytes, signed
5652or unsigned shorts, signed or unsigned integers, or single-precision
5653floating-point values, depending on TYPE. When TYPE is one of
5654`GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5655`GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5656integers, or floating-point values is interpreted as one color or depth
5657component, or one index, depending on FORMAT. When TYPE is one of
5658`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5659`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5660`GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5661unsigned value is interpreted as containing all the components for a
5662single pixel, with the color components arranged according to FORMAT.
5663When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5664`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5665`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5666`GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5667containing all color components, specified by FORMAT, for a single pixel
5668in a reversed order. Indices are always treated individually. Color
5669components are treated as groups of one, two, three, or four values,
5670again based on FORMAT. Both individual indices and groups of components
5671are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5672unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5673`GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
5674with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
5675`glPixelStore').
8925f36f 5676
3c9b6116
AW
5677WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
5678default, these pixels are taken from adjacent memory locations, except
5679that after all WIDTH pixels are read, the read pointer is advanced to
5680the next four-byte boundary. The four-byte row alignment is specified by
5681`glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
5682one, two, four, or eight bytes. Other pixel store parameters specify
5683different read pointer advancements, both before the first pixel is read
5684and after all WIDTH pixels are read. See the `glPixelStore' reference
5685page for details on these options.
5686
5687If a non-zero named buffer object is bound to the
5688`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
5689pixels is specified, DATA is treated as a byte offset into the buffer
5690object's data store.
5691
5692The WIDTH×HEIGHT pixels that are read from memory are each operated on
5693in the same way, based on the values of several parameters specified by
5694`glPixelTransfer' and `glPixelMap'. The details of these operations, as
5695well as the target buffer into which the pixels are drawn, are specific
5696to the format of the pixels, as specified by FORMAT. FORMAT can assume
5697one of 13 symbolic values:
5698
5699`GL_COLOR_INDEX'
5700 Each pixel is a single value, a color index. It is converted to
5701 fixed-point format, with an unspecified number of bits to the right
5702 of the binary point, regardless of the memory data type.
5703 Floating-point values convert to true fixed-point values. Signed
5704 and unsigned integer data is converted with all fraction bits set
5705 to 0. Bitmap data convert to either 0 or 1.
5706
5707 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5708 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5709 negative, the shift is to the right. In either case, zero bits fill
5710 otherwise unspecified bit locations in the result.
5711
5712 If the GL is in RGBA mode, the resulting index is converted to an
5713 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
5714 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
5715 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
5716 if `GL_MAP_COLOR' is true, the index is replaced with the value
5717 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
5718 the lookup replacement of the index is done or not, the integer
5719 part of the index is then ANDed with 2^B-1 , where B is the number
5720 of bits in a color index buffer.
5721
5722 The GL then converts the resulting indices or RGBA colors to
5723 fragments by attaching the current raster position Z coordinate and
5724 texture coordinates to each pixel, then assigning X and Y window
5725 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
5726 Y_N=Y_R+⌊N/WIDTH,⌋
5727
5728 where (X_R,Y_R) is the current raster position. These pixel
5729 fragments are then treated just like the fragments generated by
5730 rasterizing points, lines, or polygons. Texture mapping, fog, and
5731 all the fragment operations are applied before the fragments are
5732 written to the frame buffer.
5733
5734`GL_STENCIL_INDEX'
5735 Each pixel is a single value, a stencil index. It is converted to
5736 fixed-point format, with an unspecified number of bits to the right
5737 of the binary point, regardless of the memory data type.
5738 Floating-point values convert to true fixed-point values. Signed
5739 and unsigned integer data is converted with all fraction bits set
5740 to 0. Bitmap data convert to either 0 or 1.
5741
5742 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
5743 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
5744 negative, the shift is to the right. In either case, zero bits fill
5745 otherwise unspecified bit locations in the result. If
5746 `GL_MAP_STENCIL' is true, the index is replaced with the value that
5747 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
5748 lookup replacement of the index is done or not, the integer part of
5749 the index is then ANDed with 2^B-1 , where B is the number of bits
5750 in the stencil buffer. The resulting stencil indices are then
5751 written to the stencil buffer such that the N th index is written
5752 to location
5753
5754 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5755
5756 where (X_R,Y_R) is the current raster position. Only the pixel
5757 ownership test, the scissor test, and the stencil writemask affect
5758 these write operations.
5759
5760`GL_DEPTH_COMPONENT'
5761 Each pixel is a single-depth component. Floating-point data is
5762 converted directly to an internal floating-point format with
5763 unspecified precision. Signed integer data is mapped linearly to
5764 the internal floating-point format such that the most positive
5765 representable integer value maps to 1.0, and the most negative
5766 representable value maps to -1.0 . Unsigned integer data is mapped
5767 similarly: the largest integer value maps to 1.0, and 0 maps to
5768 0.0. The resulting floating-point depth value is then multiplied by
5769 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
5770 clamped to the range [0,1] .
5771
5772 The GL then converts the resulting depth components to fragments by
5773 attaching the current raster position color or color index and
5774 texture coordinates to each pixel, then assigning X and Y window
5775 coordinates to the N th fragment such that
5776
5777 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5778
5779 where (X_R,Y_R) is the current raster position. These pixel
5780 fragments are then treated just like the fragments generated by
5781 rasterizing points, lines, or polygons. Texture mapping, fog, and
5782 all the fragment operations are applied before the fragments are
5783 written to the frame buffer.
5784
5785`GL_RGBA'
5786`GL_BGRA'
5787 Each pixel is a four-component group: For `GL_RGBA', the red
5788 component is first, followed by green, followed by blue, followed
5789 by alpha; for `GL_BGRA' the order is blue, green, red and then
5790 alpha. Floating-point values are converted directly to an internal
5791 floating-point format with unspecified precision. Signed integer
5792 values are mapped linearly to the internal floating-point format
5793 such that the most positive representable integer value maps to
5794 1.0, and the most negative representable value maps to -1.0 . (Note
5795 that this mapping does not convert 0 precisely to 0.0.) Unsigned
5796 integer data is mapped similarly: The largest integer value maps to
5797 1.0, and 0 maps to 0.0. The resulting floating-point color values
5798 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
5799 C is RED, GREEN, BLUE, and ALPHA for the respective color
5800 components. The results are clamped to the range [0,1] .
5801
5802 If `GL_MAP_COLOR' is true, each color component is scaled by the
5803 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
5804 value that it references in that table. C is R, G, B, or A
5805 respectively.
5806
5807 The GL then converts the resulting RGBA colors to fragments by
5808 attaching the current raster position Z coordinate and texture
5809 coordinates to each pixel, then assigning X and Y window
5810 coordinates to the N th fragment such that
5811
5812 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
5813
5814 where (X_R,Y_R) is the current raster position. These pixel
5815 fragments are then treated just like the fragments generated by
5816 rasterizing points, lines, or polygons. Texture mapping, fog, and
5817 all the fragment operations are applied before the fragments are
5818 written to the frame buffer.
5819
5820`GL_RED'
5821 Each pixel is a single red component. This component is converted
5822 to the internal floating-point format in the same way the red
5823 component of an RGBA pixel is. It is then converted to an RGBA
5824 pixel with green and blue set to 0, and alpha set to 1. After this
5825 conversion, the pixel is treated as if it had been read as an RGBA
5826 pixel.
5827
5828`GL_GREEN'
5829 Each pixel is a single green component. This component is converted
5830 to the internal floating-point format in the same way the green
5831 component of an RGBA pixel is. It is then converted to an RGBA
5832 pixel with red and blue set to 0, and alpha set to 1. After this
5833 conversion, the pixel is treated as if it had been read as an RGBA
5834 pixel.
5835
5836`GL_BLUE'
5837 Each pixel is a single blue component. This component is converted
5838 to the internal floating-point format in the same way the blue
5839 component of an RGBA pixel is. It is then converted to an RGBA
5840 pixel with red and green set to 0, and alpha set to 1. After this
5841 conversion, the pixel is treated as if it had been read as an RGBA
5842 pixel.
5843
5844`GL_ALPHA'
5845 Each pixel is a single alpha component. This component is converted
5846 to the internal floating-point format in the same way the alpha
5847 component of an RGBA pixel is. It is then converted to an RGBA
5848 pixel with red, green, and blue set to 0. After this conversion,
5849 the pixel is treated as if it had been read as an RGBA pixel.
5850
5851`GL_RGB'
5852`GL_BGR'
5853 Each pixel is a three-component group: red first, followed by
5854 green, followed by blue; for `GL_BGR', the first component is blue,
5855 followed by green and then red. Each component is converted to the
5856 internal floating-point format in the same way the red, green, and
5857 blue components of an RGBA pixel are. The color triple is converted
5858 to an RGBA pixel with alpha set to 1. After this conversion, the
5859 pixel is treated as if it had been read as an RGBA pixel.
5860
5861`GL_LUMINANCE'
5862 Each pixel is a single luminance component. This component is
5863 converted to the internal floating-point format in the same way the
5864 red component of an RGBA pixel is. It is then converted to an RGBA
5865 pixel with red, green, and blue set to the converted luminance
5866 value, and alpha set to 1. After this conversion, the pixel is
5867 treated as if it had been read as an RGBA pixel.
5868
5869`GL_LUMINANCE_ALPHA'
5870 Each pixel is a two-component group: luminance first, followed by
5871 alpha. The two components are converted to the internal
5872 floating-point format in the same way the red component of an RGBA
5873 pixel is. They are then converted to an RGBA pixel with red, green,
5874 and blue set to the converted luminance value, and alpha set to the
5875 converted alpha value. After this conversion, the pixel is treated
5876 as if it had been read as an RGBA pixel.
5877
5878The following table summarizes the meaning of the valid constants for
5879the TYPE parameter:
5880
5881
5882
5883*Type*
5884 *Corresponding Type*
5885
5886`GL_UNSIGNED_BYTE'
5887 unsigned 8-bit integer
5888
5889`GL_BYTE'
5890 signed 8-bit integer
5891
5892`GL_BITMAP'
5893 single bits in unsigned 8-bit integers
5894
5895`GL_UNSIGNED_SHORT'
5896 unsigned 16-bit integer
5897
5898`GL_SHORT'
5899 signed 16-bit integer
5900
5901`GL_UNSIGNED_INT'
5902 unsigned 32-bit integer
5903
5904`GL_INT'
5905 32-bit integer
5906
5907`GL_FLOAT'
5908 single-precision floating-point
5909
5910`GL_UNSIGNED_BYTE_3_3_2'
5911 unsigned 8-bit integer
5912
5913`GL_UNSIGNED_BYTE_2_3_3_REV'
5914 unsigned 8-bit integer with reversed component ordering
5915
5916`GL_UNSIGNED_SHORT_5_6_5'
5917 unsigned 16-bit integer
5918
5919`GL_UNSIGNED_SHORT_5_6_5_REV'
5920 unsigned 16-bit integer with reversed component ordering
5921
5922`GL_UNSIGNED_SHORT_4_4_4_4'
5923 unsigned 16-bit integer
5924
5925`GL_UNSIGNED_SHORT_4_4_4_4_REV'
5926 unsigned 16-bit integer with reversed component ordering
5927
5928`GL_UNSIGNED_SHORT_5_5_5_1'
5929 unsigned 16-bit integer
5930
5931`GL_UNSIGNED_SHORT_1_5_5_5_REV'
5932 unsigned 16-bit integer with reversed component ordering
5933
5934`GL_UNSIGNED_INT_8_8_8_8'
5935 unsigned 32-bit integer
5936
5937`GL_UNSIGNED_INT_8_8_8_8_REV'
5938 unsigned 32-bit integer with reversed component ordering
5939
5940`GL_UNSIGNED_INT_10_10_10_2'
5941 unsigned 32-bit integer
5942
5943`GL_UNSIGNED_INT_2_10_10_10_REV'
5944 unsigned 32-bit integer with reversed component ordering
5945
5946
5947
5948The rasterization described so far assumes pixel zoom factors of 1. If
5949`glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
5950are converted to fragments as follows. If (X_R,Y_R) is the current
5951raster position, and a given pixel is in the N th column and M th row of
5952the pixel rectangle, then fragments are generated for pixels whose
5953centers are in the rectangle with corners at
5954
5955(X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
5956
5957where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
5958`GL_ZOOM_Y'.
5959
5960`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
5961accepted values.
5962
5963`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
5964either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
5965
5966`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
5967
5968`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
5969there is no stencil buffer.
5970
5971`GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
5972`GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
5973`GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
5974mode.
5975
5976`GL_INVALID_OPERATION' is generated if FORMAT is one of
5977`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5978`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
5979is not `GL_RGB'.
5980
5981`GL_INVALID_OPERATION' is generated if FORMAT is one of
5982`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5983`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5984`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5985`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
5986FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
5987
5988`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5989bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
5990data store is currently mapped.
5991
5992`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5993bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
5994unpacked from the buffer object such that the memory reads required
5995would exceed the data store size.
5996
5997`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5998bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
5999divisible into the number of bytes needed to store in memory a datum
6000indicated by TYPE.
6001
6002`GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
6003between the execution of `glBegin' and the corresponding execution of
6004`glEnd'.")
8925f36f 6005
25072f02 6006(define-gl-procedures
bb894c9d
AW
6007 ((glDrawRangeElements
6008 (mode GLenum)
6009 (start GLuint)
6010 (end GLuint)
6011 (count GLsizei)
6012 (type GLenum)
00239761 6013 (indices const-GLvoid-*)
bb894c9d
AW
6014 ->
6015 void))
3c9b6116 6016 "Render primitives from array data.
8925f36f 6017
3c9b6116
AW
6018MODE
6019 Specifies what kind of primitives to render. Symbolic constants
6020 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
6021 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
6022 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
8925f36f 6023
3c9b6116
AW
6024START
6025 Specifies the minimum array index contained in INDICES.
6026
6027END
6028 Specifies the maximum array index contained in INDICES.
6029
6030COUNT
6031 Specifies the number of elements to be rendered.
6032
6033TYPE
6034 Specifies the type of the values in INDICES. Must be one of
6035 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
6036
6037INDICES
6038 Specifies a pointer to the location where the indices are stored.
6039
6040`glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
6041START, END, and COUNT match the corresponding arguments to
6042`glDrawElements', with the additional constraint that all values in the
6043arrays COUNT must lie between START and END, inclusive.
6044
6045Implementations denote recommended maximum amounts of vertex and index
6046data, which may be queried by calling `glGet' with argument
6047`GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
6048is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
6049greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
6050operate at reduced performance. There is no requirement that all
6051vertices in the range [START,END] be referenced. However, the
6052implementation may partially process unused vertices, reducing
6053performance from what could be achieved with an optimal index set.
6054
6055When `glDrawRangeElements' is called, it uses COUNT sequential elements
6056from an enabled array, starting at START to construct a sequence of
6057geometric primitives. MODE specifies what kind of primitives are
6058constructed, and how the array elements construct these primitives. If
6059more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
6060not enabled, no geometric primitives are constructed.
6061
6062Vertex attributes that are modified by `glDrawRangeElements' have an
6063unspecified value after `glDrawRangeElements' returns. For example, if
6064`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
6065after `glDrawRangeElements' executes. Attributes that aren't modified
6066maintain their previous values.
6067
6068It is an error for indices to lie outside the range [START,END] , but
6069implementations may not check for this situation. Such indices cause
6070implementation-dependent behavior.
6071
6072`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6073
6074`GL_INVALID_VALUE' is generated if COUNT is negative.
6075
6076`GL_INVALID_VALUE' is generated if END<START .
6077
6078`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6079bound to an enabled array or the element array and the buffer object's
6080data store is currently mapped.
6081
6082`GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
6083between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 6084
25072f02 6085(define-gl-procedures
bb894c9d
AW
6086 ((glEdgeFlagPointer
6087 (stride GLsizei)
00239761 6088 (pointer const-GLvoid-*)
bb894c9d
AW
6089 ->
6090 void))
3c9b6116 6091 "Define an array of edge flags.
8925f36f 6092
3c9b6116
AW
6093STRIDE
6094 Specifies the byte offset between consecutive edge flags. If STRIDE
6095 is 0, the edge flags are understood to be tightly packed in the
6096 array. The initial value is 0.
8925f36f 6097
3c9b6116
AW
6098POINTER
6099 Specifies a pointer to the first edge flag in the array. The
6100 initial value is 0.
8925f36f 6101
3c9b6116
AW
6102`glEdgeFlagPointer' specifies the location and data format of an array
6103of boolean edge flags to use when rendering. STRIDE specifies the byte
6104stride from one edge flag to the next, allowing vertices and attributes
6105to be packed into a single array or stored in separate arrays.
8925f36f 6106
3c9b6116
AW
6107If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
6108target (see `glBindBuffer') while an edge flag array is specified,
6109POINTER is treated as a byte offset into the buffer object's data store.
6110Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
6111edge flag vertex array client-side state
6112(`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
8925f36f 6113
3c9b6116
AW
6114When an edge flag array is specified, STRIDE and POINTER are saved as
6115client-side state, in addition to the current vertex array buffer object
6116binding.
6117
6118To enable and disable the edge flag array, call `glEnableClientState'
6119and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
6120enabled, the edge flag array is used when `glDrawArrays',
6121`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
6122`glDrawRangeElements', or `glArrayElement' is called.
6123
6124`GL_INVALID_ENUM' is generated if STRIDE is negative.")
8925f36f 6125
25072f02 6126(define-gl-procedures
bb894c9d 6127 ((glEdgeFlag (flag GLboolean) -> void))
3c9b6116
AW
6128 "Flag edges as either boundary or nonboundary.
6129
6130FLAG
6131 Specifies the current edge flag value, either `GL_TRUE' or
6132 `GL_FALSE'. The initial value is `GL_TRUE'.
6133
6134Each vertex of a polygon, separate triangle, or separate quadrilateral
6135specified between a `glBegin'/`glEnd' pair is marked as the start of
6136either a boundary or nonboundary edge. If the current edge flag is true
6137when the vertex is specified, the vertex is marked as the start of a
6138boundary edge. Otherwise, the vertex is marked as the start of a
6139nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6140FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6141
6142The vertices of connected triangles and connected quadrilaterals are
6143always marked as boundary, regardless of the value of the edge flag.
6144
6145Boundary and nonboundary edge flags on vertices are significant only if
6146`GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6147`glPolygonMode'.")
8925f36f 6148
25072f02 6149(define-gl-procedures
bb894c9d
AW
6150 ((glEnableClientState (cap GLenum) -> void)
6151 (glDisableClientState (cap GLenum) -> void))
3c9b6116
AW
6152 "Enable or disable client-side capability.
6153
6154CAP
6155 Specifies the capability to enable. Symbolic constants
6156 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6157 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6158 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6159
6160`glEnableClientState' and `glDisableClientState' enable or disable
6161individual client-side capabilities. By default, all client-side
6162capabilities are disabled. Both `glEnableClientState' and
6163`glDisableClientState' take a single argument, CAP, which can assume one
6164of the following values:
6165
6166`GL_COLOR_ARRAY'
6167 If enabled, the color array is enabled for writing and used during
6168 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6169 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6170 is called. See `glColorPointer'.
6171
6172`GL_EDGE_FLAG_ARRAY'
6173 If enabled, the edge flag array is enabled for writing and used
6174 during rendering when `glArrayElement', `glDrawArrays',
6175 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6176 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6177
6178`GL_FOG_COORD_ARRAY'
6179 If enabled, the fog coordinate array is enabled for writing and
6180 used during rendering when `glArrayElement', `glDrawArrays',
6181 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6182 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6183
6184`GL_INDEX_ARRAY'
6185 If enabled, the index array is enabled for writing and used during
6186 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6187 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6188 is called. See `glIndexPointer'.
6189
6190`GL_NORMAL_ARRAY'
6191 If enabled, the normal array is enabled for writing and used during
6192 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6193 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6194 is called. See `glNormalPointer'.
6195
6196`GL_SECONDARY_COLOR_ARRAY'
6197 If enabled, the secondary color array is enabled for writing and
6198 used during rendering when `glArrayElement', `glDrawArrays',
6199 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6200 `glMultiDrawElements' is called. See `glColorPointer'.
6201
6202`GL_TEXTURE_COORD_ARRAY'
6203 If enabled, the texture coordinate array is enabled for writing and
6204 used during rendering when `glArrayElement', `glDrawArrays',
6205 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6206 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6207
6208`GL_VERTEX_ARRAY'
6209 If enabled, the vertex array is enabled for writing and used during
6210 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6211 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6212 is called. See `glVertexPointer'.
6213
6214`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6215
6216`glEnableClientState' is not allowed between the execution of `glBegin'
6217and the corresponding `glEnd', but an error may or may not be generated.
6218If no error is generated, the behavior is undefined.")
8925f36f 6219
25072f02 6220(define-gl-procedures
bb894c9d
AW
6221 ((glEnableVertexAttribArray
6222 (index GLuint)
6223 ->
6224 void)
6225 (glDisableVertexAttribArray
6226 (index GLuint)
6227 ->
6228 void))
3c9b6116
AW
6229 "Enable or disable a generic vertex attribute array.
6230
6231INDEX
6232 Specifies the index of the generic vertex attribute to be enabled
6233 or disabled.
6234
6235`glEnableVertexAttribArray' enables the generic vertex attribute array
6236specified by INDEX. `glDisableVertexAttribArray' disables the generic
6237vertex attribute array specified by INDEX. By default, all client-side
6238capabilities are disabled, including all generic vertex attribute
6239arrays. If enabled, the values in the generic vertex attribute array
6240will be accessed and used for rendering when calls are made to vertex
6241array commands such as `glDrawArrays', `glDrawElements',
6242`glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6243`glMultiDrawArrays'.
6244
6245`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6246`GL_MAX_VERTEX_ATTRIBS'.
6247
6248`GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6249' or `glDisableVertexAttribArray ' is executed between the execution of
6250`glBegin' and the corresponding execution of `glEnd'.")
8925f36f 6251
25072f02 6252(define-gl-procedures
bb894c9d
AW
6253 ((glEnable (cap GLenum) -> void)
6254 (glDisable (cap GLenum) -> void))
3c9b6116
AW
6255 "Enable or disable server-side GL capabilities.
6256
6257CAP
6258 Specifies a symbolic constant indicating a GL capability.
6259
6260`glEnable' and `glDisable' enable and disable various capabilities. Use
6261`glIsEnabled' or `glGet' to determine the current setting of any
6262capability. The initial value for each capability with the exception of
6263`GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6264`GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6265
6266Both `glEnable' and `glDisable' take a single argument, CAP, which can
6267assume one of the following values:
6268
6269`GL_ALPHA_TEST'
6270
6271
6272 If enabled, do alpha testing. See `glAlphaFunc'.
6273
6274`GL_AUTO_NORMAL'
6275
6276
6277 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6278 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6279
6280`GL_BLEND'
6281
6282
6283 If enabled, blend the computed fragment color values with the
6284 values in the color buffers. See `glBlendFunc'.
6285
6286`GL_CLIP_PLANE'I
6287
6288
6289 If enabled, clip geometry against user-defined clipping plane I.
6290 See `glClipPlane'.
6291
6292`GL_COLOR_LOGIC_OP'
6293
6294
6295 If enabled, apply the currently selected logical operation to the
6296 computed fragment color and color buffer values. See `glLogicOp'.
6297
6298`GL_COLOR_MATERIAL'
6299
6300
6301 If enabled, have one or more material parameters track the current
6302 color. See `glColorMaterial'.
6303
6304`GL_COLOR_SUM'
6305
6306
6307 If enabled and no fragment shader is active, add the secondary
6308 color value to the computed fragment color. See `glSecondaryColor'.
6309
6310`GL_COLOR_TABLE'
6311
6312
6313 If enabled, perform a color table lookup on the incoming RGBA color
6314 values. See `glColorTable'.
6315
6316`GL_CONVOLUTION_1D'
6317
6318
6319 If enabled, perform a 1D convolution operation on incoming RGBA
6320 color values. See `glConvolutionFilter1D'.
6321
6322`GL_CONVOLUTION_2D'
6323
6324
6325 If enabled, perform a 2D convolution operation on incoming RGBA
6326 color values. See `glConvolutionFilter2D'.
6327
6328`GL_CULL_FACE'
6329
6330
6331 If enabled, cull polygons based on their winding in window
6332 coordinates. See `glCullFace'.
6333
6334`GL_DEPTH_TEST'
6335
6336
6337 If enabled, do depth comparisons and update the depth buffer. Note
6338 that even if the depth buffer exists and the depth mask is
6339 non-zero, the depth buffer is not updated if the depth test is
6340 disabled. See `glDepthFunc' and `glDepthRange'.
6341
6342`GL_DITHER'
6343
6344
6345 If enabled, dither color components or indices before they are
6346 written to the color buffer.
6347
6348`GL_FOG'
6349
6350
6351 If enabled and no fragment shader is active, blend a fog color into
6352 the post-texturing color. See `glFog'.
6353
6354`GL_HISTOGRAM'
6355
6356
6357 If enabled, histogram incoming RGBA color values. See
6358 `glHistogram'.
6359
6360`GL_INDEX_LOGIC_OP'
6361
6362
6363 If enabled, apply the currently selected logical operation to the
6364 incoming index and color buffer indices. See `glLogicOp'.
6365
6366`GL_LIGHT'I
6367
6368
6369 If enabled, include light I in the evaluation of the lighting
6370 equation. See `glLightModel' and `glLight'.
6371
6372`GL_LIGHTING'
6373
6374
6375 If enabled and no vertex shader is active, use the current lighting
6376 parameters to compute the vertex color or index. Otherwise, simply
6377 associate the current color or index with each vertex. See
6378 `glMaterial', `glLightModel', and `glLight'.
6379
6380`GL_LINE_SMOOTH'
6381
6382
6383 If enabled, draw lines with correct filtering. Otherwise, draw
6384 aliased lines. See `glLineWidth'.
6385
6386`GL_LINE_STIPPLE'
6387
6388
6389 If enabled, use the current line stipple pattern when drawing
6390 lines. See `glLineStipple'.
6391
6392`GL_MAP1_COLOR_4'
6393
6394
6395 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6396 `glEvalPoint1' generate RGBA values. See `glMap1'.
6397
6398`GL_MAP1_INDEX'
6399
6400
6401 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6402 `glEvalPoint1' generate color indices. See `glMap1'.
6403
6404`GL_MAP1_NORMAL'
6405
6406
6407 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6408 `glEvalPoint1' generate normals. See `glMap1'.
6409
6410`GL_MAP1_TEXTURE_COORD_1'
6411
6412
6413 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6414 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6415
6416`GL_MAP1_TEXTURE_COORD_2'
6417
6418
6419 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6420 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6421
6422`GL_MAP1_TEXTURE_COORD_3'
6423
6424
6425 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6426 `glEvalPoint1' generate S, T, and R texture coordinates. See
6427 `glMap1'.
6428
6429`GL_MAP1_TEXTURE_COORD_4'
6430
6431
6432 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6433 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6434 `glMap1'.
6435
6436`GL_MAP1_VERTEX_3'
6437
6438
6439 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6440 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6441 `glMap1'.
6442
6443`GL_MAP1_VERTEX_4'
6444
6445
6446 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6447 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6448 coordinates. See `glMap1'.
6449
6450`GL_MAP2_COLOR_4'
6451
6452
6453 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6454 `glEvalPoint2' generate RGBA values. See `glMap2'.
6455
6456`GL_MAP2_INDEX'
6457
6458
6459 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6460 `glEvalPoint2' generate color indices. See `glMap2'.
6461
6462`GL_MAP2_NORMAL'
6463
6464
6465 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6466 `glEvalPoint2' generate normals. See `glMap2'.
6467
6468`GL_MAP2_TEXTURE_COORD_1'
6469
6470
6471 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6472 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6473
6474`GL_MAP2_TEXTURE_COORD_2'
6475
6476
6477 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6478 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6479
6480`GL_MAP2_TEXTURE_COORD_3'
6481
6482
6483 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6484 `glEvalPoint2' generate S, T, and R texture coordinates. See
6485 `glMap2'.
6486
6487`GL_MAP2_TEXTURE_COORD_4'
6488
6489
6490 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6491 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6492 `glMap2'.
6493
6494`GL_MAP2_VERTEX_3'
6495
6496
6497 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6498 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6499 `glMap2'.
6500
6501`GL_MAP2_VERTEX_4'
6502
6503
6504 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6505 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6506 coordinates. See `glMap2'.
6507
6508`GL_MINMAX'
6509
6510
6511 If enabled, compute the minimum and maximum values of incoming RGBA
6512 color values. See `glMinmax'.
6513
6514`GL_MULTISAMPLE'
6515
6516
6517 If enabled, use multiple fragment samples in computing the final
6518 color of a pixel. See `glSampleCoverage'.
6519
6520`GL_NORMALIZE'
6521
6522
6523 If enabled and no vertex shader is active, normal vectors are
6524 normalized to unit length after transformation and before lighting.
6525 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6526 See `glNormal' and `glNormalPointer'.
6527
6528`GL_POINT_SMOOTH'
6529
6530
6531 If enabled, draw points with proper filtering. Otherwise, draw
6532 aliased points. See `glPointSize'.
6533
6534`GL_POINT_SPRITE'
6535
6536
6537 If enabled, calculate texture coordinates for points based on
6538 texture environment and point parameter settings. Otherwise texture
6539 coordinates are constant across points.
6540
6541`GL_POLYGON_OFFSET_FILL'
6542
6543
6544 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6545 offset is added to depth values of a polygon's fragments before the
6546 depth comparison is performed. See `glPolygonOffset'.
6547
6548`GL_POLYGON_OFFSET_LINE'
6549
6550
6551 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6552 offset is added to depth values of a polygon's fragments before the
6553 depth comparison is performed. See `glPolygonOffset'.
6554
6555`GL_POLYGON_OFFSET_POINT'
6556
6557
6558 If enabled, an offset is added to depth values of a polygon's
6559 fragments before the depth comparison is performed, if the polygon
6560 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6561
6562`GL_POLYGON_SMOOTH'
6563
6564
6565 If enabled, draw polygons with proper filtering. Otherwise, draw
6566 aliased polygons. For correct antialiased polygons, an alpha buffer
6567 is needed and the polygons must be sorted front to back.
6568
6569`GL_POLYGON_STIPPLE'
6570
6571
6572 If enabled, use the current polygon stipple pattern when rendering
6573 polygons. See `glPolygonStipple'.
6574
6575`GL_POST_COLOR_MATRIX_COLOR_TABLE'
6576
6577
6578 If enabled, perform a color table lookup on RGBA color values after
6579 color matrix transformation. See `glColorTable'.
6580
6581`GL_POST_CONVOLUTION_COLOR_TABLE'
6582
6583
6584 If enabled, perform a color table lookup on RGBA color values after
6585 convolution. See `glColorTable'.
6586
6587`GL_RESCALE_NORMAL'
6588
6589
6590 If enabled and no vertex shader is active, normal vectors are
6591 scaled after transformation and before lighting by a factor
6592 computed from the modelview matrix. If the modelview matrix scales
6593 space uniformly, this has the effect of restoring the transformed
6594 normal to unit length. This method is generally more efficient than
6595 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6596
6597`GL_SAMPLE_ALPHA_TO_COVERAGE'
6598
6599
6600 If enabled, compute a temporary coverage value where each bit is
6601 determined by the alpha value at the corresponding sample location.
6602 The temporary coverage value is then ANDed with the fragment
6603 coverage value.
6604
6605`GL_SAMPLE_ALPHA_TO_ONE'
6606
6607
6608 If enabled, each sample alpha value is replaced by the maximum
6609 representable alpha value.
6610
6611`GL_SAMPLE_COVERAGE'
6612
6613
6614 If enabled, the fragment's coverage is ANDed with the temporary
6615 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6616 invert the coverage value. See `glSampleCoverage'.
6617
6618`GL_SEPARABLE_2D'
6619
6620
6621 If enabled, perform a two-dimensional convolution operation using a
6622 separable convolution filter on incoming RGBA color values. See
6623 `glSeparableFilter2D'.
6624
6625`GL_SCISSOR_TEST'
6626
6627
6628 If enabled, discard fragments that are outside the scissor
6629 rectangle. See `glScissor'.
6630
6631`GL_STENCIL_TEST'
6632
6633
6634 If enabled, do stencil testing and update the stencil buffer. See
6635 `glStencilFunc' and `glStencilOp'.
6636
6637`GL_TEXTURE_1D'
6638
6639
6640 If enabled and no fragment shader is active, one-dimensional
6641 texturing is performed (unless two- or three-dimensional or
6642 cube-mapped texturing is also enabled). See `glTexImage1D'.
6643
6644`GL_TEXTURE_2D'
6645
6646
6647 If enabled and no fragment shader is active, two-dimensional
6648 texturing is performed (unless three-dimensional or cube-mapped
6649 texturing is also enabled). See `glTexImage2D'.
6650
6651`GL_TEXTURE_3D'
6652
6653
6654 If enabled and no fragment shader is active, three-dimensional
6655 texturing is performed (unless cube-mapped texturing is also
6656 enabled). See `glTexImage3D'.
6657
6658`GL_TEXTURE_CUBE_MAP'
6659
6660
6661 If enabled and no fragment shader is active, cube-mapped texturing
6662 is performed. See `glTexImage2D'.
6663
6664`GL_TEXTURE_GEN_Q'
6665
6666
6667 If enabled and no vertex shader is active, the Q texture coordinate
6668 is computed using the texture generation function defined with
6669 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6670 See `glTexGen'.
6671
6672`GL_TEXTURE_GEN_R'
6673
6674
6675 If enabled and no vertex shader is active, the R texture coordinate
6676 is computed using the texture generation function defined with
6677 `glTexGen'. Otherwise, the current R texture coordinate is used.
6678 See `glTexGen'.
6679
6680`GL_TEXTURE_GEN_S'
6681
6682
6683 If enabled and no vertex shader is active, the S texture coordinate
6684 is computed using the texture generation function defined with
6685 `glTexGen'. Otherwise, the current S texture coordinate is used.
6686 See `glTexGen'.
6687
6688`GL_TEXTURE_GEN_T'
6689
6690
6691 If enabled and no vertex shader is active, the T texture coordinate
6692 is computed using the texture generation function defined with
6693 `glTexGen'. Otherwise, the current T texture coordinate is used.
6694 See `glTexGen'.
6695
6696`GL_VERTEX_PROGRAM_POINT_SIZE'
6697
6698
6699 If enabled and a vertex shader is active, then the derived point
6700 size is taken from the (potentially clipped) shader builtin
6701 `gl_PointSize' and clamped to the implementation-dependent point
6702 size range.
6703
6704`GL_VERTEX_PROGRAM_TWO_SIDE'
6705
6706
6707 If enabled and a vertex shader is active, it specifies that the GL
6708 will choose between front and back colors based on the polygon's
6709 face direction of which the vertex being shaded is a part. It has
6710 no effect on points or lines.
6711
6712`GL_INVALID_ENUM' is generated if CAP is not one of the values listed
6713previously.
6714
6715`GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
6716executed between the execution of `glBegin' and the corresponding
6717execution of `glEnd'.")
6718
25072f02 6719(define-gl-procedures
ca09631c
AW
6720 ((glEvalCoord1f (u GLfloat) -> void)
6721 (glEvalCoord2f (u GLfloat) (v GLfloat) -> void))
3c9b6116
AW
6722 "Evaluate enabled one- and two-dimensional maps.
6723
6724U
6725 Specifies a value that is the domain coordinate U to the basis
6726 function defined in a previous `glMap1' or `glMap2' command.
6727
6728V
6729 Specifies a value that is the domain coordinate V to the basis
6730 function defined in a previous `glMap2' command. This argument is
6731 not present in a `glEvalCoord1' command.
6732
6733`glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
6734`glEvalCoord2' does the same for two-dimensional maps using two domain
6735values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
6736and disable it, call `glEnable' and `glDisable'.
6737
6738When one of the `glEvalCoord' commands is issued, all currently enabled
6739maps of the indicated dimension are evaluated. Then, for each enabled
6740map, it is as if the corresponding GL command had been issued with the
6741computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
6742enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
6743`GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
6744`GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
6745produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
6746`GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
6747`GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
6748`GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
6749`GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
6750command is simulated.
6751
6752For color, color index, normal, and texture coordinates the GL uses
6753evaluated values instead of current values for those evaluations that
6754are enabled, and current values otherwise, However, the evaluated values
6755do not update the current values. Thus, if `glVertex' commands are
6756interspersed with `glEvalCoord' commands, the color, normal, and texture
6757coordinates associated with the `glVertex' commands are not affected by
6758the values generated by the `glEvalCoord' commands, but only by the most
6759recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
6760
6761No commands are issued for maps that are not enabled. If more than one
6762texture evaluation is enabled for a particular dimension (for example,
6763`GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
6764evaluation of the map that produces the larger number of coordinates (in
6765this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
6766overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
6767`GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
6768four-component vertex map is enabled for the specified dimension, the
6769`glEvalCoord' command is ignored.
6770
6771If you have enabled automatic normal generation, by calling `glEnable'
6772with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
6773analytically, regardless of the contents or enabling of the
6774`GL_MAP2_NORMAL' map. Let
6775
6776`m'=∂`p',/∂U,,×∂`p',/∂V,,
6777
6778Then the generated normal `n' is `n'=`m'/∥`m',∥,
6779
6780If automatic normal generation is disabled, the corresponding normal map
6781`GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
6782automatic normal generation nor a normal map is enabled, no normal is
6783generated for `glEvalCoord2' commands.")
6784
25072f02 6785(define-gl-procedures
bb894c9d
AW
6786 ((glEvalMesh1
6787 (mode GLenum)
6788 (i1 GLint)
6789 (i2 GLint)
6790 ->
6791 void)
6792 (glEvalMesh2
6793 (mode GLenum)
6794 (i1 GLint)
6795 (i2 GLint)
6796 (j1 GLint)
6797 (j2 GLint)
6798 ->
6799 void))
3c9b6116
AW
6800 "Compute a one- or two-dimensional grid of points or lines.
6801
6802MODE
6803 In `glEvalMesh1', specifies whether to compute a one-dimensional
6804 mesh of points or lines. Symbolic constants `GL_POINT' and
6805 `GL_LINE' are accepted.
6806
6807I1
6808 I2
6809
6810 Specify the first and last integer values for grid domain variable
6811 I .
6812
6813`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6814and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
6815steps through the integer domain of a one- or two-dimensional grid,
6816whose range is the domain of the evaluation maps specified by `glMap1'
6817and `glMap2'. MODE determines whether the resulting vertices are
6818connected as points, lines, or filled polygons.
6819
6820In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
6821the following code fragment were executed:
6822
6823where
6824
6825
6826 glBegin( TYPE );
6827 for ( i = I1; i <= I2; i += 1 )
6828 glEvalCoord1( i·ΔU+U_1
6829
6830 );
6831 glEnd();
6832
6833ΔU=(U_2-U_1,)/N
6834
6835and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6836command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
6837MODE is `GL_LINE'.
6838
6839The one absolute numeric requirement is that if I=N , then the value
6840computed from I·ΔU+U_1 is exactly U_2 .
6841
6842In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
6843
6844ΔV=(V_2-V_1,)/M
6845
6846where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6847recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
6848`glEvalMesh2' command is equivalent to:
6849
6850
6851
6852
6853 for ( j = J1; j < J2; j += 1 ) {
6854 glBegin( GL_QUAD_STRIP );
6855 for ( i = I1; i <= I2; i += 1 ) {
6856 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6857
6858 );
6859 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
6860
6861 );
6862 }
6863 glEnd();
6864 }
6865
6866If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
6867
6868
6869
6870
6871 for ( j = J1; j <= J2; j += 1 ) {
6872 glBegin( GL_LINE_STRIP );
6873 for ( i = I1; i <= I2; i += 1 )
6874 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6875
6876 );
6877 glEnd();
6878 }
6879
6880 for ( i = I1; i <= I2; i += 1 ) {
6881 glBegin( GL_LINE_STRIP );
6882 for ( j = J1; j <= J1; j += 1 )
6883 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6884
6885 );
6886 glEnd();
6887 }
6888
6889And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
6890equivalent to:
6891
6892
6893
6894
6895 glBegin( GL_POINTS );
6896 for ( j = J1; j <= J2; j += 1 )
6897 for ( i = I1; i <= I2; i += 1 )
6898 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6899
6900 );
6901 glEnd();
6902
6903In all three cases, the only absolute numeric requirements are that if
6904I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6905, then the value computed from J·ΔV+V_1 is exactly V_2 .
6906
6907`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6908
6909`GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
6910the execution of `glBegin' and the corresponding execution of `glEnd'.")
6911
25072f02 6912(define-gl-procedures
bb894c9d
AW
6913 ((glEvalPoint1 (i GLint) -> void)
6914 (glEvalPoint2 (i GLint) (j GLint) -> void))
3c9b6116
AW
6915 "Generate and evaluate a single point in a mesh.
6916
6917I
6918 Specifies the integer value for grid domain variable I .
6919
6920J
6921 Specifies the integer value for grid domain variable J
6922 (`glEvalPoint2' only).
6923
6924`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
6925and evaluate a series of evenly spaced map domain values. `glEvalPoint'
6926can be used to evaluate a single grid point in the same gridspace that
6927is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
6928calling where ΔU=(U_2-U_1,)/N
6929
6930
6931 glEvalCoord1( i·ΔU+U_1
6932
6933 );
6934
6935and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
6936command. The one absolute numeric requirement is that if I=N , then the
6937value computed from I·ΔU+U_1 is exactly U_2 .
6938
6939In the two-dimensional case, `glEvalPoint2', let
6940
6941ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
6942
6943where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
6944recent `glMapGrid2' command. Then the `glEvalPoint2' command is
6945equivalent to calling The only absolute numeric requirements are that if
6946I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
6947, then the value computed from J·ΔV+V_1 is exactly V_2 .
6948
6949
6950 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
6951
6952 );")
6953
25072f02 6954(define-gl-procedures
bb894c9d
AW
6955 ((glFeedbackBuffer
6956 (size GLsizei)
6957 (type GLenum)
00239761 6958 (buffer GLfloat-*)
bb894c9d
AW
6959 ->
6960 void))
3c9b6116
AW
6961 "Controls feedback mode.
6962
6963SIZE
6964 Specifies the maximum number of values that can be written into
6965 BUFFER.
6966
6967TYPE
6968 Specifies a symbolic constant that describes the information that
6969 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
6970 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
6971
6972BUFFER
6973 Returns the feedback data.
6974
6975The `glFeedbackBuffer' function controls feedback. Feedback, like
6976selection, is a GL mode. The mode is selected by calling `glRenderMode'
6977with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
6978produced by rasterization. Instead, information about primitives that
6979would have been rasterized is fed back to the application using the GL.
6980
6981`glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
6982of floating-point values into which feedback information is placed. SIZE
6983indicates the size of the array. TYPE is a symbolic constant describing
6984the information that is fed back for each vertex. `glFeedbackBuffer'
6985must be issued before feedback mode is enabled (by calling
6986`glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
6987without establishing the feedback buffer, or calling `glFeedbackBuffer'
6988while the GL is in feedback mode, is an error.
6989
6990When `glRenderMode' is called while in feedback mode, it returns the
6991number of entries placed in the feedback array and resets the feedback
6992array pointer to the base of the feedback buffer. The returned value
6993never exceeds SIZE. If the feedback data required more room than was
6994available in BUFFER, `glRenderMode' returns a negative value. To take
6995the GL out of feedback mode, call `glRenderMode' with a parameter value
6996other than `GL_FEEDBACK'.
6997
6998While in feedback mode, each primitive, bitmap, or pixel rectangle that
6999would be rasterized generates a block of values that are copied into the
7000feedback array. If doing so would cause the number of entries to exceed
7001the maximum, the block is partially written so as to fill the array (if
7002there is any room left at all), and an overflow flag is set. Each block
7003begins with a code indicating the primitive type, followed by values
7004that describe the primitive's vertices and associated data. Entries are
7005also written for bitmaps and pixel rectangles. Feedback occurs after
7006polygon culling and `glPolygonMode' interpretation of polygons has taken
7007place, so polygons that are culled are not returned in the feedback
7008buffer. It can also occur after polygons with more than three edges are
7009broken up into triangles, if the GL implementation renders polygons by
7010performing this decomposition.
7011
7012The `glPassThrough' command can be used to insert a marker into the
7013feedback buffer. See `glPassThrough'.
7014
7015Following is the grammar for the blocks of values written into the
7016feedback buffer. Each primitive is indicated with a unique identifying
7017value followed by some number of vertices. Polygon entries include an
7018integer value indicating how many vertices follow. A vertex is fed back
7019as some number of floating-point values, as determined by TYPE. Colors
7020are fed back as four values in RGBA mode and one value in color index
7021mode.
7022
7023feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
7024point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
7025← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
7026`GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
7027polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
7028`GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
7029`GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
7030vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
7031value 3d ← value value value 3dColor ← value value value color
70323dColorTexture ← value value value color tex 4dColorTexture ← value
7033value value value color tex color ← rgba | index rgba ← value value
7034value value index ← value tex ← value value value value
7035
7036VALUE is a floating-point number, and N is a floating-point integer
7037giving the number of vertices in the polygon. `GL_POINT_TOKEN',
7038`GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
7039`GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
7040`GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
7041`GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
7042reset. The data returned as a vertex depends on the feedback TYPE.
7043
7044The following table gives the correspondence between TYPE and the number
7045of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
7046
7047
7048
7049*Type*
7050 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
7051
7052`GL_2D'
7053 X, Y, , , 2
7054
7055`GL_3D'
7056 X, Y, Z, , , 3
7057
7058`GL_3D_COLOR'
7059 X, Y, Z, K , , 3+K
7060
7061`GL_3D_COLOR_TEXTURE'
7062 X, Y, Z, K , 4 , 7+K
7063
7064`GL_4D_COLOR_TEXTURE'
7065 X, Y, Z, W, K , 4 , 8+K
7066
7067Feedback vertex coordinates are in window coordinates, except W, which
7068is in clip coordinates. Feedback colors are lighted, if lighting is
7069enabled. Feedback texture coordinates are generated, if texture
7070coordinate generation is enabled. They are always transformed by the
7071texture matrix.
7072
7073`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
7074
7075`GL_INVALID_VALUE' is generated if SIZE is negative.
7076
7077`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
7078while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
7079with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
7080once.
7081
7082`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
7083between the execution of `glBegin' and the corresponding execution of
7084`glEnd'.")
7085
25072f02 7086(define-gl-procedures
bb894c9d 7087 ((glFinish -> void))
3c9b6116
AW
7088 "Block until all GL execution is complete.
7089
7090`glFinish' does not return until the effects of all previously called GL
7091commands are complete. Such effects include all changes to GL state, all
7092changes to connection state, and all changes to the frame buffer
7093contents.
7094
7095`GL_INVALID_OPERATION' is generated if `glFinish' is executed between
7096the execution of `glBegin' and the corresponding execution of `glEnd'.")
7097
25072f02 7098(define-gl-procedures
bb894c9d 7099 ((glFlush -> void))
3c9b6116
AW
7100 "Force execution of GL commands in finite time.
7101
7102Different GL implementations buffer commands in several different
7103locations, including network buffers and the graphics accelerator
7104itself. `glFlush' empties all of these buffers, causing all issued
7105commands to be executed as quickly as they are accepted by the actual
7106rendering engine. Though this execution may not be completed in any
7107particular time period, it does complete in finite time.
7108
7109Because any GL program might be executed over a network, or on an
7110accelerator that buffers commands, all programs should call `glFlush'
7111whenever they count on having all of their previously issued commands
7112completed. For example, call `glFlush' before waiting for user input
7113that depends on the generated image.
7114
7115`GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
7116execution of `glBegin' and the corresponding execution of `glEnd'.")
7117
25072f02 7118(define-gl-procedures
bb894c9d
AW
7119 ((glFogCoordPointer
7120 (type GLenum)
7121 (stride GLsizei)
00239761 7122 (pointer GLvoid-*)
bb894c9d
AW
7123 ->
7124 void))
3c9b6116
AW
7125 "Define an array of fog coordinates.
7126
7127TYPE
7128 Specifies the data type of each fog coordinate. Symbolic constants
7129 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7130 `GL_FLOAT'.
7131
7132STRIDE
7133 Specifies the byte offset between consecutive fog coordinates. If
7134 STRIDE is 0, the array elements are understood to be tightly
7135 packed. The initial value is 0.
7136
7137POINTER
7138 Specifies a pointer to the first coordinate of the first fog
7139 coordinate in the array. The initial value is 0.
7140
7141`glFogCoordPointer' specifies the location and data format of an array
7142of fog coordinates to use when rendering. TYPE specifies the data type
7143of each fog coordinate, and STRIDE specifies the byte stride from one
7144fog coordinate to the next, allowing vertices and attributes to be
7145packed into a single array or stored in separate arrays.
7146
7147If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7148target (see `glBindBuffer') while a fog coordinate array is specified,
7149POINTER is treated as a byte offset into the buffer object's data store.
7150Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7151fog coordinate vertex array client-side state
7152(`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7153
7154When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7155saved as client-side state, in addition to the current vertex array
7156buffer object binding.
7157
7158To enable and disable the fog coordinate array, call
7159`glEnableClientState' and `glDisableClientState' with the argument
7160`GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7161`glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7162`glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7163called.
7164
7165`GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7166`GL_DOUBLE'.
7167
7168`GL_INVALID_VALUE' is generated if STRIDE is negative.")
7169
25072f02 7170(define-gl-procedures
ca09631c 7171 ((glFogCoordf (coord GLfloat) -> void))
3c9b6116
AW
7172 "Set the current fog coordinates.
7173
7174COORD
7175 Specify the fog distance.
7176
7177`glFogCoord' specifies the fog coordinate that is associated with each
7178vertex and the current raster position. The value specified is
7179interpolated and used in computing the fog color (see `glFog').")
7180
25072f02 7181(define-gl-procedures
bb894c9d
AW
7182 ((glFogf (pname GLenum) (param GLfloat) -> void)
7183 (glFogi (pname GLenum) (param GLint) -> void))
3c9b6116
AW
7184 "Specify fog parameters.
7185
7186PNAME
7187 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7188 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7189 `GL_FOG_COORD_SRC' are accepted.
7190
7191PARAM
7192 Specifies the value that PNAME will be set to.
7193
7194Fog is initially disabled. While enabled, fog affects rasterized
7195geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7196enable and disable fog, call `glEnable' and `glDisable' with argument
7197`GL_FOG'.
7198
7199`glFog' assigns the value or values in PARAMS to the fog parameter
7200specified by PNAME. The following values are accepted for PNAME:
7201
7202`GL_FOG_MODE'
7203 PARAMS is a single integer or floating-point value that specifies
7204 the equation to be used to compute the fog blend factor, F . Three
7205 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7206 `GL_EXP2'. The equations corresponding to these symbolic constants
7207 are defined below. The initial fog mode is `GL_EXP'.
7208
7209`GL_FOG_DENSITY'
7210 PARAMS is a single integer or floating-point value that specifies
7211 DENSITY , the fog density used in both exponential fog equations.
7212 Only nonnegative densities are accepted. The initial fog density is
7213 1.
7214
7215`GL_FOG_START'
7216 PARAMS is a single integer or floating-point value that specifies
7217 START , the near distance used in the linear fog equation. The
7218 initial near distance is 0.
7219
7220`GL_FOG_END'
7221 PARAMS is a single integer or floating-point value that specifies
7222 END , the far distance used in the linear fog equation. The initial
7223 far distance is 1.
7224
7225`GL_FOG_INDEX'
7226 PARAMS is a single integer or floating-point value that specifies
7227 I_F , the fog color index. The initial fog index is 0.
7228
7229`GL_FOG_COLOR'
7230 PARAMS contains four integer or floating-point values that specify
7231 C_F , the fog color. Integer values are mapped linearly such that
7232 the most positive representable value maps to 1.0, and the most
7233 negative representable value maps to -1.0 . Floating-point values
7234 are mapped directly. After conversion, all color components are
7235 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7236
7237`GL_FOG_COORD_SRC'
7238 PARAMS contains either of the following symbolic constants:
7239 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7240 that the current fog coordinate should be used as distance value in
7241 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7242 current fragment depth should be used as distance value in the fog
7243 computation.
7244
7245Fog blends a fog color with each rasterized pixel fragment's
7246post-texturing color using a blending factor F . Factor F is computed in
7247one of three ways, depending on the fog mode. Let C be either the
7248distance in eye coordinate from the origin (in the case that the
7249`GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7250(in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7251for `GL_LINEAR' fog is F=END-C,/END-START,
7252
7253The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7254
7255The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7256
7257Regardless of the fog mode, F is clamped to the range [0,1] after it is
7258computed. Then, if the GL is in RGBA color mode, the fragment's red,
7259green, and blue colors, represented by C_R , are replaced by
7260
7261C_R,^″=F×C_R+(1-F,)×C_F
7262
7263Fog does not affect a fragment's alpha component.
7264
7265In color index mode, the fragment's color index I_R is replaced by
7266
7267I_R,^″=I_R+(1-F,)×I_F
7268
7269
7270
7271`GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7272PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7273
7274`GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7275is negative.
7276
7277`GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7278execution of `glBegin' and the corresponding execution of `glEnd'.")
7279
25072f02 7280(define-gl-procedures
bb894c9d 7281 ((glFrontFace (mode GLenum) -> void))
3c9b6116
AW
7282 "Define front- and back-facing polygons.
7283
7284MODE
7285 Specifies the orientation of front-facing polygons. `GL_CW' and
7286 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7287
7288In a scene composed entirely of opaque closed surfaces, back-facing
7289polygons are never visible. Eliminating these invisible polygons has the
7290obvious benefit of speeding up the rendering of the image. To enable and
7291disable elimination of back-facing polygons, call `glEnable' and
7292`glDisable' with argument `GL_CULL_FACE'.
7293
7294The projection of a polygon to window coordinates is said to have
7295clockwise winding if an imaginary object following the path from its
7296first vertex, its second vertex, and so on, to its last vertex, and
7297finally back to its first vertex, moves in a clockwise direction about
7298the interior of the polygon. The polygon's winding is said to be
7299counterclockwise if the imaginary object following the same path moves
7300in a counterclockwise direction about the interior of the polygon.
7301`glFrontFace' specifies whether polygons with clockwise winding in
7302window coordinates, or counterclockwise winding in window coordinates,
7303are taken to be front-facing. Passing `GL_CCW' to MODE selects
7304counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7305polygons as front-facing. By default, counterclockwise polygons are
7306taken to be front-facing.
7307
7308`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7309
7310`GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7311the execution of `glBegin' and the corresponding execution of `glEnd'.")
7312
25072f02 7313(define-gl-procedures
bb894c9d
AW
7314 ((glFrustum
7315 (left GLdouble)
7316 (right GLdouble)
7317 (bottom GLdouble)
7318 (top GLdouble)
7319 (nearVal GLdouble)
7320 (farVal GLdouble)
7321 ->
7322 void))
3c9b6116
AW
7323 "Multiply the current matrix by a perspective matrix.
7324
7325LEFT
7326 RIGHT
7327
7328 Specify the coordinates for the left and right vertical clipping
7329 planes.
7330
7331BOTTOM
7332 TOP
7333
7334 Specify the coordinates for the bottom and top horizontal clipping
7335 planes.
7336
7337NEARVAL
7338 FARVAL
7339
7340 Specify the distances to the near and far depth clipping planes.
7341 Both distances must be positive.
7342
7343`glFrustum' describes a perspective matrix that produces a perspective
7344projection. The current matrix (see `glMatrixMode') is multiplied by
7345this matrix and the result replaces the current matrix, as if
7346`glMultMatrix' were called with the following matrix as its argument:
7347
7348
7349
7350[(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7351C D), (0 0 -1 0),]
7352
7353A=RIGHT+LEFT,/RIGHT-LEFT,
7354
7355B=TOP+BOTTOM,/TOP-BOTTOM,
7356
7357C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7358
7359D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7360
7361
7362
7363Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7364and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7365that are mapped to the lower left and upper right corners of the window,
7366assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7367location of the far clipping plane. Both NEARVAL and FARVAL must be
7368positive.
7369
7370Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7371matrix stack.
7372
7373`GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7374if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7375
7376`GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7377the execution of `glBegin' and the corresponding execution of `glEnd'.")
7378
25072f02 7379(define-gl-procedures
00239761
AW
7380 ((glGenBuffers
7381 (n GLsizei)
7382 (buffers GLuint-*)
7383 ->
7384 void))
3c9b6116
AW
7385 "Generate buffer object names.
7386
7387N
7388 Specifies the number of buffer object names to be generated.
7389
7390BUFFERS
7391 Specifies an array in which the generated buffer object names are
7392 stored.
7393
7394`glGenBuffers' returns N buffer object names in BUFFERS. There is no
7395guarantee that the names form a contiguous set of integers; however, it
7396is guaranteed that none of the returned names was in use immediately
7397before the call to `glGenBuffers'.
7398
7399Buffer object names returned by a call to `glGenBuffers' are not
7400returned by subsequent calls, unless they are first deleted with
7401`glDeleteBuffers'.
7402
7403No buffer objects are associated with the returned buffer object names
7404until they are first bound by calling `glBindBuffer'.
7405
7406`GL_INVALID_VALUE' is generated if N is negative.
7407
7408`GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7409between the execution of `glBegin' and the corresponding execution of
7410`glEnd'.")
7411
25072f02 7412(define-gl-procedures
bb894c9d 7413 ((glGenLists (range GLsizei) -> GLuint))
3c9b6116
AW
7414 "Generate a contiguous set of empty display lists.
7415
7416RANGE
7417 Specifies the number of contiguous empty display lists to be
7418 generated.
7419
7420`glGenLists' has one argument, RANGE. It returns an integer N such that
7421RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7422are created. If RANGE is 0, if there is no group of RANGE contiguous
7423names available, or if any error is generated, no display lists are
7424generated, and 0 is returned.
7425
7426`GL_INVALID_VALUE' is generated if RANGE is negative.
7427
7428`GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7429the execution of `glBegin' and the corresponding execution of `glEnd'.")
7430
25072f02 7431(define-gl-procedures
00239761 7432 ((glGenQueries (n GLsizei) (ids GLuint-*) -> void))
3c9b6116
AW
7433 "Generate query object names.
7434
7435N
7436 Specifies the number of query object names to be generated.
7437
7438IDS
7439 Specifies an array in which the generated query object names are
7440 stored.
7441
7442`glGenQueries' returns N query object names in IDS. There is no
7443guarantee that the names form a contiguous set of integers; however, it
7444is guaranteed that none of the returned names was in use immediately
7445before the call to `glGenQueries'.
7446
7447Query object names returned by a call to `glGenQueries' are not returned
7448by subsequent calls, unless they are first deleted with
7449`glDeleteQueries'.
7450
7451No query objects are associated with the returned query object names
7452until they are first used by calling `glBeginQuery'.
7453
7454`GL_INVALID_VALUE' is generated if N is negative.
7455
7456`GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7457between the execution of `glBegin' and the corresponding execution of
7458`glEnd'.")
7459
25072f02 7460(define-gl-procedures
00239761
AW
7461 ((glGenTextures
7462 (n GLsizei)
7463 (textures GLuint-*)
7464 ->
7465 void))
3c9b6116
AW
7466 "Generate texture names.
7467
7468N
7469 Specifies the number of texture names to be generated.
7470
7471TEXTURES
7472 Specifies an array in which the generated texture names are stored.
7473
7474`glGenTextures' returns N texture names in TEXTURES. There is no
7475guarantee that the names form a contiguous set of integers; however, it
7476is guaranteed that none of the returned names was in use immediately
7477before the call to `glGenTextures'.
7478
7479The generated textures have no dimensionality; they assume the
7480dimensionality of the texture target to which they are first bound (see
7481`glBindTexture').
7482
7483Texture names returned by a call to `glGenTextures' are not returned by
7484subsequent calls, unless they are first deleted with `glDeleteTextures'.
7485
7486`GL_INVALID_VALUE' is generated if N is negative.
7487
7488`GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7489between the execution of `glBegin' and the corresponding execution of
7490`glEnd'.")
7491
25072f02 7492(define-gl-procedures
bb894c9d
AW
7493 ((glGetActiveAttrib
7494 (program GLuint)
7495 (index GLuint)
7496 (bufSize GLsizei)
00239761
AW
7497 (length GLsizei-*)
7498 (size GLint-*)
7499 (type GLenum-*)
7500 (name GLchar-*)
bb894c9d
AW
7501 ->
7502 void))
3c9b6116
AW
7503 "Returns information about an active attribute variable for the specified
7504program object.
7505
7506PROGRAM
7507 Specifies the program object to be queried.
7508
7509INDEX
7510 Specifies the index of the attribute variable to be queried.
7511
7512BUFSIZE
7513 Specifies the maximum number of characters OpenGL is allowed to
7514 write in the character buffer indicated by NAME.
7515
7516LENGTH
7517 Returns the number of characters actually written by OpenGL in the
7518 string indicated by NAME (excluding the null terminator) if a value
7519 other than `NULL' is passed.
7520
7521SIZE
7522 Returns the size of the attribute variable.
7523
7524TYPE
7525 Returns the data type of the attribute variable.
7526
7527NAME
7528 Returns a null terminated string containing the name of the
7529 attribute variable.
7530
7531`glGetActiveAttrib' returns information about an active attribute
7532variable in the program object specified by PROGRAM. The number of
7533active attributes can be obtained by calling `glGetProgram' with the
7534value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7535active attribute variable. Permissible values for INDEX range from 0 to
7536the number of active attribute variables minus 1.
7537
7538A vertex shader may use either built-in attribute variables,
7539user-defined attribute variables, or both. Built-in attribute variables
7540have a prefix of \"gl_\" and reference conventional OpenGL vertex
7541attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7542Language specification for a complete list.) User-defined attribute
7543variables have arbitrary names and obtain their values through numbered
7544generic vertex attributes. An attribute variable (either built-in or
7545user-defined) is considered active if it is determined during the link
7546operation that it may be accessed during program execution. Therefore,
7547PROGRAM should have previously been the target of a call to
7548`glLinkProgram', but it is not necessary for it to have been linked
7549successfully.
7550
7551The size of the character buffer required to store the longest attribute
7552variable name in PROGRAM can be obtained by calling `glGetProgram' with
7553the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7554allocate a buffer of sufficient size to store the returned attribute
7555name. The size of this character buffer is passed in BUFSIZE, and a
7556pointer to this character buffer is passed in NAME.
7557
7558`glGetActiveAttrib' returns the name of the attribute variable indicated
7559by INDEX, storing it in the character buffer specified by NAME. The
7560string returned will be null terminated. The actual number of characters
7561written into this buffer is returned in LENGTH, and this count does not
7562include the null termination character. If the length of the returned
7563string is not required, a value of `NULL' can be passed in the LENGTH
7564argument.
7565
7566The TYPE argument will return a pointer to the attribute variable's data
7567type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7568`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7569`GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7570`GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7571`GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7572size of the attribute, in units of the type returned in TYPE.
7573
7574The list of active attribute variables may include both built-in
7575attribute variables (which begin with the prefix \"gl_\") as well as
7576user-defined attribute variable names.
7577
7578This function will return as much information as it can about the
7579specified active attribute variable. If no information is available,
7580LENGTH will be 0, and NAME will be an empty string. This situation could
7581occur if this function is called after a link operation that failed. If
7582an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7583unmodified.
7584
7585`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7586OpenGL.
7587
7588`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7589
7590`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7591number of active attribute variables in PROGRAM.
7592
7593`GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7594between the execution of `glBegin' and the corresponding execution of
7595`glEnd'.
7596
7597`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7598
25072f02 7599(define-gl-procedures
bb894c9d
AW
7600 ((glGetActiveUniform
7601 (program GLuint)
7602 (index GLuint)
7603 (bufSize GLsizei)
00239761
AW
7604 (length GLsizei-*)
7605 (size GLint-*)
7606 (type GLenum-*)
7607 (name GLchar-*)
bb894c9d
AW
7608 ->
7609 void))
3c9b6116
AW
7610 "Returns information about an active uniform variable for the specified
7611program object.
7612
7613PROGRAM
7614 Specifies the program object to be queried.
7615
7616INDEX
7617 Specifies the index of the uniform variable to be queried.
7618
7619BUFSIZE
7620 Specifies the maximum number of characters OpenGL is allowed to
7621 write in the character buffer indicated by NAME.
7622
7623LENGTH
7624 Returns the number of characters actually written by OpenGL in the
7625 string indicated by NAME (excluding the null terminator) if a value
7626 other than `NULL' is passed.
7627
7628SIZE
7629 Returns the size of the uniform variable.
7630
7631TYPE
7632 Returns the data type of the uniform variable.
7633
7634NAME
7635 Returns a null terminated string containing the name of the uniform
7636 variable.
7637
7638`glGetActiveUniform' returns information about an active uniform
7639variable in the program object specified by PROGRAM. The number of
7640active uniform variables can be obtained by calling `glGetProgram' with
7641the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7642active uniform variable. Permissible values for INDEX range from 0 to
7643the number of active uniform variables minus 1.
7644
7645Shaders may use either built-in uniform variables, user-defined uniform
7646variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7647and reference existing OpenGL state or values derived from such state
7648(e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7649specification for a complete list.) User-defined uniform variables have
7650arbitrary names and obtain their values from the application through
7651calls to `glUniform'. A uniform variable (either built-in or
7652user-defined) is considered active if it is determined during the link
7653operation that it may be accessed during program execution. Therefore,
7654PROGRAM should have previously been the target of a call to
7655`glLinkProgram', but it is not necessary for it to have been linked
7656successfully.
7657
7658The size of the character buffer required to store the longest uniform
7659variable name in PROGRAM can be obtained by calling `glGetProgram' with
7660the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
7661allocate a buffer of sufficient size to store the returned uniform
7662variable name. The size of this character buffer is passed in BUFSIZE,
7663and a pointer to this character buffer is passed in NAME.
7664
7665`glGetActiveUniform' returns the name of the uniform variable indicated
7666by INDEX, storing it in the character buffer specified by NAME. The
7667string returned will be null terminated. The actual number of characters
7668written into this buffer is returned in LENGTH, and this count does not
7669include the null termination character. If the length of the returned
7670string is not required, a value of `NULL' can be passed in the LENGTH
7671argument.
7672
7673The TYPE argument will return a pointer to the uniform variable's data
7674type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7675`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
7676`GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
7677`GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
7678`GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
7679`GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
7680`GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
7681`GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
7682
7683If one or more elements of an array are active, the name of the array is
7684returned in NAME, the type is returned in TYPE, and the SIZE parameter
7685returns the highest array element index used, plus one, as determined by
7686the compiler and/or linker. Only one active uniform variable will be
7687reported for a uniform array.
7688
7689Uniform variables that are declared as structures or arrays of
7690structures will not be returned directly by this function. Instead, each
7691of these uniform variables will be reduced to its fundamental components
7692containing the \".\" and \"[]\" operators such that each of the names is
7693valid as an argument to `glGetUniformLocation'. Each of these reduced
7694uniform variables is counted as one active uniform variable and is
7695assigned an index. A valid name cannot be a structure, an array of
7696structures, or a subcomponent of a vector or matrix.
7697
7698The size of the uniform variable will be returned in SIZE. Uniform
7699variables other than arrays will have a size of 1. Structures and arrays
7700of structures will be reduced as described earlier, such that each of
7701the names returned will be a data type in the earlier list. If this
7702reduction results in an array, the size returned will be as described
7703for uniform arrays; otherwise, the size returned will be 1.
7704
7705The list of active uniform variables may include both built-in uniform
7706variables (which begin with the prefix \"gl_\") as well as user-defined
7707uniform variable names.
7708
7709This function will return as much information as it can about the
7710specified active uniform variable. If no information is available,
7711LENGTH will be 0, and NAME will be an empty string. This situation could
7712occur if this function is called after a link operation that failed. If
7713an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7714unmodified.
7715
7716`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7717OpenGL.
7718
7719`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7720
7721`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7722number of active uniform variables in PROGRAM.
7723
7724`GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
7725between the execution of `glBegin' and the corresponding execution of
7726`glEnd'.
7727
7728`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7729
25072f02 7730(define-gl-procedures
bb894c9d
AW
7731 ((glGetAttachedShaders
7732 (program GLuint)
7733 (maxCount GLsizei)
00239761
AW
7734 (count GLsizei-*)
7735 (shaders GLuint-*)
bb894c9d
AW
7736 ->
7737 void))
3c9b6116
AW
7738 "Returns the handles of the shader objects attached to a program object.
7739
7740PROGRAM
7741 Specifies the program object to be queried.
7742
7743MAXCOUNT
7744 Specifies the size of the array for storing the returned object
7745 names.
7746
7747COUNT
7748 Returns the number of names actually returned in OBJECTS.
7749
7750SHADERS
7751 Specifies an array that is used to return the names of attached
7752 shader objects.
7753
7754`glGetAttachedShaders' returns the names of the shader objects attached
7755to PROGRAM. The names of shader objects that are attached to PROGRAM
7756will be returned in SHADERS. The actual number of shader names written
7757into SHADERS is returned in COUNT. If no shader objects are attached to
7758PROGRAM, COUNT is set to 0. The maximum number of shader names that may
7759be returned in SHADERS is specified by MAXCOUNT.
7760
7761If the number of names actually returned is not required (for instance,
7762if it has just been obtained by calling `glGetProgram'), a value of
7763`NULL' may be passed for count. If no shader objects are attached to
7764PROGRAM, a value of 0 will be returned in COUNT. The actual number of
7765attached shaders can be obtained by calling `glGetProgram' with the
7766value `GL_ATTACHED_SHADERS'.
7767
7768`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7769OpenGL.
7770
7771`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7772
7773`GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
7774
7775`GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
7776executed between the execution of `glBegin' and the corresponding
7777execution of `glEnd'.")
7778
25072f02 7779(define-gl-procedures
bb894c9d
AW
7780 ((glGetAttribLocation
7781 (program GLuint)
00239761 7782 (name const-GLchar-*)
bb894c9d
AW
7783 ->
7784 GLint))
3c9b6116
AW
7785 "Returns the location of an attribute variable.
7786
7787PROGRAM
7788 Specifies the program object to be queried.
7789
7790NAME
7791 Points to a null terminated string containing the name of the
7792 attribute variable whose location is to be queried.
7793
7794`glGetAttribLocation' queries the previously linked program object
7795specified by PROGRAM for the attribute variable specified by NAME and
7796returns the index of the generic vertex attribute that is bound to that
7797attribute variable. If NAME is a matrix attribute variable, the index of
7798the first column of the matrix is returned. If the named attribute
7799variable is not an active attribute in the specified program object or
7800if NAME starts with the reserved prefix \"gl_\", a value of -1 is
7801returned.
7802
7803The association between an attribute variable name and a generic
7804attribute index can be specified at any time by calling
7805`glBindAttribLocation'. Attribute bindings do not go into effect until
7806`glLinkProgram' is called. After a program object has been linked
7807successfully, the index values for attribute variables remain fixed
7808until the next link command occurs. The attribute values can only be
7809queried after a link if the link was successful. `glGetAttribLocation'
7810returns the binding that actually went into effect the last time
7811`glLinkProgram' was called for the specified program object. Attribute
7812bindings that have been specified since the last link operation are not
7813returned by `glGetAttribLocation'.
7814
7815`GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
7816by OpenGL.
7817
7818`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7819
7820`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
7821linked.
7822
7823`GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
7824between the execution of `glBegin' and the corresponding execution of
7825`glEnd'.")
7826
b002944d
AW
7827(define-gl-procedures
7828 ((glGetBufferParameteriv
7829 (target GLenum)
7830 (value GLenum)
7831 (data GLint-*)
7832 ->
7833 void))
7834 "Return parameters of a buffer object.
7835
7836TARGET
7837 Specifies the target buffer object. The symbolic constant must be
7838 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7839 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7840
7841VALUE
7842 Specifies the symbolic name of a buffer object parameter. Accepted
7843 values are `GL_BUFFER_ACCESS', `GL_BUFFER_MAPPED',
7844 `GL_BUFFER_SIZE', or `GL_BUFFER_USAGE'.
7845
7846DATA
7847 Returns the requested parameter.
7848
7849`glGetBufferParameteriv' returns in DATA a selected parameter of the
7850buffer object specified by TARGET.
7851
7852VALUE names a specific buffer object parameter, as follows:
7853
7854`GL_BUFFER_ACCESS'
7855 PARAMS returns the access policy set while mapping the buffer
7856 object. The initial value is `GL_READ_WRITE'.
7857
7858`GL_BUFFER_MAPPED'
7859 PARAMS returns a flag indicating whether the buffer object is
7860 currently mapped. The initial value is `GL_FALSE'.
7861
7862`GL_BUFFER_SIZE'
7863 PARAMS returns the size of the buffer object, measured in bytes.
7864 The initial value is 0.
7865
7866`GL_BUFFER_USAGE'
7867 PARAMS returns the buffer object's usage pattern. The initial value
7868 is `GL_STATIC_DRAW'.
7869
7870`GL_INVALID_ENUM' is generated if TARGET or VALUE is not an accepted
7871value.
7872
7873`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7874is bound to TARGET.
7875
7876`GL_INVALID_OPERATION' is generated if `glGetBufferParameteriv' is
7877executed between the execution of `glBegin' and the corresponding
7878execution of `glEnd'.")
7879
7880(define-gl-procedures
7881 ((glGetBufferPointerv
7882 (target GLenum)
7883 (pname GLenum)
7884 (params GLvoid-**)
7885 ->
7886 void))
7887 "Return the pointer to a mapped buffer object's data store.
7888
7889TARGET
7890 Specifies the target buffer object. The symbolic constant must be
7891 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7892 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7893
7894PNAME
7895 Specifies the pointer to be returned. The symbolic constant must be
7896 `GL_BUFFER_MAP_POINTER'.
7897
7898PARAMS
7899 Returns the pointer value specified by PNAME.
7900
7901`glGetBufferPointerv' returns pointer information. PNAME is a symbolic
7902constant indicating the pointer to be returned, which must be
7903`GL_BUFFER_MAP_POINTER', the pointer to which the buffer object's data
7904store is mapped. If the data store is not currently mapped, `NULL' is
7905returned. PARAMS is a pointer to a location in which to place the
7906returned pointer value.
7907
7908`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
7909value.
7910
7911`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7912is bound to TARGET.
7913
7914`GL_INVALID_OPERATION' is generated if `glGetBufferPointerv' is executed
7915between the execution of `glBegin' and the corresponding execution of
7916`glEnd'.")
7917
25072f02 7918(define-gl-procedures
bb894c9d
AW
7919 ((glGetBufferSubData
7920 (target GLenum)
7921 (offset GLintptr)
7922 (size GLsizeiptr)
00239761 7923 (data GLvoid-*)
bb894c9d
AW
7924 ->
7925 void))
3c9b6116
AW
7926 "Returns a subset of a buffer object's data store.
7927
7928TARGET
7929 Specifies the target buffer object. The symbolic constant must be
7930 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
7931 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
7932
7933OFFSET
7934 Specifies the offset into the buffer object's data store from which
7935 data will be returned, measured in bytes.
7936
7937SIZE
7938 Specifies the size in bytes of the data store region being
7939 returned.
7940
7941DATA
7942 Specifies a pointer to the location where buffer object data is
7943 returned.
7944
7945`glGetBufferSubData' returns some or all of the data from the buffer
7946object currently bound to TARGET. Data starting at byte offset OFFSET
7947and extending for SIZE bytes is copied from the data store to the memory
7948pointed to by DATA. An error is thrown if the buffer object is currently
7949mapped, or if OFFSET and SIZE together define a range beyond the bounds
7950of the buffer object's data store.
7951
7952`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
7953`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
7954`GL_PIXEL_UNPACK_BUFFER'.
7955
7956`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
7957together they define a region of memory that extends beyond the buffer
7958object's allocated data store.
7959
7960`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
7961is bound to TARGET.
7962
7963`GL_INVALID_OPERATION' is generated if the buffer object being queried
7964is mapped.
7965
7966`GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
7967between the execution of `glBegin' and the corresponding execution of
7968`glEnd'.")
7969
25072f02 7970(define-gl-procedures
bb894c9d
AW
7971 ((glGetClipPlane
7972 (plane GLenum)
00239761 7973 (equation GLdouble-*)
bb894c9d
AW
7974 ->
7975 void))
3c9b6116
AW
7976 "Return the coefficients of the specified clipping plane.
7977
7978PLANE
7979 Specifies a clipping plane. The number of clipping planes depends
7980 on the implementation, but at least six clipping planes are
7981 supported. They are identified by symbolic names of the form
7982 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
7983 `GL_MAX_CLIP_PLANES' - 1.
7984
7985EQUATION
7986 Returns four double-precision values that are the coefficients of
7987 the plane equation of PLANE in eye coordinates. The initial value
7988 is (0, 0, 0, 0).
7989
7990`glGetClipPlane' returns in EQUATION the four coefficients of the plane
7991equation for PLANE.
7992
7993`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
7994
7995`GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
7996between the execution of `glBegin' and the corresponding execution of
7997`glEnd'.")
7998
b002944d
AW
7999(define-gl-procedures
8000 ((glGetColorTableParameterfv
8001 (target GLenum)
8002 (pname GLenum)
8003 (params GLfloat-*)
8004 ->
8005 void)
8006 (glGetColorTableParameteriv
8007 (target GLenum)
8008 (pname GLenum)
8009 (params GLint-*)
8010 ->
8011 void))
8012 "Get color lookup table parameters.
8013
8014TARGET
8015 The target color table. Must be `GL_COLOR_TABLE',
8016 `GL_POST_CONVOLUTION_COLOR_TABLE',
8017 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
8018 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
8019 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8020
8021PNAME
8022 The symbolic name of a color lookup table parameter. Must be one of
8023 `GL_COLOR_TABLE_BIAS', `GL_COLOR_TABLE_SCALE',
8024 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
8025 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
8026 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
8027 `GL_COLOR_TABLE_LUMINANCE_SIZE', or
8028 `GL_COLOR_TABLE_INTENSITY_SIZE'.
8029
8030PARAMS
8031 A pointer to an array where the values of the parameter will be
8032 stored.
8033
8034Returns parameters specific to color table TARGET.
8035
8036When PNAME is set to `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS',
8037`glGetColorTableParameter' returns the color table scale or bias
8038parameters for the table specified by TARGET. For these queries, TARGET
8039must be set to `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8040`GL_POST_COLOR_MATRIX_COLOR_TABLE' and PARAMS points to an array of four
8041elements, which receive the scale or bias factors for red, green, blue,
8042and alpha, in that order.
8043
8044`glGetColorTableParameter' can also be used to retrieve the format and
8045size parameters for a color table. For these queries, set TARGET to
8046either the color table target or the proxy color table target. The
8047format and size parameters are set by `glColorTable'.
8048
8049The following table lists the format and size parameters that may be
8050queried. For each symbolic constant listed below for PNAME, PARAMS must
8051point to an array of the given length and receive the values indicated.
8052
8053
8054
8055*Parameter*
8056 *N*, *Meaning*
8057
8058`GL_COLOR_TABLE_FORMAT'
8059 1 , Internal format (e.g., `GL_RGBA')
8060
8061`GL_COLOR_TABLE_WIDTH'
8062 1 , Number of elements in table
8063
8064`GL_COLOR_TABLE_RED_SIZE'
8065 1 , Size of red component, in bits
8066
8067`GL_COLOR_TABLE_GREEN_SIZE'
8068 1 , Size of green component
8069
8070`GL_COLOR_TABLE_BLUE_SIZE'
8071 1 , Size of blue component
8072
8073`GL_COLOR_TABLE_ALPHA_SIZE'
8074 1 , Size of alpha component
8075
8076`GL_COLOR_TABLE_LUMINANCE_SIZE'
8077 1 , Size of luminance component
8078
8079`GL_COLOR_TABLE_INTENSITY_SIZE'
8080 1 , Size of intensity component
8081
8082
8083
8084`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
8085value.
8086
8087`GL_INVALID_OPERATION' is generated if `glGetColorTableParameter' is
8088executed between the execution of `glBegin' and the corresponding
8089execution of `glEnd'.")
8090
25072f02 8091(define-gl-procedures
bb894c9d
AW
8092 ((glGetColorTable
8093 (target GLenum)
8094 (format GLenum)
8095 (type GLenum)
00239761 8096 (table GLvoid-*)
bb894c9d
AW
8097 ->
8098 void))
3c9b6116
AW
8099 "Retrieve contents of a color lookup table.
8100
8101TARGET
8102 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8103 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
8104
8105FORMAT
8106 The format of the pixel data in TABLE. The possible values are
8107 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
8108 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8109
8110TYPE
8111 The type of the pixel data in TABLE. Symbolic constants
8112 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8113 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8114 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8115 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8116 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8117 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8118 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8119 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8120 are accepted.
8121
8122TABLE
8123 Pointer to a one-dimensional array of pixel data containing the
8124 contents of the color table.
8125
8126`glGetColorTable' returns in TABLE the contents of the color table
8127specified by TARGET. No pixel transfer operations are performed, but
8128pixel storage modes that are applicable to `glReadPixels' are performed.
8129
8130If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8131target (see `glBindBuffer') while a histogram table is requested, TABLE
8132is treated as a byte offset into the buffer object's data store.
8133
8134Color components that are requested in the specified FORMAT, but which
8135are not included in the internal format of the color lookup table, are
8136returned as zero. The assignments of internal color components to the
8137components requested by FORMAT are
8138
8139*Internal Component*
8140 *Resulting Component*
8141
8142Red
8143 Red
8144
8145Green
8146 Green
8147
8148Blue
8149 Blue
8150
8151Alpha
8152 Alpha
8153
8154Luminance
8155 Red
8156
8157Intensity
8158 Red
8159
8160
8161
8162`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8163values.
8164
8165`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8166values.
8167
8168`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8169values.
8170
8171`GL_INVALID_OPERATION' is generated if TYPE is one of
8172`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8173`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8174is not `GL_RGB'.
8175
8176`GL_INVALID_OPERATION' is generated if TYPE is one of
8177`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8178`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8179`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8180`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8181FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8182
8183`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8184bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8185store is currently mapped.
8186
8187`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8188bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8189to the buffer object such that the memory writes required would exceed
8190the data store size.
8191
8192`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8193bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
8194divisible into the number of bytes needed to store in memory a datum
8195indicated by TYPE.
8196
8197`GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
8198between the execution of `glBegin' and the corresponding execution of
8199`glEnd'.")
8200
25072f02 8201(define-gl-procedures
bb894c9d
AW
8202 ((glGetCompressedTexImage
8203 (target GLenum)
8204 (lod GLint)
00239761 8205 (img GLvoid-*)
bb894c9d
AW
8206 ->
8207 void))
3c9b6116
AW
8208 "Return a compressed texture image.
8209
8210TARGET
8211 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8212 `GL_TEXTURE_2D', and
8213 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8214 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8215 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8216 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8217
8218LOD
8219 Specifies the level-of-detail number of the desired image. Level 0
8220 is the base image level. Level N is the N th mipmap reduction
8221 image.
8222
8223IMG
8224 Returns the compressed texture image.
8225
8226`glGetCompressedTexImage' returns the compressed texture image
8227associated with TARGET and LOD into IMG. IMG should be an array of
8228`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
8229desired texture image was one specified by `glTexImage1D'
8230(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8231`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
8232specifies the level-of-detail number of the desired image.
8233
8234If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8235target (see `glBindBuffer') while a texture image is requested, IMG is
8236treated as a byte offset into the buffer object's data store.
8237
8238To minimize errors, first verify that the texture is compressed by
8239calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
8240If the texture is compressed, then determine the amount of memory
8241required to store the compressed texture by calling
8242`glGetTexLevelParameter' with argument
8243`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
8244format of the texture by calling `glGetTexLevelParameter' with argument
8245`GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
8246associate the internal format and size with the retrieved texture image.
8247These data can be used by the respective texture or subtexture loading
8248routine used for loading TARGET textures.
8249
8250`GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
8251the maximum number of LODs permitted by the implementation.
8252
8253`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
8254to retrieve a texture that is in an uncompressed internal format.
8255
8256`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8257bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8258store is currently mapped.
8259
8260`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8261bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8262to the buffer object such that the memory writes required would exceed
8263the data store size.
8264
8265`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
8266executed between the execution of `glBegin' and the corresponding
8267execution of `glEnd'.")
8268
25072f02 8269(define-gl-procedures
bb894c9d
AW
8270 ((glGetConvolutionFilter
8271 (target GLenum)
8272 (format GLenum)
8273 (type GLenum)
00239761 8274 (image GLvoid-*)
bb894c9d
AW
8275 ->
8276 void))
3c9b6116
AW
8277 "Get current 1D or 2D convolution filter kernel.
8278
8279TARGET
8280 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
8281 `GL_CONVOLUTION_2D'.
8282
8283FORMAT
8284 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
8285 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
8286 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8287
8288TYPE
8289 Data type of components in the output image. Symbolic constants
8290 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8291 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8292 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8293 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8294 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8295 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8296 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8297 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8298 are accepted.
8299
8300IMAGE
8301 Pointer to storage for the output image.
8302
8303`glGetConvolutionFilter' returns the current 1D or 2D convolution filter
8304kernel as an image. The one- or two-dimensional image is placed in IMAGE
8305according to the specifications in FORMAT and TYPE. No pixel transfer
8306operations are performed on this image, but the relevant pixel storage
8307modes are applied.
8308
8309If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8310target (see `glBindBuffer') while a convolution filter is requested,
8311IMAGE is treated as a byte offset into the buffer object's data store.
8312
8313Color components that are present in FORMAT but not included in the
8314internal format of the filter are returned as zero. The assignments of
8315internal color components to the components of FORMAT are as follows.
8316
8317*Internal Component*
8318 *Resulting Component*
8319
8320Red
8321 Red
8322
8323Green
8324 Green
8325
8326Blue
8327 Blue
8328
8329Alpha
8330 Alpha
8331
8332Luminance
8333 Red
8334
8335Intensity
8336 Red
8337
8338
8339
8340`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8341values.
8342
8343`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8344values.
8345
8346`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8347values.
8348
8349`GL_INVALID_OPERATION' is generated if TYPE is one of
8350`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8351`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8352is not `GL_RGB'.
8353
8354`GL_INVALID_OPERATION' is generated if TYPE is one of
8355`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8356`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8357`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8358`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8359FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8360
8361`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8362bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8363store is currently mapped.
8364
8365`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8366bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8367to the buffer object such that the memory writes required would exceed
8368the data store size.
8369
8370`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8371bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8372divisible into the number of bytes needed to store in memory a datum
8373indicated by TYPE.
8374
8375`GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8376executed between the execution of `glBegin' and the corresponding
8377execution of `glEnd'.")
8378
b002944d
AW
8379(define-gl-procedures
8380 ((glGetConvolutionParameterfv
8381 (target GLenum)
8382 (pname GLenum)
8383 (params GLfloat-*)
8384 ->
8385 void)
8386 (glGetConvolutionParameteriv
8387 (target GLenum)
8388 (pname GLenum)
8389 (params GLint-*)
8390 ->
8391 void))
8392 "Get convolution parameters.
8393
8394TARGET
8395 The filter whose parameters are to be retrieved. Must be one of
8396 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
8397
8398PNAME
8399 The parameter to be retrieved. Must be one of
8400 `GL_CONVOLUTION_BORDER_MODE', `GL_CONVOLUTION_BORDER_COLOR',
8401 `GL_CONVOLUTION_FILTER_SCALE', `GL_CONVOLUTION_FILTER_BIAS',
8402 `GL_CONVOLUTION_FORMAT', `GL_CONVOLUTION_WIDTH',
8403 `GL_CONVOLUTION_HEIGHT', `GL_MAX_CONVOLUTION_WIDTH', or
8404 `GL_MAX_CONVOLUTION_HEIGHT'.
8405
8406PARAMS
8407 Pointer to storage for the parameters to be retrieved.
8408
8409`glGetConvolutionParameter' retrieves convolution parameters. TARGET
8410determines which convolution filter is queried. PNAME determines which
8411parameter is returned:
8412
8413`GL_CONVOLUTION_BORDER_MODE'
8414
8415
8416 The convolution border mode. See `glConvolutionParameter' for a
8417 list of border modes.
8418
8419`GL_CONVOLUTION_BORDER_COLOR'
8420
8421
8422 The current convolution border color. PARAMS must be a pointer to
8423 an array of four elements, which will receive the red, green, blue,
8424 and alpha border colors.
8425
8426`GL_CONVOLUTION_FILTER_SCALE'
8427
8428
8429 The current filter scale factors. PARAMS must be a pointer to an
8430 array of four elements, which will receive the red, green, blue,
8431 and alpha filter scale factors in that order.
8432
8433`GL_CONVOLUTION_FILTER_BIAS'
8434
8435
8436 The current filter bias factors. PARAMS must be a pointer to an
8437 array of four elements, which will receive the red, green, blue,
8438 and alpha filter bias terms in that order.
8439
8440`GL_CONVOLUTION_FORMAT'
8441
8442
8443 The current internal format. See `glConvolutionFilter1D',
8444 `glConvolutionFilter2D', and `glSeparableFilter2D' for lists of
8445 allowable formats.
8446
8447`GL_CONVOLUTION_WIDTH'
8448
8449
8450 The current filter image width.
8451
8452`GL_CONVOLUTION_HEIGHT'
8453
8454
8455 The current filter image height.
8456
8457`GL_MAX_CONVOLUTION_WIDTH'
8458
8459
8460 The maximum acceptable filter image width.
8461
8462`GL_MAX_CONVOLUTION_HEIGHT'
8463
8464
8465 The maximum acceptable filter image height.
8466
8467`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8468values.
8469
8470`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8471values.
8472
8473`GL_INVALID_ENUM' is generated if TARGET is `GL_CONVOLUTION_1D' and
8474PNAME is `GL_CONVOLUTION_HEIGHT' or `GL_MAX_CONVOLUTION_HEIGHT'.
8475
8476`GL_INVALID_OPERATION' is generated if `glGetConvolutionParameter' is
8477executed between the execution of `glBegin' and the corresponding
8478execution of `glEnd'.")
8479
25072f02 8480(define-gl-procedures
bb894c9d 8481 ((glGetError -> GLenum))
3c9b6116
AW
8482 "Return error information.
8483
8484`glGetError' returns the value of the error flag. Each detectable error
8485is assigned a numeric code and symbolic name. When an error occurs, the
8486error flag is set to the appropriate error code value. No other errors
8487are recorded until `glGetError' is called, the error code is returned,
8488and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8489returns `GL_NO_ERROR', there has been no detectable error since the last
8490call to `glGetError', or since the GL was initialized.
8491
8492To allow for distributed implementations, there may be several error
8493flags. If any single error flag has recorded an error, the value of that
8494flag is returned and that flag is reset to `GL_NO_ERROR' when
8495`glGetError' is called. If more than one flag has recorded an error,
8496`glGetError' returns and clears an arbitrary error flag value. Thus,
8497`glGetError' should always be called in a loop, until it returns
8498`GL_NO_ERROR', if all error flags are to be reset.
8499
8500Initially, all error flags are set to `GL_NO_ERROR'.
8501
8502The following errors are currently defined:
8503
8504`GL_NO_ERROR'
8505 No error has been recorded. The value of this symbolic constant is
8506 guaranteed to be 0.
8507
8508`GL_INVALID_ENUM'
8509 An unacceptable value is specified for an enumerated argument. The
8510 offending command is ignored and has no other side effect than to
8511 set the error flag.
8512
8513`GL_INVALID_VALUE'
8514 A numeric argument is out of range. The offending command is
8515 ignored and has no other side effect than to set the error flag.
8516
8517`GL_INVALID_OPERATION'
8518 The specified operation is not allowed in the current state. The
8519 offending command is ignored and has no other side effect than to
8520 set the error flag.
8521
8522`GL_STACK_OVERFLOW'
8523 This command would cause a stack overflow. The offending command is
8524 ignored and has no other side effect than to set the error flag.
8525
8526`GL_STACK_UNDERFLOW'
8527 This command would cause a stack underflow. The offending command
8528 is ignored and has no other side effect than to set the error flag.
8529
8530`GL_OUT_OF_MEMORY'
8531 There is not enough memory left to execute the command. The state
8532 of the GL is undefined, except for the state of the error flags,
8533 after this error is recorded.
8534
8535`GL_TABLE_TOO_LARGE'
8536 The specified table exceeds the implementation's maximum supported
8537 table size. The offending command is ignored and has no other side
8538 effect than to set the error flag.
8539
8540When an error flag is set, results of a GL operation are undefined only
8541if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8542generating the error is ignored and has no effect on the GL state or
8543frame buffer contents. If the generating command returns a value, it
8544returns 0. If `glGetError' itself generates an error, it returns 0.
8545
8546`GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8547the execution of `glBegin' and the corresponding execution of `glEnd'.
8548In this case, `glGetError' returns 0.")
8549
b002944d
AW
8550(define-gl-procedures
8551 ((glGetHistogramParameterfv
8552 (target GLenum)
8553 (pname GLenum)
8554 (params GLfloat-*)
8555 ->
8556 void)
8557 (glGetHistogramParameteriv
8558 (target GLenum)
8559 (pname GLenum)
8560 (params GLint-*)
8561 ->
8562 void))
8563 "Get histogram parameters.
8564
8565TARGET
8566 Must be one of `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
8567
8568PNAME
8569 The name of the parameter to be retrieved. Must be one of
8570 `GL_HISTOGRAM_WIDTH', `GL_HISTOGRAM_FORMAT',
8571 `GL_HISTOGRAM_RED_SIZE', `GL_HISTOGRAM_GREEN_SIZE',
8572 `GL_HISTOGRAM_BLUE_SIZE', `GL_HISTOGRAM_ALPHA_SIZE',
8573 `GL_HISTOGRAM_LUMINANCE_SIZE', or `GL_HISTOGRAM_SINK'.
8574
8575PARAMS
8576 Pointer to storage for the returned values.
8577
8578`glGetHistogramParameter' is used to query parameter values for the
8579current histogram or for a proxy. The histogram state information may be
8580queried by calling `glGetHistogramParameter' with a TARGET of
8581`GL_HISTOGRAM' (to obtain information for the current histogram table)
8582or `GL_PROXY_HISTOGRAM' (to obtain information from the most recent
8583proxy request) and one of the following values for the PNAME argument:
8584
8585
8586
8587*Parameter*
8588 *Description*
8589
8590`GL_HISTOGRAM_WIDTH'
8591 Histogram table width
8592
8593`GL_HISTOGRAM_FORMAT'
8594 Internal format
8595
8596`GL_HISTOGRAM_RED_SIZE'
8597 Red component counter size, in bits
8598
8599`GL_HISTOGRAM_GREEN_SIZE'
8600 Green component counter size, in bits
8601
8602`GL_HISTOGRAM_BLUE_SIZE'
8603 Blue component counter size, in bits
8604
8605`GL_HISTOGRAM_ALPHA_SIZE'
8606 Alpha component counter size, in bits
8607
8608`GL_HISTOGRAM_LUMINANCE_SIZE'
8609 Luminance component counter size, in bits
8610
8611`GL_HISTOGRAM_SINK'
8612 Value of the SINK parameter
8613
8614
8615
8616`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8617values.
8618
8619`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8620values.
8621
8622`GL_INVALID_OPERATION' is generated if `glGetHistogramParameter' is
8623executed between the execution of `glBegin' and the corresponding
8624execution of `glEnd'.")
8625
25072f02 8626(define-gl-procedures
bb894c9d
AW
8627 ((glGetHistogram
8628 (target GLenum)
8629 (reset GLboolean)
8630 (format GLenum)
8631 (type GLenum)
00239761 8632 (values GLvoid-*)
bb894c9d
AW
8633 ->
8634 void))
3c9b6116
AW
8635 "Get histogram table.
8636
8637TARGET
8638 Must be `GL_HISTOGRAM'.
8639
8640RESET
8641 If `GL_TRUE', each component counter that is actually returned is
8642 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8643 of the counters in the histogram table is modified.
8644
8645FORMAT
8646 The format of values to be returned in VALUES. Must be one of
8647 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8648 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8649
8650TYPE
8651 The type of values to be returned in VALUES. Symbolic constants
8652 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8653 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8654 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8655 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8656 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8657 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8658 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8659 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8660 are accepted.
8661
8662VALUES
8663 A pointer to storage for the returned histogram table.
8664
8665`glGetHistogram' returns the current histogram table as a
8666one-dimensional image with the same width as the histogram. No pixel
8667transfer operations are performed on this image, but pixel storage modes
8668that are applicable to 1D images are honored.
8669
8670If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8671target (see `glBindBuffer') while a histogram table is requested, VALUES
8672is treated as a byte offset into the buffer object's data store.
8673
8674Color components that are requested in the specified FORMAT, but which
8675are not included in the internal format of the histogram, are returned
8676as zero. The assignments of internal color components to the components
8677requested by FORMAT are:
8678
8679*Internal Component*
8680 *Resulting Component*
8681
8682Red
8683 Red
8684
8685Green
8686 Green
8687
8688Blue
8689 Blue
8690
8691Alpha
8692 Alpha
8693
8694Luminance
8695 Red
8696
8697
8698
8699`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
8700
8701`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8702values.
8703
8704`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8705values.
8706
8707`GL_INVALID_OPERATION' is generated if TYPE is one of
8708`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8709`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8710is not `GL_RGB'.
8711
8712`GL_INVALID_OPERATION' is generated if TYPE is one of
8713`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8714`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8715`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8716`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8717FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8718
8719`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8720bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8721store is currently mapped.
8722
8723`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8724bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8725to the buffer object such that the memory writes required would exceed
8726the data store size.
8727
8728`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8729bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
8730divisible into the number of bytes needed to store in memory a datum
8731indicated by TYPE.
8732
8733`GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
8734between the execution of `glBegin' and the corresponding execution of
8735`glEnd'.")
8736
25072f02 8737(define-gl-procedures
b002944d
AW
8738 ((glGetLightfv
8739 (light GLenum)
8740 (pname GLenum)
8741 (params GLfloat-*)
8742 ->
8743 void)
8744 (glGetLightiv
8745 (light GLenum)
8746 (pname GLenum)
8747 (params GLint-*)
bb894c9d
AW
8748 ->
8749 void))
b002944d 8750 "Return light source parameter values.
3c9b6116 8751
b002944d
AW
8752LIGHT
8753 Specifies a light source. The number of possible lights depends on
8754 the implementation, but at least eight lights are supported. They
8755 are identified by symbolic names of the form `GL_LIGHT' I where I
8756 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
3c9b6116 8757
b002944d
AW
8758PNAME
8759 Specifies a light source parameter for LIGHT. Accepted symbolic
8760 names are `GL_AMBIENT', `GL_DIFFUSE', `GL_SPECULAR', `GL_POSITION',
8761 `GL_SPOT_DIRECTION', `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF',
8762 `GL_CONSTANT_ATTENUATION', `GL_LINEAR_ATTENUATION', and
8763 `GL_QUADRATIC_ATTENUATION'.
3c9b6116 8764
b002944d
AW
8765PARAMS
8766 Returns the requested data.
3c9b6116 8767
b002944d
AW
8768`glGetLight' returns in PARAMS the value or values of a light source
8769parameter. LIGHT names the light and is a symbolic name of the form
8770`GL_LIGHT'I where i ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
8771`GL_MAX_LIGHTS' is an implementation dependent constant that is greater
8772than or equal to eight. PNAME specifies one of ten light source
8773parameters, again by symbolic name.
8774
8775The following parameters are defined:
8776
8777`GL_AMBIENT'
8778 PARAMS returns four integer or floating-point values representing
8779 the ambient intensity of the light source. Integer values, when
8780 requested, are linearly mapped from the internal floating-point
8781 representation such that 1.0 maps to the most positive
8782 representable integer value, and -1.0 maps to the most negative
8783 representable integer value. If the internal value is outside the
8784 range [-1,1] , the corresponding integer return value is undefined.
8785 The initial value is (0, 0, 0, 1).
8786
8787`GL_DIFFUSE'
8788 PARAMS returns four integer or floating-point values representing
8789 the diffuse intensity of the light source. Integer values, when
8790 requested, are linearly mapped from the internal floating-point
8791 representation such that 1.0 maps to the most positive
8792 representable integer value, and -1.0 maps to the most negative
8793 representable integer value. If the internal value is outside the
8794 range [-1,1] , the corresponding integer return value is undefined.
8795 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
8796 lights, the initial value is (0, 0, 0, 0).
8797
8798`GL_SPECULAR'
8799 PARAMS returns four integer or floating-point values representing
8800 the specular intensity of the light source. Integer values, when
8801 requested, are linearly mapped from the internal floating-point
8802 representation such that 1.0 maps to the most positive
8803 representable integer value, and -1.0 maps to the most negative
8804 representable integer value. If the internal value is outside the
8805 range [-1,1] , the corresponding integer return value is undefined.
8806 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
8807 lights, the initial value is (0, 0, 0, 0).
8808
8809`GL_POSITION'
8810 PARAMS returns four integer or floating-point values representing
8811 the position of the light source. Integer values, when requested,
8812 are computed by rounding the internal floating-point values to the
8813 nearest integer value. The returned values are those maintained in
8814 eye coordinates. They will not be equal to the values specified
8815 using `glLight', unless the modelview matrix was identity at the
8816 time `glLight' was called. The initial value is (0, 0, 1, 0).
8817
8818`GL_SPOT_DIRECTION'
8819 PARAMS returns three integer or floating-point values representing
8820 the direction of the light source. Integer values, when requested,
8821 are computed by rounding the internal floating-point values to the
8822 nearest integer value. The returned values are those maintained in
8823 eye coordinates. They will not be equal to the values specified
8824 using `glLight', unless the modelview matrix was identity at the
8825 time `glLight' was called. Although spot direction is normalized
8826 before being used in the lighting equation, the returned values are
8827 the transformed versions of the specified values prior to
8828 normalization. The initial value is (0,0-1) .
8829
8830`GL_SPOT_EXPONENT'
8831 PARAMS returns a single integer or floating-point value
8832 representing the spot exponent of the light. An integer value, when
8833 requested, is computed by rounding the internal floating-point
8834 representation to the nearest integer. The initial value is 0.
8835
8836`GL_SPOT_CUTOFF'
8837 PARAMS returns a single integer or floating-point value
8838 representing the spot cutoff angle of the light. An integer value,
8839 when requested, is computed by rounding the internal floating-point
8840 representation to the nearest integer. The initial value is 180.
8841
8842`GL_CONSTANT_ATTENUATION'
8843 PARAMS returns a single integer or floating-point value
8844 representing the constant (not distance-related) attenuation of the
8845 light. An integer value, when requested, is computed by rounding
8846 the internal floating-point representation to the nearest integer.
8847 The initial value is 1.
8848
8849`GL_LINEAR_ATTENUATION'
8850 PARAMS returns a single integer or floating-point value
8851 representing the linear attenuation of the light. An integer value,
8852 when requested, is computed by rounding the internal floating-point
8853 representation to the nearest integer. The initial value is 0.
8854
8855`GL_QUADRATIC_ATTENUATION'
8856 PARAMS returns a single integer or floating-point value
8857 representing the quadratic attenuation of the light. An integer
8858 value, when requested, is computed by rounding the internal
8859 floating-point representation to the nearest integer. The initial
8860 value is 0.
8861
8862`GL_INVALID_ENUM' is generated if LIGHT or PNAME is not an accepted
8863value.
8864
8865`GL_INVALID_OPERATION' is generated if `glGetLight' is executed between
8866the execution of `glBegin' and the corresponding execution of `glEnd'.")
8867
8868(define-gl-procedures
8869 ((glGetMapfv
8870 (target GLenum)
8871 (query GLenum)
8872 (v GLfloat-*)
8873 ->
8874 void)
8875 (glGetMapiv
8876 (target GLenum)
8877 (query GLenum)
8878 (v GLint-*)
8879 ->
8880 void))
8881 "Return evaluator parameters.
8882
8883TARGET
8884 Specifies the symbolic name of a map. Accepted values are
8885 `GL_MAP1_COLOR_4', `GL_MAP1_INDEX', `GL_MAP1_NORMAL',
8886 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
8887 `GL_MAP1_TEXTURE_COORD_3', `GL_MAP1_TEXTURE_COORD_4',
8888 `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4', `GL_MAP2_COLOR_4',
8889 `GL_MAP2_INDEX', `GL_MAP2_NORMAL', `GL_MAP2_TEXTURE_COORD_1',
8890 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3',
8891 `GL_MAP2_TEXTURE_COORD_4', `GL_MAP2_VERTEX_3', and
8892 `GL_MAP2_VERTEX_4'.
8893
8894QUERY
8895 Specifies which parameter to return. Symbolic names `GL_COEFF',
8896 `GL_ORDER', and `GL_DOMAIN' are accepted.
8897
8898V
8899 Returns the requested data.
8900
8901`glMap1' and `glMap2' define evaluators. `glGetMap' returns evaluator
8902parameters. TARGET chooses a map, QUERY selects a specific parameter,
8903and V points to storage where the values will be returned.
8904
8905The acceptable values for the TARGET parameter are described in the
8906`glMap1' and `glMap2' reference pages.
8907
8908QUERY can assume the following values:
8909
8910`GL_COEFF'
8911 V returns the control points for the evaluator function.
8912 One-dimensional evaluators return ORDER control points, and
8913 two-dimensional evaluators return UORDER×VORDER control points.
8914 Each control point consists of one, two, three, or four integer,
8915 single-precision floating-point, or double-precision floating-point
8916 values, depending on the type of the evaluator. The GL returns
8917 two-dimensional control points in row-major order, incrementing the
8918 UORDER index quickly and the VORDER index after each row. Integer
8919 values, when requested, are computed by rounding the internal
8920 floating-point values to the nearest integer values.
8921
8922`GL_ORDER'
8923 V returns the order of the evaluator function. One-dimensional
8924 evaluators return a single value, ORDER . The initial value is 1.
8925 Two-dimensional evaluators return two values, UORDER and VORDER .
8926 The initial value is 1,1.
8927
8928`GL_DOMAIN'
8929 V returns the linear U and V mapping parameters. One-dimensional
8930 evaluators return two values, U1 and U2 , as specified by `glMap1'.
8931 Two-dimensional evaluators return four values ( U1 , U2 , V1 , and
8932 V2 ) as specified by `glMap2'. Integer values, when requested, are
8933 computed by rounding the internal floating-point values to the
8934 nearest integer values.
8935
8936`GL_INVALID_ENUM' is generated if either TARGET or QUERY is not an
8937accepted value.
8938
8939`GL_INVALID_OPERATION' is generated if `glGetMap' is executed between
8940the execution of `glBegin' and the corresponding execution of `glEnd'.")
8941
8942(define-gl-procedures
8943 ((glGetMaterialfv
8944 (face GLenum)
8945 (pname GLenum)
8946 (params GLfloat-*)
8947 ->
8948 void)
8949 (glGetMaterialiv
8950 (face GLenum)
8951 (pname GLenum)
8952 (params GLint-*)
8953 ->
8954 void))
8955 "Return material parameters.
8956
8957FACE
8958 Specifies which of the two materials is being queried. `GL_FRONT'
8959 or `GL_BACK' are accepted, representing the front and back
8960 materials, respectively.
8961
8962PNAME
8963 Specifies the material parameter to return. `GL_AMBIENT',
8964 `GL_DIFFUSE', `GL_SPECULAR', `GL_EMISSION', `GL_SHININESS', and
8965 `GL_COLOR_INDEXES' are accepted.
8966
8967PARAMS
8968 Returns the requested data.
8969
8970`glGetMaterial' returns in PARAMS the value or values of parameter PNAME
8971of material FACE. Six parameters are defined:
8972
8973`GL_AMBIENT'
8974 PARAMS returns four integer or floating-point values representing
8975 the ambient reflectance of the material. Integer values, when
8976 requested, are linearly mapped from the internal floating-point
8977 representation such that 1.0 maps to the most positive
8978 representable integer value, and -1.0 maps to the most negative
8979 representable integer value. If the internal value is outside the
8980 range [-1,1] , the corresponding integer return value is undefined.
8981 The initial value is (0.2, 0.2, 0.2, 1.0)
8982
8983`GL_DIFFUSE'
8984 PARAMS returns four integer or floating-point values representing
8985 the diffuse reflectance of the material. Integer values, when
8986 requested, are linearly mapped from the internal floating-point
8987 representation such that 1.0 maps to the most positive
8988 representable integer value, and -1.0 maps to the most negative
8989 representable integer value. If the internal value is outside the
8990 range [-1,1] , the corresponding integer return value is undefined.
8991 The initial value is (0.8, 0.8, 0.8, 1.0).
8992
8993`GL_SPECULAR'
8994 PARAMS returns four integer or floating-point values representing
8995 the specular reflectance of the material. Integer values, when
8996 requested, are linearly mapped from the internal floating-point
8997 representation such that 1.0 maps to the most positive
8998 representable integer value, and -1.0 maps to the most negative
8999 representable integer value. If the internal value is outside the
9000 range [-1,1] , the corresponding integer return value is undefined.
9001 The initial value is (0, 0, 0, 1).
9002
9003`GL_EMISSION'
9004 PARAMS returns four integer or floating-point values representing
9005 the emitted light intensity of the material. Integer values, when
9006 requested, are linearly mapped from the internal floating-point
9007 representation such that 1.0 maps to the most positive
9008 representable integer value, and -1.0 maps to the most negative
9009 representable integer value. If the internal value is outside the
9010 range [-1,1] , the corresponding integer return value is undefined.
9011 The initial value is (0, 0, 0, 1).
9012
9013`GL_SHININESS'
9014 PARAMS returns one integer or floating-point value representing the
9015 specular exponent of the material. Integer values, when requested,
9016 are computed by rounding the internal floating-point value to the
9017 nearest integer value. The initial value is 0.
9018
9019`GL_COLOR_INDEXES'
9020 PARAMS returns three integer or floating-point values representing
9021 the ambient, diffuse, and specular indices of the material. These
9022 indices are used only for color index lighting. (All the other
9023 parameters are used only for RGBA lighting.) Integer values, when
9024 requested, are computed by rounding the internal floating-point
9025 values to the nearest integer values.
9026
9027`GL_INVALID_ENUM' is generated if FACE or PNAME is not an accepted
9028value.
9029
9030`GL_INVALID_OPERATION' is generated if `glGetMaterial' is executed
9031between the execution of `glBegin' and the corresponding execution of
9032`glEnd'.")
9033
9034(define-gl-procedures
9035 ((glGetMinmaxParameterfv
9036 (target GLenum)
9037 (pname GLenum)
9038 (params GLfloat-*)
9039 ->
9040 void)
9041 (glGetMinmaxParameteriv
9042 (target GLenum)
9043 (pname GLenum)
9044 (params GLint-*)
9045 ->
9046 void))
9047 "Get minmax parameters.
9048
9049TARGET
9050 Must be `GL_MINMAX'.
9051
9052PNAME
9053 The parameter to be retrieved. Must be one of `GL_MINMAX_FORMAT' or
9054 `GL_MINMAX_SINK'.
9055
9056PARAMS
9057 A pointer to storage for the retrieved parameters.
9058
9059`glGetMinmaxParameter' retrieves parameters for the current minmax table
9060by setting PNAME to one of the following values:
9061
9062
9063
9064*Parameter*
9065 *Description*
9066
9067`GL_MINMAX_FORMAT'
9068 Internal format of minmax table
9069
9070`GL_MINMAX_SINK'
9071 Value of the SINK parameter
9072
9073
9074
9075`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
9076
9077`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
9078values.
9079
9080`GL_INVALID_OPERATION' is generated if `glGetMinmaxParameter' is
9081executed between the execution of `glBegin' and the corresponding
9082execution of `glEnd'.")
9083
9084(define-gl-procedures
9085 ((glGetMinmax
9086 (target GLenum)
9087 (reset GLboolean)
9088 (format GLenum)
9089 (types GLenum)
9090 (values GLvoid-*)
9091 ->
9092 void))
9093 "Get minimum and maximum pixel values.
9094
9095TARGET
9096 Must be `GL_MINMAX'.
9097
9098RESET
9099 If `GL_TRUE', all entries in the minmax table that are actually
9100 returned are reset to their initial values. (Other entries are
9101 unaltered.) If `GL_FALSE', the minmax table is unaltered.
9102
9103FORMAT
9104 The format of the data to be returned in VALUES. Must be one of
9105 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
9106 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9107
9108TYPES
9109 The type of the data to be returned in VALUES. Symbolic constants
9110 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9111 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9112 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9113 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9114 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9115 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9116 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9117 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
bb894c9d 9118 are accepted.
3c9b6116 9119
bb894c9d
AW
9120VALUES
9121 A pointer to storage for the returned values.
3c9b6116 9122
bb894c9d
AW
9123`glGetMinmax' returns the accumulated minimum and maximum pixel values
9124(computed on a per-component basis) in a one-dimensional image of width
91252. The first set of return values are the minima, and the second set of
9126return values are the maxima. The format of the return values is
9127determined by FORMAT, and their type is determined by TYPES.
3c9b6116 9128
bb894c9d
AW
9129If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9130target (see `glBindBuffer') while minimum and maximum pixel values are
9131requested, VALUES is treated as a byte offset into the buffer object's
9132data store.
3c9b6116 9133
bb894c9d
AW
9134No pixel transfer operations are performed on the return values, but
9135pixel storage modes that are applicable to one-dimensional images are
9136performed. Color components that are requested in the specified FORMAT,
9137but that are not included in the internal format of the minmax table,
9138are returned as zero. The assignment of internal color components to the
9139components requested by FORMAT are as follows:
3c9b6116 9140
3c9b6116 9141
3c9b6116 9142
bb894c9d
AW
9143*Internal Component*
9144 *Resulting Component*
3c9b6116 9145
bb894c9d
AW
9146Red
9147 Red
3c9b6116 9148
bb894c9d
AW
9149Green
9150 Green
3c9b6116 9151
bb894c9d
AW
9152Blue
9153 Blue
3c9b6116 9154
bb894c9d
AW
9155Alpha
9156 Alpha
3c9b6116 9157
bb894c9d
AW
9158Luminance
9159 Red
3c9b6116 9160
bb894c9d
AW
9161If RESET is `GL_TRUE', the minmax table entries corresponding to the
9162return values are reset to their initial values. Minimum and maximum
9163values that are not returned are not modified, even if RESET is
9164`GL_TRUE'.
3c9b6116 9165
bb894c9d 9166`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
3c9b6116
AW
9167
9168`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
9169values.
9170
9171`GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
9172values.
9173
9174`GL_INVALID_OPERATION' is generated if TYPES is one of
9175`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9176`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9177is not `GL_RGB'.
9178
9179`GL_INVALID_OPERATION' is generated if TYPES is one of
9180`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9181`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9182`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9183`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9184FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
9185
9186`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9187bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9188store is currently mapped.
9189
9190`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9191bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9192to the buffer object such that the memory writes required would exceed
9193the data store size.
9194
9195`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9196bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
9197divisible into the number of bytes needed to store in memory a datum
9198indicated by TYPE.
9199
9200`GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
9201the execution of `glBegin' and the corresponding execution of `glEnd'.")
9202
b002944d
AW
9203(define-gl-procedures
9204 ((glGetPixelMapfv
9205 (map GLenum)
9206 (data GLfloat-*)
9207 ->
9208 void)
9209 (glGetPixelMapuiv
9210 (map GLenum)
9211 (data GLuint-*)
9212 ->
9213 void))
9214 "Return the specified pixel map.
9215
9216MAP
9217 Specifies the name of the pixel map to return. Accepted values are
9218 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
9219 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
9220 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
9221 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
9222 `GL_PIXEL_MAP_B_TO_B', and `GL_PIXEL_MAP_A_TO_A'.
9223
9224DATA
9225 Returns the pixel map contents.
9226
9227See the `glPixelMap' reference page for a description of the acceptable
9228values for the MAP parameter. `glGetPixelMap' returns in DATA the
9229contents of the pixel map specified in MAP. Pixel maps are used during
9230the execution of `glReadPixels', `glDrawPixels', `glCopyPixels',
9231`glTexImage1D', `glTexImage2D', `glTexImage3D', `glTexSubImage1D',
9232`glTexSubImage2D', `glTexSubImage3D', `glCopyTexImage1D',
9233`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D', and
9234`glCopyTexSubImage3D'. to map color indices, stencil indices, color
9235components, and depth components to other values.
9236
9237If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9238target (see `glBindBuffer') while a pixel map is requested, DATA is
9239treated as a byte offset into the buffer object's data store.
9240
9241Unsigned integer values, if requested, are linearly mapped from the
9242internal fixed or floating-point representation such that 1.0 maps to
9243the largest representable integer value, and 0.0 maps to 0. Return
9244unsigned integer values are undefined if the map value was not in the
9245range [0,1].
9246
9247To determine the required size of MAP, call `glGet' with the appropriate
9248symbolic constant.
9249
9250`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
9251
9252`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9253bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9254store is currently mapped.
9255
9256`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9257bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9258to the buffer object such that the memory writes required would exceed
9259the data store size.
9260
9261`GL_INVALID_OPERATION' is generated by `glGetPixelMapfv' if a non-zero
9262buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9263DATA is not evenly divisible into the number of bytes needed to store in
9264memory a GLfloat datum.
9265
9266`GL_INVALID_OPERATION' is generated by `glGetPixelMapuiv' if a non-zero
9267buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9268DATA is not evenly divisible into the number of bytes needed to store in
9269memory a GLuint datum.
9270
9271`GL_INVALID_OPERATION' is generated by `glGetPixelMapusv' if a non-zero
9272buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9273DATA is not evenly divisible into the number of bytes needed to store in
9274memory a GLushort datum.
9275
9276`GL_INVALID_OPERATION' is generated if `glGetPixelMap' is executed
9277between the execution of `glBegin' and the corresponding execution of
9278`glEnd'.")
9279
9280(define-gl-procedures
9281 ((glGetPointerv
9282 (pname GLenum)
9283 (params GLvoid-**)
9284 ->
9285 void))
9286 "Return the address of the specified pointer.
9287
9288PNAME
9289 Specifies the array or buffer pointer to be returned. Symbolic
9290 constants `GL_COLOR_ARRAY_POINTER', `GL_EDGE_FLAG_ARRAY_POINTER',
9291 `GL_FOG_COORD_ARRAY_POINTER', `GL_FEEDBACK_BUFFER_POINTER',
9292 `GL_INDEX_ARRAY_POINTER', `GL_NORMAL_ARRAY_POINTER',
9293 `GL_SECONDARY_COLOR_ARRAY_POINTER', `GL_SELECTION_BUFFER_POINTER',
9294 `GL_TEXTURE_COORD_ARRAY_POINTER', or `GL_VERTEX_ARRAY_POINTER' are
9295 accepted.
9296
9297PARAMS
9298 Returns the pointer value specified by PNAME.
9299
9300`glGetPointerv' returns pointer information. PNAME is a symbolic
9301constant indicating the pointer to be returned, and PARAMS is a pointer
9302to a location in which to place the returned data.
9303
9304For all PNAME arguments except `GL_FEEDBACK_BUFFER_POINTER' and
9305`GL_SELECTION_BUFFER_POINTER', if a non-zero named buffer object was
9306bound to the `GL_ARRAY_BUFFER' target (see `glBindBuffer') when the
9307desired pointer was previously specified, the pointer returned is a byte
9308offset into the buffer object's data store. Buffer objects are only
9309available in OpenGL versions 1.5 and greater.
9310
9311`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
9312
25072f02 9313(define-gl-procedures
00239761 9314 ((glGetPolygonStipple (pattern GLubyte-*) -> void))
3c9b6116
AW
9315 "Return the polygon stipple pattern.
9316
9317PATTERN
9318 Returns the stipple pattern. The initial value is all 1's.
9319
9320`glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
9321pattern. The pattern is packed into memory as if `glReadPixels' with
9322both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
9323`GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
9324internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
9325transfer operations (shift, offset, pixel map) are not applied to the
9326returned stipple image.
9327
9328If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9329target (see `glBindBuffer') while a polygon stipple pattern is
9330requested, PATTERN is treated as a byte offset into the buffer object's
9331data store.
9332
9333`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9334bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9335store is currently mapped.
9336
9337`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9338bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9339to the buffer object such that the memory writes required would exceed
9340the data store size.
9341
9342`GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
9343between the execution of `glBegin' and the corresponding execution of
9344`glEnd'.")
9345
25072f02 9346(define-gl-procedures
bb894c9d
AW
9347 ((glGetProgramInfoLog
9348 (program GLuint)
9349 (maxLength GLsizei)
00239761
AW
9350 (length GLsizei-*)
9351 (infoLog GLchar-*)
bb894c9d
AW
9352 ->
9353 void))
3c9b6116
AW
9354 "Returns the information log for a program object.
9355
9356PROGRAM
9357 Specifies the program object whose information log is to be
9358 queried.
9359
9360MAXLENGTH
9361 Specifies the size of the character buffer for storing the returned
9362 information log.
9363
9364LENGTH
9365 Returns the length of the string returned in INFOLOG (excluding the
9366 null terminator).
9367
9368INFOLOG
9369 Specifies an array of characters that is used to return the
9370 information log.
9371
9372`glGetProgramInfoLog' returns the information log for the specified
9373program object. The information log for a program object is modified
9374when the program object is linked or validated. The string that is
9375returned will be null terminated.
9376
9377`glGetProgramInfoLog' returns in INFOLOG as much of the information log
9378as it can, up to a maximum of MAXLENGTH characters. The number of
9379characters actually returned, excluding the null termination character,
9380is specified by LENGTH. If the length of the returned string is not
9381required, a value of `NULL' can be passed in the LENGTH argument. The
9382size of the buffer required to store the returned information log can be
9383obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
9384
9385The information log for a program object is either an empty string, or a
9386string containing information about the last link operation, or a string
9387containing information about the last validation operation. It may
9388contain diagnostic messages, warning messages, and other information.
9389When a program object is created, its information log will be a string
9390of length 0.
9391
9392`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9393OpenGL.
9394
9395`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
9396
9397`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
9398
9399`GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
9400between the execution of `glBegin' and the corresponding execution of
9401`glEnd'.")
9402
25072f02 9403(define-gl-procedures
b002944d
AW
9404 ((glGetProgramiv
9405 (program GLuint)
9406 (pname GLenum)
9407 (params GLint-*)
bb894c9d
AW
9408 ->
9409 void))
b002944d 9410 "Returns a parameter from a program object.
3c9b6116 9411
b002944d
AW
9412PROGRAM
9413 Specifies the program object to be queried.
3c9b6116 9414
b002944d
AW
9415PNAME
9416 Specifies the object parameter. Accepted symbolic names are
9417 `GL_DELETE_STATUS', `GL_LINK_STATUS', `GL_VALIDATE_STATUS',
9418 `GL_INFO_LOG_LENGTH', `GL_ATTACHED_SHADERS',
9419 `GL_ACTIVE_ATTRIBUTES', `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH',
9420 `GL_ACTIVE_UNIFORMS', `GL_ACTIVE_UNIFORM_MAX_LENGTH'.
3c9b6116 9421
b002944d
AW
9422PARAMS
9423 Returns the requested object parameter.
3c9b6116 9424
b002944d
AW
9425`glGetProgram' returns in PARAMS the value of a parameter for a specific
9426program object. The following parameters are defined:
3c9b6116 9427
b002944d 9428`GL_DELETE_STATUS'
3c9b6116
AW
9429
9430
b002944d
AW
9431 PARAMS returns `GL_TRUE' if PROGRAM is currently flagged for
9432 deletion, and `GL_FALSE' otherwise.
3c9b6116 9433
b002944d 9434`GL_LINK_STATUS'
3c9b6116
AW
9435
9436
b002944d
AW
9437 PARAMS returns `GL_TRUE' if the last link operation on PROGRAM was
9438 successful, and `GL_FALSE' otherwise.
3c9b6116 9439
b002944d 9440`GL_VALIDATE_STATUS'
3c9b6116
AW
9441
9442
b002944d
AW
9443 PARAMS returns `GL_TRUE' or if the last validation operation on
9444 PROGRAM was successful, and `GL_FALSE' otherwise.
3c9b6116 9445
b002944d 9446`GL_INFO_LOG_LENGTH'
3c9b6116
AW
9447
9448
b002944d
AW
9449 PARAMS returns the number of characters in the information log for
9450 PROGRAM including the null termination character (i.e., the size of
9451 the character buffer required to store the information log). If
9452 PROGRAM has no information log, a value of 0 is returned.
3c9b6116 9453
b002944d 9454`GL_ATTACHED_SHADERS'
3c9b6116
AW
9455
9456
b002944d 9457 PARAMS returns the number of shader objects attached to PROGRAM.
3c9b6116 9458
b002944d 9459`GL_ACTIVE_ATTRIBUTES'
3c9b6116
AW
9460
9461
b002944d
AW
9462 PARAMS returns the number of active attribute variables for
9463 PROGRAM.
9464
9465`GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'
9466
9467
9468 PARAMS returns the length of the longest active attribute name for
9469 PROGRAM, including the null termination character (i.e., the size
9470 of the character buffer required to store the longest attribute
9471 name). If no active attributes exist, 0 is returned.
9472
9473`GL_ACTIVE_UNIFORMS'
9474
9475
9476 PARAMS returns the number of active uniform variables for PROGRAM.
9477
9478`GL_ACTIVE_UNIFORM_MAX_LENGTH'
9479
9480
9481 PARAMS returns the length of the longest active uniform variable
9482 name for PROGRAM, including the null termination character (i.e.,
9483 the size of the character buffer required to store the longest
9484 uniform variable name). If no active uniform variables exist, 0 is
9485 returned.
9486
9487`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9488OpenGL.
9489
9490`GL_INVALID_OPERATION' is generated if PROGRAM does not refer to a
9491program object.
9492
9493`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9494
9495`GL_INVALID_OPERATION' is generated if `glGetProgram' is executed
9496between the execution of `glBegin' and the corresponding execution of
9497`glEnd'.")
9498
9499(define-gl-procedures
9500 ((glGetQueryiv
9501 (target GLenum)
9502 (pname GLenum)
9503 (params GLint-*)
9504 ->
9505 void))
9506 "Return parameters of a query object target.
9507
9508TARGET
9509 Specifies a query object target. Must be `GL_SAMPLES_PASSED'.
9510
9511PNAME
9512 Specifies the symbolic name of a query object target parameter.
9513 Accepted values are `GL_CURRENT_QUERY' or `GL_QUERY_COUNTER_BITS'.
9514
9515PARAMS
9516 Returns the requested data.
9517
9518`glGetQueryiv' returns in PARAMS a selected parameter of the query
9519object target specified by TARGET.
9520
9521PNAME names a specific query object target parameter. When TARGET is
9522`GL_SAMPLES_PASSED', PNAME can be as follows:
9523
9524`GL_CURRENT_QUERY'
9525 PARAMS returns the name of the currently active occlusion query
9526 object. If no occlusion query is active, 0 is returned. The initial
9527 value is 0.
9528
9529`GL_QUERY_COUNTER_BITS'
9530 PARAMS returns the number of bits in the query counter used to
9531 accumulate passing samples. If the number of bits returned is 0,
9532 the implementation does not support a query counter, and the
9533 results obtained from `glGetQueryObject' are useless.
9534
9535`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
9536value.
9537
9538`GL_INVALID_OPERATION' is generated if `glGetQueryiv' is executed
9539between the execution of `glBegin' and the corresponding execution of
9540`glEnd'.")
9541
9542(define-gl-procedures
9543 ((glGetQueryObjectiv
9544 (id GLuint)
9545 (pname GLenum)
9546 (params GLint-*)
9547 ->
9548 void)
9549 (glGetQueryObjectuiv
9550 (id GLuint)
9551 (pname GLenum)
9552 (params GLuint-*)
9553 ->
9554 void))
9555 "Return parameters of a query object.
9556
9557ID
9558 Specifies the name of a query object.
9559
9560PNAME
9561 Specifies the symbolic name of a query object parameter. Accepted
9562 values are `GL_QUERY_RESULT' or `GL_QUERY_RESULT_AVAILABLE'.
9563
9564PARAMS
9565 Returns the requested data.
9566
9567`glGetQueryObject' returns in PARAMS a selected parameter of the query
9568object specified by ID.
9569
9570PNAME names a specific query object parameter. PNAME can be as follows:
9571
9572`GL_QUERY_RESULT'
9573 PARAMS returns the value of the query object's passed samples
9574 counter. The initial value is 0.
9575
9576`GL_QUERY_RESULT_AVAILABLE'
9577 PARAMS returns whether the passed samples counter is immediately
9578 available. If a delay would occur waiting for the query result,
9579 `GL_FALSE' is returned. Otherwise, `GL_TRUE' is returned, which
9580 also indicates that the results of all previous queries are
9581 available as well.
9582
9583`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9584
9585`GL_INVALID_OPERATION' is generated if ID is not the name of a query
9586object.
9587
9588`GL_INVALID_OPERATION' is generated if ID is the name of a currently
9589active query object.
9590
9591`GL_INVALID_OPERATION' is generated if `glGetQueryObject' is executed
9592between the execution of `glBegin' and the corresponding execution of
9593`glEnd'.")
9594
9595(define-gl-procedures
9596 ((glGetSeparableFilter
9597 (target GLenum)
9598 (format GLenum)
9599 (type GLenum)
9600 (row GLvoid-*)
9601 (column GLvoid-*)
9602 (span GLvoid-*)
9603 ->
9604 void))
9605 "Get separable convolution filter kernel images.
9606
9607TARGET
9608 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
9609
9610FORMAT
9611 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
9612 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
9613 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9614
9615TYPE
9616 Data type of components in the output images. Symbolic constants
9617 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9618 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9619 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9620 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9621 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9622 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9623 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9624 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
9625 are accepted.
9626
9627ROW
9628 Pointer to storage for the row filter image.
9629
9630COLUMN
9631 Pointer to storage for the column filter image.
9632
9633SPAN
9634 Pointer to storage for the span filter image (currently unused).
9635
9636`glGetSeparableFilter' returns the two one-dimensional filter kernel
9637images for the current separable 2D convolution filter. The row image is
9638placed in ROW and the column image is placed in COLUMN according to the
9639specifications in FORMAT and TYPE. (In the current implementation, SPAN
9640is not affected in any way.) No pixel transfer operations are performed
9641on the images, but the relevant pixel storage modes are applied.
9642
9643If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9644target (see `glBindBuffer') while a separable convolution filter is
9645requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
9646buffer object's data store.
9647
9648Color components that are present in FORMAT but not included in the
9649internal format of the filters are returned as zero. The assignments of
9650internal color components to the components of FORMAT are as follows:
9651
9652
9653
9654*Internal Component*
9655 *Resulting Component*
9656
9657Red
9658 Red
9659
9660Green
9661 Green
9662
9663Blue
9664 Blue
9665
9666Alpha
9667 Alpha
9668
9669Luminance
9670 Red
9671
9672Intensity
9673 Red
9674
9675
9676
9677`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
9678
9679`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
bb894c9d 9680values.
3c9b6116 9681
bb894c9d
AW
9682`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
9683values.
3c9b6116 9684
bb894c9d
AW
9685`GL_INVALID_OPERATION' is generated if TYPE is one of
9686`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9687`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9688is not `GL_RGB'.
3c9b6116 9689
bb894c9d
AW
9690`GL_INVALID_OPERATION' is generated if TYPE is one of
9691`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9692`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9693`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9694`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9695FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3c9b6116 9696
bb894c9d
AW
9697`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9698bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9699store is currently mapped.
3c9b6116 9700
bb894c9d
AW
9701`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9702bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9703to the buffer object such that the memory writes required would exceed
9704the data store size.
3c9b6116 9705
bb894c9d
AW
9706`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9707bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
9708evenly divisible into the number of bytes needed to store in memory a
9709datum indicated by TYPE.
3c9b6116 9710
bb894c9d
AW
9711`GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
9712executed between the execution of `glBegin' and the corresponding
9713execution of `glEnd'.")
3c9b6116 9714
25072f02 9715(define-gl-procedures
bb894c9d
AW
9716 ((glGetShaderInfoLog
9717 (shader GLuint)
9718 (maxLength GLsizei)
00239761
AW
9719 (length GLsizei-*)
9720 (infoLog GLchar-*)
bb894c9d
AW
9721 ->
9722 void))
3c9b6116
AW
9723 "Returns the information log for a shader object.
9724
9725SHADER
9726 Specifies the shader object whose information log is to be queried.
9727
9728MAXLENGTH
9729 Specifies the size of the character buffer for storing the returned
9730 information log.
9731
9732LENGTH
9733 Returns the length of the string returned in INFOLOG (excluding the
9734 null terminator).
9735
9736INFOLOG
9737 Specifies an array of characters that is used to return the
9738 information log.
9739
9740`glGetShaderInfoLog' returns the information log for the specified
9741shader object. The information log for a shader object is modified when
9742the shader is compiled. The string that is returned will be null
9743terminated.
9744
9745`glGetShaderInfoLog' returns in INFOLOG as much of the information log
9746as it can, up to a maximum of MAXLENGTH characters. The number of
9747characters actually returned, excluding the null termination character,
9748is specified by LENGTH. If the length of the returned string is not
9749required, a value of `NULL' can be passed in the LENGTH argument. The
9750size of the buffer required to store the returned information log can be
9751obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
9752
9753The information log for a shader object is a string that may contain
9754diagnostic messages, warning messages, and other information about the
9755last compile operation. When a shader object is created, its information
9756log will be a string of length 0.
9757
9758`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
9759OpenGL.
9760
9761`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
9762
9763`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
9764
9765`GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
9766between the execution of `glBegin' and the corresponding execution of
9767`glEnd'.")
9768
25072f02 9769(define-gl-procedures
bb894c9d
AW
9770 ((glGetShaderSource
9771 (shader GLuint)
9772 (bufSize GLsizei)
00239761
AW
9773 (length GLsizei-*)
9774 (source GLchar-*)
bb894c9d
AW
9775 ->
9776 void))
3c9b6116
AW
9777 "Returns the source code string from a shader object.
9778
9779SHADER
9780 Specifies the shader object to be queried.
9781
9782BUFSIZE
9783 Specifies the size of the character buffer for storing the returned
9784 source code string.
9785
9786LENGTH
9787 Returns the length of the string returned in SOURCE (excluding the
9788 null terminator).
9789
9790SOURCE
9791 Specifies an array of characters that is used to return the source
9792 code string.
9793
9794`glGetShaderSource' returns the concatenation of the source code strings
9795from the shader object specified by SHADER. The source code strings for
9796a shader object are the result of a previous call to `glShaderSource'.
9797The string returned by the function will be null terminated.
9798
9799`glGetShaderSource' returns in SOURCE as much of the source code string
9800as it can, up to a maximum of BUFSIZE characters. The number of
9801characters actually returned, excluding the null termination character,
9802is specified by LENGTH. If the length of the returned string is not
9803required, a value of `NULL' can be passed in the LENGTH argument. The
9804size of the buffer required to store the returned source code string can
9805be obtained by calling `glGetShader' with the value
9806`GL_SHADER_SOURCE_LENGTH'.
9807
9808`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
9809OpenGL.
9810
bb894c9d 9811`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
3c9b6116 9812
bb894c9d 9813`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
3c9b6116 9814
bb894c9d
AW
9815`GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
9816between the execution of `glBegin' and the corresponding execution of
9817`glEnd'.")
3c9b6116 9818
b002944d
AW
9819(define-gl-procedures
9820 ((glGetShaderiv
9821 (shader GLuint)
9822 (pname GLenum)
9823 (params GLint-*)
9824 ->
9825 void))
9826 "Returns a parameter from a shader object.
9827
9828SHADER
9829 Specifies the shader object to be queried.
9830
9831PNAME
9832 Specifies the object parameter. Accepted symbolic names are
9833 `GL_SHADER_TYPE', `GL_DELETE_STATUS', `GL_COMPILE_STATUS',
9834 `GL_INFO_LOG_LENGTH', `GL_SHADER_SOURCE_LENGTH'.
9835
9836PARAMS
9837 Returns the requested object parameter.
9838
9839`glGetShader' returns in PARAMS the value of a parameter for a specific
9840shader object. The following parameters are defined:
9841
9842`GL_SHADER_TYPE'
9843 PARAMS returns `GL_VERTEX_SHADER' if SHADER is a vertex shader
9844 object, and `GL_FRAGMENT_SHADER' if SHADER is a fragment shader
9845 object.
9846
9847`GL_DELETE_STATUS'
9848 PARAMS returns `GL_TRUE' if SHADER is currently flagged for
9849 deletion, and `GL_FALSE' otherwise.
9850
9851`GL_COMPILE_STATUS'
9852 PARAMS returns `GL_TRUE' if the last compile operation on SHADER
9853 was successful, and `GL_FALSE' otherwise.
9854
9855`GL_INFO_LOG_LENGTH'
9856 PARAMS returns the number of characters in the information log for
9857 SHADER including the null termination character (i.e., the size of
9858 the character buffer required to store the information log). If
9859 SHADER has no information log, a value of 0 is returned.
9860
9861`GL_SHADER_SOURCE_LENGTH'
9862 PARAMS returns the length of the concatenation of the source
9863 strings that make up the shader source for the SHADER, including
9864 the null termination character. (i.e., the size of the character
9865 buffer required to store the shader source). If no source code
9866 exists, 0 is returned.
9867
9868`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
9869OpenGL.
9870
9871`GL_INVALID_OPERATION' is generated if SHADER does not refer to a shader
9872object.
9873
9874`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9875
9876`GL_INVALID_OPERATION' is generated if `glGetShader' is executed between
9877the execution of `glBegin' and the corresponding execution of `glEnd'.")
9878
25072f02 9879(define-gl-procedures
00239761 9880 ((glGetString (name GLenum) -> const-GLubyte*))
bb894c9d 9881 "Return a string describing the current GL connection.
3c9b6116 9882
bb894c9d
AW
9883NAME
9884 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
9885 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
3c9b6116 9886
bb894c9d
AW
9887`glGetString' returns a pointer to a static string describing some
9888aspect of the current GL connection. NAME can be one of the following:
3c9b6116 9889
bb894c9d 9890`GL_VENDOR'
3c9b6116 9891
3c9b6116 9892
bb894c9d
AW
9893 Returns the company responsible for this GL implementation. This
9894 name does not change from release to release.
3c9b6116 9895
bb894c9d 9896`GL_RENDERER'
3c9b6116 9897
3c9b6116 9898
bb894c9d
AW
9899 Returns the name of the renderer. This name is typically specific
9900 to a particular configuration of a hardware platform. It does not
9901 change from release to release.
3c9b6116 9902
bb894c9d 9903`GL_VERSION'
3c9b6116 9904
3c9b6116 9905
bb894c9d 9906 Returns a version or release number.
3c9b6116 9907
bb894c9d 9908`GL_SHADING_LANGUAGE_VERSION'
3c9b6116 9909
3c9b6116 9910
bb894c9d 9911 Returns a version or release number for the shading language.
3c9b6116 9912
bb894c9d 9913`GL_EXTENSIONS'
3c9b6116 9914
3c9b6116 9915
bb894c9d 9916 Returns a space-separated list of supported extensions to GL.
3c9b6116 9917
bb894c9d
AW
9918Because the GL does not include queries for the performance
9919characteristics of an implementation, some applications are written to
9920recognize known platforms and modify their GL usage based on known
9921performance characteristics of these platforms. Strings `GL_VENDOR' and
9922`GL_RENDERER' together uniquely specify a platform. They do not change
9923from release to release and should be used by platform-recognition
9924algorithms.
3c9b6116 9925
bb894c9d
AW
9926Some applications want to make use of features that are not part of the
9927standard GL. These features may be implemented as extensions to the
9928standard GL. The `GL_EXTENSIONS' string is a space-separated list of
9929supported GL extensions. (Extension names never contain a space
9930character.)
3c9b6116 9931
bb894c9d
AW
9932The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
9933version number. The version number uses one of these forms:
3c9b6116 9934
bb894c9d 9935MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
3c9b6116 9936
bb894c9d
AW
9937Vendor-specific information may follow the version number. Its format
9938depends on the implementation, but a space always separates the version
9939number and the vendor-specific information.
3c9b6116 9940
bb894c9d 9941All strings are null-terminated.
3c9b6116 9942
bb894c9d 9943`GL_INVALID_ENUM' is generated if NAME is not an accepted value.
3c9b6116 9944
bb894c9d
AW
9945`GL_INVALID_OPERATION' is generated if `glGetString' is executed between
9946the execution of `glBegin' and the corresponding execution of `glEnd'.")
3c9b6116 9947
b002944d
AW
9948(define-gl-procedures
9949 ((glGetTexEnvfv
9950 (target GLenum)
9951 (pname GLenum)
9952 (params GLfloat-*)
9953 ->
9954 void)
9955 (glGetTexEnviv
9956 (target GLenum)
9957 (pname GLenum)
9958 (params GLint-*)
9959 ->
9960 void))
9961 "Return texture environment parameters.
9962
9963TARGET
9964 Specifies a texture environment. May be `GL_TEXTURE_ENV',
9965 `GL_TEXTURE_FILTER_CONTROL', or `GL_POINT_SPRITE'.
9966
9967PNAME
9968 Specifies the symbolic name of a texture environment parameter.
9969 Accepted values are `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
9970 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
9971 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
9972 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
9973 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
9974 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
9975 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
9976
9977PARAMS
9978 Returns the requested data.
9979
9980`glGetTexEnv' returns in PARAMS selected values of a texture environment
9981that was specified with `glTexEnv'. TARGET specifies a texture
9982environment.
9983
9984When TARGET is `GL_TEXTURE_FILTER_CONTROL', PNAME must be
9985`GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_POINT_SPRITE', PNAME must be
9986`GL_COORD_REPLACE'. When TARGET is `GL_TEXTURE_ENV', PNAME can be
9987`GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR', `GL_COMBINE_RGB',
9988`GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE', `GL_SRC0_RGB',
9989`GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', `GL_SRC1_ALPHA', or
9990`GL_SRC2_ALPHA'.
9991
9992PNAME names a specific texture environment parameter, as follows:
9993
9994`GL_TEXTURE_ENV_MODE'
9995 PARAMS returns the single-valued texture environment mode, a
9996 symbolic constant. The initial value is `GL_MODULATE'.
9997
9998`GL_TEXTURE_ENV_COLOR'
9999 PARAMS returns four integer or floating-point values that are the
10000 texture environment color. Integer values, when requested, are
10001 linearly mapped from the internal floating-point representation
10002 such that 1.0 maps to the most positive representable integer, and
10003 -1.0 maps to the most negative representable integer. The initial
10004 value is (0, 0, 0, 0).
10005
10006`GL_TEXTURE_LOD_BIAS'
10007 PARAMS returns a single floating-point value that is the texture
10008 level-of-detail bias. The initial value is 0.
10009
10010`GL_COMBINE_RGB'
10011 PARAMS returns a single symbolic constant value representing the
10012 current RGB combine mode. The initial value is `GL_MODULATE'.
10013
10014`GL_COMBINE_ALPHA'
10015 PARAMS returns a single symbolic constant value representing the
10016 current alpha combine mode. The initial value is `GL_MODULATE'.
10017
10018`GL_SRC0_RGB'
10019 PARAMS returns a single symbolic constant value representing the
10020 texture combiner zero's RGB source. The initial value is
10021 `GL_TEXTURE'.
10022
10023`GL_SRC1_RGB'
10024 PARAMS returns a single symbolic constant value representing the
10025 texture combiner one's RGB source. The initial value is
10026 `GL_PREVIOUS'.
10027
10028`GL_SRC2_RGB'
10029 PARAMS returns a single symbolic constant value representing the
10030 texture combiner two's RGB source. The initial value is
10031 `GL_CONSTANT'.
10032
10033`GL_SRC0_ALPHA'
10034 PARAMS returns a single symbolic constant value representing the
10035 texture combiner zero's alpha source. The initial value is
10036 `GL_TEXTURE'.
10037
10038`GL_SRC1_ALPHA'
10039 PARAMS returns a single symbolic constant value representing the
10040 texture combiner one's alpha source. The initial value is
10041 `GL_PREVIOUS'.
10042
10043`GL_SRC2_ALPHA'
10044 PARAMS returns a single symbolic constant value representing the
10045 texture combiner two's alpha source. The initial value is
10046 `GL_CONSTANT'.
10047
10048`GL_OPERAND0_RGB'
10049 PARAMS returns a single symbolic constant value representing the
10050 texture combiner zero's RGB operand. The initial value is
10051 `GL_SRC_COLOR'.
10052
10053`GL_OPERAND1_RGB'
10054 PARAMS returns a single symbolic constant value representing the
10055 texture combiner one's RGB operand. The initial value is
10056 `GL_SRC_COLOR'.
10057
10058`GL_OPERAND2_RGB'
10059 PARAMS returns a single symbolic constant value representing the
10060 texture combiner two's RGB operand. The initial value is
10061 `GL_SRC_ALPHA'.
10062
10063`GL_OPERAND0_ALPHA'
10064 PARAMS returns a single symbolic constant value representing the
10065 texture combiner zero's alpha operand. The initial value is
10066 `GL_SRC_ALPHA'.
10067
10068`GL_OPERAND1_ALPHA'
10069 PARAMS returns a single symbolic constant value representing the
10070 texture combiner one's alpha operand. The initial value is
10071 `GL_SRC_ALPHA'.
10072
10073`GL_OPERAND2_ALPHA'
10074 PARAMS returns a single symbolic constant value representing the
10075 texture combiner two's alpha operand. The initial value is
10076 `GL_SRC_ALPHA'.
10077
10078`GL_RGB_SCALE'
10079 PARAMS returns a single floating-point value representing the
10080 current RGB texture combiner scaling factor. The initial value is
10081 1.0.
10082
10083`GL_ALPHA_SCALE'
10084 PARAMS returns a single floating-point value representing the
10085 current alpha texture combiner scaling factor. The initial value is
10086 1.0.
10087
10088`GL_COORD_REPLACE'
10089 PARAMS returns a single boolean value representing the current
10090 point sprite texture coordinate replacement enable state. The
10091 initial value is `GL_FALSE'.
10092
10093`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10094value.
10095
10096`GL_INVALID_OPERATION' is generated if `glGetTexEnv' is executed between
10097the execution of `glBegin' and the corresponding execution of `glEnd'.")
10098
10099(define-gl-procedures
10100 ((glGetTexGenfv
10101 (coord GLenum)
10102 (pname GLenum)
10103 (params GLfloat-*)
10104 ->
10105 void)
10106 (glGetTexGeniv
10107 (coord GLenum)
10108 (pname GLenum)
10109 (params GLint-*)
10110 ->
10111 void))
10112 "Return texture coordinate generation parameters.
10113
10114COORD
10115 Specifies a texture coordinate. Must be `GL_S', `GL_T', `GL_R', or
10116 `GL_Q'.
10117
10118PNAME
10119 Specifies the symbolic name of the value(s) to be returned. Must be
10120 either `GL_TEXTURE_GEN_MODE' or the name of one of the texture
10121 generation plane equations: `GL_OBJECT_PLANE' or `GL_EYE_PLANE'.
10122
10123PARAMS
10124 Returns the requested data.
10125
10126`glGetTexGen' returns in PARAMS selected parameters of a texture
10127coordinate generation function that was specified using `glTexGen'.
10128COORD names one of the (S, T, R, Q) texture coordinates, using the
10129symbolic constant `GL_S', `GL_T', `GL_R', or `GL_Q'.
10130
10131PNAME specifies one of three symbolic names:
10132
10133`GL_TEXTURE_GEN_MODE'
10134 PARAMS returns the single-valued texture generation function, a
10135 symbolic constant. The initial value is `GL_EYE_LINEAR'.
10136
10137`GL_OBJECT_PLANE'
10138 PARAMS returns the four plane equation coefficients that specify
10139 object linear-coordinate generation. Integer values, when
10140 requested, are mapped directly from the internal floating-point
10141 representation.
10142
10143`GL_EYE_PLANE'
10144 PARAMS returns the four plane equation coefficients that specify
10145 eye linear-coordinate generation. Integer values, when requested,
10146 are mapped directly from the internal floating-point
10147 representation. The returned values are those maintained in eye
10148 coordinates. They are not equal to the values specified using
10149 `glTexGen', unless the modelview matrix was identity when
10150 `glTexGen' was called.
10151
10152`GL_INVALID_ENUM' is generated if COORD or PNAME is not an accepted
10153value.
10154
10155`GL_INVALID_OPERATION' is generated if `glGetTexGen' is executed between
10156the execution of `glBegin' and the corresponding execution of `glEnd'.")
10157
25072f02 10158(define-gl-procedures
bb894c9d
AW
10159 ((glGetTexImage
10160 (target GLenum)
10161 (level GLint)
10162 (format GLenum)
10163 (type GLenum)
00239761 10164 (img GLvoid-*)
bb894c9d
AW
10165 ->
10166 void))
10167 "Return a texture image.
3c9b6116 10168
b002944d
AW
10169TARGET
10170 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
10171 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10172 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10173 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10174 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
10175
10176LEVEL
10177 Specifies the level-of-detail number of the desired image. Level 0
10178 is the base image level. Level N is the N th mipmap reduction
10179 image.
10180
10181FORMAT
10182 Specifies a pixel format for the returned data. The supported
10183 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
10184 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
10185 `GL_LUMINANCE_ALPHA'.
10186
10187TYPE
10188 Specifies a pixel type for the returned data. The supported types
10189 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
10190 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
10191 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
10192 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
10193 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
10194 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
10195 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
10196 `GL_UNSIGNED_INT_2_10_10_10_REV'.
10197
10198IMG
10199 Returns the texture image. Should be a pointer to an array of the
10200 type specified by TYPE.
10201
10202`glGetTexImage' returns a texture image into IMG. TARGET specifies
10203whether the desired texture image is one specified by `glTexImage1D'
10204(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
10205`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
10206specifies the level-of-detail number of the desired image. FORMAT and
10207TYPE specify the format and type of the desired image array. See the
10208reference pages `glTexImage1D' and `glDrawPixels' for a description of
10209the acceptable values for the FORMAT and TYPE parameters, respectively.
10210
10211If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
10212target (see `glBindBuffer') while a texture image is requested, IMG is
10213treated as a byte offset into the buffer object's data store.
10214
10215To understand the operation of `glGetTexImage', consider the selected
10216internal four-component texture image to be an RGBA color buffer the
10217size of the image. The semantics of `glGetTexImage' are then identical
10218to those of `glReadPixels', with the exception that no pixel transfer
10219operations are performed, when called with the same FORMAT and TYPE,
10220with X and Y set to 0, WIDTH set to the width of the texture image
10221(including border if one was specified), and HEIGHT set to 1 for 1D
10222images, or to the height of the texture image (including border if one
10223was specified) for 2D images. Because the internal texture image is an
10224RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
10225`GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
10226accepted.
10227
10228If the selected texture image does not contain four components, the
10229following mappings are applied. Single-component textures are treated as
10230RGBA buffers with red set to the single-component value, green set to 0,
10231blue set to 0, and alpha set to 1. Two-component textures are treated as
10232RGBA buffers with red set to the value of component zero, alpha set to
10233the value of component one, and green and blue set to 0. Finally,
10234three-component textures are treated as RGBA buffers with red set to
10235component zero, green set to component one, blue set to component two,
10236and alpha set to 1.
10237
10238To determine the required size of IMG, use `glGetTexLevelParameter' to
10239determine the dimensions of the internal texture image, then scale the
10240required number of pixels by the storage required for each pixel, based
10241on FORMAT and TYPE. Be sure to take the pixel storage parameters into
10242account, especially `GL_PACK_ALIGNMENT'.
10243
10244`GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
10245accepted value.
10246
10247`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10248
10249`GL_INVALID_VALUE' may be generated if LEVEL is greater than
10250LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10251
10252`GL_INVALID_OPERATION' is returned if TYPE is one of
10253`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
10254`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
10255is not `GL_RGB'.
10256
10257`GL_INVALID_OPERATION' is returned if TYPE is one of
10258`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
10259`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
10260`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
10261`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
10262FORMAT is neither `GL_RGBA' or `GL_BGRA'.
10263
10264`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10265bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
10266store is currently mapped.
10267
10268`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10269bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
10270to the buffer object such that the memory writes required would exceed
10271the data store size.
10272
10273`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10274bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
10275divisible into the number of bytes needed to store in memory a datum
10276indicated by TYPE.
10277
10278`GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
10279between the execution of `glBegin' and the corresponding execution of
10280`glEnd'.")
10281
10282(define-gl-procedures
10283 ((glGetTexLevelParameterfv
10284 (target GLenum)
10285 (level GLint)
10286 (pname GLenum)
10287 (params GLfloat-*)
10288 ->
10289 void)
10290 (glGetTexLevelParameteriv
10291 (target GLenum)
10292 (level GLint)
10293 (pname GLenum)
10294 (params GLint-*)
10295 ->
10296 void))
10297 "Return texture parameter values for a specific level of detail.
10298
10299TARGET
10300 Specifies the symbolic name of the target texture, either
10301 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D',
10302 `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10303 `GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10304 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10305 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10306 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10307
10308LEVEL
10309 Specifies the level-of-detail number of the desired image. Level 0
10310 is the base image level. Level N is the N th mipmap reduction
10311 image.
10312
10313PNAME
10314 Specifies the symbolic name of a texture parameter.
10315 `GL_TEXTURE_WIDTH', `GL_TEXTURE_HEIGHT', `GL_TEXTURE_DEPTH',
10316 `GL_TEXTURE_INTERNAL_FORMAT', `GL_TEXTURE_BORDER',
10317 `GL_TEXTURE_RED_SIZE', `GL_TEXTURE_GREEN_SIZE',
10318 `GL_TEXTURE_BLUE_SIZE', `GL_TEXTURE_ALPHA_SIZE',
10319 `GL_TEXTURE_LUMINANCE_SIZE', `GL_TEXTURE_INTENSITY_SIZE',
10320 `GL_TEXTURE_DEPTH_SIZE', `GL_TEXTURE_COMPRESSED', and
10321 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' are accepted.
10322
10323PARAMS
10324 Returns the requested data.
10325
10326`glGetTexLevelParameter' returns in PARAMS texture parameter values for
10327a specific level-of-detail value, specified as LEVEL. TARGET defines the
10328target texture, either `GL_TEXTURE_1D', `GL_TEXTURE_2D',
10329`GL_TEXTURE_3D', `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10330`GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10331`GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10332`GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10333`GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10334
10335`GL_MAX_TEXTURE_SIZE', and `GL_MAX_3D_TEXTURE_SIZE' are not really
10336descriptive enough. It has to report the largest square texture image
10337that can be accommodated with mipmaps and borders, but a long skinny
10338texture, or a texture without mipmaps and borders, may easily fit in
10339texture memory. The proxy targets allow the user to more accurately
10340query whether the GL can accommodate a texture of a given configuration.
10341If the texture cannot be accommodated, the texture state variables,
10342which may be queried with `glGetTexLevelParameter', are set to 0. If the
10343texture can be accommodated, the texture state values will be set as
10344they would be set for a non-proxy target.
10345
10346PNAME specifies the texture parameter whose value or values will be
10347returned.
10348
10349The accepted parameter names are as follows:
10350
10351`GL_TEXTURE_WIDTH'
10352
10353
10354 PARAMS returns a single value, the width of the texture image. This
10355 value includes the border of the texture image. The initial value
10356 is 0.
10357
10358`GL_TEXTURE_HEIGHT'
10359
10360
10361 PARAMS returns a single value, the height of the texture image.
10362 This value includes the border of the texture image. The initial
10363 value is 0.
10364
10365`GL_TEXTURE_DEPTH'
10366
10367
10368 PARAMS returns a single value, the depth of the texture image. This
10369 value includes the border of the texture image. The initial value
10370 is 0.
10371
10372`GL_TEXTURE_INTERNAL_FORMAT'
10373
10374
10375 PARAMS returns a single value, the internal format of the texture
10376 image.
10377
10378`GL_TEXTURE_BORDER'
10379
10380
10381 PARAMS returns a single value, the width in pixels of the border of
10382 the texture image. The initial value is 0.
10383
10384`GL_TEXTURE_RED_SIZE',
10385`GL_TEXTURE_GREEN_SIZE',
10386`GL_TEXTURE_BLUE_SIZE',
10387`GL_TEXTURE_ALPHA_SIZE',
10388`GL_TEXTURE_LUMINANCE_SIZE',
10389`GL_TEXTURE_INTENSITY_SIZE',
10390`GL_TEXTURE_DEPTH_SIZE'
10391
10392
10393 The internal storage resolution of an individual component. The
10394 resolution chosen by the GL will be a close match for the
10395 resolution requested by the user with the component argument of
10396 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
10397 and `glCopyTexImage2D'. The initial value is 0.
10398
10399`GL_TEXTURE_COMPRESSED'
10400
10401
10402 PARAMS returns a single boolean value indicating if the texture
10403 image is stored in a compressed internal format. The initiali value
10404 is `GL_FALSE'.
10405
10406`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'
10407
10408
10409 PARAMS returns a single integer value, the number of unsigned bytes
10410 of the compressed texture image that would be returned from
10411 `glGetCompressedTexImage'.
10412
10413`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10414value.
10415
10416`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10417
10418`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
10419where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10420
10421`GL_INVALID_OPERATION' is generated if `glGetTexLevelParameter' is
10422executed between the execution of `glBegin' and the corresponding
10423execution of `glEnd'.
10424
10425`GL_INVALID_OPERATION' is generated if
10426`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' is queried on texture images with an
10427uncompressed internal format or on proxy targets.")
10428
10429(define-gl-procedures
10430 ((glGetTexParameterfv
10431 (target GLenum)
10432 (pname GLenum)
10433 (params GLfloat-*)
10434 ->
10435 void)
10436 (glGetTexParameteriv
10437 (target GLenum)
10438 (pname GLenum)
10439 (params GLint-*)
10440 ->
10441 void))
10442 "Return texture parameter values.
10443
10444TARGET
10445 Specifies the symbolic name of the target texture. `GL_TEXTURE_1D',
10446 `GL_TEXTURE_2D', `GL_TEXTURE_3D', and `GL_TEXTURE_CUBE_MAP' are
10447 accepted.
10448
10449PNAME
10450 Specifies the symbolic name of a texture parameter.
10451 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_FILTER',
10452 `GL_TEXTURE_MIN_LOD', `GL_TEXTURE_MAX_LOD',
10453 `GL_TEXTURE_BASE_LEVEL', `GL_TEXTURE_MAX_LEVEL',
10454 `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T', `GL_TEXTURE_WRAP_R',
10455 `GL_TEXTURE_BORDER_COLOR', `GL_TEXTURE_PRIORITY',
10456 `GL_TEXTURE_RESIDENT', `GL_TEXTURE_COMPARE_MODE',
10457 `GL_TEXTURE_COMPARE_FUNC', `GL_DEPTH_TEXTURE_MODE', and
10458 `GL_GENERATE_MIPMAP' are accepted.
10459
10460PARAMS
10461 Returns the texture parameters.
10462
10463`glGetTexParameter' returns in PARAMS the value or values of the texture
10464parameter specified as PNAME. TARGET defines the target texture, either
10465`GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
10466`GL_TEXTURE_CUBE_MAP', to specify one-, two-, or three-dimensional or
10467cube-mapped texturing. PNAME accepts the same symbols as
10468`glTexParameter', with the same interpretations:
10469
10470`GL_TEXTURE_MAG_FILTER'
10471 Returns the single-valued texture magnification filter, a symbolic
10472 constant. The initial value is `GL_LINEAR'.
10473
10474`GL_TEXTURE_MIN_FILTER'
10475 Returns the single-valued texture minification filter, a symbolic
10476 constant. The initial value is `GL_NEAREST_MIPMAP_LINEAR'.
10477
10478`GL_TEXTURE_MIN_LOD'
10479 Returns the single-valued texture minimum level-of-detail value.
10480 The initial value is -1000 .
10481
10482`GL_TEXTURE_MAX_LOD'
10483 Returns the single-valued texture maximum level-of-detail value.
10484 The initial value is 1000.
10485
10486`GL_TEXTURE_BASE_LEVEL'
10487 Returns the single-valued base texture mipmap level. The initial
10488 value is 0.
10489
10490`GL_TEXTURE_MAX_LEVEL'
10491 Returns the single-valued maximum texture mipmap array level. The
10492 initial value is 1000.
10493
10494`GL_TEXTURE_WRAP_S'
10495 Returns the single-valued wrapping function for texture coordinate
10496 S , a symbolic constant. The initial value is `GL_REPEAT'.
10497
10498`GL_TEXTURE_WRAP_T'
10499 Returns the single-valued wrapping function for texture coordinate
10500 T , a symbolic constant. The initial value is `GL_REPEAT'.
10501
10502`GL_TEXTURE_WRAP_R'
10503 Returns the single-valued wrapping function for texture coordinate
10504 R , a symbolic constant. The initial value is `GL_REPEAT'.
10505
10506`GL_TEXTURE_BORDER_COLOR'
10507 Returns four integer or floating-point numbers that comprise the
10508 RGBA color of the texture border. Floating-point values are
10509 returned in the range [0,1] . Integer values are returned as a
10510 linear mapping of the internal floating-point representation such
10511 that 1.0 maps to the most positive representable integer and -1.0
10512 maps to the most negative representable integer. The initial value
10513 is (0, 0, 0, 0).
10514
10515`GL_TEXTURE_PRIORITY'
10516 Returns the residence priority of the target texture (or the named
10517 texture bound to it). The initial value is 1. See
10518 `glPrioritizeTextures'.
10519
10520`GL_TEXTURE_RESIDENT'
10521 Returns the residence status of the target texture. If the value
10522 returned in PARAMS is `GL_TRUE', the texture is resident in texture
10523 memory. See `glAreTexturesResident'.
10524
10525`GL_TEXTURE_COMPARE_MODE'
10526 Returns a single-valued texture comparison mode, a symbolic
10527 constant. The initial value is `GL_NONE'. See `glTexParameter'.
10528
10529`GL_TEXTURE_COMPARE_FUNC'
10530 Returns a single-valued texture comparison function, a symbolic
10531 constant. The initial value is `GL_LEQUAL'. See `glTexParameter'.
10532
10533`GL_DEPTH_TEXTURE_MODE'
10534 Returns a single-valued texture format indicating how the depth
10535 values should be converted into color components. The initial value
10536 is `GL_LUMINANCE'. See `glTexParameter'.
10537
10538`GL_GENERATE_MIPMAP'
10539 Returns a single boolean value indicating if automatic mipmap level
10540 updates are enabled. See `glTexParameter'.
10541
10542`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10543value.
10544
10545`GL_INVALID_OPERATION' is generated if `glGetTexParameter' is executed
10546between the execution of `glBegin' and the corresponding execution of
10547`glEnd'.")
10548
10549(define-gl-procedures
10550 ((glGetUniformLocation
10551 (program GLuint)
10552 (name const-GLchar-*)
10553 ->
10554 GLint))
10555 "Returns the location of a uniform variable.
10556
10557PROGRAM
10558 Specifies the program object to be queried.
10559
10560NAME
10561 Points to a null terminated string containing the name of the
10562 uniform variable whose location is to be queried.
10563
10564`glGetUniformLocation ' returns an integer that represents the location
10565of a specific uniform variable within a program object. NAME must be a
10566null terminated string that contains no white space. NAME must be an
10567active uniform variable name in PROGRAM that is not a structure, an
10568array of structures, or a subcomponent of a vector or a matrix. This
10569function returns -1 if NAME does not correspond to an active uniform
10570variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
10571
10572Uniform variables that are structures or arrays of structures may be
10573queried by calling `glGetUniformLocation' for each field within the
10574structure. The array element operator \"[]\" and the structure field
10575operator \".\" may be used in NAME in order to select elements within an
10576array or fields within a structure. The result of using these operators
10577is not allowed to be another structure, an array of structures, or a
10578subcomponent of a vector or a matrix. Except if the last part of NAME
10579indicates a uniform variable array, the location of the first element of
10580an array can be retrieved by using the name of the array, or by using
10581the name appended by \"[0]\".
10582
10583The actual locations assigned to uniform variables are not known until
10584the program object is linked successfully. After linking has occurred,
10585the command `glGetUniformLocation' can be used to obtain the location of
10586a uniform variable. This location value can then be passed to
10587`glUniform' to set the value of the uniform variable or to
10588`glGetUniform' in order to query the current value of the uniform
10589variable. After a program object has been linked successfully, the index
10590values for uniform variables remain fixed until the next link command
10591occurs. Uniform variable locations and values can only be queried after
10592a link if the link was successful.
10593
10594`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10595OpenGL.
10596
10597`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10598
10599`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
10600linked.
10601
10602`GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
10603executed between the execution of `glBegin' and the corresponding
10604execution of `glEnd'.")
10605
10606(define-gl-procedures
10607 ((glGetUniformfv
10608 (program GLuint)
10609 (location GLint)
10610 (params GLfloat-*)
10611 ->
10612 void)
10613 (glGetUniformiv
10614 (program GLuint)
10615 (location GLint)
10616 (params GLint-*)
10617 ->
10618 void))
10619 "Returns the value of a uniform variable.
10620
10621PROGRAM
10622 Specifies the program object to be queried.
10623
10624LOCATION
10625 Specifies the location of the uniform variable to be queried.
10626
10627PARAMS
10628 Returns the value of the specified uniform variable.
10629
10630`glGetUniform' returns in PARAMS the value(s) of the specified uniform
10631variable. The type of the uniform variable specified by LOCATION
10632determines the number of values returned. If the uniform variable is
10633defined in the shader as a boolean, int, or float, a single value will
10634be returned. If it is defined as a vec2, ivec2, or bvec2, two values
10635will be returned. If it is defined as a vec3, ivec3, or bvec3, three
10636values will be returned, and so on. To query values stored in uniform
10637variables declared as arrays, call `glGetUniform' for each element of
10638the array. To query values stored in uniform variables declared as
10639structures, call `glGetUniform' for each field in the structure. The
10640values for uniform variables declared as a matrix will be returned in
10641column major order.
10642
10643The locations assigned to uniform variables are not known until the
10644program object is linked. After linking has occurred, the command
10645`glGetUniformLocation' can be used to obtain the location of a uniform
10646variable. This location value can then be passed to `glGetUniform' in
10647order to query the current value of the uniform variable. After a
10648program object has been linked successfully, the index values for
10649uniform variables remain fixed until the next link command occurs. The
10650uniform variable values can only be queried after a link if the link was
10651successful.
10652
10653`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10654OpenGL.
10655
10656`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10657
10658`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
10659linked.
10660
10661`GL_INVALID_OPERATION' is generated if LOCATION does not correspond to a
10662valid uniform variable location for the specified program object.
10663
10664`GL_INVALID_OPERATION' is generated if `glGetUniform' is executed
10665between the execution of `glBegin' and the corresponding execution of
10666`glEnd'.")
10667
10668(define-gl-procedures
10669 ((glGetVertexAttribPointerv
10670 (index GLuint)
10671 (pname GLenum)
10672 (pointer GLvoid-**)
10673 ->
10674 void))
10675 "Return the address of the specified generic vertex attribute pointer.
10676
10677INDEX
10678 Specifies the generic vertex attribute parameter to be returned.
10679
10680PNAME
10681 Specifies the symbolic name of the generic vertex attribute
10682 parameter to be returned. Must be `GL_VERTEX_ATTRIB_ARRAY_POINTER'.
10683
10684POINTER
10685 Returns the pointer value.
10686
10687`glGetVertexAttribPointerv' returns pointer information. INDEX is the
10688generic vertex attribute to be queried, PNAME is a symbolic constant
10689indicating the pointer to be returned, and PARAMS is a pointer to a
10690location in which to place the returned data.
10691
10692If a non-zero named buffer object was bound to the `GL_ARRAY_BUFFER'
10693target (see `glBindBuffer') when the desired pointer was previously
10694specified, the POINTER returned is a byte offset into the buffer
10695object's data store.
10696
10697`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
10698`GL_MAX_VERTEX_ATTRIBS'.
10699
10700`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
10701
10702(define-gl-procedures
10703 ((glGetVertexAttribfv
10704 (index GLuint)
10705 (pname GLenum)
10706 (params GLfloat-*)
10707 ->
10708 void)
10709 (glGetVertexAttribiv
10710 (index GLuint)
10711 (pname GLenum)
10712 (params GLint-*)
10713 ->
10714 void))
10715 "Return a generic vertex attribute parameter.
10716
10717INDEX
10718 Specifies the generic vertex attribute parameter to be queried.
10719
10720PNAME
10721 Specifies the symbolic name of the vertex attribute parameter to be
10722 queried. Accepted values are
10723 `GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING',
10724 `GL_VERTEX_ATTRIB_ARRAY_ENABLED', `GL_VERTEX_ATTRIB_ARRAY_SIZE',
10725 `GL_VERTEX_ATTRIB_ARRAY_STRIDE', `GL_VERTEX_ATTRIB_ARRAY_TYPE',
10726 `GL_VERTEX_ATTRIB_ARRAY_NORMALIZED', or `GL_CURRENT_VERTEX_ATTRIB'.
10727
10728PARAMS
10729 Returns the requested data.
10730
10731`glGetVertexAttrib' returns in PARAMS the value of a generic vertex
10732attribute parameter. The generic vertex attribute to be queried is
10733specified by INDEX, and the parameter to be queried is specified by
10734PNAME.
10735
10736The accepted parameter names are as follows:
10737
10738`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING'
10739
10740
10741 PARAMS returns a single value, the name of the buffer object
10742 currently bound to the binding point corresponding to generic
10743 vertex attribute array INDEX. If no buffer object is bound, 0 is
10744 returned. The initial value is 0.
10745
10746`GL_VERTEX_ATTRIB_ARRAY_ENABLED'
10747
10748
10749 PARAMS returns a single value that is non-zero (true) if the vertex
10750 attribute array for INDEX is enabled and 0 (false) if it is
10751 disabled. The initial value is `GL_FALSE'.
10752
10753`GL_VERTEX_ATTRIB_ARRAY_SIZE'
10754
10755
10756 PARAMS returns a single value, the size of the vertex attribute
10757 array for INDEX. The size is the number of values for each element
10758 of the vertex attribute array, and it will be 1, 2, 3, or 4. The
10759 initial value is 4.
10760
10761`GL_VERTEX_ATTRIB_ARRAY_STRIDE'
10762
10763
10764 PARAMS returns a single value, the array stride for (number of
10765 bytes between successive elements in) the vertex attribute array
10766 for INDEX. A value of 0 indicates that the array elements are
10767 stored sequentially in memory. The initial value is 0.
10768
10769`GL_VERTEX_ATTRIB_ARRAY_TYPE'
10770
10771
10772 PARAMS returns a single value, a symbolic constant indicating the
10773 array type for the vertex attribute array for INDEX. Possible
10774 values are `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
10775 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
10776 `GL_DOUBLE'. The initial value is `GL_FLOAT'.
10777
10778`GL_VERTEX_ATTRIB_ARRAY_NORMALIZED'
10779
10780
10781 PARAMS returns a single value that is non-zero (true) if
10782 fixed-point data types for the vertex attribute array indicated by
10783 INDEX are normalized when they are converted to floating point, and
10784 0 (false) otherwise. The initial value is `GL_FALSE'.
10785
10786`GL_CURRENT_VERTEX_ATTRIB'
10787
10788
10789 PARAMS returns four values that represent the current value for the
10790 generic vertex attribute specified by index. Generic vertex
10791 attribute 0 is unique in that it has no current state, so an error
10792 will be generated if INDEX is 0. The initial value for all other
10793 generic vertex attributes is (0,0,0,1).
10794
10795All of the parameters except `GL_CURRENT_VERTEX_ATTRIB' represent
10796client-side state.
10797
10798`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
10799`GL_MAX_VERTEX_ATTRIBS'.
10800
10801`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
10802
10803`GL_INVALID_OPERATION' is generated if INDEX is 0 and PNAME is
10804`GL_CURRENT_VERTEX_ATTRIB'.")
10805
10806(define-gl-procedures
10807 ((glGetBooleanv
10808 (pname GLenum)
10809 (params GLboolean-*)
10810 ->
10811 void)
10812 (glGetDoublev
10813 (pname GLenum)
10814 (params GLdouble-*)
10815 ->
10816 void)
10817 (glGetFloatv
10818 (pname GLenum)
10819 (params GLfloat-*)
10820 ->
10821 void)
10822 (glGetIntegerv
10823 (pname GLenum)
10824 (params GLint-*)
10825 ->
10826 void))
10827 "Return the value or values of a selected parameter.
10828
10829PNAME
10830 Specifies the parameter value to be returned. The symbolic
10831 constants in the list below are accepted.
10832
10833PARAMS
10834 Returns the value or values of the specified parameter.
10835
10836These four commands return values for simple state variables in GL.
10837PNAME is a symbolic constant indicating the state variable to be
10838returned, and PARAMS is a pointer to an array of the indicated type in
10839which to place the returned data.
10840
10841Type conversion is performed if PARAMS has a different type than the
10842state variable value being requested. If `glGetBooleanv' is called, a
10843floating-point (or integer) value is converted to `GL_FALSE' if and only
10844if it is 0.0 (or 0). Otherwise, it is converted to `GL_TRUE'. If
10845`glGetIntegerv' is called, boolean values are returned as `GL_TRUE' or
10846`GL_FALSE', and most floating-point values are rounded to the nearest
10847integer value. Floating-point colors and normals, however, are returned
10848with a linear mapping that maps 1.0 to the most positive representable
10849integer value and -1.0 to the most negative representable integer value.
10850If `glGetFloatv' or `glGetDoublev' is called, boolean values are
10851returned as `GL_TRUE' or `GL_FALSE', and integer values are converted to
10852floating-point values.
10853
10854The following symbolic constants are accepted by PNAME:
10855
10856`GL_ACCUM_ALPHA_BITS'
10857
10858
10859 PARAMS returns one value, the number of alpha bitplanes in the
10860 accumulation buffer.
10861
10862`GL_ACCUM_BLUE_BITS'
10863
10864
10865 PARAMS returns one value, the number of blue bitplanes in the
10866 accumulation buffer.
10867
10868`GL_ACCUM_CLEAR_VALUE'
10869
10870
10871 PARAMS returns four values: the red, green, blue, and alpha values
10872 used to clear the accumulation buffer. Integer values, if
10873 requested, are linearly mapped from the internal floating-point
10874 representation such that 1.0 returns the most positive
10875 representable integer value, and -1.0 returns the most negative
10876 representable integer value. The initial value is (0, 0, 0, 0). See
10877 `glClearAccum'.
10878
10879`GL_ACCUM_GREEN_BITS'
10880
10881
10882 PARAMS returns one value, the number of green bitplanes in the
10883 accumulation buffer.
10884
10885`GL_ACCUM_RED_BITS'
10886
10887
10888 PARAMS returns one value, the number of red bitplanes in the
10889 accumulation buffer.
10890
10891`GL_ACTIVE_TEXTURE'
10892
10893
10894 PARAMS returns a single value indicating the active multitexture
10895 unit. The initial value is `GL_TEXTURE0'. See `glActiveTexture'.
10896
10897`GL_ALIASED_POINT_SIZE_RANGE'
10898
10899
10900 PARAMS returns two values, the smallest and largest supported sizes
10901 for aliased points.
10902
10903`GL_ALIASED_LINE_WIDTH_RANGE'
10904
10905
10906 PARAMS returns two values, the smallest and largest supported
10907 widths for aliased lines.
10908
10909`GL_ALPHA_BIAS'
10910
10911
10912 PARAMS returns one value, the alpha bias factor used during pixel
10913 transfers. The initial value is 0. See `glPixelTransfer'.
10914
10915`GL_ALPHA_BITS'
10916
10917
10918 PARAMS returns one value, the number of alpha bitplanes in each
10919 color buffer.
10920
10921`GL_ALPHA_SCALE'
10922
10923
10924 PARAMS returns one value, the alpha scale factor used during pixel
10925 transfers. The initial value is 1. See `glPixelTransfer'.
10926
10927`GL_ALPHA_TEST'
10928
10929
10930 PARAMS returns a single boolean value indicating whether alpha
10931 testing of fragments is enabled. The initial value is `GL_FALSE'.
10932 See `glAlphaFunc'.
10933
10934`GL_ALPHA_TEST_FUNC'PARAMS returns one value,
10935
10936
10937 the symbolic name of the alpha test function. The initial value is
10938 `GL_ALWAYS'. See `glAlphaFunc'.
10939
10940`GL_ALPHA_TEST_REF'
10941
10942
10943 PARAMS returns one value, the reference value for the alpha test.
10944 The initial value is 0. See `glAlphaFunc'. An integer value, if
10945 requested, is linearly mapped from the internal floating-point
10946 representation such that 1.0 returns the most positive
10947 representable integer value, and -1.0 returns the most negative
10948 representable integer value.
10949
10950`GL_ARRAY_BUFFER_BINDING'
10951
10952
10953 PARAMS returns a single value, the name of the buffer object
10954 currently bound to the target `GL_ARRAY_BUFFER'. If no buffer
10955 object is bound to this target, 0 is returned. The initial value is
10956 0. See `glBindBuffer'.
10957
10958`GL_ATTRIB_STACK_DEPTH'
10959
10960
10961 PARAMS returns one value, the depth of the attribute stack. If the
10962 stack is empty, 0 is returned. The initial value is 0. See
10963 `glPushAttrib'.
10964
10965`GL_AUTO_NORMAL'
10966
10967
10968 PARAMS returns a single boolean value indicating whether 2D map
10969 evaluation automatically generates surface normals. The initial
10970 value is `GL_FALSE'. See `glMap2'.
10971
10972`GL_AUX_BUFFERS'
10973
10974
10975 PARAMS returns one value, the number of auxiliary color buffers
10976 available.
10977
10978`GL_BLEND'
10979
10980
10981 PARAMS returns a single boolean value indicating whether blending
10982 is enabled. The initial value is `GL_FALSE'. See `glBlendFunc'.
10983
10984`GL_BLEND_COLOR'
10985
10986
10987 PARAMS returns four values, the red, green, blue, and alpha values
10988 which are the components of the blend color. See `glBlendColor'.
10989
10990`GL_BLEND_DST_ALPHA'
10991
10992
10993 PARAMS returns one value, the symbolic constant identifying the
10994 alpha destination blend function. The initial value is `GL_ZERO'.
10995 See `glBlendFunc' and `glBlendFuncSeparate'.
10996
10997`GL_BLEND_DST_RGB'
10998
10999
11000 PARAMS returns one value, the symbolic constant identifying the RGB
11001 destination blend function. The initial value is `GL_ZERO'. See
11002 `glBlendFunc' and `glBlendFuncSeparate'.
11003
11004`GL_BLEND_EQUATION_RGB'
11005
11006
11007 PARAMS returns one value, a symbolic constant indicating whether
11008 the RGB blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11009 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11010 `glBlendEquationSeparate'.
11011
11012`GL_BLEND_EQUATION_ALPHA'
11013
11014
11015 PARAMS returns one value, a symbolic constant indicating whether
11016 the Alpha blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11017 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11018 `glBlendEquationSeparate'.
11019
11020`GL_BLEND_SRC_ALPHA'
11021
11022
11023 PARAMS returns one value, the symbolic constant identifying the
11024 alpha source blend function. The initial value is `GL_ONE'. See
11025 `glBlendFunc' and `glBlendFuncSeparate'.
11026
11027`GL_BLEND_SRC_RGB'
11028
11029
11030 PARAMS returns one value, the symbolic constant identifying the RGB
11031 source blend function. The initial value is `GL_ONE'. See
11032 `glBlendFunc' and `glBlendFuncSeparate'.
11033
11034`GL_BLUE_BIAS'
11035
11036
11037 PARAMS returns one value, the blue bias factor used during pixel
11038 transfers. The initial value is 0. See `glPixelTransfer'.
11039
11040`GL_BLUE_BITS'
11041
11042
11043 PARAMS returns one value, the number of blue bitplanes in each
11044 color buffer.
11045
11046`GL_BLUE_SCALE'
11047
11048
11049 PARAMS returns one value, the blue scale factor used during pixel
11050 transfers. The initial value is 1. See `glPixelTransfer'.
11051
11052`GL_CLIENT_ACTIVE_TEXTURE'
11053
11054
11055 PARAMS returns a single integer value indicating the current client
11056 active multitexture unit. The initial value is `GL_TEXTURE0'. See
11057 `glClientActiveTexture'.
11058
11059`GL_CLIENT_ATTRIB_STACK_DEPTH'
11060
11061
11062 PARAMS returns one value indicating the depth of the attribute
11063 stack. The initial value is 0. See `glPushClientAttrib'.
11064
11065`GL_CLIP_PLANE'I
11066
11067
11068 PARAMS returns a single boolean value indicating whether the
11069 specified clipping plane is enabled. The initial value is
11070 `GL_FALSE'. See `glClipPlane'.
11071
11072`GL_COLOR_ARRAY'
11073
11074
11075 PARAMS returns a single boolean value indicating whether the color
11076 array is enabled. The initial value is `GL_FALSE'. See
11077 `glColorPointer'.
11078
11079`GL_COLOR_ARRAY_BUFFER_BINDING'
11080
11081
11082 PARAMS returns a single value, the name of the buffer object
11083 associated with the color array. This buffer object would have been
11084 bound to the target `GL_ARRAY_BUFFER' at the time of the most
11085 recent call to `glColorPointer'. If no buffer object was bound to
11086 this target, 0 is returned. The initial value is 0. See
11087 `glBindBuffer'.
11088
11089`GL_COLOR_ARRAY_SIZE'
11090
11091
11092 PARAMS returns one value, the number of components per color in the
11093 color array. The initial value is 4. See `glColorPointer'.
11094
11095`GL_COLOR_ARRAY_STRIDE'
11096
11097
11098 PARAMS returns one value, the byte offset between consecutive
11099 colors in the color array. The initial value is 0. See
11100 `glColorPointer'.
11101
11102`GL_COLOR_ARRAY_TYPE'
11103
11104
11105 PARAMS returns one value, the data type of each component in the
11106 color array. The initial value is `GL_FLOAT'. See `glColorPointer'.
11107
11108`GL_COLOR_CLEAR_VALUE'
11109
11110
11111 PARAMS returns four values: the red, green, blue, and alpha values
11112 used to clear the color buffers. Integer values, if requested, are
11113 linearly mapped from the internal floating-point representation
11114 such that 1.0 returns the most positive representable integer
11115 value, and -1.0 returns the most negative representable integer
11116 value. The initial value is (0, 0, 0, 0). See `glClearColor'.
11117
11118`GL_COLOR_LOGIC_OP'
11119
11120
11121 PARAMS returns a single boolean value indicating whether a
11122 fragment's RGBA color values are merged into the framebuffer using
11123 a logical operation. The initial value is `GL_FALSE'. See
11124 `glLogicOp'.
11125
11126`GL_COLOR_MATERIAL'
11127
11128
11129 PARAMS returns a single boolean value indicating whether one or
11130 more material parameters are tracking the current color. The
11131 initial value is `GL_FALSE'. See `glColorMaterial'.
11132
11133`GL_COLOR_MATERIAL_FACE'
11134
11135
11136 PARAMS returns one value, a symbolic constant indicating which
11137 materials have a parameter that is tracking the current color. The
11138 initial value is `GL_FRONT_AND_BACK'. See `glColorMaterial'.
11139
11140`GL_COLOR_MATERIAL_PARAMETER'
11141
11142
11143 PARAMS returns one value, a symbolic constant indicating which
11144 material parameters are tracking the current color. The initial
11145 value is `GL_AMBIENT_AND_DIFFUSE'. See `glColorMaterial'.
11146
11147`GL_COLOR_MATRIX'
11148
11149
11150 PARAMS returns sixteen values: the color matrix on the top of the
11151 color matrix stack. Initially this matrix is the identity matrix.
11152 See `glPushMatrix'.
11153
11154`GL_COLOR_MATRIX_STACK_DEPTH'
11155
11156
11157 PARAMS returns one value, the maximum supported depth of the
11158 projection matrix stack. The value must be at least 2. See
11159 `glPushMatrix'.
11160
11161`GL_COLOR_SUM'
11162
11163
11164 PARAMS returns a single boolean value indicating whether primary
11165 and secondary color sum is enabled. See `glSecondaryColor'.
11166
11167`GL_COLOR_TABLE'
11168
11169
11170 PARAMS returns a single boolean value indicating whether the color
11171 table lookup is enabled. See `glColorTable'.
11172
11173`GL_COLOR_WRITEMASK'
11174
11175
11176 PARAMS returns four boolean values: the red, green, blue, and alpha
11177 write enables for the color buffers. The initial value is
11178 (`GL_TRUE', `GL_TRUE', `GL_TRUE', `GL_TRUE'). See `glColorMask'.
11179
11180`GL_COMPRESSED_TEXTURE_FORMATS'
11181
11182
11183 PARAMS returns a list of symbolic constants of length
11184 `GL_NUM_COMPRESSED_TEXTURE_FORMATS' indicating which compressed
11185 texture formats are available. See `glCompressedTexImage2D'.
11186
11187`GL_CONVOLUTION_1D'
11188
11189
11190 PARAMS returns a single boolean value indicating whether 1D
11191 convolution is enabled. The initial value is `GL_FALSE'. See
11192 `glConvolutionFilter1D'.
11193
11194`GL_CONVOLUTION_2D'
11195
11196
11197 PARAMS returns a single boolean value indicating whether 2D
11198 convolution is enabled. The initial value is `GL_FALSE'. See
11199 `glConvolutionFilter2D'.
11200
11201`GL_CULL_FACE'
11202
11203
11204 PARAMS returns a single boolean value indicating whether polygon
11205 culling is enabled. The initial value is `GL_FALSE'. See
11206 `glCullFace'.
11207
11208`GL_CULL_FACE_MODE'
11209
11210
11211 PARAMS returns one value, a symbolic constant indicating which
11212 polygon faces are to be culled. The initial value is `GL_BACK'. See
11213 `glCullFace'.
11214
11215`GL_CURRENT_COLOR'
11216
11217
11218 PARAMS returns four values: the red, green, blue, and alpha values
11219 of the current color. Integer values, if requested, are linearly
11220 mapped from the internal floating-point representation such that
11221 1.0 returns the most positive representable integer value, and -1.0
11222 returns the most negative representable integer value. The initial
11223 value is (1, 1, 1, 1). See `glColor'.
11224
11225`GL_CURRENT_FOG_COORD'
11226
11227
11228 PARAMS returns one value, the current fog coordinate. The initial
11229 value is 0. See `glFogCoord'.
11230
11231`GL_CURRENT_INDEX'
11232
11233
11234 PARAMS returns one value, the current color index. The initial
11235 value is 1. See `glIndex'.
11236
11237`GL_CURRENT_NORMAL'
11238
11239
11240 PARAMS returns three values: the X, Y, and Z values of the current
11241 normal. Integer values, if requested, are linearly mapped from the
11242 internal floating-point representation such that 1.0 returns the
11243 most positive representable integer value, and -1.0 returns the
11244 most negative representable integer value. The initial value is (0,
11245 0, 1). See `glNormal'.
11246
11247`GL_CURRENT_PROGRAM'
11248
11249
11250 PARAMS returns one value, the name of the program object that is
11251 currently active, or 0 if no program object is active. See
11252 `glUseProgram'.
11253
11254`GL_CURRENT_RASTER_COLOR'
11255
11256
11257 PARAMS returns four values: the red, green, blue, and alpha color
11258 values of the current raster position. Integer values, if
11259 requested, are linearly mapped from the internal floating-point
11260 representation such that 1.0 returns the most positive
11261 representable integer value, and -1.0 returns the most negative
11262 representable integer value. The initial value is (1, 1, 1, 1). See
11263 `glRasterPos'.
11264
11265`GL_CURRENT_RASTER_DISTANCE'
11266
11267
11268 PARAMS returns one value, the distance from the eye to the current
11269 raster position. The initial value is 0. See `glRasterPos'.
11270
11271`GL_CURRENT_RASTER_INDEX'
11272
11273
11274 PARAMS returns one value, the color index of the current raster
11275 position. The initial value is 1. See `glRasterPos'.
11276
11277`GL_CURRENT_RASTER_POSITION'
11278
11279
11280 PARAMS returns four values: the X, Y, Z, and W components of the
11281 current raster position. X, Y, and Z are in window coordinates, and
11282 W is in clip coordinates. The initial value is (0, 0, 0, 1). See
11283 `glRasterPos'.
11284
11285`GL_CURRENT_RASTER_POSITION_VALID'
11286
11287
11288 PARAMS returns a single boolean value indicating whether the
11289 current raster position is valid. The initial value is `GL_TRUE'.
11290 See `glRasterPos'.
11291
11292`GL_CURRENT_RASTER_SECONDARY_COLOR'
11293
11294
11295 PARAMS returns four values: the red, green, blue, and alpha
11296 secondary color values of the current raster position. Integer
11297 values, if requested, are linearly mapped from the internal
11298 floating-point representation such that 1.0 returns the most
11299 positive representable integer value, and -1.0 returns the most
11300 negative representable integer value. The initial value is (1, 1,
11301 1, 1). See `glRasterPos'.
11302
11303`GL_CURRENT_RASTER_TEXTURE_COORDS'
11304
11305
11306 PARAMS returns four values: the S, T, R, and Q texture coordinates
11307 of the current raster position. The initial value is (0, 0, 0, 1).
11308 See `glRasterPos' and `glMultiTexCoord'.
11309
11310`GL_CURRENT_SECONDARY_COLOR'
11311
11312
11313 PARAMS returns four values: the red, green, blue, and alpha values
11314 of the current secondary color. Integer values, if requested, are
11315 linearly mapped from the internal floating-point representation
11316 such that 1.0 returns the most positive representable integer
11317 value, and -1.0 returns the most negative representable integer
11318 value. The initial value is (0, 0, 0, 0). See `glSecondaryColor'.
11319
11320`GL_CURRENT_TEXTURE_COORDS'
11321
11322
11323 PARAMS returns four values: the S, T, R, and Q current texture
11324 coordinates. The initial value is (0, 0, 0, 1). See
11325 `glMultiTexCoord'.
11326
11327`GL_DEPTH_BIAS'
11328
11329
11330 PARAMS returns one value, the depth bias factor used during pixel
11331 transfers. The initial value is 0. See `glPixelTransfer'.
11332
11333`GL_DEPTH_BITS'
11334
11335
11336 PARAMS returns one value, the number of bitplanes in the depth
11337 buffer.
11338
11339`GL_DEPTH_CLEAR_VALUE'
11340
11341
11342 PARAMS returns one value, the value that is used to clear the depth
11343 buffer. Integer values, if requested, are linearly mapped from the
11344 internal floating-point representation such that 1.0 returns the
11345 most positive representable integer value, and -1.0 returns the
11346 most negative representable integer value. The initial value is 1.
11347 See `glClearDepth'.
11348
11349`GL_DEPTH_FUNC'
11350
11351
11352 PARAMS returns one value, the symbolic constant that indicates the
11353 depth comparison function. The initial value is `GL_LESS'. See
11354 `glDepthFunc'.
11355
11356`GL_DEPTH_RANGE'
11357
11358
11359 PARAMS returns two values: the near and far mapping limits for the
11360 depth buffer. Integer values, if requested, are linearly mapped
11361 from the internal floating-point representation such that 1.0
11362 returns the most positive representable integer value, and -1.0
11363 returns the most negative representable integer value. The initial
11364 value is (0, 1). See `glDepthRange'.
11365
11366`GL_DEPTH_SCALE'
11367
11368
11369 PARAMS returns one value, the depth scale factor used during pixel
11370 transfers. The initial value is 1. See `glPixelTransfer'.
11371
11372`GL_DEPTH_TEST'
11373
11374
11375 PARAMS returns a single boolean value indicating whether depth
11376 testing of fragments is enabled. The initial value is `GL_FALSE'.
11377 See `glDepthFunc' and `glDepthRange'.
11378
11379`GL_DEPTH_WRITEMASK'
11380
11381
11382 PARAMS returns a single boolean value indicating if the depth
11383 buffer is enabled for writing. The initial value is `GL_TRUE'. See
11384 `glDepthMask'.
11385
11386`GL_DITHER'
11387
11388
11389 PARAMS returns a single boolean value indicating whether dithering
11390 of fragment colors and indices is enabled. The initial value is
11391 `GL_TRUE'.
11392
11393`GL_DOUBLEBUFFER'
11394
11395
11396 PARAMS returns a single boolean value indicating whether double
11397 buffering is supported.
11398
11399`GL_DRAW_BUFFER'
11400
11401
11402 PARAMS returns one value, a symbolic constant indicating which
11403 buffers are being drawn to. See `glDrawBuffer'. The initial value
11404 is `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11405
11406`GL_DRAW_BUFFER'I
11407
11408
11409 PARAMS returns one value, a symbolic constant indicating which
11410 buffers are being drawn to by the corresponding output color. See
11411 `glDrawBuffers'. The initial value of `GL_DRAW_BUFFER0' is
11412 `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11413 The initial values of draw buffers for all other output colors is
11414 `GL_NONE'.
11415
11416`GL_EDGE_FLAG'
11417
11418
11419 PARAMS returns a single boolean value indicating whether the
11420 current edge flag is `GL_TRUE' or `GL_FALSE'. The initial value is
11421 `GL_TRUE'. See `glEdgeFlag'.
11422
11423`GL_EDGE_FLAG_ARRAY'
11424
11425
11426 PARAMS returns a single boolean value indicating whether the edge
11427 flag array is enabled. The initial value is `GL_FALSE'. See
11428 `glEdgeFlagPointer'.
11429
11430`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING'
11431
11432
11433 PARAMS returns a single value, the name of the buffer object
11434 associated with the edge flag array. This buffer object would have
11435 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
11436 recent call to `glEdgeFlagPointer'. If no buffer object was bound
11437 to this target, 0 is returned. The initial value is 0. See
11438 `glBindBuffer'.
11439
11440`GL_EDGE_FLAG_ARRAY_STRIDE'
11441
11442
11443 PARAMS returns one value, the byte offset between consecutive edge
11444 flags in the edge flag array. The initial value is 0. See
11445 `glEdgeFlagPointer'.
11446
11447`GL_ELEMENT_ARRAY_BUFFER_BINDING'
11448
11449
11450 PARAMS returns a single value, the name of the buffer object
11451 currently bound to the target `GL_ELEMENT_ARRAY_BUFFER'. If no
11452 buffer object is bound to this target, 0 is returned. The initial
11453 value is 0. See `glBindBuffer'.
11454
11455`GL_FEEDBACK_BUFFER_SIZE'
11456
11457
11458 PARAMS returns one value, the size of the feedback buffer. See
11459 `glFeedbackBuffer'.
11460
11461`GL_FEEDBACK_BUFFER_TYPE'
11462
11463
11464 PARAMS returns one value, the type of the feedback buffer. See
11465 `glFeedbackBuffer'.
11466
11467`GL_FOG'
11468
11469
11470 PARAMS returns a single boolean value indicating whether fogging is
11471 enabled. The initial value is `GL_FALSE'. See `glFog'.
11472
11473`GL_FOG_COORD_ARRAY'
11474
11475
11476 PARAMS returns a single boolean value indicating whether the fog
11477 coordinate array is enabled. The initial value is `GL_FALSE'. See
11478 `glFogCoordPointer'.
11479
11480`GL_FOG_COORD_ARRAY_BUFFER_BINDING'
11481
11482
11483 PARAMS returns a single value, the name of the buffer object
11484 associated with the fog coordinate array. This buffer object would
11485 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11486 most recent call to `glFogCoordPointer'. If no buffer object was
11487 bound to this target, 0 is returned. The initial value is 0. See
11488 `glBindBuffer'.
11489
11490`GL_FOG_COORD_ARRAY_STRIDE'
11491
11492
11493 PARAMS returns one value, the byte offset between consecutive fog
11494 coordinates in the fog coordinate array. The initial value is 0.
11495 See `glFogCoordPointer'.
11496
11497`GL_FOG_COORD_ARRAY_TYPE'
11498
11499
11500 PARAMS returns one value, the type of the fog coordinate array. The
11501 initial value is `GL_FLOAT'. See `glFogCoordPointer'.
11502
11503`GL_FOG_COORD_SRC'
11504
11505
11506 PARAMS returns one value, a symbolic constant indicating the source
11507 of the fog coordinate. The initial value is `GL_FRAGMENT_DEPTH'.
11508 See `glFog'.
11509
11510`GL_FOG_COLOR'
11511
11512
11513 PARAMS returns four values: the red, green, blue, and alpha
11514 components of the fog color. Integer values, if requested, are
11515 linearly mapped from the internal floating-point representation
11516 such that 1.0 returns the most positive representable integer
11517 value, and -1.0 returns the most negative representable integer
11518 value. The initial value is (0, 0, 0, 0). See `glFog'.
11519
11520`GL_FOG_DENSITY'
11521
11522
11523 PARAMS returns one value, the fog density parameter. The initial
11524 value is 1. See `glFog'.
11525
11526`GL_FOG_END'
11527
11528
11529 PARAMS returns one value, the end factor for the linear fog
11530 equation. The initial value is 1. See `glFog'.
11531
11532`GL_FOG_HINT'
11533
11534
11535 PARAMS returns one value, a symbolic constant indicating the mode
11536 of the fog hint. The initial value is `GL_DONT_CARE'. See `glHint'.
11537
11538`GL_FOG_INDEX'
11539
11540
11541 PARAMS returns one value, the fog color index. The initial value is
11542 0. See `glFog'.
11543
11544`GL_FOG_MODE'
11545
11546
11547 PARAMS returns one value, a symbolic constant indicating which fog
11548 equation is selected. The initial value is `GL_EXP'. See `glFog'.
11549
11550`GL_FOG_START'
11551
11552
11553 PARAMS returns one value, the start factor for the linear fog
11554 equation. The initial value is 0. See `glFog'.
11555
11556`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
11557
11558
11559 PARAMS returns one value, a symbolic constant indicating the mode
11560 of the derivative accuracy hint for fragment shaders. The initial
11561 value is `GL_DONT_CARE'. See `glHint'.
11562
11563`GL_FRONT_FACE'
11564
11565
11566 PARAMS returns one value, a symbolic constant indicating whether
11567 clockwise or counterclockwise polygon winding is treated as
11568 front-facing. The initial value is `GL_CCW'. See `glFrontFace'.
11569
11570`GL_GENERATE_MIPMAP_HINT'
11571
11572
11573 PARAMS returns one value, a symbolic constant indicating the mode
11574 of the mipmap generation filtering hint. The initial value is
11575 `GL_DONT_CARE'. See `glHint'.
11576
11577`GL_GREEN_BIAS'
11578
11579
11580 PARAMS returns one value, the green bias factor used during pixel
11581 transfers. The initial value is 0.
11582
11583`GL_GREEN_BITS'
11584
11585
11586 PARAMS returns one value, the number of green bitplanes in each
11587 color buffer.
11588
11589`GL_GREEN_SCALE'
11590
11591
11592 PARAMS returns one value, the green scale factor used during pixel
11593 transfers. The initial value is 1. See `glPixelTransfer'.
11594
11595`GL_HISTOGRAM'
11596
11597
11598 PARAMS returns a single boolean value indicating whether histogram
11599 is enabled. The initial value is `GL_FALSE'. See `glHistogram'.
11600
11601`GL_INDEX_ARRAY'
11602
11603
11604 PARAMS returns a single boolean value indicating whether the color
11605 index array is enabled. The initial value is `GL_FALSE'. See
11606 `glIndexPointer'.
11607
11608`GL_INDEX_ARRAY_BUFFER_BINDING'
11609
11610
11611 PARAMS returns a single value, the name of the buffer object
11612 associated with the color index array. This buffer object would
11613 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11614 most recent call to `glIndexPointer'. If no buffer object was bound
11615 to this target, 0 is returned. The initial value is 0. See
11616 `glBindBuffer'.
11617
11618`GL_INDEX_ARRAY_STRIDE'
11619
11620
11621 PARAMS returns one value, the byte offset between consecutive color
11622 indexes in the color index array. The initial value is 0. See
11623 `glIndexPointer'.
11624
11625`GL_INDEX_ARRAY_TYPE'
11626
11627
11628 PARAMS returns one value, the data type of indexes in the color
11629 index array. The initial value is `GL_FLOAT'. See `glIndexPointer'.
11630
11631`GL_INDEX_BITS'
11632
11633
11634 PARAMS returns one value, the number of bitplanes in each color
11635 index buffer.
11636
11637`GL_INDEX_CLEAR_VALUE'
11638
11639
11640 PARAMS returns one value, the color index used to clear the color
11641 index buffers. The initial value is 0. See `glClearIndex'.
11642
11643`GL_INDEX_LOGIC_OP'
11644
11645
11646 PARAMS returns a single boolean value indicating whether a
11647 fragment's index values are merged into the framebuffer using a
11648 logical operation. The initial value is `GL_FALSE'. See
11649 `glLogicOp'.
11650
11651`GL_INDEX_MODE'
11652
11653
11654 PARAMS returns a single boolean value indicating whether the GL is
11655 in color index mode (`GL_TRUE') or RGBA mode (`GL_FALSE').
11656
11657`GL_INDEX_OFFSET'
11658
11659
11660 PARAMS returns one value, the offset added to color and stencil
11661 indices during pixel transfers. The initial value is 0. See
11662 `glPixelTransfer'.
11663
11664`GL_INDEX_SHIFT'
11665
11666
11667 PARAMS returns one value, the amount that color and stencil indices
11668 are shifted during pixel transfers. The initial value is 0. See
11669 `glPixelTransfer'.
11670
11671`GL_INDEX_WRITEMASK'
11672
11673
11674 PARAMS returns one value, a mask indicating which bitplanes of each
11675 color index buffer can be written. The initial value is all 1's.
11676 See `glIndexMask'.
11677
11678`GL_LIGHT'I
11679
11680
11681 PARAMS returns a single boolean value indicating whether the
11682 specified light is enabled. The initial value is `GL_FALSE'. See
11683 `glLight' and `glLightModel'.
11684
11685`GL_LIGHTING'
11686
11687
11688 PARAMS returns a single boolean value indicating whether lighting
11689 is enabled. The initial value is `GL_FALSE'. See `glLightModel'.
11690
11691`GL_LIGHT_MODEL_AMBIENT'
11692
11693
11694 PARAMS returns four values: the red, green, blue, and alpha
11695 components of the ambient intensity of the entire scene. Integer
11696 values, if requested, are linearly mapped from the internal
11697 floating-point representation such that 1.0 returns the most
11698 positive representable integer value, and -1.0 returns the most
11699 negative representable integer value. The initial value is (0.2,
11700 0.2, 0.2, 1.0). See `glLightModel'.
11701
11702`GL_LIGHT_MODEL_COLOR_CONTROL'
11703
11704
11705 PARAMS returns single enumerated value indicating whether specular
11706 reflection calculations are separated from normal lighting
11707 computations. The initial value is `GL_SINGLE_COLOR'.
11708
11709`GL_LIGHT_MODEL_LOCAL_VIEWER'
11710
11711
11712 PARAMS returns a single boolean value indicating whether specular
11713 reflection calculations treat the viewer as being local to the
11714 scene. The initial value is `GL_FALSE'. See `glLightModel'.
11715
11716`GL_LIGHT_MODEL_TWO_SIDE'
11717
11718
11719 PARAMS returns a single boolean value indicating whether separate
11720 materials are used to compute lighting for front- and back-facing
11721 polygons. The initial value is `GL_FALSE'. See `glLightModel'.
11722
11723`GL_LINE_SMOOTH'
11724
11725
11726 PARAMS returns a single boolean value indicating whether
11727 antialiasing of lines is enabled. The initial value is `GL_FALSE'.
11728 See `glLineWidth'.
11729
11730`GL_LINE_SMOOTH_HINT'
11731
11732
11733 PARAMS returns one value, a symbolic constant indicating the mode
11734 of the line antialiasing hint. The initial value is `GL_DONT_CARE'.
11735 See `glHint'.
11736
11737`GL_LINE_STIPPLE'
11738
11739
11740 PARAMS returns a single boolean value indicating whether stippling
11741 of lines is enabled. The initial value is `GL_FALSE'. See
11742 `glLineStipple'.
11743
11744`GL_LINE_STIPPLE_PATTERN'
11745
11746
11747 PARAMS returns one value, the 16-bit line stipple pattern. The
11748 initial value is all 1's. See `glLineStipple'.
11749
11750`GL_LINE_STIPPLE_REPEAT'
11751
11752
11753 PARAMS returns one value, the line stipple repeat factor. The
11754 initial value is 1. See `glLineStipple'.
11755
11756`GL_LINE_WIDTH'
11757
11758
11759 PARAMS returns one value, the line width as specified with
11760 `glLineWidth'. The initial value is 1.
11761
11762`GL_LINE_WIDTH_GRANULARITY'
11763
11764
11765 PARAMS returns one value, the width difference between adjacent
11766 supported widths for antialiased lines. See `glLineWidth'.
11767
11768`GL_LINE_WIDTH_RANGE'
11769
11770
11771 PARAMS returns two values: the smallest and largest supported
11772 widths for antialiased lines. See `glLineWidth'.
11773
11774`GL_LIST_BASE'
11775
11776
11777 PARAMS returns one value, the base offset added to all names in
11778 arrays presented to `glCallLists'. The initial value is 0. See
11779 `glListBase'.
11780
11781`GL_LIST_INDEX'
11782
11783
11784 PARAMS returns one value, the name of the display list currently
11785 under construction. 0 is returned if no display list is currently
11786 under construction. The initial value is 0. See `glNewList'.
11787
11788`GL_LIST_MODE'
11789
11790
11791 PARAMS returns one value, a symbolic constant indicating the
11792 construction mode of the display list currently under construction.
11793 The initial value is 0. See `glNewList'.
11794
11795`GL_LOGIC_OP_MODE'
11796
11797
11798 PARAMS returns one value, a symbolic constant indicating the
11799 selected logic operation mode. The initial value is `GL_COPY'. See
11800 `glLogicOp'.
11801
11802`GL_MAP1_COLOR_4'
11803
11804
11805 PARAMS returns a single boolean value indicating whether 1D
11806 evaluation generates colors. The initial value is `GL_FALSE'. See
11807 `glMap1'.
11808
11809`GL_MAP1_GRID_DOMAIN'
11810
11811
11812 PARAMS returns two values: the endpoints of the 1D map's grid
11813 domain. The initial value is (0, 1). See `glMapGrid'.
11814
11815`GL_MAP1_GRID_SEGMENTS'
11816
11817
11818 PARAMS returns one value, the number of partitions in the 1D map's
11819 grid domain. The initial value is 1. See `glMapGrid'.
11820
11821`GL_MAP1_INDEX'
11822
11823
11824 PARAMS returns a single boolean value indicating whether 1D
11825 evaluation generates color indices. The initial value is
11826 `GL_FALSE'. See `glMap1'.
11827
11828`GL_MAP1_NORMAL'
11829
11830
11831 PARAMS returns a single boolean value indicating whether 1D
11832 evaluation generates normals. The initial value is `GL_FALSE'. See
11833 `glMap1'.
11834
11835`GL_MAP1_TEXTURE_COORD_1'
11836
11837
11838 PARAMS returns a single boolean value indicating whether 1D
11839 evaluation generates 1D texture coordinates. The initial value is
11840 `GL_FALSE'. See `glMap1'.
11841
11842`GL_MAP1_TEXTURE_COORD_2'
11843
11844
11845 PARAMS returns a single boolean value indicating whether 1D
11846 evaluation generates 2D texture coordinates. The initial value is
11847 `GL_FALSE'. See `glMap1'.
11848
11849`GL_MAP1_TEXTURE_COORD_3'
11850
11851
11852 PARAMS returns a single boolean value indicating whether 1D
11853 evaluation generates 3D texture coordinates. The initial value is
11854 `GL_FALSE'. See `glMap1'.
11855
11856`GL_MAP1_TEXTURE_COORD_4'
11857
11858
11859 PARAMS returns a single boolean value indicating whether 1D
11860 evaluation generates 4D texture coordinates. The initial value is
11861 `GL_FALSE'. See `glMap1'.
11862
11863`GL_MAP1_VERTEX_3'
11864
11865
11866 PARAMS returns a single boolean value indicating whether 1D
11867 evaluation generates 3D vertex coordinates. The initial value is
11868 `GL_FALSE'. See `glMap1'.
11869
11870`GL_MAP1_VERTEX_4'
11871
11872
11873 PARAMS returns a single boolean value indicating whether 1D
11874 evaluation generates 4D vertex coordinates. The initial value is
11875 `GL_FALSE'. See `glMap1'.
11876
11877`GL_MAP2_COLOR_4'
11878
11879
11880 PARAMS returns a single boolean value indicating whether 2D
11881 evaluation generates colors. The initial value is `GL_FALSE'. See
11882 `glMap2'.
11883
11884`GL_MAP2_GRID_DOMAIN'
11885
11886
11887 PARAMS returns four values: the endpoints of the 2D map's I and J
11888 grid domains. The initial value is (0,1; 0,1). See `glMapGrid'.
11889
11890`GL_MAP2_GRID_SEGMENTS'
11891
11892
11893 PARAMS returns two values: the number of partitions in the 2D map's
11894 I and J grid domains. The initial value is (1,1). See `glMapGrid'.
11895
11896`GL_MAP2_INDEX'
11897
11898
11899 PARAMS returns a single boolean value indicating whether 2D
11900 evaluation generates color indices. The initial value is
11901 `GL_FALSE'. See `glMap2'.
11902
11903`GL_MAP2_NORMAL'
11904
11905
11906 PARAMS returns a single boolean value indicating whether 2D
11907 evaluation generates normals. The initial value is `GL_FALSE'. See
11908 `glMap2'.
11909
11910`GL_MAP2_TEXTURE_COORD_1'
11911
11912
11913 PARAMS returns a single boolean value indicating whether 2D
11914 evaluation generates 1D texture coordinates. The initial value is
11915 `GL_FALSE'. See `glMap2'.
11916
11917`GL_MAP2_TEXTURE_COORD_2'
11918
11919
11920 PARAMS returns a single boolean value indicating whether 2D
11921 evaluation generates 2D texture coordinates. The initial value is
11922 `GL_FALSE'. See `glMap2'.
11923
11924`GL_MAP2_TEXTURE_COORD_3'
11925
11926
11927 PARAMS returns a single boolean value indicating whether 2D
11928 evaluation generates 3D texture coordinates. The initial value is
11929 `GL_FALSE'. See `glMap2'.
11930
11931`GL_MAP2_TEXTURE_COORD_4'
11932
11933
11934 PARAMS returns a single boolean value indicating whether 2D
11935 evaluation generates 4D texture coordinates. The initial value is
11936 `GL_FALSE'. See `glMap2'.
11937
11938`GL_MAP2_VERTEX_3'
11939
11940
11941 PARAMS returns a single boolean value indicating whether 2D
11942 evaluation generates 3D vertex coordinates. The initial value is
11943 `GL_FALSE'. See `glMap2'.
11944
11945`GL_MAP2_VERTEX_4'
11946
11947
11948 PARAMS returns a single boolean value indicating whether 2D
11949 evaluation generates 4D vertex coordinates. The initial value is
11950 `GL_FALSE'. See `glMap2'.
11951
11952`GL_MAP_COLOR'
11953
11954
11955 PARAMS returns a single boolean value indicating if colors and
11956 color indices are to be replaced by table lookup during pixel
11957 transfers. The initial value is `GL_FALSE'. See `glPixelTransfer'.
11958
11959`GL_MAP_STENCIL'
11960
11961
11962 PARAMS returns a single boolean value indicating if stencil indices
11963 are to be replaced by table lookup during pixel transfers. The
11964 initial value is `GL_FALSE'. See `glPixelTransfer'.
11965
11966`GL_MATRIX_MODE'
11967
11968
11969 PARAMS returns one value, a symbolic constant indicating which
11970 matrix stack is currently the target of all matrix operations. The
11971 initial value is `GL_MODELVIEW'. See `glMatrixMode'.
11972
11973`GL_MAX_3D_TEXTURE_SIZE'
11974
11975
11976 PARAMS returns one value, a rough estimate of the largest 3D
11977 texture that the GL can handle. The value must be at least 16. If
11978 the GL version is 1.2 or greater, use `GL_PROXY_TEXTURE_3D' to
11979 determine if a texture is too large. See `glTexImage3D'.
11980
11981`GL_MAX_CLIENT_ATTRIB_STACK_DEPTH'
11982
11983
11984 PARAMS returns one value indicating the maximum supported depth of
11985 the client attribute stack. See `glPushClientAttrib'.
11986
11987`GL_MAX_ATTRIB_STACK_DEPTH'
11988
11989
11990 PARAMS returns one value, the maximum supported depth of the
11991 attribute stack. The value must be at least 16. See `glPushAttrib'.
11992
11993`GL_MAX_CLIP_PLANES'
11994
11995
11996 PARAMS returns one value, the maximum number of application-defined
11997 clipping planes. The value must be at least 6. See `glClipPlane'.
11998
11999`GL_MAX_COLOR_MATRIX_STACK_DEPTH'
12000
12001
12002 PARAMS returns one value, the maximum supported depth of the color
12003 matrix stack. The value must be at least 2. See `glPushMatrix'.
12004
12005`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS'
12006
12007
12008 PARAMS returns one value, the maximum supported texture image units
12009 that can be used to access texture maps from the vertex shader and
12010 the fragment processor combined. If both the vertex shader and the
12011 fragment processing stage access the same texture image unit, then
12012 that counts as using two texture image units against this limit.
12013 The value must be at least 2. See `glActiveTexture'.
12014
12015`GL_MAX_CUBE_MAP_TEXTURE_SIZE'
12016
12017
12018 PARAMS returns one value. The value gives a rough estimate of the
12019 largest cube-map texture that the GL can handle. The value must be
12020 at least 16. If the GL version is 1.3 or greater, use
12021 `GL_PROXY_TEXTURE_CUBE_MAP' to determine if a texture is too large.
12022 See `glTexImage2D'.
12023
12024`GL_MAX_DRAW_BUFFERS'
12025
12026
12027 PARAMS returns one value, the maximum number of simultaneous output
12028 colors allowed from a fragment shader using the `gl_FragData'
12029 built-in array. The value must be at least 1. See `glDrawBuffers'.
12030
12031`GL_MAX_ELEMENTS_INDICES'
12032
12033
12034 PARAMS returns one value, the recommended maximum number of vertex
12035 array indices. See `glDrawRangeElements'.
12036
12037`GL_MAX_ELEMENTS_VERTICES'
12038
12039
12040 PARAMS returns one value, the recommended maximum number of vertex
12041 array vertices. See `glDrawRangeElements'.
12042
12043`GL_MAX_EVAL_ORDER'
12044
12045
12046 PARAMS returns one value, the maximum equation order supported by
12047 1D and 2D evaluators. The value must be at least 8. See `glMap1'
12048 and `glMap2'.
12049
12050`GL_MAX_FRAGMENT_UNIFORM_COMPONENTS'
12051
12052
12053 PARAMS returns one value, the maximum number of individual
12054 floating-point, integer, or boolean values that can be held in
12055 uniform variable storage for a fragment shader. The value must be
12056 at least 64. See `glUniform'.
12057
12058`GL_MAX_LIGHTS'
12059
12060
12061 PARAMS returns one value, the maximum number of lights. The value
12062 must be at least 8. See `glLight'.
12063
12064`GL_MAX_LIST_NESTING'
12065
12066
12067 PARAMS returns one value, the maximum recursion depth allowed
12068 during display-list traversal. The value must be at least 64. See
12069 `glCallList'.
12070
12071`GL_MAX_MODELVIEW_STACK_DEPTH'
12072
12073
12074 PARAMS returns one value, the maximum supported depth of the
12075 modelview matrix stack. The value must be at least 32. See
12076 `glPushMatrix'.
12077
12078`GL_MAX_NAME_STACK_DEPTH'
12079
12080
12081 PARAMS returns one value, the maximum supported depth of the
12082 selection name stack. The value must be at least 64. See
12083 `glPushName'.
12084
12085`GL_MAX_PIXEL_MAP_TABLE'
12086
12087
12088 PARAMS returns one value, the maximum supported size of a
12089 `glPixelMap' lookup table. The value must be at least 32. See
12090 `glPixelMap'.
12091
12092`GL_MAX_PROJECTION_STACK_DEPTH'
12093
12094
12095 PARAMS returns one value, the maximum supported depth of the
12096 projection matrix stack. The value must be at least 2. See
12097 `glPushMatrix'.
12098
12099`GL_MAX_TEXTURE_COORDS'
12100
12101
12102 PARAMS returns one value, the maximum number of texture coordinate
12103 sets available to vertex and fragment shaders. The value must be at
12104 least 2. See `glActiveTexture' and `glClientActiveTexture'.
12105
12106`GL_MAX_TEXTURE_IMAGE_UNITS'
12107
12108
12109 PARAMS returns one value, the maximum supported texture image units
12110 that can be used to access texture maps from the fragment shader.
12111 The value must be at least 2. See `glActiveTexture'.
12112
12113`GL_MAX_TEXTURE_LOD_BIAS'
12114
12115
12116 PARAMS returns one value, the maximum, absolute value of the
12117 texture level-of-detail bias. The value must be at least 4.
12118
12119`GL_MAX_TEXTURE_SIZE'
12120
12121
12122 PARAMS returns one value. The value gives a rough estimate of the
12123 largest texture that the GL can handle. The value must be at least
12124 64. If the GL version is 1.1 or greater, use `GL_PROXY_TEXTURE_1D'
12125 or `GL_PROXY_TEXTURE_2D' to determine if a texture is too large.
12126 See `glTexImage1D' and `glTexImage2D'.
12127
12128`GL_MAX_TEXTURE_STACK_DEPTH'
12129
12130
12131 PARAMS returns one value, the maximum supported depth of the
12132 texture matrix stack. The value must be at least 2. See
12133 `glPushMatrix'.
12134
12135`GL_MAX_TEXTURE_UNITS'
12136
12137
12138 PARAMS returns a single value indicating the number of conventional
12139 texture units supported. Each conventional texture unit includes
12140 both a texture coordinate set and a texture image unit.
12141 Conventional texture units may be used for fixed-function
12142 (non-shader) rendering. The value must be at least 2. Additional
12143 texture coordinate sets and texture image units may be accessed
12144 from vertex and fragment shaders. See `glActiveTexture' and
12145 `glClientActiveTexture'.
12146
12147`GL_MAX_VARYING_FLOATS'
12148
12149
12150 PARAMS returns one value, the maximum number of interpolators
12151 available for processing varying variables used by vertex and
12152 fragment shaders. This value represents the number of individual
12153 floating-point values that can be interpolated; varying variables
12154 declared as vectors, matrices, and arrays will all consume multiple
12155 interpolators. The value must be at least 32.
12156
12157`GL_MAX_VERTEX_ATTRIBS'
12158
12159
12160 PARAMS returns one value, the maximum number of 4-component generic
12161 vertex attributes accessible to a vertex shader. The value must be
12162 at least 16. See `glVertexAttrib'.
12163
12164`GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS'
12165
12166
12167 PARAMS returns one value, the maximum supported texture image units
12168 that can be used to access texture maps from the vertex shader. The
12169 value may be 0. See `glActiveTexture'.
12170
12171`GL_MAX_VERTEX_UNIFORM_COMPONENTS'
12172
12173
12174 PARAMS returns one value, the maximum number of individual
12175 floating-point, integer, or boolean values that can be held in
12176 uniform variable storage for a vertex shader. The value must be at
12177 least 512. See `glUniform'.
12178
12179`GL_MAX_VIEWPORT_DIMS'
12180
12181
12182 PARAMS returns two values: the maximum supported width and height
12183 of the viewport. These must be at least as large as the visible
12184 dimensions of the display being rendered to. See `glViewport'.
12185
12186`GL_MINMAX'
12187
12188
12189 PARAMS returns a single boolean value indicating whether pixel
12190 minmax values are computed. The initial value is `GL_FALSE'. See
12191 `glMinmax'.
12192
12193`GL_MODELVIEW_MATRIX'
12194
12195
12196 PARAMS returns sixteen values: the modelview matrix on the top of
12197 the modelview matrix stack. Initially this matrix is the identity
12198 matrix. See `glPushMatrix'.
12199
12200`GL_MODELVIEW_STACK_DEPTH'
12201
12202
12203 PARAMS returns one value, the number of matrices on the modelview
12204 matrix stack. The initial value is 1. See `glPushMatrix'.
12205
12206`GL_NAME_STACK_DEPTH'
12207
12208
12209 PARAMS returns one value, the number of names on the selection name
12210 stack. The initial value is 0. See `glPushName'.
12211
12212`GL_NORMAL_ARRAY'
12213
12214
12215 PARAMS returns a single boolean value, indicating whether the
12216 normal array is enabled. The initial value is `GL_FALSE'. See
12217 `glNormalPointer'.
12218
12219`GL_NORMAL_ARRAY_BUFFER_BINDING'
12220
12221
12222 PARAMS returns a single value, the name of the buffer object
12223 associated with the normal array. This buffer object would have
12224 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
12225 recent call to `glNormalPointer'. If no buffer object was bound to
12226 this target, 0 is returned. The initial value is 0. See
12227 `glBindBuffer'.
12228
12229`GL_NORMAL_ARRAY_STRIDE'
12230
12231
12232 PARAMS returns one value, the byte offset between consecutive
12233 normals in the normal array. The initial value is 0. See
12234 `glNormalPointer'.
12235
12236`GL_NORMAL_ARRAY_TYPE'
12237
12238
12239 PARAMS returns one value, the data type of each coordinate in the
12240 normal array. The initial value is `GL_FLOAT'. See
12241 `glNormalPointer'.
12242
12243`GL_NORMALIZE'
12244
12245
12246 PARAMS returns a single boolean value indicating whether normals
12247 are automatically scaled to unit length after they have been
12248 transformed to eye coordinates. The initial value is `GL_FALSE'.
12249 See `glNormal'.
12250
12251`GL_NUM_COMPRESSED_TEXTURE_FORMATS'
12252
12253
12254 PARAMS returns a single integer value indicating the number of
12255 available compressed texture formats. The minimum value is 0. See
12256 `glCompressedTexImage2D'.
12257
12258`GL_PACK_ALIGNMENT'
12259
12260
12261 PARAMS returns one value, the byte alignment used for writing pixel
12262 data to memory. The initial value is 4. See `glPixelStore'.
12263
12264`GL_PACK_IMAGE_HEIGHT'
12265
12266
12267 PARAMS returns one value, the image height used for writing pixel
12268 data to memory. The initial value is 0. See `glPixelStore'.
12269
12270`GL_PACK_LSB_FIRST'
12271
12272
12273 PARAMS returns a single boolean value indicating whether single-bit
12274 pixels being written to memory are written first to the least
12275 significant bit of each unsigned byte. The initial value is
12276 `GL_FALSE'. See `glPixelStore'.
12277
12278`GL_PACK_ROW_LENGTH'
12279
12280
12281 PARAMS returns one value, the row length used for writing pixel
12282 data to memory. The initial value is 0. See `glPixelStore'.
12283
12284`GL_PACK_SKIP_IMAGES'
12285
12286
12287 PARAMS returns one value, the number of pixel images skipped before
12288 the first pixel is written into memory. The initial value is 0. See
12289 `glPixelStore'.
12290
12291`GL_PACK_SKIP_PIXELS'
12292
12293
12294 PARAMS returns one value, the number of pixel locations skipped
12295 before the first pixel is written into memory. The initial value is
12296 0. See `glPixelStore'.
12297
12298`GL_PACK_SKIP_ROWS'
12299
12300
12301 PARAMS returns one value, the number of rows of pixel locations
12302 skipped before the first pixel is written into memory. The initial
12303 value is 0. See `glPixelStore'.
12304
12305`GL_PACK_SWAP_BYTES'
12306
12307
12308 PARAMS returns a single boolean value indicating whether the bytes
12309 of two-byte and four-byte pixel indices and components are swapped
12310 before being written to memory. The initial value is `GL_FALSE'.
12311 See `glPixelStore'.
12312
12313`GL_PERSPECTIVE_CORRECTION_HINT'
12314
12315
12316 PARAMS returns one value, a symbolic constant indicating the mode
12317 of the perspective correction hint. The initial value is
12318 `GL_DONT_CARE'. See `glHint'.
12319
12320`GL_PIXEL_MAP_A_TO_A_SIZE'
12321
12322
12323 PARAMS returns one value, the size of the alpha-to-alpha pixel
12324 translation table. The initial value is 1. See `glPixelMap'.
12325
12326`GL_PIXEL_MAP_B_TO_B_SIZE'
12327
12328
12329 PARAMS returns one value, the size of the blue-to-blue pixel
12330 translation table. The initial value is 1. See `glPixelMap'.
12331
12332`GL_PIXEL_MAP_G_TO_G_SIZE'
12333
12334
12335 PARAMS returns one value, the size of the green-to-green pixel
12336 translation table. The initial value is 1. See `glPixelMap'.
12337
12338`GL_PIXEL_MAP_I_TO_A_SIZE'
12339
12340
12341 PARAMS returns one value, the size of the index-to-alpha pixel
12342 translation table. The initial value is 1. See `glPixelMap'.
12343
12344`GL_PIXEL_MAP_I_TO_B_SIZE'
12345
12346
12347 PARAMS returns one value, the size of the index-to-blue pixel
12348 translation table. The initial value is 1. See `glPixelMap'.
12349
12350`GL_PIXEL_MAP_I_TO_G_SIZE'
12351
12352
12353 PARAMS returns one value, the size of the index-to-green pixel
12354 translation table. The initial value is 1. See `glPixelMap'.
12355
12356`GL_PIXEL_MAP_I_TO_I_SIZE'
12357
12358
12359 PARAMS returns one value, the size of the index-to-index pixel
12360 translation table. The initial value is 1. See `glPixelMap'.
12361
12362`GL_PIXEL_MAP_I_TO_R_SIZE'
12363
12364
12365 PARAMS returns one value, the size of the index-to-red pixel
12366 translation table. The initial value is 1. See `glPixelMap'.
12367
12368`GL_PIXEL_MAP_R_TO_R_SIZE'
12369
12370
12371 PARAMS returns one value, the size of the red-to-red pixel
12372 translation table. The initial value is 1. See `glPixelMap'.
12373
12374`GL_PIXEL_MAP_S_TO_S_SIZE'
12375
12376
12377 PARAMS returns one value, the size of the stencil-to-stencil pixel
12378 translation table. The initial value is 1. See `glPixelMap'.
12379
12380`GL_PIXEL_PACK_BUFFER_BINDING'
12381
12382
12383 PARAMS returns a single value, the name of the buffer object
12384 currently bound to the target `GL_PIXEL_PACK_BUFFER'. If no buffer
12385 object is bound to this target, 0 is returned. The initial value is
12386 0. See `glBindBuffer'.
12387
12388`GL_PIXEL_UNPACK_BUFFER_BINDING'
12389
12390
12391 PARAMS returns a single value, the name of the buffer object
12392 currently bound to the target `GL_PIXEL_UNPACK_BUFFER'. If no
12393 buffer object is bound to this target, 0 is returned. The initial
12394 value is 0. See `glBindBuffer'.
12395
12396`GL_POINT_DISTANCE_ATTENUATION'
12397
12398
12399 PARAMS returns three values, the coefficients for computing the
12400 attenuation value for points. See `glPointParameter'.
12401
12402`GL_POINT_FADE_THRESHOLD_SIZE'
12403
12404
12405 PARAMS returns one value, the point size threshold for determining
12406 the point size. See `glPointParameter'.
12407
12408`GL_POINT_SIZE'
12409
12410
12411 PARAMS returns one value, the point size as specified by
12412 `glPointSize'. The initial value is 1.
12413
12414`GL_POINT_SIZE_GRANULARITY'
12415
12416
12417 PARAMS returns one value, the size difference between adjacent
12418 supported sizes for antialiased points. See `glPointSize'.
12419
12420`GL_POINT_SIZE_MAX'
12421
12422
12423 PARAMS returns one value, the upper bound for the attenuated point
12424 sizes. The initial value is 0.0. See `glPointParameter'.
12425
12426`GL_POINT_SIZE_MIN'
12427
12428
12429 PARAMS returns one value, the lower bound for the attenuated point
12430 sizes. The initial value is 1.0. See `glPointParameter'.
12431
12432`GL_POINT_SIZE_RANGE'
12433
12434
12435 PARAMS returns two values: the smallest and largest supported sizes
12436 for antialiased points. The smallest size must be at most 1, and
12437 the largest size must be at least 1. See `glPointSize'.
12438
12439`GL_POINT_SMOOTH'
12440
12441
12442 PARAMS returns a single boolean value indicating whether
12443 antialiasing of points is enabled. The initial value is `GL_FALSE'.
12444 See `glPointSize'.
12445
12446`GL_POINT_SMOOTH_HINT'
12447
12448
12449 PARAMS returns one value, a symbolic constant indicating the mode
12450 of the point antialiasing hint. The initial value is
12451 `GL_DONT_CARE'. See `glHint'.
12452
12453`GL_POINT_SPRITE'
12454
12455
12456 PARAMS returns a single boolean value indicating whether point
12457 sprite is enabled. The initial value is `GL_FALSE'.
12458
12459`GL_POLYGON_MODE'
12460
12461
12462 PARAMS returns two values: symbolic constants indicating whether
12463 front-facing and back-facing polygons are rasterized as points,
12464 lines, or filled polygons. The initial value is `GL_FILL'. See
12465 `glPolygonMode'.
12466
12467`GL_POLYGON_OFFSET_FACTOR'
12468
12469
12470 PARAMS returns one value, the scaling factor used to determine the
12471 variable offset that is added to the depth value of each fragment
12472 generated when a polygon is rasterized. The initial value is 0. See
12473 `glPolygonOffset'.
12474
12475`GL_POLYGON_OFFSET_UNITS'
12476
12477
12478 PARAMS returns one value. This value is multiplied by an
12479 implementation-specific value and then added to the depth value of
12480 each fragment generated when a polygon is rasterized. The initial
12481 value is 0. See `glPolygonOffset'.
12482
12483`GL_POLYGON_OFFSET_FILL'
12484
12485
12486 PARAMS returns a single boolean value indicating whether polygon
12487 offset is enabled for polygons in fill mode. The initial value is
12488 `GL_FALSE'. See `glPolygonOffset'.
12489
12490`GL_POLYGON_OFFSET_LINE'
12491
12492
12493 PARAMS returns a single boolean value indicating whether polygon
12494 offset is enabled for polygons in line mode. The initial value is
12495 `GL_FALSE'. See `glPolygonOffset'.
12496
12497`GL_POLYGON_OFFSET_POINT'
12498
12499
12500 PARAMS returns a single boolean value indicating whether polygon
12501 offset is enabled for polygons in point mode. The initial value is
12502 `GL_FALSE'. See `glPolygonOffset'.
12503
12504`GL_POLYGON_SMOOTH'
12505
12506
12507 PARAMS returns a single boolean value indicating whether
12508 antialiasing of polygons is enabled. The initial value is
12509 `GL_FALSE'. See `glPolygonMode'.
12510
12511`GL_POLYGON_SMOOTH_HINT'
12512
12513
12514 PARAMS returns one value, a symbolic constant indicating the mode
12515 of the polygon antialiasing hint. The initial value is
12516 `GL_DONT_CARE'. See `glHint'.
12517
12518`GL_POLYGON_STIPPLE'
12519
12520
12521 PARAMS returns a single boolean value indicating whether polygon
12522 stippling is enabled. The initial value is `GL_FALSE'. See
12523 `glPolygonStipple'.
12524
12525`GL_POST_COLOR_MATRIX_COLOR_TABLE'
12526
12527
12528 PARAMS returns a single boolean value indicating whether post color
12529 matrix transformation lookup is enabled. The initial value is
12530 `GL_FALSE'. See `glColorTable'.
12531
12532`GL_POST_COLOR_MATRIX_RED_BIAS'
12533
12534
12535 PARAMS returns one value, the red bias factor applied to RGBA
12536 fragments after color matrix transformations. The initial value is
12537 0. See `glPixelTransfer'.
12538
12539`GL_POST_COLOR_MATRIX_GREEN_BIAS'
12540
12541
12542 PARAMS returns one value, the green bias factor applied to RGBA
12543 fragments after color matrix transformations. The initial value is
12544 0. See `glPixelTransfer'
12545
12546`GL_POST_COLOR_MATRIX_BLUE_BIAS'
12547
12548
12549 PARAMS returns one value, the blue bias factor applied to RGBA
12550 fragments after color matrix transformations. The initial value is
12551 0. See `glPixelTransfer'.
12552
12553`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12554
12555
12556 PARAMS returns one value, the alpha bias factor applied to RGBA
12557 fragments after color matrix transformations. The initial value is
12558 0. See `glPixelTransfer'.
12559
12560`GL_POST_COLOR_MATRIX_RED_SCALE'
12561
12562
12563 PARAMS returns one value, the red scale factor applied to RGBA
12564 fragments after color matrix transformations. The initial value is
12565 1. See `glPixelTransfer'.
12566
12567`GL_POST_COLOR_MATRIX_GREEN_SCALE'
12568
12569
12570 PARAMS returns one value, the green scale factor applied to RGBA
12571 fragments after color matrix transformations. The initial value is
12572 1. See `glPixelTransfer'.
12573
12574`GL_POST_COLOR_MATRIX_BLUE_SCALE'
12575
12576
12577 PARAMS returns one value, the blue scale factor applied to RGBA
12578 fragments after color matrix transformations. The initial value is
12579 1. See `glPixelTransfer'.
12580
12581`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12582
12583
12584 PARAMS returns one value, the alpha scale factor applied to RGBA
12585 fragments after color matrix transformations. The initial value is
12586 1. See `glPixelTransfer'.
12587
12588`GL_POST_CONVOLUTION_COLOR_TABLE'
12589
12590
12591 PARAMS returns a single boolean value indicating whether post
12592 convolution lookup is enabled. The initial value is `GL_FALSE'. See
12593 `glColorTable'.
12594
12595`GL_POST_CONVOLUTION_RED_BIAS'
12596
12597
12598 PARAMS returns one value, the red bias factor applied to RGBA
12599 fragments after convolution. The initial value is 0. See
12600 `glPixelTransfer'.
12601
12602`GL_POST_CONVOLUTION_GREEN_BIAS'
12603
12604
12605 PARAMS returns one value, the green bias factor applied to RGBA
12606 fragments after convolution. The initial value is 0. See
12607 `glPixelTransfer'.
12608
12609`GL_POST_CONVOLUTION_BLUE_BIAS'
12610
12611
12612 PARAMS returns one value, the blue bias factor applied to RGBA
12613 fragments after convolution. The initial value is 0. See
12614 `glPixelTransfer'.
12615
12616`GL_POST_CONVOLUTION_ALPHA_BIAS'
12617
12618
12619 PARAMS returns one value, the alpha bias factor applied to RGBA
12620 fragments after convolution. The initial value is 0. See
12621 `glPixelTransfer'.
12622
12623`GL_POST_CONVOLUTION_RED_SCALE'
12624
12625
12626 PARAMS returns one value, the red scale factor applied to RGBA
12627 fragments after convolution. The initial value is 1. See
12628 `glPixelTransfer'.
12629
12630`GL_POST_CONVOLUTION_GREEN_SCALE'
12631
12632
12633 PARAMS returns one value, the green scale factor applied to RGBA
12634 fragments after convolution. The initial value is 1. See
12635 `glPixelTransfer'.
12636
12637`GL_POST_CONVOLUTION_BLUE_SCALE'
12638
12639
12640 PARAMS returns one value, the blue scale factor applied to RGBA
12641 fragments after convolution. The initial value is 1. See
12642 `glPixelTransfer'.
12643
12644`GL_POST_CONVOLUTION_ALPHA_SCALE'
12645
12646
12647 PARAMS returns one value, the alpha scale factor applied to RGBA
12648 fragments after convolution. The initial value is 1. See
12649 `glPixelTransfer'.
12650
12651`GL_PROJECTION_MATRIX'
12652
12653
12654 PARAMS returns sixteen values: the projection matrix on the top of
12655 the projection matrix stack. Initially this matrix is the identity
12656 matrix. See `glPushMatrix'.
12657
12658`GL_PROJECTION_STACK_DEPTH'
12659
12660
12661 PARAMS returns one value, the number of matrices on the projection
12662 matrix stack. The initial value is 1. See `glPushMatrix'.
12663
12664`GL_READ_BUFFER'
12665
12666
12667 PARAMS returns one value, a symbolic constant indicating which
12668 color buffer is selected for reading. The initial value is
12669 `GL_BACK' if there is a back buffer, otherwise it is `GL_FRONT'.
12670 See `glReadPixels' and `glAccum'.
12671
12672`GL_RED_BIAS'
12673
12674
12675 PARAMS returns one value, the red bias factor used during pixel
12676 transfers. The initial value is 0.
12677
12678`GL_RED_BITS'
12679
12680
12681 PARAMS returns one value, the number of red bitplanes in each color
12682 buffer.
12683
12684`GL_RED_SCALE'
12685
12686
12687 PARAMS returns one value, the red scale factor used during pixel
12688 transfers. The initial value is 1. See `glPixelTransfer'.
12689
12690`GL_RENDER_MODE'
12691
12692
12693 PARAMS returns one value, a symbolic constant indicating whether
12694 the GL is in render, select, or feedback mode. The initial value is
12695 `GL_RENDER'. See `glRenderMode'.
12696
12697`GL_RESCALE_NORMAL'
12698
12699
12700 PARAMS returns single boolean value indicating whether normal
12701 rescaling is enabled. See `glEnable'.
12702
12703`GL_RGBA_MODE'
12704
12705
12706 PARAMS returns a single boolean value indicating whether the GL is
12707 in RGBA mode (true) or color index mode (false). See `glColor'.
12708
12709`GL_SAMPLE_BUFFERS'
12710
12711
12712 PARAMS returns a single integer value indicating the number of
12713 sample buffers associated with the framebuffer. See
12714 `glSampleCoverage'.
12715
12716`GL_SAMPLE_COVERAGE_VALUE'
12717
12718
12719 PARAMS returns a single positive floating-point value indicating
12720 the current sample coverage value. See `glSampleCoverage'.
12721
12722`GL_SAMPLE_COVERAGE_INVERT'
12723
12724
12725 PARAMS returns a single boolean value indicating if the temporary
12726 coverage value should be inverted. See `glSampleCoverage'.
12727
12728`GL_SAMPLES'
12729
12730
12731 PARAMS returns a single integer value indicating the coverage mask
12732 size. See `glSampleCoverage'.
12733
12734`GL_SCISSOR_BOX'
12735
12736
12737 PARAMS returns four values: the X and Y window coordinates of the
12738 scissor box, followed by its width and height. Initially the X and
12739 Y window coordinates are both 0 and the width and height are set to
12740 the size of the window. See `glScissor'.
12741
12742`GL_SCISSOR_TEST'
12743
12744
12745 PARAMS returns a single boolean value indicating whether scissoring
12746 is enabled. The initial value is `GL_FALSE'. See `glScissor'.
12747
12748`GL_SECONDARY_COLOR_ARRAY'
12749
12750
12751 PARAMS returns a single boolean value indicating whether the
12752 secondary color array is enabled. The initial value is `GL_FALSE'.
12753 See `glSecondaryColorPointer'.
12754
12755`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING'
12756
12757
12758 PARAMS returns a single value, the name of the buffer object
12759 associated with the secondary color array. This buffer object would
12760 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
12761 most recent call to `glSecondaryColorPointer'. If no buffer object
12762 was bound to this target, 0 is returned. The initial value is 0.
12763 See `glBindBuffer'.
12764
12765`GL_SECONDARY_COLOR_ARRAY_SIZE'
12766
12767
12768 PARAMS returns one value, the number of components per color in the
12769 secondary color array. The initial value is 3. See
12770 `glSecondaryColorPointer'.
12771
12772`GL_SECONDARY_COLOR_ARRAY_STRIDE'
12773
12774
12775 PARAMS returns one value, the byte offset between consecutive
12776 colors in the secondary color array. The initial value is 0. See
12777 `glSecondaryColorPointer'.
12778
12779`GL_SECONDARY_COLOR_ARRAY_TYPE'
12780
12781
12782 PARAMS returns one value, the data type of each component in the
12783 secondary color array. The initial value is `GL_FLOAT'. See
12784 `glSecondaryColorPointer'.
12785
12786`GL_SELECTION_BUFFER_SIZE'
12787
12788
12789 PARAMS return one value, the size of the selection buffer. See
12790 `glSelectBuffer'.
12791
12792`GL_SEPARABLE_2D'
12793
12794
12795 PARAMS returns a single boolean value indicating whether 2D
12796 separable convolution is enabled. The initial value is `GL_FALSE'.
12797 See `glSeparableFilter2D'.
12798
12799`GL_SHADE_MODEL'
12800
12801
12802 PARAMS returns one value, a symbolic constant indicating whether
12803 the shading mode is flat or smooth. The initial value is
12804 `GL_SMOOTH'. See `glShadeModel'.
12805
12806`GL_SMOOTH_LINE_WIDTH_RANGE'
12807
12808
12809 PARAMS returns two values, the smallest and largest supported
12810 widths for antialiased lines. See `glLineWidth'.
12811
12812`GL_SMOOTH_LINE_WIDTH_GRANULARITY'
12813
12814
12815 PARAMS returns one value, the granularity of widths for antialiased
12816 lines. See `glLineWidth'.
12817
12818`GL_SMOOTH_POINT_SIZE_RANGE'
12819
12820
12821 PARAMS returns two values, the smallest and largest supported
12822 widths for antialiased points. See `glPointSize'.
12823
12824`GL_SMOOTH_POINT_SIZE_GRANULARITY'
12825
12826
12827 PARAMS returns one value, the granularity of sizes for antialiased
12828 points. See `glPointSize'.
12829
12830`GL_STENCIL_BACK_FAIL'
12831
12832
12833 PARAMS returns one value, a symbolic constant indicating what
12834 action is taken for back-facing polygons when the stencil test
12835 fails. The initial value is `GL_KEEP'. See `glStencilOpSeparate'.
12836
12837`GL_STENCIL_BACK_FUNC'
12838
12839
12840 PARAMS returns one value, a symbolic constant indicating what
12841 function is used for back-facing polygons to compare the stencil
12842 reference value with the stencil buffer value. The initial value is
12843 `GL_ALWAYS'. See `glStencilFuncSeparate'.
12844
12845`GL_STENCIL_BACK_PASS_DEPTH_FAIL'
12846
12847
12848 PARAMS returns one value, a symbolic constant indicating what
12849 action is taken for back-facing polygons when the stencil test
12850 passes, but the depth test fails. The initial value is `GL_KEEP'.
12851 See `glStencilOpSeparate'.
12852
12853`GL_STENCIL_BACK_PASS_DEPTH_PASS'
12854
12855
12856 PARAMS returns one value, a symbolic constant indicating what
12857 action is taken for back-facing polygons when the stencil test
12858 passes and the depth test passes. The initial value is `GL_KEEP'.
12859 See `glStencilOpSeparate'.
12860
12861`GL_STENCIL_BACK_REF'
12862
12863
12864 PARAMS returns one value, the reference value that is compared with
12865 the contents of the stencil buffer for back-facing polygons. The
12866 initial value is 0. See `glStencilFuncSeparate'.
12867
12868`GL_STENCIL_BACK_VALUE_MASK'
12869
12870
12871 PARAMS returns one value, the mask that is used for back-facing
12872 polygons to mask both the stencil reference value and the stencil
12873 buffer value before they are compared. The initial value is all
12874 1's. See `glStencilFuncSeparate'.
12875
12876`GL_STENCIL_BACK_WRITEMASK'
12877
12878
12879 PARAMS returns one value, the mask that controls writing of the
12880 stencil bitplanes for back-facing polygons. The initial value is
12881 all 1's. See `glStencilMaskSeparate'.
12882
12883`GL_STENCIL_BITS'
12884
12885
12886 PARAMS returns one value, the number of bitplanes in the stencil
12887 buffer.
12888
12889`GL_STENCIL_CLEAR_VALUE'
12890
12891
12892 PARAMS returns one value, the index to which the stencil bitplanes
12893 are cleared. The initial value is 0. See `glClearStencil'.
12894
12895`GL_STENCIL_FAIL'
12896
12897
12898 PARAMS returns one value, a symbolic constant indicating what
12899 action is taken when the stencil test fails. The initial value is
12900 `GL_KEEP'. See `glStencilOp'. If the GL version is 2.0 or greater,
12901 this stencil state only affects non-polygons and front-facing
12902 polygons. Back-facing polygons use separate stencil state. See
12903 `glStencilOpSeparate'.
12904
12905`GL_STENCIL_FUNC'
12906
12907
12908 PARAMS returns one value, a symbolic constant indicating what
12909 function is used to compare the stencil reference value with the
12910 stencil buffer value. The initial value is `GL_ALWAYS'. See
12911 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
12912 state only affects non-polygons and front-facing polygons.
12913 Back-facing polygons use separate stencil state. See
12914 `glStencilFuncSeparate'.
12915
12916`GL_STENCIL_PASS_DEPTH_FAIL'
12917
12918
12919 PARAMS returns one value, a symbolic constant indicating what
12920 action is taken when the stencil test passes, but the depth test
12921 fails. The initial value is `GL_KEEP'. See `glStencilOp'. If the GL
12922 version is 2.0 or greater, this stencil state only affects
12923 non-polygons and front-facing polygons. Back-facing polygons use
12924 separate stencil state. See `glStencilOpSeparate'.
12925
12926`GL_STENCIL_PASS_DEPTH_PASS'
12927
12928
12929 PARAMS returns one value, a symbolic constant indicating what
12930 action is taken when the stencil test passes and the depth test
12931 passes. The initial value is `GL_KEEP'. See `glStencilOp'. If the
12932 GL version is 2.0 or greater, this stencil state only affects
12933 non-polygons and front-facing polygons. Back-facing polygons use
12934 separate stencil state. See `glStencilOpSeparate'.
12935
12936`GL_STENCIL_REF'
12937
12938
12939 PARAMS returns one value, the reference value that is compared with
12940 the contents of the stencil buffer. The initial value is 0. See
12941 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
12942 state only affects non-polygons and front-facing polygons.
12943 Back-facing polygons use separate stencil state. See
12944 `glStencilFuncSeparate'.
12945
12946`GL_STENCIL_TEST'
12947
12948
12949 PARAMS returns a single boolean value indicating whether stencil
12950 testing of fragments is enabled. The initial value is `GL_FALSE'.
12951 See `glStencilFunc' and `glStencilOp'.
12952
12953`GL_STENCIL_VALUE_MASK'
12954
12955
12956 PARAMS returns one value, the mask that is used to mask both the
12957 stencil reference value and the stencil buffer value before they
12958 are compared. The initial value is all 1's. See `glStencilFunc'. If
12959 the GL version is 2.0 or greater, this stencil state only affects
12960 non-polygons and front-facing polygons. Back-facing polygons use
12961 separate stencil state. See `glStencilFuncSeparate'.
12962
12963`GL_STENCIL_WRITEMASK'
12964
12965
12966 PARAMS returns one value, the mask that controls writing of the
12967 stencil bitplanes. The initial value is all 1's. See
12968 `glStencilMask'. If the GL version is 2.0 or greater, this stencil
12969 state only affects non-polygons and front-facing polygons.
12970 Back-facing polygons use separate stencil state. See
12971 `glStencilMaskSeparate'.
12972
12973`GL_STEREO'
12974
12975
12976 PARAMS returns a single boolean value indicating whether stereo
12977 buffers (left and right) are supported.
12978
12979`GL_SUBPIXEL_BITS'
12980
12981
12982 PARAMS returns one value, an estimate of the number of bits of
12983 subpixel resolution that are used to position rasterized geometry
12984 in window coordinates. The value must be at least 4.
12985
12986`GL_TEXTURE_1D'
12987
12988
12989 PARAMS returns a single boolean value indicating whether 1D texture
12990 mapping is enabled. The initial value is `GL_FALSE'. See
12991 `glTexImage1D'.
12992
12993`GL_TEXTURE_BINDING_1D'
12994
12995
12996 PARAMS returns a single value, the name of the texture currently
12997 bound to the target `GL_TEXTURE_1D'. The initial value is 0. See
12998 `glBindTexture'.
12999
13000`GL_TEXTURE_2D'
13001
13002
13003 PARAMS returns a single boolean value indicating whether 2D texture
13004 mapping is enabled. The initial value is `GL_FALSE'. See
13005 `glTexImage2D'.
13006
13007`GL_TEXTURE_BINDING_2D'
13008
13009
13010 PARAMS returns a single value, the name of the texture currently
13011 bound to the target `GL_TEXTURE_2D'. The initial value is 0. See
13012 `glBindTexture'.
13013
13014`GL_TEXTURE_3D'
13015
13016
13017 PARAMS returns a single boolean value indicating whether 3D texture
13018 mapping is enabled. The initial value is `GL_FALSE'. See
13019 `glTexImage3D'.
13020
13021`GL_TEXTURE_BINDING_3D'
13022
13023
13024 PARAMS returns a single value, the name of the texture currently
13025 bound to the target `GL_TEXTURE_3D'. The initial value is 0. See
13026 `glBindTexture'.
13027
13028`GL_TEXTURE_BINDING_CUBE_MAP'
13029
13030
13031 PARAMS returns a single value, the name of the texture currently
13032 bound to the target `GL_TEXTURE_CUBE_MAP'. The initial value is 0.
13033 See `glBindTexture'.
13034
13035`GL_TEXTURE_COMPRESSION_HINT'
13036
13037
13038 PARAMS returns a single value indicating the mode of the texture
13039 compression hint. The initial value is `GL_DONT_CARE'.
13040
13041`GL_TEXTURE_COORD_ARRAY'
13042
13043
13044 PARAMS returns a single boolean value indicating whether the
13045 texture coordinate array is enabled. The initial value is
13046 `GL_FALSE'. See `glTexCoordPointer'.
13047
13048`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING'
13049
13050
13051 PARAMS returns a single value, the name of the buffer object
13052 associated with the texture coordinate array. This buffer object
13053 would have been bound to the target `GL_ARRAY_BUFFER' at the time
13054 of the most recent call to `glTexCoordPointer'. If no buffer object
13055 was bound to this target, 0 is returned. The initial value is 0.
13056 See `glBindBuffer'.
13057
13058`GL_TEXTURE_COORD_ARRAY_SIZE'
13059
13060
13061 PARAMS returns one value, the number of coordinates per element in
13062 the texture coordinate array. The initial value is 4. See
13063 `glTexCoordPointer'.
13064
13065`GL_TEXTURE_COORD_ARRAY_STRIDE'
13066
13067
13068 PARAMS returns one value, the byte offset between consecutive
13069 elements in the texture coordinate array. The initial value is 0.
13070 See `glTexCoordPointer'.
13071
13072`GL_TEXTURE_COORD_ARRAY_TYPE'
13073
13074
13075 PARAMS returns one value, the data type of the coordinates in the
13076 texture coordinate array. The initial value is `GL_FLOAT'. See
13077 `glTexCoordPointer'.
13078
13079`GL_TEXTURE_CUBE_MAP'
13080
13081
13082 PARAMS returns a single boolean value indicating whether
13083 cube-mapped texture mapping is enabled. The initial value is
13084 `GL_FALSE'. See `glTexImage2D'.
13085
13086`GL_TEXTURE_GEN_Q'
13087
13088
13089 PARAMS returns a single boolean value indicating whether automatic
13090 generation of the Q texture coordinate is enabled. The initial
13091 value is `GL_FALSE'. See `glTexGen'.
13092
13093`GL_TEXTURE_GEN_R'
13094
13095
13096 PARAMS returns a single boolean value indicating whether automatic
13097 generation of the R texture coordinate is enabled. The initial
13098 value is `GL_FALSE'. See `glTexGen'.
13099
13100`GL_TEXTURE_GEN_S'
13101
13102
13103 PARAMS returns a single boolean value indicating whether automatic
13104 generation of the S texture coordinate is enabled. The initial
13105 value is `GL_FALSE'. See `glTexGen'.
13106
13107`GL_TEXTURE_GEN_T'
13108
13109
13110 PARAMS returns a single boolean value indicating whether automatic
13111 generation of the T texture coordinate is enabled. The initial
13112 value is `GL_FALSE'. See `glTexGen'.
13113
13114`GL_TEXTURE_MATRIX'
13115
13116
13117 PARAMS returns sixteen values: the texture matrix on the top of the
13118 texture matrix stack. Initially this matrix is the identity matrix.
13119 See `glPushMatrix'.
13120
13121`GL_TEXTURE_STACK_DEPTH'
13122
13123
13124 PARAMS returns one value, the number of matrices on the texture
13125 matrix stack. The initial value is 1. See `glPushMatrix'.
13126
13127`GL_TRANSPOSE_COLOR_MATRIX'
13128
13129
13130 PARAMS returns 16 values, the elements of the color matrix in
13131 row-major order. See `glLoadTransposeMatrix'.
13132
13133`GL_TRANSPOSE_MODELVIEW_MATRIX'
13134
13135
13136 PARAMS returns 16 values, the elements of the modelview matrix in
13137 row-major order. See `glLoadTransposeMatrix'.
13138
13139`GL_TRANSPOSE_PROJECTION_MATRIX'
13140
13141
13142 PARAMS returns 16 values, the elements of the projection matrix in
13143 row-major order. See `glLoadTransposeMatrix'.
13144
13145`GL_TRANSPOSE_TEXTURE_MATRIX'
13146
13147
13148 PARAMS returns 16 values, the elements of the texture matrix in
13149 row-major order. See `glLoadTransposeMatrix'.
13150
13151`GL_UNPACK_ALIGNMENT'
13152
13153
13154 PARAMS returns one value, the byte alignment used for reading pixel
13155 data from memory. The initial value is 4. See `glPixelStore'.
13156
13157`GL_UNPACK_IMAGE_HEIGHT'
13158
13159
13160 PARAMS returns one value, the image height used for reading pixel
13161 data from memory. The initial is 0. See `glPixelStore'.
13162
13163`GL_UNPACK_LSB_FIRST'
13164
13165
13166 PARAMS returns a single boolean value indicating whether single-bit
13167 pixels being read from memory are read first from the least
13168 significant bit of each unsigned byte. The initial value is
13169 `GL_FALSE'. See `glPixelStore'.
13170
13171`GL_UNPACK_ROW_LENGTH'
13172
13173
13174 PARAMS returns one value, the row length used for reading pixel
13175 data from memory. The initial value is 0. See `glPixelStore'.
13176
13177`GL_UNPACK_SKIP_IMAGES'
13178
13179
13180 PARAMS returns one value, the number of pixel images skipped before
13181 the first pixel is read from memory. The initial value is 0. See
13182 `glPixelStore'.
13183
13184`GL_UNPACK_SKIP_PIXELS'
13185
13186
13187 PARAMS returns one value, the number of pixel locations skipped
13188 before the first pixel is read from memory. The initial value is 0.
13189 See `glPixelStore'.
13190
13191`GL_UNPACK_SKIP_ROWS'
13192
13193
13194 PARAMS returns one value, the number of rows of pixel locations
13195 skipped before the first pixel is read from memory. The initial
13196 value is 0. See `glPixelStore'.
13197
13198`GL_UNPACK_SWAP_BYTES'
13199
13200
13201 PARAMS returns a single boolean value indicating whether the bytes
13202 of two-byte and four-byte pixel indices and components are swapped
13203 after being read from memory. The initial value is `GL_FALSE'. See
13204 `glPixelStore'.
13205
13206`GL_VERTEX_ARRAY'
13207
13208
13209 PARAMS returns a single boolean value indicating whether the vertex
13210 array is enabled. The initial value is `GL_FALSE'. See
13211 `glVertexPointer'.
13212
13213`GL_VERTEX_ARRAY_BUFFER_BINDING'
13214
3c9b6116 13215
b002944d
AW
13216 PARAMS returns a single value, the name of the buffer object
13217 associated with the vertex array. This buffer object would have
13218 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
13219 recent call to `glVertexPointer'. If no buffer object was bound to
13220 this target, 0 is returned. The initial value is 0. See
13221 `glBindBuffer'.
3c9b6116 13222
b002944d 13223`GL_VERTEX_ARRAY_SIZE'
3c9b6116
AW
13224
13225
b002944d
AW
13226 PARAMS returns one value, the number of coordinates per vertex in
13227 the vertex array. The initial value is 4. See `glVertexPointer'.
3c9b6116 13228
b002944d 13229`GL_VERTEX_ARRAY_STRIDE'
3c9b6116
AW
13230
13231
b002944d
AW
13232 PARAMS returns one value, the byte offset between consecutive
13233 vertices in the vertex array. The initial value is 0. See
13234 `glVertexPointer'.
3c9b6116 13235
b002944d 13236`GL_VERTEX_ARRAY_TYPE'
3c9b6116
AW
13237
13238
b002944d
AW
13239 PARAMS returns one value, the data type of each coordinate in the
13240 vertex array. The initial value is `GL_FLOAT'. See
13241 `glVertexPointer'.
3c9b6116 13242
b002944d 13243`GL_VERTEX_PROGRAM_POINT_SIZE'
3c9b6116
AW
13244
13245
b002944d
AW
13246 PARAMS returns a single boolean value indicating whether vertex
13247 program point size mode is enabled. If enabled, and a vertex shader
13248 is active, then the point size is taken from the shader built-in
13249 `gl_PointSize'. If disabled, and a vertex shader is active, then
13250 the point size is taken from the point state as specified by
13251 `glPointSize'. The initial value is `GL_FALSE'.
3c9b6116 13252
b002944d 13253`GL_VERTEX_PROGRAM_TWO_SIDE'
3c9b6116
AW
13254
13255
b002944d
AW
13256 PARAMS returns a single boolean value indicating whether vertex
13257 program two-sided color mode is enabled. If enabled, and a vertex
13258 shader is active, then the GL chooses the back color output for
13259 back-facing polygons, and the front color output for non-polygons
13260 and front-facing polygons. If disabled, and a vertex shader is
13261 active, then the front color output is always selected. The initial
13262 value is `GL_FALSE'.
3c9b6116 13263
b002944d 13264`GL_VIEWPORT'
3c9b6116
AW
13265
13266
b002944d
AW
13267 PARAMS returns four values: the X and Y window coordinates of the
13268 viewport, followed by its width and height. Initially the X and Y
13269 window coordinates are both set to 0, and the width and height are
13270 set to the width and height of the window into which the GL will do
13271 its rendering. See `glViewport'.
3c9b6116 13272
b002944d 13273`GL_ZOOM_X'
3c9b6116
AW
13274
13275
b002944d
AW
13276 PARAMS returns one value, the X pixel zoom factor. The initial
13277 value is 1. See `glPixelZoom'.
3c9b6116 13278
b002944d 13279`GL_ZOOM_Y'
3c9b6116
AW
13280
13281
b002944d
AW
13282 PARAMS returns one value, the Y pixel zoom factor. The initial
13283 value is 1. See `glPixelZoom'.
3c9b6116 13284
b002944d
AW
13285Many of the boolean parameters can also be queried more easily using
13286`glIsEnabled'.
3c9b6116 13287
b002944d 13288`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
3c9b6116 13289
b002944d
AW
13290`GL_INVALID_OPERATION' is generated if `glGet' is executed between the
13291execution of `glBegin' and the corresponding execution of `glEnd'.")
3c9b6116 13292
25072f02 13293(define-gl-procedures
bb894c9d 13294 ((glHint (target GLenum) (mode GLenum) -> void))
3c9b6116
AW
13295 "Specify implementation-specific hints.
13296
13297TARGET
13298 Specifies a symbolic constant indicating the behavior to be
13299 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
13300 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
13301 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
13302 `GL_TEXTURE_COMPRESSION_HINT', and
13303 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
13304
13305MODE
13306 Specifies a symbolic constant indicating the desired behavior.
13307 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
13308
13309Certain aspects of GL behavior, when there is room for interpretation,
13310can be controlled with hints. A hint is specified with two arguments.
13311TARGET is a symbolic constant indicating the behavior to be controlled,
13312and MODE is another symbolic constant indicating the desired behavior.
13313The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
13314the following:
13315
13316`GL_FASTEST'
13317
13318
13319 The most efficient option should be chosen.
13320
13321`GL_NICEST'
13322
13323
13324 The most correct, or highest quality, option should be chosen.
13325
13326`GL_DONT_CARE'
13327
13328
13329 No preference.
13330
13331Though the implementation aspects that can be hinted are well defined,
13332the interpretation of the hints depends on the implementation. The hint
13333aspects that can be specified with TARGET, along with suggested
13334semantics, are as follows:
13335
13336`GL_FOG_HINT'
13337
13338
13339 Indicates the accuracy of fog calculation. If per-pixel fog
13340 calculation is not efficiently supported by the GL implementation,
13341 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
13342 calculation of fog effects.
13343
13344`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
13345
13346
13347 Indicates the accuracy of the derivative calculation for the GL
13348 shading language fragment processing built-in functions: `dFdx',
13349 `dFdy', and `fwidth'.
13350
13351`GL_GENERATE_MIPMAP_HINT'
13352
13353
13354 Indicates the quality of filtering when generating mipmap images.
13355
13356`GL_LINE_SMOOTH_HINT'
13357
13358
13359 Indicates the sampling quality of antialiased lines. If a larger
13360 filter function is applied, hinting `GL_NICEST' can result in more
13361 pixel fragments being generated during rasterization.
13362
13363`GL_PERSPECTIVE_CORRECTION_HINT'
13364
13365
13366 Indicates the quality of color, texture coordinate, and fog
13367 coordinate interpolation. If perspective-corrected parameter
13368 interpolation is not efficiently supported by the GL
13369 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
13370 in simple linear interpolation of colors and/or texture
13371 coordinates.
13372
13373`GL_POINT_SMOOTH_HINT'
13374
13375
13376 Indicates the sampling quality of antialiased points. If a larger
13377 filter function is applied, hinting `GL_NICEST' can result in more
13378 pixel fragments being generated during rasterization.
13379
13380`GL_POLYGON_SMOOTH_HINT'
13381
13382
13383 Indicates the sampling quality of antialiased polygons. Hinting
13384 `GL_NICEST' can result in more pixel fragments being generated
13385 during rasterization, if a larger filter function is applied.
13386
13387`GL_TEXTURE_COMPRESSION_HINT'
13388
13389
13390 Indicates the quality and performance of the compressing texture
13391 images. Hinting `GL_FASTEST' indicates that texture images should
13392 be compressed as quickly as possible, while `GL_NICEST' indicates
13393 that texture images should be compressed with as little image
13394 quality loss as possible. `GL_NICEST' should be selected if the
13395 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
13396
13397`GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
13398accepted value.
13399
13400`GL_INVALID_OPERATION' is generated if `glHint' is executed between the
13401execution of `glBegin' and the corresponding execution of `glEnd'.")
13402
25072f02 13403(define-gl-procedures
bb894c9d
AW
13404 ((glHistogram
13405 (target GLenum)
13406 (width GLsizei)
13407 (internalformat GLenum)
13408 (sink GLboolean)
13409 ->
13410 void))
3c9b6116
AW
13411 "Define histogram table.
13412
13413TARGET
13414 The histogram whose parameters are to be set. Must be one of
13415 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
13416
13417WIDTH
13418 The number of entries in the histogram table. Must be a power of 2.
13419
13420INTERNALFORMAT
13421 The format of entries in the histogram table. Must be one of
13422 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
13423 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
13424 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
13425 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
13426 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
13427 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
13428 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
13429 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
13430 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
13431
13432SINK
13433 If `GL_TRUE', pixels will be consumed by the histogramming process
13434 and no drawing or texture loading will take place. If `GL_FALSE',
13435 pixels will proceed to the minmax process after histogramming.
13436
13437When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
13438histogram table indices by clamping to the range [0,1], multiplying by
13439the width of the histogram table, and rounding to the nearest integer.
13440The table entries selected by the RGBA indices are then incremented. (If
13441the internal format of the histogram table includes luminance, then the
13442index derived from the R color component determines the luminance table
13443entry to be incremented.) If a histogram table entry is incremented
13444beyond its maximum value, then its value becomes undefined. (This is not
13445an error.)
13446
13447Histogramming is performed only for RGBA pixels (though these may be
13448specified originally as color indices and converted to RGBA by index
13449table lookup). Histogramming is enabled with `glEnable' and disabled
13450with `glDisable'.
13451
13452When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
13453histogram table to have WIDTH entries of the format specified by
13454INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
13455entries are initialized to zero. The values in the previous histogram
13456table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
13457after histogramming; no further processing of the pixels takes place,
13458and no drawing, texture loading, or pixel readback will result.
13459
13460When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
13461information as if the histogram table were to be redefined, but does not
13462actually define the new table. If the requested histogram table is too
13463large to be supported, then the state information will be set to zero.
13464This provides a way to determine if a histogram table with the given
13465parameters can be supported.
13466
13467
13468
13469`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
13470values.
13471
13472`GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
13473power of 2.
13474
13475`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
13476allowable values.
13477
13478`GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
13479histogram table specified is too large for the implementation.
13480
13481`GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
13482the execution of `glBegin' and the corresponding execution of `glEnd'.")
13483
25072f02 13484(define-gl-procedures
bb894c9d 13485 ((glIndexMask (mask GLuint) -> void))
3c9b6116
AW
13486 "Control the writing of individual bits in the color index buffers.
13487
13488MASK
13489 Specifies a bit mask to enable and disable the writing of
13490 individual bits in the color index buffers. Initially, the mask is
13491 all 1's.
13492
13493`glIndexMask' controls the writing of individual bits in the color index
13494buffers. The least significant N bits of MASK, where N is the number of
13495bits in a color index buffer, specify a mask. Where a 1 (one) appears in
13496the mask, it's possible to write to the corresponding bit in the color
13497index buffer (or buffers). Where a 0 (zero) appears, the corresponding
13498bit is write-protected.
13499
13500This mask is used only in color index mode, and it affects only the
13501buffers currently selected for writing (see `glDrawBuffer'). Initially,
13502all bits are enabled for writing.
13503
13504`GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
13505the execution of `glBegin' and the corresponding execution of `glEnd'.")
13506
25072f02 13507(define-gl-procedures
bb894c9d
AW
13508 ((glIndexPointer
13509 (type GLenum)
13510 (stride GLsizei)
00239761 13511 (pointer const-GLvoid-*)
bb894c9d
AW
13512 ->
13513 void))
3c9b6116
AW
13514 "Define an array of color indexes.
13515
13516TYPE
13517 Specifies the data type of each color index in the array. Symbolic
13518 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
13519 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13520
13521STRIDE
13522 Specifies the byte offset between consecutive color indexes. If
13523 STRIDE is 0, the color indexes are understood to be tightly packed
13524 in the array. The initial value is 0.
13525
13526POINTER
13527 Specifies a pointer to the first index in the array. The initial
13528 value is 0.
13529
13530`glIndexPointer' specifies the location and data format of an array of
13531color indexes to use when rendering. TYPE specifies the data type of
13532each color index and STRIDE specifies the byte stride from one color
13533index to the next, allowing vertices and attributes to be packed into a
13534single array or stored in separate arrays.
13535
13536If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13537target (see `glBindBuffer') while a color index array is specified,
13538POINTER is treated as a byte offset into the buffer object's data store.
13539Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13540color index vertex array client-side state
13541(`GL_INDEX_ARRAY_BUFFER_BINDING').
13542
13543When a color index array is specified, TYPE, STRIDE, and POINTER are
13544saved as client-side state, in addition to the current vertex array
13545buffer object binding.
13546
13547To enable and disable the color index array, call `glEnableClientState'
13548and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
13549enabled, the color index array is used when `glDrawArrays',
13550`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
13551`glDrawRangeElements', or `glArrayElement' is called.
13552
13553`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13554
13555`GL_INVALID_VALUE' is generated if STRIDE is negative.")
13556
25072f02 13557(define-gl-procedures
bb894c9d 13558 ((glIndexi (c GLint) -> void)
ca09631c 13559 (glIndexf (c GLfloat) -> void)
bb894c9d 13560 (glIndexub (c GLubyte) -> void))
3c9b6116
AW
13561 "Set the current color index.
13562
13563C
13564 Specifies the new value for the current color index.
13565
13566
13567
13568`glIndex' updates the current (single-valued) color index. It takes one
13569argument, the new value for the current color index.
13570
13571The current index is stored as a floating-point value. Integer values
13572are converted directly to floating-point values, with no special
13573mapping. The initial value is 1.
13574
13575Index values outside the representable range of the color index buffer
13576are not clamped. However, before an index is dithered (if enabled) and
13577written to the frame buffer, it is converted to fixed-point format. Any
13578bits in the integer portion of the resulting fixed-point value that do
13579not correspond to bits in the frame buffer are masked out.")
13580
25072f02 13581(define-gl-procedures
bb894c9d 13582 ((glInitNames -> void))
3c9b6116
AW
13583 "Initialize the name stack.
13584
13585The name stack is used during selection mode to allow sets of rendering
13586commands to be uniquely identified. It consists of an ordered set of
13587unsigned integers. `glInitNames' causes the name stack to be initialized
13588to its default empty state.
13589
13590The name stack is always empty while the render mode is not `GL_SELECT'.
13591Calls to `glInitNames' while the render mode is not `GL_SELECT' are
13592ignored.
13593
13594`GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
13595the execution of `glBegin' and the corresponding execution of `glEnd'.")
13596
25072f02 13597(define-gl-procedures
bb894c9d
AW
13598 ((glInterleavedArrays
13599 (format GLenum)
13600 (stride GLsizei)
00239761 13601 (pointer const-GLvoid-*)
bb894c9d
AW
13602 ->
13603 void))
3c9b6116
AW
13604 "Simultaneously specify and enable several interleaved arrays.
13605
13606FORMAT
13607 Specifies the type of array to enable. Symbolic constants `GL_V2F',
13608 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
13609 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
13610 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
13611 `GL_T4F_C4F_N3F_V4F' are accepted.
13612
13613STRIDE
13614 Specifies the offset in bytes between each aggregate array element.
13615
13616`glInterleavedArrays' lets you specify and enable individual color,
13617normal, texture and vertex arrays whose elements are part of a larger
13618aggregate array element. For some implementations, this is more
13619efficient than specifying the arrays separately.
13620
13621If STRIDE is 0, the aggregate elements are stored consecutively.
13622Otherwise, STRIDE bytes occur between the beginning of one aggregate
13623array element and the beginning of the next aggregate array element.
13624
13625FORMAT serves as a ``key'' describing the extraction of individual
13626arrays from the aggregate array. If FORMAT contains a T, then texture
13627coordinates are extracted from the interleaved array. If C is present,
13628color values are extracted. If N is present, normal coordinates are
13629extracted. Vertex coordinates are always extracted.
13630
13631The digits 2, 3, and 4 denote how many values are extracted. F indicates
13632that values are extracted as floating-point values. Colors may also be
13633extracted as 4 unsigned bytes if 4UB follows the C. If a color is
13634extracted as 4 unsigned bytes, the vertex array element which follows is
13635located at the first possible floating-point aligned address.
13636
13637`GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
13638
13639`GL_INVALID_VALUE' is generated if STRIDE is negative.")
13640
25072f02 13641(define-gl-procedures
bb894c9d 13642 ((glIsBuffer (buffer GLuint) -> GLboolean))
3c9b6116
AW
13643 "Determine if a name corresponds to a buffer object.
13644
13645BUFFER
13646 Specifies a value that may be the name of a buffer object.
13647
13648`glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
13649buffer object. If BUFFER is zero, or is a non-zero value that is not
13650currently the name of a buffer object, or if an error occurs,
13651`glIsBuffer' returns `GL_FALSE'.
13652
13653A name returned by `glGenBuffers', but not yet associated with a buffer
13654object by calling `glBindBuffer', is not the name of a buffer object.
13655
13656`GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
13657the execution of `glBegin' and the corresponding execution of `glEnd'.")
13658
25072f02 13659(define-gl-procedures
bb894c9d 13660 ((glIsEnabled (cap GLenum) -> GLboolean))
3c9b6116
AW
13661 "Test whether a capability is enabled.
13662
13663CAP
13664 Specifies a symbolic constant indicating a GL capability.
13665
13666`glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
13667returns `GL_FALSE' otherwise. Initially all capabilities except
13668`GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
13669
13670The following capabilities are accepted for CAP:
13671
13672
13673
13674*Constant*
13675 *See*
13676
13677`GL_ALPHA_TEST'
13678 `glAlphaFunc'
13679
13680`GL_AUTO_NORMAL'
13681 `glEvalCoord'
13682
13683`GL_BLEND'
13684 `glBlendFunc', `glLogicOp'
13685
13686`GL_CLIP_PLANE'I
13687 `glClipPlane'
13688
13689`GL_COLOR_ARRAY'
13690 `glColorPointer'
13691
13692`GL_COLOR_LOGIC_OP'
13693 `glLogicOp'
13694
13695`GL_COLOR_MATERIAL'
13696 `glColorMaterial'
13697
13698`GL_COLOR_SUM'
13699 `glSecondaryColor'
13700
13701`GL_COLOR_TABLE'
13702 `glColorTable'
13703
13704`GL_CONVOLUTION_1D'
13705 `glConvolutionFilter1D'
13706
13707`GL_CONVOLUTION_2D'
13708 `glConvolutionFilter2D'
13709
13710`GL_CULL_FACE'
13711 `glCullFace'
13712
13713`GL_DEPTH_TEST'
13714 `glDepthFunc', `glDepthRange'
13715
13716`GL_DITHER'
13717 `glEnable'
13718
13719`GL_EDGE_FLAG_ARRAY'
13720 `glEdgeFlagPointer'
13721
13722`GL_FOG'
13723 `glFog'
13724
13725`GL_FOG_COORD_ARRAY'
13726 `glFogCoordPointer'
13727
13728`GL_HISTOGRAM'
13729 `glHistogram'
13730
13731`GL_INDEX_ARRAY'
13732 `glIndexPointer'
13733
13734`GL_INDEX_LOGIC_OP'
13735 `glLogicOp'
13736
13737`GL_LIGHT'I
13738 `glLightModel', `glLight'
13739
13740`GL_LIGHTING'
13741 `glMaterial', `glLightModel', `glLight'
13742
13743`GL_LINE_SMOOTH'
13744 `glLineWidth'
13745
13746`GL_LINE_STIPPLE'
13747 `glLineStipple'
13748
13749`GL_MAP1_COLOR_4'
13750 `glMap1'
13751
13752`GL_MAP1_INDEX'
13753 `glMap1'
13754
13755`GL_MAP1_NORMAL'
13756 `glMap1'
13757
13758`GL_MAP1_TEXTURE_COORD_1'
13759 `glMap1'
13760
13761`GL_MAP1_TEXTURE_COORD_2'
13762 `glMap1'
13763
13764`GL_MAP1_TEXTURE_COORD_3'
13765 `glMap1'
13766
13767`GL_MAP1_TEXTURE_COORD_4'
13768 `glMap1'
13769
13770`GL_MAP2_COLOR_4'
13771 `glMap2'
13772
13773`GL_MAP2_INDEX'
13774 `glMap2'
13775
13776`GL_MAP2_NORMAL'
13777 `glMap2'
13778
13779`GL_MAP2_TEXTURE_COORD_1'
13780 `glMap2'
13781
13782`GL_MAP2_TEXTURE_COORD_2'
13783 `glMap2'
13784
13785`GL_MAP2_TEXTURE_COORD_3'
13786 `glMap2'
13787
13788`GL_MAP2_TEXTURE_COORD_4'
13789 `glMap2'
13790
13791`GL_MAP2_VERTEX_3'
13792 `glMap2'
13793
13794`GL_MAP2_VERTEX_4'
13795 `glMap2'
13796
13797`GL_MINMAX'
13798 `glMinmax'
13799
13800`GL_MULTISAMPLE'
13801 `glSampleCoverage'
13802
13803`GL_NORMAL_ARRAY'
13804 `glNormalPointer'
13805
13806`GL_NORMALIZE'
13807 `glNormal'
13808
13809`GL_POINT_SMOOTH'
13810 `glPointSize'
13811
13812`GL_POINT_SPRITE'
13813 `glEnable'
13814
13815`GL_POLYGON_SMOOTH'
13816 `glPolygonMode'
13817
13818`GL_POLYGON_OFFSET_FILL'
13819 `glPolygonOffset'
13820
13821`GL_POLYGON_OFFSET_LINE'
13822 `glPolygonOffset'
13823
13824`GL_POLYGON_OFFSET_POINT'
13825 `glPolygonOffset'
13826
13827`GL_POLYGON_STIPPLE'
13828 `glPolygonStipple'
13829
13830`GL_POST_COLOR_MATRIX_COLOR_TABLE'
13831 `glColorTable'
13832
13833`GL_POST_CONVOLUTION_COLOR_TABLE'
13834 `glColorTable'
13835
13836`GL_RESCALE_NORMAL'
13837 `glNormal'
13838
13839`GL_SAMPLE_ALPHA_TO_COVERAGE'
13840 `glSampleCoverage'
13841
13842`GL_SAMPLE_ALPHA_TO_ONE'
13843 `glSampleCoverage'
13844
13845`GL_SAMPLE_COVERAGE'
13846 `glSampleCoverage'
13847
13848`GL_SCISSOR_TEST'
13849 `glScissor'
13850
13851`GL_SECONDARY_COLOR_ARRAY'
13852 `glSecondaryColorPointer'
13853
13854`GL_SEPARABLE_2D'
13855 `glSeparableFilter2D'
13856
13857`GL_STENCIL_TEST'
13858 `glStencilFunc', `glStencilOp'
13859
13860`GL_TEXTURE_1D'
13861 `glTexImage1D'
13862
13863`GL_TEXTURE_2D'
13864 `glTexImage2D'
13865
13866`GL_TEXTURE_3D'
13867 `glTexImage3D'
13868
13869`GL_TEXTURE_COORD_ARRAY'
13870 `glTexCoordPointer'
13871
13872`GL_TEXTURE_CUBE_MAP'
13873 `glTexImage2D'
13874
13875`GL_TEXTURE_GEN_Q'
13876 `glTexGen'
13877
13878`GL_TEXTURE_GEN_R'
13879 `glTexGen'
13880
13881`GL_TEXTURE_GEN_S'
13882 `glTexGen'
13883
13884`GL_TEXTURE_GEN_T'
13885 `glTexGen'
13886
13887`GL_VERTEX_ARRAY'
13888 `glVertexPointer'
13889
13890`GL_VERTEX_PROGRAM_POINT_SIZE'
13891 `glEnable'
13892
13893`GL_VERTEX_PROGRAM_TWO_SIDE'
13894 `glEnable'
13895
13896
13897
13898`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
13899
13900`GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
13901the execution of `glBegin' and the corresponding execution of `glEnd'.")
13902
25072f02 13903(define-gl-procedures
bb894c9d 13904 ((glIsList (list GLuint) -> GLboolean))
3c9b6116
AW
13905 "Determine if a name corresponds to a display list.
13906
13907LIST
13908 Specifies a potential display list name.
13909
13910`glIsList' returns `GL_TRUE' if LIST is the name of a display list and
13911returns `GL_FALSE' if it is not, or if an error occurs.
13912
13913A name returned by `glGenLists', but not yet associated with a display
13914list by calling `glNewList', is not the name of a display list.
13915
13916`GL_INVALID_OPERATION' is generated if `glIsList' is executed between
13917the execution of `glBegin' and the corresponding execution of `glEnd'.")
13918
25072f02 13919(define-gl-procedures
bb894c9d 13920 ((glIsProgram (program GLuint) -> GLboolean))
3c9b6116
AW
13921 "Determines if a name corresponds to a program object.
13922
13923PROGRAM
13924 Specifies a potential program object.
13925
13926`glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
13927object previously created with `glCreateProgram' and not yet deleted
13928with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
13929not the name of a program object, or if an error occurs, `glIsProgram'
13930returns `GL_FALSE'.
13931
13932`GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
13933the execution of `glBegin' and the corresponding execution of `glEnd'.")
13934
25072f02 13935(define-gl-procedures
bb894c9d 13936 ((glIsQuery (id GLuint) -> GLboolean))
3c9b6116
AW
13937 "Determine if a name corresponds to a query object.
13938
13939ID
13940 Specifies a value that may be the name of a query object.
13941
13942`glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
13943object. If ID is zero, or is a non-zero value that is not currently the
13944name of a query object, or if an error occurs, `glIsQuery' returns
13945`GL_FALSE'.
13946
13947A name returned by `glGenQueries', but not yet associated with a query
13948object by calling `glBeginQuery', is not the name of a query object.
13949
13950`GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
13951the execution of `glBegin' and the corresponding execution of `glEnd'.")
13952
25072f02 13953(define-gl-procedures
bb894c9d 13954 ((glIsShader (shader GLuint) -> GLboolean))
3c9b6116
AW
13955 "Determines if a name corresponds to a shader object.
13956
13957SHADER
13958 Specifies a potential shader object.
13959
13960`glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
13961previously created with `glCreateShader' and not yet deleted with
13962`glDeleteShader'. If SHADER is zero or a non-zero value that is not the
13963name of a shader object, or if an error occurs, `glIsShader ' returns
13964`GL_FALSE'.
13965
13966`GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
13967the execution of `glBegin' and the corresponding execution of `glEnd'.")
13968
25072f02 13969(define-gl-procedures
bb894c9d 13970 ((glIsTexture (texture GLuint) -> GLboolean))
3c9b6116
AW
13971 "Determine if a name corresponds to a texture.
13972
13973TEXTURE
13974 Specifies a value that may be the name of a texture.
13975
13976`glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
13977texture. If TEXTURE is zero, or is a non-zero value that is not
13978currently the name of a texture, or if an error occurs, `glIsTexture'
13979returns `GL_FALSE'.
13980
13981A name returned by `glGenTextures', but not yet associated with a
13982texture by calling `glBindTexture', is not the name of a texture.
13983
13984`GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
13985the execution of `glBegin' and the corresponding execution of `glEnd'.")
13986
25072f02 13987(define-gl-procedures
bb894c9d
AW
13988 ((glLightModelf
13989 (pname GLenum)
13990 (param GLfloat)
13991 ->
13992 void)
13993 (glLightModeli
13994 (pname GLenum)
13995 (param GLint)
13996 ->
13997 void))
3c9b6116
AW
13998 "Set the lighting model parameters.
13999
14000PNAME
14001 Specifies a single-valued lighting model parameter.
14002 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
14003 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
14004
14005PARAM
14006 Specifies the value that PARAM will be set to.
14007
14008`glLightModel' sets the lighting model parameter. PNAME names a
14009parameter and PARAMS gives the new value. There are three lighting model
14010parameters:
14011
14012`GL_LIGHT_MODEL_AMBIENT'
14013
14014
14015 PARAMS contains four integer or floating-point values that specify
14016 the ambient RGBA intensity of the entire scene. Integer values are
14017 mapped linearly such that the most positive representable value
14018 maps to 1.0, and the most negative representable value maps to -1.0
14019 . Floating-point values are mapped directly. Neither integer nor
14020 floating-point values are clamped. The initial ambient scene
14021 intensity is (0.2, 0.2, 0.2, 1.0).
14022
14023`GL_LIGHT_MODEL_COLOR_CONTROL'
14024
14025
14026 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
14027 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
14028 is generated from the lighting computation for a vertex.
14029 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
14030 computation of lighting be stored separately from the remainder of
14031 the lighting computation. The specular color is summed into the
14032 generated fragment's color after the application of texture mapping
14033 (if enabled). The initial value is `GL_SINGLE_COLOR'.
14034
14035`GL_LIGHT_MODEL_LOCAL_VIEWER'
14036
14037
14038 PARAMS is a single integer or floating-point value that specifies
14039 how specular reflection angles are computed. If PARAMS is 0 (or
14040 0.0), specular reflection angles take the view direction to be
14041 parallel to and in the direction of the -Z axis, regardless of the
14042 location of the vertex in eye coordinates. Otherwise, specular
14043 reflections are computed from the origin of the eye coordinate
14044 system. The initial value is 0.
14045
14046`GL_LIGHT_MODEL_TWO_SIDE'
14047
14048
14049 PARAMS is a single integer or floating-point value that specifies
14050 whether one- or two-sided lighting calculations are done for
14051 polygons. It has no effect on the lighting calculations for points,
14052 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
14053 specified, and only the FRONT material parameters are used in the
14054 lighting equation. Otherwise, two-sided lighting is specified. In
14055 this case, vertices of back-facing polygons are lighted using the
14056 BACK material parameters and have their normals reversed before the
14057 lighting equation is evaluated. Vertices of front-facing polygons
14058 are always lighted using the FRONT material parameters, with no
14059 change to their normals. The initial value is 0.
14060
14061In RGBA mode, the lighted color of a vertex is the sum of the material
14062emission intensity, the product of the material ambient reflectance and
14063the lighting model full-scene ambient intensity, and the contribution of
14064each enabled light source. Each light source contributes the sum of
14065three terms: ambient, diffuse, and specular. The ambient light source
14066contribution is the product of the material ambient reflectance and the
14067light's ambient intensity. The diffuse light source contribution is the
14068product of the material diffuse reflectance, the light's diffuse
14069intensity, and the dot product of the vertex's normal with the
14070normalized vector from the vertex to the light source. The specular
14071light source contribution is the product of the material specular
14072reflectance, the light's specular intensity, and the dot product of the
14073normalized vertex-to-eye and vertex-to-light vectors, raised to the
14074power of the shininess of the material. All three light source
14075contributions are attenuated equally based on the distance from the
14076vertex to the light source and on light source direction, spread
14077exponent, and spread cutoff angle. All dot products are replaced with 0
14078if they evaluate to a negative value.
14079
14080The alpha component of the resulting lighted color is set to the alpha
14081value of the material diffuse reflectance.
14082
14083In color index mode, the value of the lighted index of a vertex ranges
14084from the ambient to the specular values passed to `glMaterial' using
14085`GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
14086(.30, .59, .11) weighting of the lights' colors, the shininess of the
14087material, and the same reflection and attenuation equations as in the
14088RGBA case, determine how much above ambient the resulting index is.
14089
14090`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
14091
14092`GL_INVALID_ENUM' is generated if PNAME is
14093`GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
14094`GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
14095
14096`GL_INVALID_OPERATION' is generated if `glLightModel' is executed
14097between the execution of `glBegin' and the corresponding execution of
14098`glEnd'.")
14099
25072f02 14100(define-gl-procedures
bb894c9d
AW
14101 ((glLightf
14102 (light GLenum)
14103 (pname GLenum)
14104 (param GLfloat)
14105 ->
14106 void)
14107 (glLighti
14108 (light GLenum)
14109 (pname GLenum)
14110 (param GLint)
14111 ->
14112 void))
3c9b6116
AW
14113 "Set light source parameters.
14114
14115LIGHT
14116 Specifies a light. The number of lights depends on the
14117 implementation, but at least eight lights are supported. They are
14118 identified by symbolic names of the form `GL_LIGHT' I , where i
14119 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
14120
14121PNAME
14122 Specifies a single-valued light source parameter for LIGHT.
14123 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
14124 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
14125 accepted.
14126
14127PARAM
14128 Specifies the value that parameter PNAME of light source LIGHT will
14129 be set to.
14130
14131`glLight' sets the values of individual light source parameters. LIGHT
14132names the light and is a symbolic name of the form `GL_LIGHT'I , where i
14133ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
14134of ten light source parameters, again by symbolic name. PARAMS is either
14135a single value or a pointer to an array that contains the new values.
14136
14137To enable and disable lighting calculation, call `glEnable' and
14138`glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
14139When it is enabled, light sources that are enabled contribute to the
14140lighting calculation. Light source I is enabled and disabled using
14141`glEnable' and `glDisable' with argument `GL_LIGHT'I .
14142
14143The ten light parameters are as follows:
14144
14145`GL_AMBIENT'
14146 PARAMS contains four integer or floating-point values that specify
14147 the ambient RGBA intensity of the light. Integer values are mapped
14148 linearly such that the most positive representable value maps to
14149 1.0, and the most negative representable value maps to -1.0 .
14150 Floating-point values are mapped directly. Neither integer nor
14151 floating-point values are clamped. The initial ambient light
14152 intensity is (0, 0, 0, 1).
14153
14154`GL_DIFFUSE'
14155 PARAMS contains four integer or floating-point values that specify
14156 the diffuse RGBA intensity of the light. Integer values are mapped
14157 linearly such that the most positive representable value maps to
14158 1.0, and the most negative representable value maps to -1.0 .
14159 Floating-point values are mapped directly. Neither integer nor
14160 floating-point values are clamped. The initial value for
14161 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14162 (0, 0, 0, 1).
14163
14164`GL_SPECULAR'
14165 PARAMS contains four integer or floating-point values that specify
14166 the specular RGBA intensity of the light. Integer values are mapped
14167 linearly such that the most positive representable value maps to
14168 1.0, and the most negative representable value maps to -1.0 .
14169 Floating-point values are mapped directly. Neither integer nor
14170 floating-point values are clamped. The initial value for
14171 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14172 (0, 0, 0, 1).
14173
14174`GL_POSITION'
14175 PARAMS contains four integer or floating-point values that specify
14176 the position of the light in homogeneous object coordinates. Both
14177 integer and floating-point values are mapped directly. Neither
14178 integer nor floating-point values are clamped.
14179
14180 The position is transformed by the modelview matrix when `glLight'
14181 is called (just as if it were a point), and it is stored in eye
14182 coordinates. If the W component of the position is 0, the light is
14183 treated as a directional source. Diffuse and specular lighting
14184 calculations take the light's direction, but not its actual
14185 position, into account, and attenuation is disabled. Otherwise,
14186 diffuse and specular lighting calculations are based on the actual
14187 location of the light in eye coordinates, and attenuation is
14188 enabled. The initial position is (0, 0, 1, 0); thus, the initial
14189 light source is directional, parallel to, and in the direction of
14190 the -Z axis.
14191
14192`GL_SPOT_DIRECTION'
14193 PARAMS contains three integer or floating-point values that specify
14194 the direction of the light in homogeneous object coordinates. Both
14195 integer and floating-point values are mapped directly. Neither
14196 integer nor floating-point values are clamped.
14197
14198 The spot direction is transformed by the upper 3x3 of the modelview
14199 matrix when `glLight' is called, and it is stored in eye
14200 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
14201 180, which it is initially. The initial direction is (0,0-1) .
14202
14203`GL_SPOT_EXPONENT'
14204 PARAMS is a single integer or floating-point value that specifies
14205 the intensity distribution of the light. Integer and floating-point
14206 values are mapped directly. Only values in the range [0,128] are
14207 accepted.
14208
14209 Effective light intensity is attenuated by the cosine of the angle
14210 between the direction of the light and the direction from the light
14211 to the vertex being lighted, raised to the power of the spot
14212 exponent. Thus, higher spot exponents result in a more focused
14213 light source, regardless of the spot cutoff angle (see
14214 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
14215 resulting in uniform light distribution.
14216
14217`GL_SPOT_CUTOFF'
14218 PARAMS is a single integer or floating-point value that specifies
14219 the maximum spread angle of a light source. Integer and
14220 floating-point values are mapped directly. Only values in the range
14221 [0,90] and the special value 180 are accepted. If the angle between
14222 the direction of the light and the direction from the light to the
14223 vertex being lighted is greater than the spot cutoff angle, the
14224 light is completely masked. Otherwise, its intensity is controlled
14225 by the spot exponent and the attenuation factors. The initial spot
14226 cutoff is 180, resulting in uniform light distribution.
14227
14228`GL_CONSTANT_ATTENUATION'
14229`GL_LINEAR_ATTENUATION'
14230`GL_QUADRATIC_ATTENUATION'
14231 PARAMS is a single integer or floating-point value that specifies
14232 one of the three light attenuation factors. Integer and
14233 floating-point values are mapped directly. Only nonnegative values
14234 are accepted. If the light is positional, rather than directional,
14235 its intensity is attenuated by the reciprocal of the sum of the
14236 constant factor, the linear factor times the distance between the
14237 light and the vertex being lighted, and the quadratic factor times
14238 the square of the same distance. The initial attenuation factors
14239 are (1, 0, 0), resulting in no attenuation.
14240
14241`GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
14242accepted value.
14243
14244`GL_INVALID_VALUE' is generated if a spot exponent value is specified
14245outside the range [0,128] , or if spot cutoff is specified outside the
14246range [0,90] (except for the special value 180), or if a negative
14247attenuation factor is specified.
14248
14249`GL_INVALID_OPERATION' is generated if `glLight' is executed between the
14250execution of `glBegin' and the corresponding execution of `glEnd'.")
14251
25072f02 14252(define-gl-procedures
bb894c9d
AW
14253 ((glLineStipple
14254 (factor GLint)
14255 (pattern GLushort)
14256 ->
14257 void))
3c9b6116
AW
14258 "Specify the line stipple pattern.
14259
14260FACTOR
14261 Specifies a multiplier for each bit in the line stipple pattern. If
14262 FACTOR is 3, for example, each bit in the pattern is used three
14263 times before the next bit in the pattern is used. FACTOR is clamped
14264 to the range [1, 256] and defaults to 1.
14265
14266PATTERN
14267 Specifies a 16-bit integer whose bit pattern determines which
14268 fragments of a line will be drawn when the line is rasterized. Bit
14269 zero is used first; the default pattern is all 1's.
14270
14271Line stippling masks out certain fragments produced by rasterization;
14272those fragments will not be drawn. The masking is achieved by using
14273three parameters: the 16-bit line stipple pattern PATTERN, the repeat
14274count FACTOR, and an integer stipple counter S .
14275
14276Counter S is reset to 0 whenever `glBegin' is called and before each
14277line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
14278It is incremented after each fragment of a unit width aliased line
14279segment is generated or after each I fragments of an I width line
14280segment are generated. The I fragments associated with count S are
14281masked out if
14282
14283PATTERN bit (S/FACTOR,)%16
14284
14285is 0, otherwise these fragments are sent to the frame buffer. Bit zero
14286of PATTERN is the least significant bit.
14287
14288Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
14289purposes of stippling. Whether rectangle S is rasterized or not depends
14290on the fragment rule described for aliased lines, counting rectangles
14291rather than groups of fragments.
14292
14293To enable and disable line stippling, call `glEnable' and `glDisable'
14294with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
14295is applied as described above. When disabled, it is as if the pattern
14296were all 1's. Initially, line stippling is disabled.
14297
14298`GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
14299between the execution of `glBegin' and the corresponding execution of
14300`glEnd'.")
14301
25072f02 14302(define-gl-procedures
bb894c9d 14303 ((glLineWidth (width GLfloat) -> void))
3c9b6116
AW
14304 "Specify the width of rasterized lines.
14305
14306WIDTH
14307 Specifies the width of rasterized lines. The initial value is 1.
14308
14309`glLineWidth' specifies the rasterized width of both aliased and
14310antialiased lines. Using a line width other than 1 has different
14311effects, depending on whether line antialiasing is enabled. To enable
14312and disable line antialiasing, call `glEnable' and `glDisable' with
14313argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
14314
14315If line antialiasing is disabled, the actual width is determined by
14316rounding the supplied width to the nearest integer. (If the rounding
14317results in the value 0, it is as if the line width were 1.) If
14318∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
14319where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
14320each row that is rasterized.
14321
14322If antialiasing is enabled, line rasterization produces a fragment for
14323each pixel square that intersects the region lying within the rectangle
14324having width equal to the current line width, length equal to the actual
14325length of the line, and centered on the mathematical line segment. The
14326coverage value for each fragment is the window coordinate area of the
14327intersection of the rectangular region with the corresponding pixel
14328square. This value is saved and used in the final rasterization step.
14329
14330Not all widths can be supported when line antialiasing is enabled. If an
14331unsupported width is requested, the nearest supported width is used.
14332Only width 1 is guaranteed to be supported; others depend on the
14333implementation. Likewise, there is a range for aliased line widths as
14334well. To query the range of supported widths and the size difference
14335between supported widths within the range, call `glGet' with arguments
14336`GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
14337`GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
14338
14339`GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
14340
14341`GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
14342the execution of `glBegin' and the corresponding execution of `glEnd'.")
14343
25072f02 14344(define-gl-procedures
bb894c9d 14345 ((glLinkProgram (program GLuint) -> void))
3c9b6116
AW
14346 "Links a program object.
14347
14348PROGRAM
14349 Specifies the handle of the program object to be linked.
14350
14351`glLinkProgram' links the program object specified by PROGRAM. If any
14352shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
14353will be used to create an executable that will run on the programmable
14354vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
14355attached to PROGRAM, they will be used to create an executable that will
14356run on the programmable fragment processor.
14357
14358The status of the link operation will be stored as part of the program
14359object's state. This value will be set to `GL_TRUE' if the program
14360object was linked without errors and is ready for use, and `GL_FALSE'
14361otherwise. It can be queried by calling `glGetProgram' with arguments
14362PROGRAM and `GL_LINK_STATUS'.
14363
14364As a result of a successful link operation, all active user-defined
14365uniform variables belonging to PROGRAM will be initialized to 0, and
14366each of the program object's active uniform variables will be assigned a
14367location that can be queried by calling `glGetUniformLocation'. Also,
14368any active user-defined attribute variables that have not been bound to
14369a generic vertex attribute index will be bound to one at this time.
14370
14371Linking of a program object can fail for a number of reasons as
14372specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
14373lists some of the conditions that will cause a link error.
14374
14375 * The storage limit for uniform variables has been exceeded.
14376
14377 * The number of active uniform variables supported by the
14378 implementation has been exceeded.
14379
14380 * The `main' function is missing for the vertex shader or the
14381 fragment shader.
14382
14383 * A varying variable actually used in the fragment shader is not
14384 declared in the same way (or is not declared at all) in the vertex
14385 shader.
14386
14387 * A reference to a function or variable name is unresolved.
14388
14389 * A shared global is declared with two different types or two
14390 different initial values.
14391
14392 * One or more of the attached shader objects has not been
14393 successfully compiled.
14394
14395 * Binding a generic attribute matrix caused some rows of the matrix
14396 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
14397
14398 * Not enough contiguous vertex attribute slots could be found to bind
14399 attribute matrices.
14400
14401When a program object has been successfully linked, the program object
14402can be made part of current state by calling `glUseProgram'. Whether or
14403not the link operation was successful, the program object's information
14404log will be overwritten. The information log can be retrieved by calling
14405`glGetProgramInfoLog'.
14406
14407`glLinkProgram' will also install the generated executables as part of
14408the current rendering state if the link operation was successful and the
14409specified program object is already currently in use as a result of a
14410previous call to `glUseProgram'. If the program object currently in use
14411is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
14412but the executables and associated state will remain part of the current
14413state until a subsequent call to `glUseProgram' removes it from use.
14414After it is removed from use, it cannot be made part of current state
14415until it has been successfully relinked.
14416
14417If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
14418not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
14419shader will be linked against the implicit interface for fixed
14420functionality fragment processing. Similarly, if PROGRAM contains shader
14421objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
14422objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
14423against the implicit interface for fixed functionality vertex
14424processing.
14425
14426The program object's information log is updated and the program is
14427generated at the time of the link operation. After the link operation,
14428applications are free to modify attached shader objects, compile
14429attached shader objects, detach shader objects, delete shader objects,
14430and attach additional shader objects. None of these operations affects
14431the information log or the program that is part of the program object.
14432
14433`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
14434OpenGL.
14435
14436`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
14437
14438`GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
14439between the execution of `glBegin' and the corresponding execution of
14440`glEnd'.")
14441
25072f02 14442(define-gl-procedures
bb894c9d 14443 ((glListBase (base GLuint) -> void))
3c9b6116
AW
14444 "Set the display-list base for .
14445
14446BASE
14447 Specifies an integer offset that will be added to `glCallLists'
14448 offsets to generate display-list names. The initial value is 0.
14449
14450`glCallLists' specifies an array of offsets. Display-list names are
14451generated by adding BASE to each offset. Names that reference valid
14452display lists are executed; the others are ignored.
14453
14454`GL_INVALID_OPERATION' is generated if `glListBase' is executed between
14455the execution of `glBegin' and the corresponding execution of `glEnd'.")
14456
25072f02 14457(define-gl-procedures
bb894c9d 14458 ((glLoadIdentity -> void))
3c9b6116
AW
14459 "Replace the current matrix with the identity matrix.
14460
14461`glLoadIdentity' replaces the current matrix with the identity matrix.
14462It is semantically equivalent to calling `glLoadMatrix' with the
14463identity matrix
14464
14465
14466
14467((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
14468
14469
14470
14471but in some cases it is more efficient.
14472
14473`GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
14474between the execution of `glBegin' and the corresponding execution of
14475`glEnd'.")
14476
25072f02 14477(define-gl-procedures
00239761 14478 ((glLoadMatrixf (m const-GLfloat-*) -> void))
3c9b6116
AW
14479 "Replace the current matrix with the specified matrix.
14480
14481M
14482 Specifies a pointer to 16 consecutive values, which are used as the
14483 elements of a 4×4 column-major matrix.
14484
14485`glLoadMatrix' replaces the current matrix with the one whose elements
14486are specified by M. The current matrix is the projection matrix,
14487modelview matrix, or texture matrix, depending on the current matrix
14488mode (see `glMatrixMode').
14489
14490The current matrix, M, defines a transformation of coordinates. For
14491instance, assume M refers to the modelview matrix. If
14492V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14493vertex, and M points to an array of 16 single- or double-precision
14494floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14495transformation M\u2061(V,) does the following:
14496
14497M\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,]),
14498(M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
14499M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14500
14501
14502
14503Projection and texture transformations are similarly defined.
14504
14505`GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
14506between the execution of `glBegin' and the corresponding execution of
14507`glEnd'.")
14508
25072f02 14509(define-gl-procedures
bb894c9d 14510 ((glLoadName (name GLuint) -> void))
3c9b6116
AW
14511 "Load a name onto the name stack.
14512
14513NAME
14514 Specifies a name that will replace the top value on the name stack.
14515
14516The name stack is used during selection mode to allow sets of rendering
14517commands to be uniquely identified. It consists of an ordered set of
14518unsigned integers and is initially empty.
14519
14520`glLoadName' causes NAME to replace the value on the top of the name
14521stack.
14522
14523The name stack is always empty while the render mode is not `GL_SELECT'.
14524Calls to `glLoadName' while the render mode is not `GL_SELECT' are
14525ignored.
14526
14527`GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
14528name stack is empty.
14529
14530`GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
14531the execution of `glBegin' and the corresponding execution of `glEnd'.")
14532
25072f02 14533(define-gl-procedures
00239761
AW
14534 ((glLoadTransposeMatrixf
14535 (m const-GLfloat-*)
14536 ->
14537 void))
3c9b6116
AW
14538 "Replace the current matrix with the specified row-major ordered matrix.
14539
14540M
14541 Specifies a pointer to 16 consecutive values, which are used as the
14542 elements of a 4×4 row-major matrix.
14543
14544`glLoadTransposeMatrix' replaces the current matrix with the one whose
14545elements are specified by M. The current matrix is the projection
14546matrix, modelview matrix, or texture matrix, depending on the current
14547matrix mode (see `glMatrixMode').
14548
14549The current matrix, M, defines a transformation of coordinates. For
14550instance, assume M refers to the modelview matrix. If
14551V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14552vertex, and M points to an array of 16 single- or double-precision
14553floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14554transformation M\u2061(V,) does the following:
14555
14556M\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,]),
14557(M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
14558M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14559
14560
14561
14562Projection and texture transformations are similarly defined.
14563
14564Calling `glLoadTransposeMatrix' with matrix M is identical in operation
14565to `glLoadMatrix' with M^T , where T represents the transpose.
14566
14567`GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
14568executed between the execution of `glBegin' and the corresponding
14569execution of `glEnd'.")
14570
25072f02 14571(define-gl-procedures
bb894c9d 14572 ((glLogicOp (opcode GLenum) -> void))
3c9b6116
AW
14573 "Specify a logical pixel operation for color index rendering.
14574
14575OPCODE
14576 Specifies a symbolic constant that selects a logical operation. The
14577 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
14578 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
14579 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
14580 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
14581 initial value is `GL_COPY'.
14582
14583`glLogicOp' specifies a logical operation that, when enabled, is applied
14584between the incoming color index or RGBA color and the color index or
14585RGBA color at the corresponding location in the frame buffer. To enable
14586or disable the logical operation, call `glEnable' and `glDisable' using
14587the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
14588`GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
14589for both operations.
14590
14591
14592
14593*Opcode*
14594 *Resulting Operation*
14595
14596`GL_CLEAR'
14597 0
14598
14599`GL_SET'
14600 1
14601
14602`GL_COPY'
14603 s
14604
14605`GL_COPY_INVERTED'
14606 ~s
14607
14608`GL_NOOP'
14609 d
14610
14611`GL_INVERT'
14612 ~d
14613
14614`GL_AND'
14615 s & d
14616
14617`GL_NAND'
14618 ~(s & d)
14619
14620`GL_OR'
14621 s | d
14622
14623`GL_NOR'
14624 ~(s | d)
14625
14626`GL_XOR'
14627 s ^ d
14628
14629`GL_EQUIV'
14630 ~(s ^ d)
14631
14632`GL_AND_REVERSE'
14633 s & ~d
14634
14635`GL_AND_INVERTED'
14636 ~s & d
14637
14638`GL_OR_REVERSE'
14639 s | ~d
14640
14641`GL_OR_INVERTED'
14642 ~s | d
14643
14644OPCODE is a symbolic constant chosen from the list above. In the
14645explanation of the logical operations, S represents the incoming color
14646index and D represents the index in the frame buffer. Standard
14647C-language operators are used. As these bitwise operators suggest, the
14648logical operation is applied independently to each bit pair of the
14649source and destination indices or colors.
14650
14651`GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
14652
14653`GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
14654the execution of `glBegin' and the corresponding execution of `glEnd'.")
14655
25072f02 14656(define-gl-procedures
ca09631c 14657 ((glMap1f
bb894c9d 14658 (target GLenum)
ca09631c
AW
14659 (u1 GLfloat)
14660 (u2 GLfloat)
bb894c9d
AW
14661 (stride GLint)
14662 (order GLint)
00239761 14663 (points const-GLfloat-*)
bb894c9d
AW
14664 ->
14665 void))
3c9b6116
AW
14666 "Define a one-dimensional evaluator.
14667
14668TARGET
14669 Specifies the kind of values that are generated by the evaluator.
14670 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
14671 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
14672 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
14673 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
14674 accepted.
14675
14676U1
14677 U2
14678
14679 Specify a linear mapping of U , as presented to `glEvalCoord1', to
14680 U^ , the variable that is evaluated by the equations specified by
14681 this command.
14682
14683STRIDE
14684 Specifies the number of floats or doubles between the beginning of
14685 one control point and the beginning of the next one in the data
14686 structure referenced in POINTS. This allows control points to be
14687 embedded in arbitrary data structures. The only constraint is that
14688 the values for a particular control point must occupy contiguous
14689 memory locations.
14690
14691ORDER
14692 Specifies the number of control points. Must be positive.
14693
14694POINTS
14695 Specifies a pointer to the array of control points.
14696
14697Evaluators provide a way to use polynomial or rational polynomial
14698mapping to produce vertices, normals, texture coordinates, and colors.
14699The values produced by an evaluator are sent to further stages of GL
14700processing just as if they had been presented using `glVertex',
14701`glNormal', `glTexCoord', and `glColor' commands, except that the
14702generated values do not update the current normal, texture coordinates,
14703or color.
14704
14705All polynomial or rational polynomial splines of any degree (up to the
14706maximum degree supported by the GL implementation) can be described
14707using evaluators. These include almost all splines used in computer
14708graphics: B-splines, Bezier curves, Hermite splines, and so on.
14709
14710Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
14711as
14712
14713P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
14714
14715
14716
14717where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
14718polynomial of degree N (ORDER = N+1 ):
14719
14720B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
14721
14722Recall that
14723
147240^0==1 and ((N), (0),,)==1
14725
14726`glMap1' is used to define the basis and to specify what kind of values
14727are produced. Once defined, a map can be enabled and disabled by calling
14728`glEnable' and `glDisable' with the map name, one of the nine predefined
14729values for TARGET described below. `glEvalCoord1' evaluates the
14730one-dimensional maps that are enabled. When `glEvalCoord1' presents a
14731value U , the Bernstein functions are evaluated using U^ , where
14732U^=U-U1,/U2-U1,
14733
14734TARGET is a symbolic constant that indicates what kind of control points
14735are provided in POINTS, and what output is generated when the map is
14736evaluated. It can assume one of nine predefined values:
14737
14738`GL_MAP1_VERTEX_3'
14739 Each control point is three floating-point values representing X ,
14740 Y , and Z . Internal `glVertex3' commands are generated when the
14741 map is evaluated.
14742
14743`GL_MAP1_VERTEX_4'
14744 Each control point is four floating-point values representing X , Y
14745 , Z , and W . Internal `glVertex4' commands are generated when the
14746 map is evaluated.
14747
14748`GL_MAP1_INDEX'
14749 Each control point is a single floating-point value representing a
14750 color index. Internal `glIndex' commands are generated when the map
14751 is evaluated but the current index is not updated with the value of
14752 these `glIndex' commands.
14753
14754`GL_MAP1_COLOR_4'
14755 Each control point is four floating-point values representing red,
14756 green, blue, and alpha. Internal `glColor4' commands are generated
14757 when the map is evaluated but the current color is not updated with
14758 the value of these `glColor4' commands.
14759
14760`GL_MAP1_NORMAL'
14761 Each control point is three floating-point values representing the
14762 X , Y , and Z components of a normal vector. Internal `glNormal'
14763 commands are generated when the map is evaluated but the current
14764 normal is not updated with the value of these `glNormal' commands.
14765
14766`GL_MAP1_TEXTURE_COORD_1'
14767 Each control point is a single floating-point value representing
14768 the S texture coordinate. Internal `glTexCoord1' commands are
14769 generated when the map is evaluated but the current texture
14770 coordinates are not updated with the value of these `glTexCoord'
14771 commands.
14772
14773`GL_MAP1_TEXTURE_COORD_2'
14774 Each control point is two floating-point values representing the S
14775 and T texture coordinates. Internal `glTexCoord2' commands are
14776 generated when the map is evaluated but the current texture
14777 coordinates are not updated with the value of these `glTexCoord'
14778 commands.
14779
14780`GL_MAP1_TEXTURE_COORD_3'
14781 Each control point is three floating-point values representing the
14782 S , T , and R texture coordinates. Internal `glTexCoord3' commands
14783 are generated when the map is evaluated but the current texture
14784 coordinates are not updated with the value of these `glTexCoord'
14785 commands.
14786
14787`GL_MAP1_TEXTURE_COORD_4'
14788 Each control point is four floating-point values representing the S
14789 , T , R , and Q texture coordinates. Internal `glTexCoord4'
14790 commands are generated when the map is evaluated but the current
14791 texture coordinates are not updated with the value of these
14792 `glTexCoord' commands.
14793
14794STRIDE, ORDER, and POINTS define the array addressing for accessing the
14795control points. POINTS is the location of the first control point, which
14796occupies one, two, three, or four contiguous memory locations, depending
14797on which map is being defined. ORDER is the number of control points in
14798the array. STRIDE specifies how many float or double locations to
14799advance the internal memory pointer to reach the next control point.
14800
14801`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
14802
14803`GL_INVALID_VALUE' is generated if U1 is equal to U2.
14804
14805`GL_INVALID_VALUE' is generated if STRIDE is less than the number of
14806values in a control point.
14807
14808`GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
14809the return value of `GL_MAX_EVAL_ORDER'.
14810
14811`GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
14812execution of `glBegin' and the corresponding execution of `glEnd'.
14813
14814`GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
14815of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
14816
25072f02 14817(define-gl-procedures
ca09631c 14818 ((glMap2f
bb894c9d 14819 (target GLenum)
ca09631c
AW
14820 (u1 GLfloat)
14821 (u2 GLfloat)
bb894c9d
AW
14822 (ustride GLint)
14823 (uorder GLint)
ca09631c
AW
14824 (v1 GLfloat)
14825 (v2 GLfloat)
bb894c9d
AW
14826 (vstride GLint)
14827 (vorder GLint)
00239761 14828 (points const-GLfloat-*)
bb894c9d
AW
14829 ->
14830 void))
3c9b6116
AW
14831 "Define a two-dimensional evaluator.
14832
14833TARGET
14834 Specifies the kind of values that are generated by the evaluator.
14835 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
14836 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
14837 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
14838 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
14839 accepted.
14840
14841U1
14842 U2
14843
14844 Specify a linear mapping of U , as presented to `glEvalCoord2', to
14845 U^ , one of the two variables that are evaluated by the equations
14846 specified by this command. Initially, U1 is 0 and U2 is 1.
14847
14848USTRIDE
14849 Specifies the number of floats or doubles between the beginning of
14850 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
14851 where I and J are the U and V control point indices, respectively.
14852 This allows control points to be embedded in arbitrary data
14853 structures. The only constraint is that the values for a particular
14854 control point must occupy contiguous memory locations. The initial
14855 value of USTRIDE is 0.
14856
14857UORDER
14858 Specifies the dimension of the control point array in the U axis.
14859 Must be positive. The initial value is 1.
14860
14861V1
14862 V2
14863
14864 Specify a linear mapping of V , as presented to `glEvalCoord2', to
14865 V^ , one of the two variables that are evaluated by the equations
14866 specified by this command. Initially, V1 is 0 and V2 is 1.
14867
14868VSTRIDE
14869 Specifies the number of floats or doubles between the beginning of
14870 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
14871 where I and J are the U and V control point indices, respectively.
14872 This allows control points to be embedded in arbitrary data
14873 structures. The only constraint is that the values for a particular
14874 control point must occupy contiguous memory locations. The initial
14875 value of VSTRIDE is 0.
14876
14877VORDER
14878 Specifies the dimension of the control point array in the V axis.
14879 Must be positive. The initial value is 1.
14880
14881POINTS
14882 Specifies a pointer to the array of control points.
14883
14884Evaluators provide a way to use polynomial or rational polynomial
14885mapping to produce vertices, normals, texture coordinates, and colors.
14886The values produced by an evaluator are sent on to further stages of GL
14887processing just as if they had been presented using `glVertex',
14888`glNormal', `glTexCoord', and `glColor' commands, except that the
14889generated values do not update the current normal, texture coordinates,
14890or color.
14891
14892All polynomial or rational polynomial splines of any degree (up to the
14893maximum degree supported by the GL implementation) can be described
14894using evaluators. These include almost all surfaces used in computer
14895graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
14896and so on.
14897
14898Evaluators define surfaces based on bivariate Bernstein polynomials.
14899Define P\u2061(U^,V^) as
14900
14901P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
14902
14903
14904
14905where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
14906polynomial of degree N (UORDER = N+1 )
14907
14908B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
14909
14910and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
14911M+1 )
14912
14913B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
14914
14915Recall that 0^0==1 and ((N), (0),,)==1
14916
14917`glMap2' is used to define the basis and to specify what kind of values
14918are produced. Once defined, a map can be enabled and disabled by calling
14919`glEnable' and `glDisable' with the map name, one of the nine predefined
14920values for TARGET, described below. When `glEvalCoord2' presents values
14921U and V , the bivariate Bernstein polynomials are evaluated using U^ and
14922V^ , where
14923
14924U^=U-U1,/U2-U1,
14925
14926V^=V-V1,/V2-V1,
14927
14928TARGET is a symbolic constant that indicates what kind of control points
14929are provided in POINTS, and what output is generated when the map is
14930evaluated. It can assume one of nine predefined values:
14931
14932`GL_MAP2_VERTEX_3'
14933 Each control point is three floating-point values representing X ,
14934 Y , and Z . Internal `glVertex3' commands are generated when the
14935 map is evaluated.
14936
14937`GL_MAP2_VERTEX_4'
14938 Each control point is four floating-point values representing X , Y
14939 , Z , and W . Internal `glVertex4' commands are generated when the
14940 map is evaluated.
14941
14942`GL_MAP2_INDEX'
14943 Each control point is a single floating-point value representing a
14944 color index. Internal `glIndex' commands are generated when the map
14945 is evaluated but the current index is not updated with the value of
14946 these `glIndex' commands.
14947
14948`GL_MAP2_COLOR_4'
14949 Each control point is four floating-point values representing red,
14950 green, blue, and alpha. Internal `glColor4' commands are generated
14951 when the map is evaluated but the current color is not updated with
14952 the value of these `glColor4' commands.
14953
14954`GL_MAP2_NORMAL'
14955 Each control point is three floating-point values representing the
14956 X , Y , and Z components of a normal vector. Internal `glNormal'
14957 commands are generated when the map is evaluated but the current
14958 normal is not updated with the value of these `glNormal' commands.
14959
14960`GL_MAP2_TEXTURE_COORD_1'
14961 Each control point is a single floating-point value representing
14962 the S texture coordinate. Internal `glTexCoord1' commands are
14963 generated when the map is evaluated but the current texture
14964 coordinates are not updated with the value of these `glTexCoord'
14965 commands.
14966
14967`GL_MAP2_TEXTURE_COORD_2'
14968 Each control point is two floating-point values representing the S
14969 and T texture coordinates. Internal `glTexCoord2' commands are
14970 generated when the map is evaluated but the current texture
14971 coordinates are not updated with the value of these `glTexCoord'
14972 commands.
14973
14974`GL_MAP2_TEXTURE_COORD_3'
14975 Each control point is three floating-point values representing the
14976 S , T , and R texture coordinates. Internal `glTexCoord3' commands
14977 are generated when the map is evaluated but the current texture
14978 coordinates are not updated with the value of these `glTexCoord'
14979 commands.
14980
14981`GL_MAP2_TEXTURE_COORD_4'
14982 Each control point is four floating-point values representing the S
14983 , T , R , and Q texture coordinates. Internal `glTexCoord4'
14984 commands are generated when the map is evaluated but the current
14985 texture coordinates are not updated with the value of these
14986 `glTexCoord' commands.
14987
14988USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
14989for accessing the control points. POINTS is the location of the first
14990control point, which occupies one, two, three, or four contiguous memory
14991locations, depending on which map is being defined. There are
14992UORDER×VORDER control points in the array. USTRIDE specifies how many
14993float or double locations are skipped to advance the internal memory
14994pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
14995specifies how many float or double locations are skipped to advance the
14996internal memory pointer from control point R_I\u2062J, to control point
14997R_I\u2061(J+1,), .
14998
14999`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
15000
15001`GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
15002to V2.
15003
15004`GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
15005than the number of values in a control point.
15006
15007`GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
150081 or greater than the return value of `GL_MAX_EVAL_ORDER'.
15009
15010`GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
15011execution of `glBegin' and the corresponding execution of `glEnd'.
15012
15013`GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
15014of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
15015
25072f02 15016(define-gl-procedures
bb894c9d
AW
15017 ((glMapBuffer
15018 (target GLenum)
15019 (access GLenum)
15020 ->
00239761 15021 void-*)
bb894c9d 15022 (glUnmapBuffer (target GLenum) -> GLboolean))
3c9b6116
AW
15023 "Map a buffer object's data store.
15024
15025TARGET
15026 Specifies the target buffer object being mapped. The symbolic
15027 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
15028 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
15029
15030ACCESS
15031 Specifies the access policy, indicating whether it will be possible
15032 to read from, write to, or both read from and write to the buffer
15033 object's mapped data store. The symbolic constant must be
15034 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
15035
15036`glMapBuffer' maps to the client's address space the entire data store
15037of the buffer object currently bound to TARGET. The data can then be
15038directly read and/or written relative to the returned pointer, depending
15039on the specified ACCESS policy. If the GL is unable to map the buffer
15040object's data store, `glMapBuffer' generates an error and returns
15041`NULL'. This may occur for system-specific reasons, such as low virtual
15042memory availability.
15043
15044If a mapped data store is accessed in a way inconsistent with the
15045specified ACCESS policy, no error is generated, but performance may be
15046negatively impacted and system errors, including program termination,
15047may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
15048a hint, and does in fact constrain the usage of the mapped data store on
15049some GL implementations. In order to achieve the highest performance
15050available, a buffer object's data store should be used in ways
15051consistent with both its specified USAGE and ACCESS parameters.
15052
15053A mapped data store must be unmapped with `glUnmapBuffer' before its
15054buffer object is used. Otherwise an error will be generated by any GL
15055command that attempts to dereference the buffer object's data store.
15056When a data store is unmapped, the pointer to its data store becomes
15057invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
15058contents have become corrupt during the time the data store was mapped.
15059This can occur for system-specific reasons that affect the availability
15060of graphics memory, such as screen mode changes. In such situations,
15061`GL_FALSE' is returned and the data store contents are undefined. An
15062application must detect this rare condition and reinitialize the data
15063store.
15064
15065A buffer object's mapped data store is automatically unmapped when the
15066buffer object is deleted or its data store is recreated with
15067`glBufferData'.
15068
15069`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
15070`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
15071`GL_PIXEL_UNPACK_BUFFER'.
15072
15073`GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
15074`GL_WRITE_ONLY', or `GL_READ_WRITE'.
15075
15076`GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
15077is unable to map the buffer object's data store. This may occur for a
15078variety of system-specific reasons, such as the absence of sufficient
15079remaining virtual memory.
15080
15081`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
15082is bound to TARGET.
15083
15084`GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
15085buffer object whose data store is already mapped.
15086
15087`GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
15088buffer object whose data store is not currently mapped.
15089
15090`GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
15091is executed between the execution of `glBegin' and the corresponding
15092execution of `glEnd'.")
15093
25072f02 15094(define-gl-procedures
ca09631c 15095 ((glMapGrid1f
bb894c9d 15096 (un GLint)
ca09631c
AW
15097 (u1 GLfloat)
15098 (u2 GLfloat)
bb894c9d
AW
15099 ->
15100 void)
ca09631c 15101 (glMapGrid2f
bb894c9d 15102 (un GLint)
ca09631c
AW
15103 (u1 GLfloat)
15104 (u2 GLfloat)
bb894c9d 15105 (vn GLint)
ca09631c
AW
15106 (v1 GLfloat)
15107 (v2 GLfloat)
bb894c9d
AW
15108 ->
15109 void))
3c9b6116
AW
15110 "Define a one- or two-dimensional mesh.
15111
15112UN
15113 Specifies the number of partitions in the grid range interval [U1,
15114 U2]. Must be positive.
15115
15116U1
15117 U2
15118
15119 Specify the mappings for integer grid domain values I=0 and I=UN .
15120
15121VN
15122 Specifies the number of partitions in the grid range interval [V1,
15123 V2] (`glMapGrid2' only).
15124
15125V1
15126 V2
15127
15128 Specify the mappings for integer grid domain values J=0 and J=VN
15129 (`glMapGrid2' only).
15130
15131`glMapGrid' and `glEvalMesh' are used together to efficiently generate
15132and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
15133steps through the integer domain of a one- or two-dimensional grid,
15134whose range is the domain of the evaluation maps specified by `glMap1'
15135and `glMap2'.
15136
15137`glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
15138the I (or I and J ) integer grid coordinates, to the U (or U and V )
15139floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
15140details of how U and V coordinates are evaluated.
15141
15142`glMapGrid1' specifies a single linear mapping such that integer grid
15143coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
15144exactly to U2. All other integer grid coordinates I are mapped so that
15145
15146U=I\u2061(U2-U1,)/UN+U1
15147
15148`glMapGrid2' specifies two such linear mappings. One maps integer grid
15149coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
15150to U2. The other maps integer grid coordinate J=0 exactly to V1, and
15151integer grid coordinate J=VN exactly to V2. Other integer grid
15152coordinates I and J are mapped such that
15153
15154U=I\u2061(U2-U1,)/UN+U1
15155
15156V=J\u2061(V2-V1,)/VN+V1
15157
15158The mappings specified by `glMapGrid' are used identically by
15159`glEvalMesh' and `glEvalPoint'.
15160
15161`GL_INVALID_VALUE' is generated if either UN or VN is not positive.
15162
15163`GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
15164the execution of `glBegin' and the corresponding execution of `glEnd'.")
15165
25072f02 15166(define-gl-procedures
bb894c9d
AW
15167 ((glMaterialf
15168 (face GLenum)
15169 (pname GLenum)
15170 (param GLfloat)
15171 ->
15172 void)
15173 (glMateriali
15174 (face GLenum)
15175 (pname GLenum)
15176 (param GLint)
15177 ->
15178 void))
3c9b6116
AW
15179 "Specify material parameters for the lighting model.
15180
15181FACE
15182 Specifies which face or faces are being updated. Must be one of
15183 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
15184
15185PNAME
15186 Specifies the single-valued material parameter of the face or faces
15187 that is being updated. Must be `GL_SHININESS'.
15188
15189PARAM
15190 Specifies the value that parameter `GL_SHININESS' will be set to.
15191
15192`glMaterial' assigns values to material parameters. There are two
15193matched sets of material parameters. One, the FRONT-FACING set, is used
15194to shade points, lines, bitmaps, and all polygons (when two-sided
15195lighting is disabled), or just front-facing polygons (when two-sided
15196lighting is enabled). The other set, BACK-FACING, is used to shade
15197back-facing polygons only when two-sided lighting is enabled. Refer to
15198the `glLightModel' reference page for details concerning one- and
15199two-sided lighting calculations.
15200
15201`glMaterial' takes three arguments. The first, FACE, specifies whether
15202the `GL_FRONT' materials, the `GL_BACK' materials, or both
15203`GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
15204specifies which of several parameters in one or both sets will be
15205modified. The third, PARAMS, specifies what value or values will be
15206assigned to the specified parameter.
15207
15208Material parameters are used in the lighting equation that is optionally
15209applied to each vertex. The equation is discussed in the `glLightModel'
15210reference page. The parameters that can be specified using `glMaterial',
15211and their interpretations by the lighting equation, are as follows:
15212
15213`GL_AMBIENT'
15214 PARAMS contains four integer or floating-point values that specify
15215 the ambient RGBA reflectance of the material. Integer values are
15216 mapped linearly such that the most positive representable value
15217 maps to 1.0, and the most negative representable value maps to -1.0
15218 . Floating-point values are mapped directly. Neither integer nor
15219 floating-point values are clamped. The initial ambient reflectance
15220 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
15221
15222`GL_DIFFUSE'
15223 PARAMS contains four integer or floating-point values that specify
15224 the diffuse RGBA reflectance of the material. Integer values are
15225 mapped linearly such that the most positive representable value
15226 maps to 1.0, and the most negative representable value maps to -1.0
15227 . Floating-point values are mapped directly. Neither integer nor
15228 floating-point values are clamped. The initial diffuse reflectance
15229 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
15230
15231`GL_SPECULAR'
15232 PARAMS contains four integer or floating-point values that specify
15233 the specular RGBA reflectance of the material. Integer values are
15234 mapped linearly such that the most positive representable value
15235 maps to 1.0, and the most negative representable value maps to -1.0
15236 . Floating-point values are mapped directly. Neither integer nor
15237 floating-point values are clamped. The initial specular reflectance
15238 for both front- and back-facing materials is (0, 0, 0, 1).
15239
15240`GL_EMISSION'
15241 PARAMS contains four integer or floating-point values that specify
15242 the RGBA emitted light intensity of the material. Integer values
15243 are mapped linearly such that the most positive representable value
15244 maps to 1.0, and the most negative representable value maps to -1.0
15245 . Floating-point values are mapped directly. Neither integer nor
15246 floating-point values are clamped. The initial emission intensity
15247 for both front- and back-facing materials is (0, 0, 0, 1).
15248
15249`GL_SHININESS'
15250 PARAMS is a single integer or floating-point value that specifies
15251 the RGBA specular exponent of the material. Integer and
15252 floating-point values are mapped directly. Only values in the range
15253 [0,128] are accepted. The initial specular exponent for both front-
15254 and back-facing materials is 0.
15255
15256`GL_AMBIENT_AND_DIFFUSE'
15257 Equivalent to calling `glMaterial' twice with the same parameter
15258 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
15259
15260`GL_COLOR_INDEXES'
15261 PARAMS contains three integer or floating-point values specifying
15262 the color indices for ambient, diffuse, and specular lighting.
15263 These three values, and `GL_SHININESS', are the only material
15264 values used by the color index mode lighting equation. Refer to the
15265 `glLightModel' reference page for a discussion of color index
15266 lighting.
15267
15268`GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
15269accepted value.
15270
15271`GL_INVALID_VALUE' is generated if a specular exponent outside the range
15272[0,128] is specified.")
15273
25072f02 15274(define-gl-procedures
bb894c9d 15275 ((glMatrixMode (mode GLenum) -> void))
3c9b6116
AW
15276 "Specify which matrix is the current matrix.
15277
15278MODE
15279 Specifies which matrix stack is the target for subsequent matrix
15280 operations. Three values are accepted: `GL_MODELVIEW',
15281 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
15282 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
15283 supported, `GL_COLOR' is also accepted.
15284
15285`glMatrixMode' sets the current matrix mode. MODE can assume one of four
15286values:
15287
15288`GL_MODELVIEW'
15289 Applies subsequent matrix operations to the modelview matrix stack.
15290
15291`GL_PROJECTION'
15292 Applies subsequent matrix operations to the projection matrix
15293 stack.
15294
15295`GL_TEXTURE'
15296 Applies subsequent matrix operations to the texture matrix stack.
15297
15298`GL_COLOR'
15299 Applies subsequent matrix operations to the color matrix stack.
15300
15301To find out which matrix stack is currently the target of all matrix
15302operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
15303value is `GL_MODELVIEW'.
15304
15305`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15306
15307`GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
15308between the execution of `glBegin' and the corresponding execution of
15309`glEnd'.")
15310
25072f02 15311(define-gl-procedures
bb894c9d
AW
15312 ((glMinmax
15313 (target GLenum)
15314 (internalformat GLenum)
15315 (sink GLboolean)
15316 ->
15317 void))
3c9b6116
AW
15318 "Define minmax table.
15319
15320TARGET
15321 The minmax table whose parameters are to be set. Must be
15322 `GL_MINMAX'.
15323
15324INTERNALFORMAT
15325 The format of entries in the minmax table. Must be one of
15326 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15327 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
15328 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15329 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15330 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15331 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
15332 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
15333 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
15334 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
15335
15336SINK
15337 If `GL_TRUE', pixels will be consumed by the minmax process and no
15338 drawing or texture loading will take place. If `GL_FALSE', pixels
15339 will proceed to the final conversion process after minmax.
15340
15341When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
15342compared to the minimum and maximum values for each component, which are
15343stored in the two-element minmax table. (The first element stores the
15344minima, and the second element stores the maxima.) If a pixel component
15345is greater than the corresponding component in the maximum element, then
15346the maximum element is updated with the pixel component value. If a
15347pixel component is less than the corresponding component in the minimum
15348element, then the minimum element is updated with the pixel component
15349value. (In both cases, if the internal format of the minmax table
15350includes luminance, then the R color component of incoming pixels is
15351used for comparison.) The contents of the minmax table may be retrieved
15352at a later time by calling `glGetMinmax'. The minmax operation is
15353enabled or disabled by calling `glEnable' or `glDisable', respectively,
15354with an argument of `GL_MINMAX'.
15355
15356`glMinmax' redefines the current minmax table to have entries of the
15357format specified by INTERNALFORMAT. The maximum element is initialized
15358with the smallest possible component values, and the minimum element is
15359initialized with the largest possible component values. The values in
15360the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
15361pixels are discarded after minmax; no further processing of the pixels
15362takes place, and no drawing, texture loading, or pixel readback will
15363result.
15364
15365
15366
15367`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
15368values.
15369
15370`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
15371allowable values.
15372
15373`GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
15374the execution of `glBegin' and the corresponding execution of `glEnd'.")
15375
25072f02 15376(define-gl-procedures
bb894c9d
AW
15377 ((glMultiDrawArrays
15378 (mode GLenum)
00239761
AW
15379 (first GLint-*)
15380 (count GLsizei-*)
bb894c9d
AW
15381 (primcount GLsizei)
15382 ->
15383 void))
3c9b6116
AW
15384 "Render multiple sets of primitives from array data.
15385
15386MODE
15387 Specifies what kind of primitives to render. Symbolic constants
15388 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15389 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15390 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15391
15392FIRST
15393 Points to an array of starting indices in the enabled arrays.
15394
15395COUNT
15396 Points to an array of the number of indices to be rendered.
15397
15398PRIMCOUNT
15399 Specifies the size of the first and count
15400
15401`glMultiDrawArrays' specifies multiple sets of geometric primitives with
15402very few subroutine calls. Instead of calling a GL procedure to pass
15403each individual vertex, normal, texture coordinate, edge flag, or color,
15404you can prespecify separate arrays of vertices, normals, and colors and
15405use them to construct a sequence of primitives with a single call to
15406`glMultiDrawArrays'.
15407
15408`glMultiDrawArrays' behaves identically to `glDrawArrays' except that
15409PRIMCOUNT separate ranges of elements are specified instead.
15410
15411When `glMultiDrawArrays' is called, it uses COUNT sequential elements
15412from each enabled array to construct a sequence of geometric primitives,
15413beginning with element FIRST. MODE specifies what kind of primitives are
15414constructed, and how the array elements construct those primitives. If
15415`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
15416
15417Vertex attributes that are modified by `glMultiDrawArrays' have an
15418unspecified value after `glMultiDrawArrays' returns. For example, if
15419`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15420after `glMultiDrawArrays' executes. Attributes that aren't modified
15421remain well defined.
15422
15423`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15424
15425`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15426
15427`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15428bound to an enabled array and the buffer object's data store is
15429currently mapped.
15430
15431`GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
15432between the execution of `glBegin' and the corresponding `glEnd'.")
15433
25072f02 15434(define-gl-procedures
bb894c9d
AW
15435 ((glMultiDrawElements
15436 (mode GLenum)
00239761 15437 (count const-GLsizei-*)
bb894c9d 15438 (type GLenum)
00239761 15439 (indices const-GLvoid-**)
bb894c9d
AW
15440 (primcount GLsizei)
15441 ->
15442 void))
3c9b6116
AW
15443 "Render multiple sets of primitives by specifying indices of array data
15444elements.
15445
15446MODE
15447 Specifies what kind of primitives to render. Symbolic constants
15448 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15449 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15450 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15451
15452COUNT
15453 Points to an array of the elements counts.
15454
15455TYPE
15456 Specifies the type of the values in INDICES. Must be one of
15457 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
15458
15459INDICES
15460 Specifies a pointer to the location where the indices are stored.
15461
15462PRIMCOUNT
15463 Specifies the size of the COUNT array.
15464
15465`glMultiDrawElements' specifies multiple sets of geometric primitives
15466with very few subroutine calls. Instead of calling a GL function to pass
15467each individual vertex, normal, texture coordinate, edge flag, or color,
15468you can prespecify separate arrays of vertices, normals, and so on, and
15469use them to construct a sequence of primitives with a single call to
15470`glMultiDrawElements'.
15471
15472`glMultiDrawElements' is identical in operation to `glDrawElements'
15473except that PRIMCOUNT separate lists of elements are specified.
15474
15475Vertex attributes that are modified by `glMultiDrawElements' have an
15476unspecified value after `glMultiDrawElements' returns. For example, if
15477`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15478after `glMultiDrawElements' executes. Attributes that aren't modified
15479maintain their previous values.
15480
15481`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15482
15483`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15484
15485`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15486bound to an enabled array or the element array and the buffer object's
15487data store is currently mapped.
15488
15489`GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
15490between the execution of `glBegin' and the corresponding `glEnd'.")
15491
25072f02 15492(define-gl-procedures
bb894c9d
AW
15493 ((glMultiTexCoord1i
15494 (target GLenum)
15495 (s GLint)
15496 ->
15497 void)
ca09631c 15498 (glMultiTexCoord1f
bb894c9d 15499 (target GLenum)
ca09631c 15500 (s GLfloat)
bb894c9d
AW
15501 ->
15502 void)
15503 (glMultiTexCoord2i
15504 (target GLenum)
15505 (s GLint)
15506 (t GLint)
15507 ->
15508 void)
ca09631c 15509 (glMultiTexCoord2f
bb894c9d 15510 (target GLenum)
ca09631c
AW
15511 (s GLfloat)
15512 (t GLfloat)
bb894c9d
AW
15513 ->
15514 void)
15515 (glMultiTexCoord3i
15516 (target GLenum)
15517 (s GLint)
15518 (t GLint)
15519 (r GLint)
15520 ->
15521 void)
ca09631c 15522 (glMultiTexCoord3f
bb894c9d 15523 (target GLenum)
ca09631c
AW
15524 (s GLfloat)
15525 (t GLfloat)
15526 (r GLfloat)
bb894c9d
AW
15527 ->
15528 void)
15529 (glMultiTexCoord4i
15530 (target GLenum)
15531 (s GLint)
15532 (t GLint)
15533 (r GLint)
15534 (q GLint)
15535 ->
15536 void)
ca09631c 15537 (glMultiTexCoord4f
bb894c9d 15538 (target GLenum)
ca09631c
AW
15539 (s GLfloat)
15540 (t GLfloat)
15541 (r GLfloat)
15542 (q GLfloat)
bb894c9d
AW
15543 ->
15544 void))
3c9b6116
AW
15545 "Set the current texture coordinates.
15546
15547TARGET
15548 Specifies the texture unit whose coordinates should be modified.
15549 The number of texture units is implementation dependent, but must
15550 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
15551 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
15552 implementation-dependent value.
15553
15554S
15555 T
15556
15557 R
15558
15559 Q
15560
15561 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
15562 Not all parameters are present in all forms of the command.
15563
15564`glMultiTexCoord' specifies texture coordinates in one, two, three, or
15565four dimensions. `glMultiTexCoord1' sets the current texture coordinates
15566to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
15567Similarly, `glMultiTexCoord3' specifies the texture coordinates as
15568(S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
15569as (S,TRQ) .
15570
15571The current texture coordinates are part of the data that is associated
15572with each vertex and with the current raster position. Initially, the
15573values for (S,TRQ) are (0,001) .")
15574
25072f02 15575(define-gl-procedures
00239761 15576 ((glMultMatrixf (m const-GLfloat-*) -> void))
3c9b6116
AW
15577 "Multiply the current matrix with the specified matrix.
15578
15579M
15580 Points to 16 consecutive values that are used as the elements of a
15581 4×4 column-major matrix.
15582
15583`glMultMatrix' multiplies the current matrix with the one specified
15584using M, and replaces the current matrix with the product.
15585
15586The current matrix is determined by the current matrix mode (see
15587`glMatrixMode'). It is either the projection matrix, modelview matrix,
15588or the texture matrix.
15589
15590`GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
15591between the execution of `glBegin' and the corresponding execution of
15592`glEnd'.")
15593
25072f02 15594(define-gl-procedures
00239761
AW
15595 ((glMultTransposeMatrixf
15596 (m const-GLfloat-*)
15597 ->
15598 void))
3c9b6116
AW
15599 "Multiply the current matrix with the specified row-major ordered matrix.
15600
15601M
15602 Points to 16 consecutive values that are used as the elements of a
15603 4×4 row-major matrix.
15604
15605`glMultTransposeMatrix' multiplies the current matrix with the one
15606specified using M, and replaces the current matrix with the product.
15607
15608The current matrix is determined by the current matrix mode (see
15609`glMatrixMode'). It is either the projection matrix, modelview matrix,
15610or the texture matrix.
15611
15612`GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
15613executed between the execution of `glBegin' and the corresponding
15614execution of `glEnd'.")
15615
25072f02 15616(define-gl-procedures
bb894c9d
AW
15617 ((glNewList (list GLuint) (mode GLenum) -> void)
15618 (glEndList -> void))
3c9b6116
AW
15619 "Create or replace a display list.
15620
15621LIST
15622 Specifies the display-list name.
15623
15624MODE
15625 Specifies the compilation mode, which can be `GL_COMPILE' or
15626 `GL_COMPILE_AND_EXECUTE'.
15627
15628Display lists are groups of GL commands that have been stored for
15629subsequent execution. Display lists are created with `glNewList'. All
15630subsequent commands are placed in the display list, in the order issued,
15631until `glEndList' is called.
15632
15633`glNewList' has two arguments. The first argument, LIST, is a positive
15634integer that becomes the unique name for the display list. Names can be
15635created and reserved with `glGenLists' and tested for uniqueness with
15636`glIsList'. The second argument, MODE, is a symbolic constant that can
15637assume one of two values:
15638
15639`GL_COMPILE'
15640 Commands are merely compiled.
15641
15642`GL_COMPILE_AND_EXECUTE'
15643 Commands are executed as they are compiled into the display list.
15644
15645Certain commands are not compiled into the display list but are executed
15646immediately, regardless of the display-list mode. These commands are
15647`glAreTexturesResident', `glColorPointer', `glDeleteLists',
15648`glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
15649`glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
15650`glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
15651`glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
15652`glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
15653`glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
15654`glVertexPointer', and all of the `glGet' commands.
15655
15656Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
15657executed immediately and not compiled into the display list when their
15658first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
15659`GL_PROXY_TEXTURE_3D', respectively.
15660
15661When the `ARB_imaging' extension is supported, `glHistogram' executes
15662immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
15663`glColorTable' executes immediately when its first argument is
15664`GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
15665`GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
15666
15667For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
15668extension is supported, `glClientActiveTexture' is not compiled into
15669display lists, but executed immediately.
15670
15671When `glEndList' is encountered, the display-list definition is
15672completed by associating the list with the unique name LIST (specified
15673in the `glNewList' command). If a display list with name LIST already
15674exists, it is replaced only when `glEndList' is called.
15675
15676`GL_INVALID_VALUE' is generated if LIST is 0.
15677
15678`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15679
15680`GL_INVALID_OPERATION' is generated if `glEndList' is called without a
15681preceding `glNewList', or if `glNewList' is called while a display list
15682is being defined.
15683
15684`GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
15685executed between the execution of `glBegin' and the corresponding
15686execution of `glEnd'.
15687
15688`GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
15689compile the display list. If the GL version is 1.1 or greater, no change
15690is made to the previous contents of the display list, if any, and no
15691other change is made to the GL state. (It is as if no attempt had been
15692made to create the new display list.)")
15693
25072f02 15694(define-gl-procedures
bb894c9d
AW
15695 ((glNormalPointer
15696 (type GLenum)
15697 (stride GLsizei)
00239761 15698 (pointer const-GLvoid-*)
bb894c9d
AW
15699 ->
15700 void))
3c9b6116
AW
15701 "Define an array of normals.
15702
15703TYPE
15704 Specifies the data type of each coordinate in the array. Symbolic
15705 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
15706 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
15707
15708STRIDE
15709 Specifies the byte offset between consecutive normals. If STRIDE is
15710 0, the normals are understood to be tightly packed in the array.
15711 The initial value is 0.
15712
15713POINTER
15714 Specifies a pointer to the first coordinate of the first normal in
15715 the array. The initial value is 0.
15716
15717`glNormalPointer' specifies the location and data format of an array of
15718normals to use when rendering. TYPE specifies the data type of each
15719normal coordinate, and STRIDE specifies the byte stride from one normal
15720to the next, allowing vertices and attributes to be packed into a single
15721array or stored in separate arrays. (Single-array storage may be more
15722efficient on some implementations; see `glInterleavedArrays'.)
15723
15724If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
15725target (see `glBindBuffer') while a normal array is specified, POINTER
15726is treated as a byte offset into the buffer object's data store. Also,
15727the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
15728vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
15729
15730When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
15731client-side state, in addition to the current vertex array buffer object
15732binding.
15733
15734To enable and disable the normal array, call `glEnableClientState' and
15735`glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
15736the normal array is used when `glDrawArrays', `glMultiDrawArrays',
15737`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
15738`glArrayElement' is called.
15739
15740`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
15741
15742`GL_INVALID_VALUE' is generated if STRIDE is negative.")
15743
25072f02 15744(define-gl-procedures
ca09631c
AW
15745 ((glNormal3f
15746 (nx GLfloat)
15747 (ny GLfloat)
15748 (nz GLfloat)
bb894c9d
AW
15749 ->
15750 void)
15751 (glNormal3i
15752 (nx GLint)
15753 (ny GLint)
15754 (nz GLint)
15755 ->
15756 void))
3c9b6116
AW
15757 "Set the current normal vector.
15758
15759NX
15760 NY
15761
15762 NZ
15763
15764 Specify the X , Y , and Z coordinates of the new current normal.
15765 The initial value of the current normal is the unit vector, (0, 0,
15766 1).
15767
15768
15769
15770The current normal is set to the given coordinates whenever `glNormal'
15771is issued. Byte, short, or integer arguments are converted to
15772floating-point format with a linear mapping that maps the most positive
15773representable integer value to 1.0 and the most negative representable
15774integer value to -1.0 .
15775
15776Normals specified with `glNormal' need not have unit length. If
15777`GL_NORMALIZE' is enabled, then normals of any length specified with
15778`glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
15779is enabled, normals are scaled by a scaling factor derived from the
15780modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
15781specified normals were of unit length, and that the modelview matrix
15782contain only uniform scales for proper results. To enable and disable
15783normalization, call `glEnable' and `glDisable' with either
15784`GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
15785disabled.")
15786
25072f02 15787(define-gl-procedures
bb894c9d
AW
15788 ((glOrtho
15789 (left GLdouble)
15790 (right GLdouble)
15791 (bottom GLdouble)
15792 (top GLdouble)
15793 (nearVal GLdouble)
15794 (farVal GLdouble)
15795 ->
15796 void))
3c9b6116
AW
15797 "Multiply the current matrix with an orthographic matrix.
15798
15799LEFT
15800 RIGHT
15801
15802 Specify the coordinates for the left and right vertical clipping
15803 planes.
15804
15805BOTTOM
15806 TOP
15807
15808 Specify the coordinates for the bottom and top horizontal clipping
15809 planes.
15810
15811NEARVAL
15812 FARVAL
15813
15814 Specify the distances to the nearer and farther depth clipping
15815 planes. These values are negative if the plane is to be behind the
15816 viewer.
15817
15818`glOrtho' describes a transformation that produces a parallel
15819projection. The current matrix (see `glMatrixMode') is multiplied by
15820this matrix and the result replaces the current matrix, as if
15821`glMultMatrix' were called with the following matrix as its argument:
15822
15823((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
15824-2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
15825
15826where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
15827T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
15828
15829Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
15830and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
15831that are mapped to the lower left and upper right corners of the window,
15832respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
15833specifies the location of the far clipping plane. Both NEARVAL and
15834FARVAL can be either positive or negative.
15835
15836Use `glPushMatrix' and `glPopMatrix' to save and restore the current
15837matrix stack.
15838
15839`GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
15840NEAR = FAR.
15841
15842`GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
15843execution of `glBegin' and the corresponding execution of `glEnd'.")
15844
25072f02 15845(define-gl-procedures
bb894c9d 15846 ((glPassThrough (token GLfloat) -> void))
3c9b6116
AW
15847 "Place a marker in the feedback buffer.
15848
15849TOKEN
15850 Specifies a marker value to be placed in the feedback buffer
15851 following a `GL_PASS_THROUGH_TOKEN'.
15852
15853
15854
15855Feedback is a GL render mode. The mode is selected by calling
15856`glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
15857pixels are produced by rasterization. Instead, information about
15858primitives that would have been rasterized is fed back to the
15859application using the GL. See the `glFeedbackBuffer' reference page for
15860a description of the feedback buffer and the values in it.
15861
15862`glPassThrough' inserts a user-defined marker in the feedback buffer
15863when it is executed in feedback mode. TOKEN is returned as if it were a
15864primitive; it is indicated with its own unique identifying value:
15865`GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
15866respect to the specification of graphics primitives is maintained.
15867
15868`GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
15869between the execution of `glBegin' and the corresponding execution of
15870`glEnd'.")
15871
b002944d
AW
15872(define-gl-procedures
15873 ((glPixelMapfv
15874 (map GLenum)
15875 (mapsize GLsizei)
15876 (values const-GLfloat-*)
15877 ->
15878 void)
15879 (glPixelMapuiv
15880 (map GLenum)
15881 (mapsize GLsizei)
15882 (values const-GLuint-*)
15883 ->
15884 void))
15885 "Set up pixel transfer maps.
15886
15887MAP
15888 Specifies a symbolic map name. Must be one of the following:
15889 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
15890 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
15891 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
15892 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
15893 `GL_PIXEL_MAP_B_TO_B', or `GL_PIXEL_MAP_A_TO_A'.
15894
15895MAPSIZE
15896 Specifies the size of the map being defined.
15897
15898VALUES
15899 Specifies an array of MAPSIZE values.
15900
15901`glPixelMap' sets up translation tables, or MAPS, used by
15902`glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
15903`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
15904`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
15905`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
15906`glTexSubImage3D'. Additionally, if the `ARB_imaging' subset is
15907supported, the routines `glColorTable', `glColorSubTable',
15908`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
15909`glMinmax', and `glSeparableFilter2D'. Use of these maps is described
15910completely in the `glPixelTransfer' reference page, and partly in the
15911reference pages for the pixel and texture image commands. Only the
15912specification of the maps is described in this reference page.
15913
15914MAP is a symbolic map name, indicating one of ten maps to set. MAPSIZE
15915specifies the number of entries in the map, and VALUES is a pointer to
15916an array of MAPSIZE map values.
15917
15918If a non-zero named buffer object is bound to the
15919`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a pixel
15920transfer map is specified, VALUES is treated as a byte offset into the
15921buffer object's data store.
15922
15923The ten maps are as follows:
15924
15925`GL_PIXEL_MAP_I_TO_I'
15926 Maps color indices to color indices.
15927
15928`GL_PIXEL_MAP_S_TO_S'
15929 Maps stencil indices to stencil indices.
15930
15931`GL_PIXEL_MAP_I_TO_R'
15932 Maps color indices to red components.
15933
15934`GL_PIXEL_MAP_I_TO_G'
15935 Maps color indices to green components.
15936
15937`GL_PIXEL_MAP_I_TO_B'
15938 Maps color indices to blue components.
15939
15940`GL_PIXEL_MAP_I_TO_A'
15941 Maps color indices to alpha components.
15942
15943`GL_PIXEL_MAP_R_TO_R'
15944 Maps red components to red components.
15945
15946`GL_PIXEL_MAP_G_TO_G'
15947 Maps green components to green components.
15948
15949`GL_PIXEL_MAP_B_TO_B'
15950 Maps blue components to blue components.
15951
15952`GL_PIXEL_MAP_A_TO_A'
15953 Maps alpha components to alpha components.
15954
15955The entries in a map can be specified as single-precision floating-point
15956numbers, unsigned short integers, or unsigned int integers. Maps that
15957store color component values (all but `GL_PIXEL_MAP_I_TO_I' and
15958`GL_PIXEL_MAP_S_TO_S') retain their values in floating-point format,
15959with unspecified mantissa and exponent sizes. Floating-point values
15960specified by `glPixelMapfv' are converted directly to the internal
15961floating-point format of these maps, then clamped to the range [0,1].
15962Unsigned integer values specified by `glPixelMapusv' and `glPixelMapuiv'
15963are converted linearly such that the largest representable integer maps
15964to 1.0, and 0 maps to 0.0.
15965
15966Maps that store indices, `GL_PIXEL_MAP_I_TO_I' and
15967`GL_PIXEL_MAP_S_TO_S', retain their values in fixed-point format, with
15968an unspecified number of bits to the right of the binary point.
15969Floating-point values specified by `glPixelMapfv' are converted directly
15970to the internal fixed-point format of these maps. Unsigned integer
15971values specified by `glPixelMapusv' and `glPixelMapuiv' specify integer
15972values, with all 0's to the right of the binary point.
15973
15974The following table shows the initial sizes and values for each of the
15975maps. Maps that are indexed by either color or stencil indices must have
15976MAPSIZE = 2^N for some N or the results are undefined. The maximum
15977allowable size for each map depends on the implementation and can be
15978determined by calling `glGet' with argument `GL_MAX_PIXEL_MAP_TABLE'.
15979The single maximum applies to all maps; it is at least 32.
15980
15981*MAP*
15982 *Lookup Index*, *Lookup Value*, *Initial Size*, *Initial Value*
15983
15984`GL_PIXEL_MAP_I_TO_I'
15985 color index , color index , 1 , 0
15986
15987`GL_PIXEL_MAP_S_TO_S'
15988 stencil index , stencil index , 1 , 0
15989
15990`GL_PIXEL_MAP_I_TO_R'
15991 color index , R , 1 , 0
15992
15993`GL_PIXEL_MAP_I_TO_G'
15994 color index , G , 1 , 0
15995
15996`GL_PIXEL_MAP_I_TO_B'
15997 color index , B , 1 , 0
15998
15999`GL_PIXEL_MAP_I_TO_A'
16000 color index , A , 1 , 0
16001
16002`GL_PIXEL_MAP_R_TO_R'
16003 R , R , 1 , 0
16004
16005`GL_PIXEL_MAP_G_TO_G'
16006 G , G , 1 , 0
16007
16008`GL_PIXEL_MAP_B_TO_B'
16009 B , B , 1 , 0
16010
16011`GL_PIXEL_MAP_A_TO_A'
16012 A , A , 1 , 0
16013
16014`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
16015
16016`GL_INVALID_VALUE' is generated if MAPSIZE is less than one or larger
16017than `GL_MAX_PIXEL_MAP_TABLE'.
16018
16019`GL_INVALID_VALUE' is generated if MAP is `GL_PIXEL_MAP_I_TO_I',
16020`GL_PIXEL_MAP_S_TO_S', `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
16021`GL_PIXEL_MAP_I_TO_B', or `GL_PIXEL_MAP_I_TO_A', and MAPSIZE is not a
16022power of two.
16023
16024`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16025bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16026data store is currently mapped.
16027
16028`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16029bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16030unpacked from the buffer object such that the memory reads required
16031would exceed the data store size.
16032
16033`GL_INVALID_OPERATION' is generated by `glPixelMapfv' if a non-zero
16034buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16035VALUES is not evenly divisible into the number of bytes needed to store
16036in memory a GLfloat datum.
16037
16038`GL_INVALID_OPERATION' is generated by `glPixelMapuiv' if a non-zero
16039buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16040VALUES is not evenly divisible into the number of bytes needed to store
16041in memory a GLuint datum.
16042
16043`GL_INVALID_OPERATION' is generated by `glPixelMapusv' if a non-zero
16044buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16045VALUES is not evenly divisible into the number of bytes needed to store
16046in memory a GLushort datum.
16047
16048`GL_INVALID_OPERATION' is generated if `glPixelMap' is executed between
16049the execution of `glBegin' and the corresponding execution of `glEnd'.")
16050
25072f02 16051(define-gl-procedures
bb894c9d
AW
16052 ((glPixelStoref
16053 (pname GLenum)
16054 (param GLfloat)
16055 ->
16056 void)
16057 (glPixelStorei
16058 (pname GLenum)
16059 (param GLint)
16060 ->
16061 void))
3c9b6116
AW
16062 "Set pixel storage modes.
16063
16064PNAME
16065 Specifies the symbolic name of the parameter to be set. Six values
16066 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
16067 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
16068 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
16069 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
16070 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
16071 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
16072 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
16073 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
16074
16075PARAM
16076 Specifies the value that PNAME is set to.
16077
16078`glPixelStore' sets pixel storage modes that affect the operation of
16079subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
16080polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
16081`glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
16082`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
16083`glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
16084supported, pixel storage modes affect convolution filters (see
16085`glConvolutionFilter1D', `glConvolutionFilter2D', and
16086`glSeparableFilter2D', color table (see `glColorTable', and
16087`glColorSubTable', and unpacking histogram (See `glHistogram'), and
16088minmax (See `glMinmax') data.
16089
16090PNAME is a symbolic constant indicating the parameter to be set, and
16091PARAM is the new value. Six of the twelve storage parameters affect how
16092pixel data is returned to client memory. They are as follows:
16093
16094`GL_PACK_SWAP_BYTES'
16095 If true, byte ordering for multibyte color components, depth
16096 components, color indices, or stencil indices is reversed. That is,
16097 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16098 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
16099 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
16100 the memory order of components within a pixel, only on the order of
16101 bytes within components or indices. For example, the three
16102 components of a `GL_RGB' format pixel are always stored with red
16103 first, green second, and blue third, regardless of the value of
16104 `GL_PACK_SWAP_BYTES'.
16105
16106`GL_PACK_LSB_FIRST'
16107 If true, bits are ordered within a byte from least significant to
16108 most significant; otherwise, the first bit in each byte is the most
16109 significant one. This parameter is significant for bitmap data
16110 only.
16111
16112`GL_PACK_ROW_LENGTH'
16113 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
16114 pixels in a row. If the first pixel of a row is placed at location
16115 P in memory, then the location of the first pixel of the next row
16116 is obtained by skipping
16117
16118 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16119
16120 components or indices, where N is the number of components or
16121 indices in a pixel, L is the number of pixels in a row
16122 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16123 to the pixel routine otherwise), A is the value of
16124 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16125 component (if A<S , then it is as if A=S ). In the case of 1-bit
16126 values, the location of the next row is obtained by skipping
16127
16128 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16129
16130 components or indices.
16131
16132 The word COMPONENT in this description refers to the nonindex
16133 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16134 for example, has three components per pixel: first red, then green,
16135 and finally blue.
16136
16137`GL_PACK_IMAGE_HEIGHT'
16138 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
16139 pixels in an image three-dimensional texture volume, where
16140 ``image'' is defined by all pixels sharing the same third dimension
16141 index. If the first pixel of a row is placed at location P in
16142 memory, then the location of the first pixel of the next row is
16143 obtained by skipping
16144
16145 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16146
16147 components or indices, where N is the number of components or
16148 indices in a pixel, L is the number of pixels in a row
16149 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16150 to `glTexImage3D' otherwise), H is the number of rows in a pixel
16151 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16152 argument to the `glTexImage3D' routine otherwise), A is the value
16153 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16154 component (if A<S , then it is as if A=S ).
16155
16156 The word COMPONENT in this description refers to the nonindex
16157 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16158 for example, has three components per pixel: first red, then green,
16159 and finally blue.
16160
16161`GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
16162 These values are provided as a convenience to the programmer; they
16163 provide no functionality that cannot be duplicated simply by
16164 incrementing the pointer passed to `glReadPixels'. Setting
16165 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
16166 pointer by I\u2062N components or indices, where N is the number of
16167 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
16168 J is equivalent to incrementing the pointer by J\u2062M components or
16169 indices, where M is the number of components or indices per row, as
16170 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
16171 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
16172 pointer by K\u2062P , where P is the number of components or indices per
16173 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
16174
16175`GL_PACK_ALIGNMENT'
16176 Specifies the alignment requirements for the start of each pixel
16177 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16178 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16179 start on double-word boundaries).
16180
16181The other six of the twelve storage parameters affect how pixel data is
16182read from client memory. These values are significant for
16183`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
16184`glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
16185`glPolygonStipple'.
16186
16187Additionally, if the `ARB_imaging' extension is supported,
16188`glColorTable', `glColorSubTable', `glConvolutionFilter1D',
16189`glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
16190
16191`GL_UNPACK_SWAP_BYTES'
16192 If true, byte ordering for multibyte color components, depth
16193 components, color indices, or stencil indices is reversed. That is,
16194 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16195 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
16196 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
16197 effect on the memory order of components within a pixel, only on
16198 the order of bytes within components or indices. For example, the
16199 three components of a `GL_RGB' format pixel are always stored with
16200 red first, green second, and blue third, regardless of the value of
16201 `GL_UNPACK_SWAP_BYTES'.
16202
16203`GL_UNPACK_LSB_FIRST'
16204 If true, bits are ordered within a byte from least significant to
16205 most significant; otherwise, the first bit in each byte is the most
16206 significant one. This is relevant only for bitmap data.
16207
16208`GL_UNPACK_ROW_LENGTH'
16209 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
16210 pixels in a row. If the first pixel of a row is placed at location
16211 P in memory, then the location of the first pixel of the next row
16212 is obtained by skipping
16213
16214 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16215
16216 components or indices, where N is the number of components or
16217 indices in a pixel, L is the number of pixels in a row
16218 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16219 to the pixel routine otherwise), A is the value of
16220 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16221 component (if A<S , then it is as if A=S ). In the case of 1-bit
16222 values, the location of the next row is obtained by skipping
16223
16224 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16225
16226 components or indices.
16227
16228 The word COMPONENT in this description refers to the nonindex
16229 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16230 for example, has three components per pixel: first red, then green,
16231 and finally blue.
16232
16233`GL_UNPACK_IMAGE_HEIGHT'
16234 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
16235 pixels in an image of a three-dimensional texture volume. Where
16236 ``image'' is defined by all pixel sharing the same third dimension
16237 index. If the first pixel of a row is placed at location P in
16238 memory, then the location of the first pixel of the next row is
16239 obtained by skipping
16240
16241 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16242
16243 components or indices, where N is the number of components or
16244 indices in a pixel, L is the number of pixels in a row
16245 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16246 to `glTexImage3D' otherwise), H is the number of rows in an image
16247 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16248 argument to `glTexImage3D' otherwise), A is the value of
16249 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16250 component (if A<S , then it is as if A=S ).
16251
16252 The word COMPONENT in this description refers to the nonindex
16253 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16254 for example, has three components per pixel: first red, then green,
16255 and finally blue.
16256
16257`GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
16258 These values are provided as a convenience to the programmer; they
16259 provide no functionality that cannot be duplicated by incrementing
16260 the pointer passed to `glDrawPixels', `glTexImage1D',
16261 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
16262 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
16263 equivalent to incrementing the pointer by I\u2062N components or
16264 indices, where N is the number of components or indices in each
16265 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
16266 incrementing the pointer by J\u2062K components or indices, where K is
16267 the number of components or indices per row, as just computed in
16268 the `GL_UNPACK_ROW_LENGTH' section.
16269
16270`GL_UNPACK_ALIGNMENT'
16271 Specifies the alignment requirements for the start of each pixel
16272 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16273 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16274 start on double-word boundaries).
16275
16276The following table gives the type, initial value, and range of valid
16277values for each storage parameter that can be set with `glPixelStore'.
16278
16279
16280
16281*PNAME*
16282 *Type*, *Initial Value*, *Valid Range*
16283
16284`GL_PACK_SWAP_BYTES'
16285 boolean , false , true or false
16286
16287`GL_PACK_LSB_FIRST'
16288 boolean , false , true or false
16289
16290`GL_PACK_ROW_LENGTH'
16291 integer , 0 , [0,∞)
16292
16293`GL_PACK_IMAGE_HEIGHT'
16294 integer , 0 , [0,∞)
16295
16296`GL_PACK_SKIP_ROWS'
16297 integer , 0 , [0,∞)
16298
16299`GL_PACK_SKIP_PIXELS'
16300 integer , 0 , [0,∞)
16301
16302`GL_PACK_SKIP_IMAGES'
16303 integer , 0 , [0,∞)
16304
16305`GL_PACK_ALIGNMENT'
16306 integer , 4 , 1, 2, 4, or 8
16307
16308`GL_UNPACK_SWAP_BYTES'
16309 boolean , false , true or false
16310
16311`GL_UNPACK_LSB_FIRST'
16312 boolean , false , true or false
16313
16314`GL_UNPACK_ROW_LENGTH'
16315 integer , 0 , [0,∞)
16316
16317`GL_UNPACK_IMAGE_HEIGHT'
16318 integer , 0 , [0,∞)
16319
16320`GL_UNPACK_SKIP_ROWS'
16321 integer , 0 , [0,∞)
16322
16323`GL_UNPACK_SKIP_PIXELS'
16324 integer , 0 , [0,∞)
16325
16326`GL_UNPACK_SKIP_IMAGES'
16327 integer , 0 , [0,∞)
16328
16329`GL_UNPACK_ALIGNMENT'
16330 integer , 4 , 1, 2, 4, or 8
16331
16332`glPixelStoref' can be used to set any pixel store parameter. If the
16333parameter type is boolean, then if PARAM is 0, the parameter is false;
16334otherwise it is set to true. If PNAME is a integer type parameter, PARAM
16335is rounded to the nearest integer.
16336
16337Likewise, `glPixelStorei' can also be used to set any of the pixel store
16338parameters. Boolean parameters are set to false if PARAM is 0 and true
16339otherwise.
16340
16341`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
16342
16343`GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
16344row skip value is specified, or if alignment is specified as other than
163451, 2, 4, or 8.
16346
16347`GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
16348between the execution of `glBegin' and the corresponding execution of
16349`glEnd'.")
16350
25072f02 16351(define-gl-procedures
bb894c9d
AW
16352 ((glPixelTransferf
16353 (pname GLenum)
16354 (param GLfloat)
16355 ->
16356 void)
16357 (glPixelTransferi
16358 (pname GLenum)
16359 (param GLint)
16360 ->
16361 void))
3c9b6116
AW
16362 "Set pixel transfer modes.
16363
16364PNAME
16365 Specifies the symbolic name of the pixel transfer parameter to be
16366 set. Must be one of the following: `GL_MAP_COLOR',
16367 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
16368 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
16369 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
16370 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
16371
16372 Additionally, if the `ARB_imaging' extension is supported, the
16373 following symbolic names are accepted:
16374 `GL_POST_COLOR_MATRIX_RED_SCALE',
16375 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
16376 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
16377 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
16378 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
16379 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
16380 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
16381 `GL_POST_CONVOLUTION_GREEN_SCALE',
16382 `GL_POST_CONVOLUTION_BLUE_SCALE',
16383 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
16384 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
16385 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
16386
16387PARAM
16388 Specifies the value that PNAME is set to.
16389
16390`glPixelTransfer' sets pixel transfer modes that affect the operation of
16391subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
16392`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
16393`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
16394`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
16395`glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
16396supported, the routines `glColorTable', `glColorSubTable',
16397`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
16398`glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
16399that are specified by pixel transfer modes operate on pixels after they
16400are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
16401`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
16402`glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
16403memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
16404`glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
16405transfer operations happen in the same order, and in the same manner,
16406regardless of the command that resulted in the pixel operation. Pixel
16407storage modes (see `glPixelStore') control the unpacking of pixels being
16408read from client memory and the packing of pixels being written back
16409into client memory.
16410
16411Pixel transfer operations handle four fundamental pixel types: COLOR,
16412COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
16413floating-point values with unspecified mantissa and exponent sizes,
16414scaled such that 0 represents zero intensity and 1 represents full
16415intensity. COLOR INDICES comprise a single fixed-point value, with
16416unspecified precision to the right of the binary point. DEPTH pixels
16417comprise a single floating-point value, with unspecified mantissa and
16418exponent sizes, scaled such that 0.0 represents the minimum depth buffer
16419value, and 1.0 represents the maximum depth buffer value. Finally,
16420STENCIL pixels comprise a single fixed-point value, with unspecified
16421precision to the right of the binary point.
16422
16423The pixel transfer operations performed on the four basic pixel types
16424are as follows:
16425
16426COLOR
16427 Each of the four color components is multiplied by a scale factor,
16428 then added to a bias factor. That is, the red component is
16429 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
16430 green component is multiplied by `GL_GREEN_SCALE', then added to
16431 `GL_GREEN_BIAS'; the blue component is multiplied by
16432 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
16433 component is multiplied by `GL_ALPHA_SCALE', then added to
16434 `GL_ALPHA_BIAS'. After all four color components are scaled and
16435 biased, each is clamped to the range [0,1] . All color, scale, and
16436 bias values are specified with `glPixelTransfer'.
16437
16438 If `GL_MAP_COLOR' is true, each color component is scaled by the
16439 size of the corresponding color-to-color map, then replaced by the
16440 contents of that map indexed by the scaled component. That is, the
16441 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
16442 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
16443 itself. The green component is scaled by
16444 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
16445 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
16446 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
16447 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
16448 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
16449 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
16450 taken from the maps are then clamped to the range [0,1] .
16451 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
16452 the various maps are specified with `glPixelMap'.
16453
16454 If the `ARB_imaging' extension is supported, each of the four color
16455 components may be scaled and biased after transformation by the
16456 color matrix. That is, the red component is multiplied by
16457 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
16458 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
16459 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
16460 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
16461 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
16462 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
16463 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
16464 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
16465 are scaled and biased, each is clamped to the range [0,1] .
16466
16467 Similarly, if the `ARB_imaging' extension is supported, each of the
16468 four color components may be scaled and biased after processing by
16469 the enabled convolution filter. That is, the red component is
16470 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
16471 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
16472 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
16473 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
16474 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
16475 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
16476 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
16477 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
16478 are scaled and biased, each is clamped to the range [0,1] .
16479
16480COLOR INDEX
16481 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
16482 beyond the number of fraction bits carried by the fixed-point index
16483 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
16484 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
16485 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
16486 with `glPixelTransfer'.
16487
16488 From this point, operation diverges depending on the required
16489 format of the resulting pixels. If the resulting pixels are to be
16490 written to a color index buffer, or if they are being read back to
16491 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
16492 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
16493 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
16494 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
16495 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
16496 the index map is specified with `glPixelMap'.
16497
16498 If the resulting pixels are to be written to an RGBA color buffer,
16499 or if they are read back to client memory in a format other than
16500 `GL_COLOR_INDEX', the pixels are converted from indices to colors
16501 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
16502 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
16503 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
16504 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
16505 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
16506 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
16507 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
16508 from the maps are then clamped to the range [0,1] . The contents of
16509 the four maps is specified with `glPixelMap'.
16510
16511DEPTH
16512 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
16513 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
16514
16515STENCIL
16516 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
16517 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
16518 each index is masked by 2^N-1 , where N is
16519 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
16520 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
16521
16522The following table gives the type, initial value, and range of valid
16523values for each of the pixel transfer parameters that are set with
16524`glPixelTransfer'.
16525
16526
16527
16528*PNAME*
16529 *Type*, *Initial Value*, *Valid Range*
16530
16531`GL_MAP_COLOR'
16532 boolean , false , true/false
16533
16534`GL_MAP_STENCIL'
16535 boolean , false , true/false
16536
16537`GL_INDEX_SHIFT'
16538 integer , 0 , (-∞,∞)
16539
16540`GL_INDEX_OFFSET'
16541 integer , 0 , (-∞,∞)
16542
16543`GL_RED_SCALE'
16544 float , 1 , (-∞,∞)
16545
16546`GL_GREEN_SCALE'
16547 float , 1 , (-∞,∞)
16548
16549`GL_BLUE_SCALE'
16550 float , 1 , (-∞,∞)
16551
16552`GL_ALPHA_SCALE'
16553 float , 1 , (-∞,∞)
16554
16555`GL_DEPTH_SCALE'
16556 float , 1 , (-∞,∞)
16557
16558`GL_RED_BIAS'
16559 float , 0 , (-∞,∞)
16560
16561`GL_GREEN_BIAS'
16562 float , 0 , (-∞,∞)
16563
16564`GL_BLUE_BIAS'
16565 float , 0 , (-∞,∞)
16566
16567`GL_ALPHA_BIAS'
16568 float , 0 , (-∞,∞)
16569
16570`GL_DEPTH_BIAS'
16571 float , 0 , (-∞,∞)
16572
16573`GL_POST_COLOR_MATRIX_RED_SCALE'
16574 float , 1 , (-∞,∞)
16575
16576`GL_POST_COLOR_MATRIX_GREEN_SCALE'
16577 float , 1 , (-∞,∞)
16578
16579`GL_POST_COLOR_MATRIX_BLUE_SCALE'
16580 float , 1 , (-∞,∞)
16581
16582`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
16583 float , 1 , (-∞,∞)
16584
16585`GL_POST_COLOR_MATRIX_RED_BIAS'
16586 float , 0 , (-∞,∞)
16587
16588`GL_POST_COLOR_MATRIX_GREEN_BIAS'
16589 float , 0 , (-∞,∞)
16590
16591`GL_POST_COLOR_MATRIX_BLUE_BIAS'
16592 float , 0 , (-∞,∞)
16593
16594`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
16595 float , 0 , (-∞,∞)
16596
16597`GL_POST_CONVOLUTION_RED_SCALE'
16598 float , 1 , (-∞,∞)
16599
16600`GL_POST_CONVOLUTION_GREEN_SCALE'
16601 float , 1 , (-∞,∞)
16602
16603`GL_POST_CONVOLUTION_BLUE_SCALE'
16604 float , 1 , (-∞,∞)
16605
16606`GL_POST_CONVOLUTION_ALPHA_SCALE'
16607 float , 1 , (-∞,∞)
16608
16609`GL_POST_CONVOLUTION_RED_BIAS'
16610 float , 0 , (-∞,∞)
16611
16612`GL_POST_CONVOLUTION_GREEN_BIAS'
16613 float , 0 , (-∞,∞)
16614
16615`GL_POST_CONVOLUTION_BLUE_BIAS'
16616 float , 0 , (-∞,∞)
16617
16618`GL_POST_CONVOLUTION_ALPHA_BIAS'
16619 float , 0 , (-∞,∞)
16620
16621`glPixelTransferf' can be used to set any pixel transfer parameter. If
16622the parameter type is boolean, 0 implies false and any other value
16623implies true. If PNAME is an integer parameter, PARAM is rounded to the
16624nearest integer.
16625
16626Likewise, `glPixelTransferi' can be used to set any of the pixel
16627transfer parameters. Boolean parameters are set to false if PARAM is 0
16628and to true otherwise. PARAM is converted to floating point before being
16629assigned to real-valued parameters.
16630
16631`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
16632
16633`GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
16634between the execution of `glBegin' and the corresponding execution of
16635`glEnd'.")
16636
25072f02 16637(define-gl-procedures
bb894c9d
AW
16638 ((glPixelZoom
16639 (xfactor GLfloat)
16640 (yfactor GLfloat)
16641 ->
16642 void))
3c9b6116
AW
16643 "Specify the pixel zoom factors.
16644
16645XFACTOR
16646 YFACTOR
16647
16648 Specify the X and Y zoom factors for pixel write operations.
16649
16650`glPixelZoom' specifies values for the X and Y zoom factors. During the
16651execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
16652current raster position, and a given element is in the M th row and N th
16653column of the pixel rectangle, then pixels whose centers are in the
16654rectangle with corners at
16655
16656(XR+N·XFACTOR , YR+M·YFACTOR )
16657
16658(XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
16659
16660are candidates for replacement. Any pixel whose center lies on the
16661bottom or left edge of this rectangular region is also modified.
16662
16663Pixel zoom factors are not limited to positive values. Negative zoom
16664factors reflect the resulting image about the current raster position.
16665
16666`GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
16667the execution of `glBegin' and the corresponding execution of `glEnd'.")
16668
25072f02 16669(define-gl-procedures
bb894c9d
AW
16670 ((glPointParameterf
16671 (pname GLenum)
16672 (param GLfloat)
16673 ->
16674 void)
16675 (glPointParameteri
16676 (pname GLenum)
16677 (param GLint)
16678 ->
16679 void))
3c9b6116
AW
16680 "Specify point parameters.
16681
16682PNAME
16683 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
16684 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
16685 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
16686
16687PARAM
16688 Specifies the value that PNAME will be set to.
16689
16690The following values are accepted for PNAME:
16691
16692`GL_POINT_SIZE_MIN'
16693
16694
16695 PARAMS is a single floating-point value that specifies the minimum
16696 point size. The default value is 0.0.
16697
16698`GL_POINT_SIZE_MAX'
16699
16700
16701 PARAMS is a single floating-point value that specifies the maximum
16702 point size. The default value is 1.0.
16703
16704`GL_POINT_FADE_THRESHOLD_SIZE'
16705
16706
16707 PARAMS is a single floating-point value that specifies the
16708 threshold value to which point sizes are clamped if they exceed the
16709 specified value. The default value is 1.0.
16710
16711`GL_POINT_DISTANCE_ATTENUATION'
16712
16713
16714 PARAMS is an array of three floating-point values that specify the
16715 coefficients used for scaling the computed point size. The default
16716 values are (1,00) .
16717
16718`GL_POINT_SPRITE_COORD_ORIGIN'
16719
16720
16721 PARAMS is a single enum specifying the point sprite texture
16722 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
16723 default value is `GL_UPPER_LEFT'.
16724
16725`GL_INVALID_VALUE' is generated If the value specified for
16726`GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
16727`GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
16728
16729`GL_INVALID_ENUM' is generated If the value specified for
16730`GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
16731`GL_UPPER_LEFT'.
16732
16733If the value for `GL_POINT_SIZE_MIN' is greater than
16734`GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
16735error is generated.")
16736
25072f02 16737(define-gl-procedures
bb894c9d 16738 ((glPointSize (size GLfloat) -> void))
3c9b6116
AW
16739 "Specify the diameter of rasterized points.
16740
16741SIZE
16742 Specifies the diameter of rasterized points. The initial value is
16743 1.
16744
16745`glPointSize' specifies the rasterized diameter of both aliased and
16746antialiased points. Using a point size other than 1 has different
16747effects, depending on whether point antialiasing is enabled. To enable
16748and disable point antialiasing, call `glEnable' and `glDisable' with
16749argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
16750
16751The specified point size is multiplied with a distance attenuation
16752factor and clamped to the specified point size range, and further
16753clamped to the implementation-dependent point size range to produce the
16754derived point size using
16755
16756POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
16757
16758where D is the eye-coordinate distance from the eye to the vertex, and A
16759, B , and C are the distance attenuation coefficients (see
16760`glPointParameter').
16761
16762If multisampling is disabled, the computed point size is used as the
16763point's width.
16764
16765If multisampling is enabled, the point may be faded by modifying the
16766point alpha value (see `glSampleCoverage') instead of allowing the point
16767width to go below a given threshold (see `glPointParameter'). In this
16768case, the width is further modified in the following manner:
16769
16770POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
16771(OTHERWISE),
16772
16773The point alpha value is modified by computing:
16774
16775POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
16776(OTHERWISE),
16777
16778If point antialiasing is disabled, the actual size is determined by
16779rounding the supplied size to the nearest integer. (If the rounding
16780results in the value 0, it is as if the point size were 1.) If the
16781rounded size is odd, then the center point (X , Y ) of the pixel
16782fragment that represents the point is computed as
16783
16784(⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
16785
16786where W subscripts indicate window coordinates. All pixels that lie
16787within the square grid of the rounded size centered at (X , Y ) make up
16788the fragment. If the size is even, the center point is
16789
16790(⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
16791
16792and the rasterized fragment's centers are the half-integer window
16793coordinates within the square of the rounded size centered at (X,Y) .
16794All pixel fragments produced in rasterizing a nonantialiased point are
16795assigned the same associated data, that of the vertex corresponding to
16796the point.
16797
16798If antialiasing is enabled, then point rasterization produces a fragment
16799for each pixel square that intersects the region lying within the circle
16800having diameter equal to the current point size and centered at the
16801point's (X_W,Y_W) . The coverage value for each fragment is the window
16802coordinate area of the intersection of the circular region with the
16803corresponding pixel square. This value is saved and used in the final
16804rasterization step. The data associated with each fragment is the data
16805associated with the point being rasterized.
16806
16807Not all sizes are supported when point antialiasing is enabled. If an
16808unsupported size is requested, the nearest supported size is used. Only
16809size 1 is guaranteed to be supported; others depend on the
16810implementation. To query the range of supported sizes and the size
16811difference between supported sizes within the range, call `glGet' with
16812arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
16813`GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
16814supported ranges and granularity with `glGet' with arguments
16815`GL_ALIASED_POINT_SIZE_RANGE'.
16816
16817`GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
16818
16819`GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
16820the execution of `glBegin' and the corresponding execution of `glEnd'.")
16821
25072f02 16822(define-gl-procedures
bb894c9d
AW
16823 ((glPolygonMode
16824 (face GLenum)
16825 (mode GLenum)
16826 ->
16827 void))
3c9b6116
AW
16828 "Select a polygon rasterization mode.
16829
16830FACE
16831 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
16832 front-facing polygons, `GL_BACK' for back-facing polygons, or
16833 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
16834
16835MODE
16836 Specifies how polygons will be rasterized. Accepted values are
16837 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
16838 `GL_FILL' for both front- and back-facing polygons.
16839
16840`glPolygonMode' controls the interpretation of polygons for
16841rasterization. FACE describes which polygons MODE applies to:
16842front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
16843both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
16844rasterization of polygons. In particular, a polygon's vertices are lit
16845and the polygon is clipped and possibly culled before these modes are
16846applied.
16847
16848Three modes are defined and can be specified in MODE:
16849
16850`GL_POINT'
16851 Polygon vertices that are marked as the start of a boundary edge
16852 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
16853 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
16854 rasterization attributes other than `GL_POLYGON_MODE' have no
16855 effect.
16856
16857`GL_LINE'
16858 Boundary edges of the polygon are drawn as line segments. They are
16859 treated as connected line segments for line stippling; the line
16860 stipple counter and pattern are not reset between segments (see
16861 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
16862 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
16863 rasterization attributes other than `GL_POLYGON_MODE' have no
16864 effect.
16865
16866`GL_FILL'
16867 The interior of the polygon is filled. Polygon attributes such as
16868 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
16869 rasterization of the polygon.
16870
16871`GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
16872value.
16873
16874`GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
16875between the execution of `glBegin' and the corresponding execution of
16876`glEnd'.")
16877
25072f02 16878(define-gl-procedures
bb894c9d
AW
16879 ((glPolygonOffset
16880 (factor GLfloat)
16881 (units GLfloat)
16882 ->
16883 void))
3c9b6116
AW
16884 "Set the scale and units used to calculate depth values.
16885
16886FACTOR
16887 Specifies a scale factor that is used to create a variable depth
16888 offset for each polygon. The initial value is 0.
16889
16890UNITS
16891 Is multiplied by an implementation-specific value to create a
16892 constant depth offset. The initial value is 0.
16893
16894When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
16895`GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
16896be offset after it is interpolated from the DEPTH values of the
16897appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
16898where DZ is a measurement of the change in depth relative to the screen
16899area of the polygon, and R is the smallest value that is guaranteed to
16900produce a resolvable offset for a given implementation. The offset is
16901added before the depth test is performed and before the value is written
16902into the depth buffer.
16903
16904`glPolygonOffset' is useful for rendering hidden-line images, for
16905applying decals to surfaces, and for rendering solids with highlighted
16906edges.
16907
16908`GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
16909between the execution of `glBegin' and the corresponding execution of
16910`glEnd'.")
16911
25072f02 16912(define-gl-procedures
00239761
AW
16913 ((glPolygonStipple
16914 (pattern const-GLubyte-*)
16915 ->
16916 void))
3c9b6116
AW
16917 "Set the polygon stippling pattern.
16918
16919PATTERN
16920 Specifies a pointer to a 32×32 stipple pattern that will be
16921 unpacked from memory in the same way that `glDrawPixels' unpacks
16922 pixels.
16923
16924Polygon stippling, like line stippling (see `glLineStipple'), masks out
16925certain fragments produced by rasterization, creating a pattern.
16926Stippling is independent of polygon antialiasing.
16927
16928PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
16929just like the pixel data supplied to a `glDrawPixels' call with height
16930and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
16931type of `GL_BITMAP'. That is, the stipple pattern is represented as a
1693232×32 array of 1-bit color indices packed in unsigned bytes.
16933`glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
16934`GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
16935pattern. Pixel transfer operations (shift, offset, pixel map) are not
16936applied to the stipple image, however.
16937
16938If a non-zero named buffer object is bound to the
16939`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
16940pattern is specified, PATTERN is treated as a byte offset into the
16941buffer object's data store.
16942
16943To enable and disable polygon stippling, call `glEnable' and `glDisable'
16944with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
16945disabled. If it's enabled, a rasterized polygon fragment with window
16946coordinates X_W and Y_W is sent to the next stage of the GL if and only
16947if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
169481 (one). When polygon stippling is disabled, it is as if the stipple
16949pattern consists of all 1's.
16950
16951`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16952bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16953data store is currently mapped.
16954
16955`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16956bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16957unpacked from the buffer object such that the memory reads required
16958would exceed the data store size.
16959
16960`GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
16961between the execution of `glBegin' and the corresponding execution of
16962`glEnd'.")
16963
25072f02 16964(define-gl-procedures
bb894c9d
AW
16965 ((glPrioritizeTextures
16966 (n GLsizei)
00239761
AW
16967 (textures const-GLuint-*)
16968 (priorities const-GLclampf-*)
bb894c9d
AW
16969 ->
16970 void))
3c9b6116
AW
16971 "Set texture residence priority.
16972
16973N
16974 Specifies the number of textures to be prioritized.
16975
16976TEXTURES
16977 Specifies an array containing the names of the textures to be
16978 prioritized.
16979
16980PRIORITIES
16981 Specifies an array containing the texture priorities. A priority
16982 given in an element of PRIORITIES applies to the texture named by
16983 the corresponding element of TEXTURES.
16984
16985`glPrioritizeTextures' assigns the N texture priorities given in
16986PRIORITIES to the N textures named in TEXTURES.
16987
16988The GL establishes a ``working set'' of textures that are resident in
16989texture memory. These textures may be bound to a texture target much
16990more efficiently than textures that are not resident. By specifying a
16991priority for each texture, `glPrioritizeTextures' allows applications to
16992guide the GL implementation in determining which textures should be
16993resident.
16994
16995The priorities given in PRIORITIES are clamped to the range [0,1] before
16996they are assigned. 0 indicates the lowest priority; textures with
16997priority 0 are least likely to be resident. 1 indicates the highest
16998priority; textures with priority 1 are most likely to be resident.
16999However, textures are not guaranteed to be resident until they are used.
17000
17001`glPrioritizeTextures' silently ignores attempts to prioritize texture 0
17002or any texture name that does not correspond to an existing texture.
17003
17004`glPrioritizeTextures' does not require that any of the textures named
17005by TEXTURES be bound to a texture target. `glTexParameter' may also be
17006used to set a texture's priority, but only if the texture is currently
17007bound. This is the only way to set the priority of a default texture.
17008
17009`GL_INVALID_VALUE' is generated if N is negative.
17010
17011`GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
17012executed between the execution of `glBegin' and the corresponding
17013execution of `glEnd'.")
17014
25072f02 17015(define-gl-procedures
bb894c9d
AW
17016 ((glPushAttrib (mask GLbitfield) -> void)
17017 (glPopAttrib -> void))
3c9b6116
AW
17018 "Push and pop the server attribute stack.
17019
17020MASK
17021 Specifies a mask that indicates which attributes to save. Values
17022 for MASK are listed below.
17023
17024`glPushAttrib' takes one argument, a mask that indicates which groups of
17025state variables to save on the attribute stack. Symbolic constants are
17026used to set bits in the mask. MASK is typically constructed by
17027specifying the bitwise-or of several of these constants together. The
17028special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
17029states.
17030
17031The symbolic mask constants and their associated GL state are as follows
17032(the second column lists which attributes are saved):
17033
17034
17035
17036`GL_ACCUM_BUFFER_BIT'
17037 Accumulation buffer clear value
17038
17039`GL_COLOR_BUFFER_BIT'
17040 `GL_ALPHA_TEST' enable bit
17041
17042
17043 Alpha test function and reference value
17044
17045
17046 `GL_BLEND' enable bit
17047
17048
17049 Blending source and destination functions
17050
17051
17052 Constant blend color
17053
17054
17055 Blending equation
17056
17057
17058 `GL_DITHER' enable bit
17059
17060
17061 `GL_DRAW_BUFFER' setting
17062
17063
17064 `GL_COLOR_LOGIC_OP' enable bit
17065
17066
17067 `GL_INDEX_LOGIC_OP' enable bit
17068
17069
17070 Logic op function
17071
17072
17073 Color mode and index mode clear values
17074
17075
17076 Color mode and index mode writemasks
17077
17078`GL_CURRENT_BIT'
17079 Current RGBA color
17080
17081
17082 Current color index
17083
17084
17085 Current normal vector
17086
17087
17088 Current texture coordinates
17089
17090
17091 Current raster position
17092
17093
17094 `GL_CURRENT_RASTER_POSITION_VALID' flag
17095
17096
17097 RGBA color associated with current raster position
17098
17099
17100 Color index associated with current raster position
17101
17102
17103 Texture coordinates associated with current raster position
17104
17105
17106 `GL_EDGE_FLAG' flag
17107
17108`GL_DEPTH_BUFFER_BIT'
17109 `GL_DEPTH_TEST' enable bit
17110
17111
17112 Depth buffer test function
17113
17114
17115 Depth buffer clear value
17116
17117
17118 `GL_DEPTH_WRITEMASK' enable bit
17119
17120`GL_ENABLE_BIT'
17121 `GL_ALPHA_TEST' flag
17122
17123
17124 `GL_AUTO_NORMAL' flag
17125
17126
17127 `GL_BLEND' flag
17128
17129
17130 Enable bits for the user-definable clipping planes
17131
17132
17133 `GL_COLOR_MATERIAL'
17134
17135
17136 `GL_CULL_FACE' flag
17137
17138
17139 `GL_DEPTH_TEST' flag
17140
17141
17142 `GL_DITHER' flag
17143
17144
17145 `GL_FOG' flag
17146
17147
17148 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
17149
17150
17151 `GL_LIGHTING' flag
17152
17153
17154 `GL_LINE_SMOOTH' flag
17155
17156
17157 `GL_LINE_STIPPLE' flag
17158
17159
17160 `GL_COLOR_LOGIC_OP' flag
17161
17162
17163 `GL_INDEX_LOGIC_OP' flag
17164
17165
17166 `GL_MAP1_'X where X is a map type
17167
17168
17169 `GL_MAP2_'X where X is a map type
17170
17171
17172 `GL_MULTISAMPLE' flag
17173
17174
17175 `GL_NORMALIZE' flag
17176
17177
17178 `GL_POINT_SMOOTH' flag
17179
17180
17181 `GL_POLYGON_OFFSET_LINE' flag
17182
17183
17184 `GL_POLYGON_OFFSET_FILL' flag
17185
17186
17187 `GL_POLYGON_OFFSET_POINT' flag
17188
17189
17190 `GL_POLYGON_SMOOTH' flag
17191
17192
17193 `GL_POLYGON_STIPPLE' flag
17194
17195
17196 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17197
17198
17199 `GL_SAMPLE_ALPHA_TO_ONE' flag
17200
17201
17202 `GL_SAMPLE_COVERAGE' flag
17203
17204
17205 `GL_SCISSOR_TEST' flag
17206
17207
17208 `GL_STENCIL_TEST' flag
17209
17210
17211 `GL_TEXTURE_1D' flag
17212
17213
17214 `GL_TEXTURE_2D' flag
17215
17216
17217 `GL_TEXTURE_3D' flag
17218
17219
17220 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
17221
17222`GL_EVAL_BIT'
17223 `GL_MAP1_'X enable bits, where X is a map type
17224
17225
17226 `GL_MAP2_'X enable bits, where X is a map type
17227
17228
17229 1D grid endpoints and divisions
17230
17231
17232 2D grid endpoints and divisions
17233
17234
17235 `GL_AUTO_NORMAL' enable bit
17236
17237`GL_FOG_BIT'
17238 `GL_FOG' enable bit
17239
17240
17241 Fog color
17242
17243
17244 Fog density
17245
17246
17247 Linear fog start
17248
17249
17250 Linear fog end
17251
17252
17253 Fog index
17254
17255
17256 `GL_FOG_MODE' value
17257
17258`GL_HINT_BIT'
17259 `GL_PERSPECTIVE_CORRECTION_HINT' setting
17260
17261
17262 `GL_POINT_SMOOTH_HINT' setting
17263
17264
17265 `GL_LINE_SMOOTH_HINT' setting
17266
17267
17268 `GL_POLYGON_SMOOTH_HINT' setting
17269
17270
17271 `GL_FOG_HINT' setting
17272
17273
17274 `GL_GENERATE_MIPMAP_HINT' setting
17275
17276
17277 `GL_TEXTURE_COMPRESSION_HINT' setting
17278
17279`GL_LIGHTING_BIT'
17280 `GL_COLOR_MATERIAL' enable bit
17281
17282
17283 `GL_COLOR_MATERIAL_FACE' value
17284
17285
17286 Color material parameters that are tracking the current color
17287
17288
17289 Ambient scene color
17290
17291
17292 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
17293
17294
17295 `GL_LIGHT_MODEL_TWO_SIDE' setting
17296
17297
17298 `GL_LIGHTING' enable bit
17299
17300
17301 Enable bit for each light
17302
17303
17304 Ambient, diffuse, and specular intensity for each light
17305
17306
17307 Direction, position, exponent, and cutoff angle for each light
17308
17309
17310 Constant, linear, and quadratic attenuation factors for each light
17311
17312
17313 Ambient, diffuse, specular, and emissive color for each material
17314
17315
17316 Ambient, diffuse, and specular color indices for each material
17317
17318
17319 Specular exponent for each material
17320
17321
17322 `GL_SHADE_MODEL' setting
17323
17324`GL_LINE_BIT'
17325 `GL_LINE_SMOOTH' flag
17326
17327
17328 `GL_LINE_STIPPLE' enable bit
17329
17330
17331 Line stipple pattern and repeat counter
17332
17333
17334 Line width
17335
17336`GL_LIST_BIT'
17337 `GL_LIST_BASE' setting
17338
17339`GL_MULTISAMPLE_BIT'
17340 `GL_MULTISAMPLE' flag
17341
17342
17343 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17344
17345
17346 `GL_SAMPLE_ALPHA_TO_ONE' flag
17347
17348
17349 `GL_SAMPLE_COVERAGE' flag
17350
17351
17352 `GL_SAMPLE_COVERAGE_VALUE' value
17353
17354
17355 `GL_SAMPLE_COVERAGE_INVERT' value
17356
17357`GL_PIXEL_MODE_BIT'
17358 `GL_RED_BIAS' and `GL_RED_SCALE' settings
17359
17360
17361 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
17362
17363
17364 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
17365
17366
17367 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
17368
17369
17370 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
17371
17372
17373 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
17374
17375
17376 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
17377
17378
17379 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
17380
17381
17382 `GL_READ_BUFFER' setting
17383
17384`GL_POINT_BIT'
17385 `GL_POINT_SMOOTH' flag
17386
17387
17388 Point size
17389
17390`GL_POLYGON_BIT'
17391 `GL_CULL_FACE' enable bit
17392
17393
17394 `GL_CULL_FACE_MODE' value
17395
17396
17397 `GL_FRONT_FACE' indicator
17398
17399
17400 `GL_POLYGON_MODE' setting
17401
17402
17403 `GL_POLYGON_SMOOTH' flag
17404
17405
17406 `GL_POLYGON_STIPPLE' enable bit
17407
17408
17409 `GL_POLYGON_OFFSET_FILL' flag
17410
17411
17412 `GL_POLYGON_OFFSET_LINE' flag
17413
17414
17415 `GL_POLYGON_OFFSET_POINT' flag
17416
17417
17418 `GL_POLYGON_OFFSET_FACTOR'
17419
17420
17421 `GL_POLYGON_OFFSET_UNITS'
17422
17423`GL_POLYGON_STIPPLE_BIT'
17424 Polygon stipple image
17425
17426`GL_SCISSOR_BIT'
17427 `GL_SCISSOR_TEST' flag
17428
17429
17430 Scissor box
17431
17432`GL_STENCIL_BUFFER_BIT'
17433 `GL_STENCIL_TEST' enable bit
17434
17435
17436 Stencil function and reference value
17437
17438
17439 Stencil value mask
17440
17441
17442 Stencil fail, pass, and depth buffer pass actions
17443
17444
17445 Stencil buffer clear value
17446
17447
17448 Stencil buffer writemask
17449
17450`GL_TEXTURE_BIT'
17451 Enable bits for the four texture coordinates
17452
17453
17454 Border color for each texture image
17455
17456
17457 Minification function for each texture image
17458
17459
17460 Magnification function for each texture image
17461
17462
17463 Texture coordinates and wrap mode for each texture image
17464
17465
17466 Color and mode for each texture environment
17467
17468
17469 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
17470
17471
17472 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
17473
17474
17475 `glTexGen' plane equations for S, T, R, and Q
17476
17477
17478 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
17479
17480`GL_TRANSFORM_BIT'
17481 Coefficients of the six clipping planes
17482
17483
17484 Enable bits for the user-definable clipping planes
17485
17486
17487 `GL_MATRIX_MODE' value
17488
17489
17490 `GL_NORMALIZE' flag
17491
17492
17493 `GL_RESCALE_NORMAL' flag
17494
17495`GL_VIEWPORT_BIT'
17496 Depth range (near and far)
17497
17498
17499 Viewport origin and extent
17500
17501`glPopAttrib' restores the values of the state variables saved with the
17502last `glPushAttrib' command. Those not saved are left unchanged.
17503
17504It is an error to push attributes onto a full stack or to pop attributes
17505off an empty stack. In either case, the error flag is set and no other
17506change is made to GL state.
17507
17508Initially, the attribute stack is empty.
17509
17510`GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
17511attribute stack is full.
17512
17513`GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
17514attribute stack is empty.
17515
17516`GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
17517is executed between the execution of `glBegin' and the corresponding
17518execution of `glEnd'.")
8925f36f 17519
25072f02 17520(define-gl-procedures
bb894c9d
AW
17521 ((glPushClientAttrib (mask GLbitfield) -> void)
17522 (glPopClientAttrib -> void))
3c9b6116
AW
17523 "Push and pop the client attribute stack.
17524
17525MASK
17526 Specifies a mask that indicates which attributes to save. Values
17527 for MASK are listed below.
17528
17529`glPushClientAttrib' takes one argument, a mask that indicates which
17530groups of client-state variables to save on the client attribute stack.
17531Symbolic constants are used to set bits in the mask. MASK is typically
17532constructed by specifying the bitwise-or of several of these constants
17533together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
17534save all stackable client state.
17535
17536The symbolic mask constants and their associated GL client state are as
17537follows (the second column lists which attributes are saved):
17538
17539`GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
17540`GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
17541
17542`glPopClientAttrib' restores the values of the client-state variables
17543saved with the last `glPushClientAttrib'. Those not saved are left
17544unchanged.
17545
17546It is an error to push attributes onto a full client attribute stack or
17547to pop attributes off an empty stack. In either case, the error flag is
17548set, and no other change is made to GL state.
17549
17550Initially, the client attribute stack is empty.
17551
17552`GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
17553the attribute stack is full.
17554
17555`GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
17556the attribute stack is empty.")
8925f36f 17557
25072f02 17558(define-gl-procedures
bb894c9d 17559 ((glPushMatrix -> void) (glPopMatrix -> void))
3c9b6116
AW
17560 "Push and pop the current matrix stack.
17561
17562There is a stack of matrices for each of the matrix modes. In
17563`GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
17564`GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
17565The current matrix in any mode is the matrix on the top of the stack for
17566that mode.
17567
17568`glPushMatrix' pushes the current matrix stack down by one, duplicating
17569the current matrix. That is, after a `glPushMatrix' call, the matrix on
17570top of the stack is identical to the one below it.
17571
17572`glPopMatrix' pops the current matrix stack, replacing the current
17573matrix with the one below it on the stack.
17574
17575Initially, each of the stacks contains one matrix, an identity matrix.
17576
17577It is an error to push a full matrix stack or to pop a matrix stack that
17578contains only a single matrix. In either case, the error flag is set and
17579no other change is made to GL state.
17580
17581`GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
17582current matrix stack is full.
17583
17584`GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
17585current matrix stack contains only a single matrix.
17586
17587`GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
17588is executed between the execution of `glBegin' and the corresponding
17589execution of `glEnd'.")
8925f36f 17590
25072f02 17591(define-gl-procedures
bb894c9d
AW
17592 ((glPushName (name GLuint) -> void)
17593 (glPopName -> void))
3c9b6116
AW
17594 "Push and pop the name stack.
17595
17596NAME
17597 Specifies a name that will be pushed onto the name stack.
17598
17599The name stack is used during selection mode to allow sets of rendering
17600commands to be uniquely identified. It consists of an ordered set of
17601unsigned integers and is initially empty.
17602
17603`glPushName' causes NAME to be pushed onto the name stack. `glPopName'
17604pops one name off the top of the stack.
17605
17606The maximum name stack depth is implementation-dependent; call
17607`GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
17608implementation. It is an error to push a name onto a full stack or to
17609pop a name off an empty stack. It is also an error to manipulate the
17610name stack between the execution of `glBegin' and the corresponding
17611execution of `glEnd'. In any of these cases, the error flag is set and
17612no other change is made to GL state.
17613
17614The name stack is always empty while the render mode is not `GL_SELECT'.
17615Calls to `glPushName' or `glPopName' while the render mode is not
17616`GL_SELECT' are ignored.
17617
17618`GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
17619name stack is full.
17620
17621`GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
17622name stack is empty.
17623
17624`GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
17625executed between a call to `glBegin' and the corresponding call to
17626`glEnd'.")
8925f36f 17627
25072f02 17628(define-gl-procedures
bb894c9d 17629 ((glRasterPos2i (x GLint) (y GLint) -> void)
ca09631c 17630 (glRasterPos2f (x GLfloat) (y GLfloat) -> void)
bb894c9d
AW
17631 (glRasterPos3i
17632 (x GLint)
17633 (y GLint)
17634 (z GLint)
17635 ->
17636 void)
ca09631c
AW
17637 (glRasterPos3f
17638 (x GLfloat)
17639 (y GLfloat)
17640 (z GLfloat)
bb894c9d
AW
17641 ->
17642 void)
17643 (glRasterPos4i
17644 (x GLint)
17645 (y GLint)
17646 (z GLint)
17647 (w GLint)
17648 ->
17649 void)
ca09631c
AW
17650 (glRasterPos4f
17651 (x GLfloat)
17652 (y GLfloat)
17653 (z GLfloat)
17654 (w GLfloat)
bb894c9d
AW
17655 ->
17656 void))
3c9b6116
AW
17657 "Specify the raster position for pixel operations.
17658
17659X
17660 Y
17661
17662 Z
17663
17664 W
17665
17666 Specify the X , Y , Z , and W object coordinates (if present) for
17667 the raster position.
17668
17669The GL maintains a 3D position in window coordinates. This position,
17670called the raster position, is used to position pixel and bitmap write
17671operations. It is maintained with subpixel accuracy. See `glBitmap',
17672`glDrawPixels', and `glCopyPixels'.
17673
17674The current raster position consists of three window coordinates (X , Y
17675, Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
17676bit, and associated color data and texture coordinates. The W coordinate
17677is a clip coordinate, because W is not projected to window coordinates.
17678`glRasterPos4' specifies object coordinates X , Y , Z , and W
17679explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
17680explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
17681argument values for X and Y while implicitly setting Z and W to 0 and 1.
17682
17683The object coordinates presented by `glRasterPos' are treated just like
17684those of a `glVertex' command: They are transformed by the current
17685modelview and projection matrices and passed to the clipping stage. If
17686the vertex is not culled, then it is projected and scaled to window
17687coordinates, which become the new current raster position, and the
17688`GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
17689then the valid bit is cleared and the current raster position and
17690associated color and texture coordinates are undefined.
17691
17692The current raster position also includes some associated color data and
17693texture coordinates. If lighting is enabled, then
17694`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
17695(in color index mode) is set to the color produced by the lighting
17696calculation (see `glLight', `glLightModel', and `glShadeModel'). If
17697lighting is disabled, current color (in RGBA mode, state variable
17698`GL_CURRENT_COLOR') or color index (in color index mode, state variable
17699`GL_CURRENT_INDEX') is used to update the current raster color.
17700`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
17701
17702Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
17703`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
17704generation functions (see `glTexGen'). Finally, the distance from the
17705origin of the eye coordinate system to the vertex as transformed by only
17706the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
17707
17708Initially, the current raster position is (0, 0, 0, 1), the current
17709raster distance is 0, the valid bit is set, the associated RGBA color is
17710(1, 1, 1, 1), the associated color index is 1, and the associated
17711texture coordinates are (0, 0, 0, 1). In RGBA mode,
17712`GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
17713raster RGBA color always maintains its initial value.
17714
17715`GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
17716the execution of `glBegin' and the corresponding execution of `glEnd'.")
17717
25072f02 17718(define-gl-procedures
bb894c9d 17719 ((glReadBuffer (mode GLenum) -> void))
3c9b6116
AW
17720 "Select a color buffer source for pixels.
17721
17722MODE
17723 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
17724 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
17725 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
17726 0 and the value of `GL_AUX_BUFFERS' minus 1.
17727
17728`glReadBuffer' specifies a color buffer as the source for subsequent
17729`glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
17730`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
17731`glCopyPixels' commands. MODE accepts one of twelve or more predefined
17732values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
17733configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
17734the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
17735right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
17736buffer.
17737
17738Nonstereo double-buffered configurations have only a front left and a
17739back left buffer. Single-buffered configurations have a front left and a
17740front right buffer if stereo, and only a front left buffer if nonstereo.
17741It is an error to specify a nonexistent buffer to `glReadBuffer'.
17742
17743MODE is initially `GL_FRONT' in single-buffered configurations and
17744`GL_BACK' in double-buffered configurations.
17745
17746`GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
17747more) accepted values.
17748
17749`GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
17750not exist.
17751
17752`GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
17753between the execution of `glBegin' and the corresponding execution of
17754`glEnd'.")
17755
25072f02 17756(define-gl-procedures
bb894c9d
AW
17757 ((glReadPixels
17758 (x GLint)
17759 (y GLint)
17760 (width GLsizei)
17761 (height GLsizei)
17762 (format GLenum)
17763 (type GLenum)
00239761 17764 (data GLvoid-*)
bb894c9d
AW
17765 ->
17766 void))
3c9b6116
AW
17767 "Read a block of pixels from the frame buffer.
17768
17769X
17770 Y
17771
17772 Specify the window coordinates of the first pixel that is read from
17773 the frame buffer. This location is the lower left corner of a
17774 rectangular block of pixels.
17775
17776WIDTH
17777 HEIGHT
17778
17779 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
17780 one correspond to a single pixel.
17781
17782FORMAT
17783 Specifies the format of the pixel data. The following symbolic
17784 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
17785 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
17786 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
17787 `GL_LUMINANCE_ALPHA'.
17788
17789TYPE
17790 Specifies the data type of the pixel data. Must be one of
17791 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
17792 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
17793 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
17794 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
17795 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
17796 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
17797 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
17798 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
17799
17800DATA
17801 Returns the pixel data.
17802
17803`glReadPixels' returns pixel data from the frame buffer, starting with
17804the pixel whose lower left corner is at location (X, Y), into client
17805memory starting at location DATA. Several parameters control the
17806processing of the pixel data before it is placed into client memory.
17807These parameters are set with three commands: `glPixelStore',
17808`glPixelTransfer', and `glPixelMap'. This reference page describes the
17809effects on `glReadPixels' of most, but not all of the parameters
17810specified by these three commands.
17811
17812If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
17813target (see `glBindBuffer') while a block of pixels is requested, DATA
17814is treated as a byte offset into the buffer object's data store rather
17815than a pointer to client memory.
17816
17817When the `ARB_imaging' extension is supported, the pixel data may be
17818processed by additional operations including color table lookup, color
17819matrix transformations, convolutions, histograms, and minimum and
17820maximum pixel value computations.
17821
17822`glReadPixels' returns values from each pixel with lower left corner at
17823(X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
17824I th pixel in the J th row. Pixels are returned in row order from the
17825lowest to the highest row, left to right in each row.
17826
17827FORMAT specifies the format for the returned pixel values; accepted
17828values are:
17829
17830`GL_COLOR_INDEX'
17831 Color indices are read from the color buffer selected by
17832 `glReadBuffer'. Each index is converted to fixed point, shifted
17833 left or right depending on the value and sign of `GL_INDEX_SHIFT',
17834 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
17835 indices are replaced by their mappings in the table
17836 `GL_PIXEL_MAP_I_TO_I'.
17837
17838`GL_STENCIL_INDEX'
17839 Stencil values are read from the stencil buffer. Each index is
17840 converted to fixed point, shifted left or right depending on the
17841 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
17842 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
17843 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
17844
17845`GL_DEPTH_COMPONENT'
17846 Depth values are read from the depth buffer. Each component is
17847 converted to floating point such that the minimum depth value maps
17848 to 0 and the maximum value maps to 1. Each component is then
17849 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
17850 finally clamped to the range [0,1] .
17851
17852`GL_RED'
17853`GL_GREEN'
17854`GL_BLUE'
17855`GL_ALPHA'
17856`GL_RGB'
17857`GL_BGR'
17858`GL_RGBA'
17859`GL_BGRA'
17860`GL_LUMINANCE'
17861`GL_LUMINANCE_ALPHA'
17862 Processing differs depending on whether color buffers store color
17863 indices or RGBA color components. If color indices are stored, they
17864 are read from the color buffer selected by `glReadBuffer'. Each
17865 index is converted to fixed point, shifted left or right depending
17866 on the value and sign of `GL_INDEX_SHIFT', and added to
17867 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
17868 blue, and alpha values obtained by indexing the tables
17869 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
17870 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
17871 be of size 2^N , but N may be different for different tables.
17872 Before an index is used to look up a value in a table of size 2^N ,
17873 it must be masked against 2^N-1 .
17874
17875 If RGBA color components are stored in the color buffers, they are
17876 read from the color buffer selected by `glReadBuffer'. Each color
17877 component is converted to floating point such that zero intensity
17878 maps to 0.0 and full intensity maps to 1.0. Each component is then
17879 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
17880 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
17881 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
17882 the size of its corresponding table, and is then replaced by its
17883 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
17884 A.
17885
17886 Unneeded data is then discarded. For example, `GL_RED' discards the
17887 green, blue, and alpha components, while `GL_RGB' discards only the
17888 alpha component. `GL_LUMINANCE' computes a single-component value
17889 as the sum of the red, green, and blue components, and
17890 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
17891 value. The final values are clamped to the range [0,1] .
17892
17893The shift, scale, bias, and lookup factors just described are all
17894specified by `glPixelTransfer'. The lookup table contents themselves are
17895specified by `glPixelMap'.
17896
17897Finally, the indices or components are converted to the proper format,
17898as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
17899`GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
17900the mask value given in the following table. If TYPE is `GL_FLOAT', then
17901each integer index is converted to single-precision floating-point
17902format.
17903
17904If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
17905`GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
17906and TYPE is not `GL_FLOAT', each component is multiplied by the
17907multiplier shown in the following table. If type is `GL_FLOAT', then
17908each component is passed as is (or converted to the client's
17909single-precision floating-point format if it is different from the one
17910used by the GL).
17911
17912
17913
17914TYPE
17915 *Index Mask*, *Component Conversion*
17916
17917`GL_UNSIGNED_BYTE'
17918 2^8-1 , (2^8-1,)\u2062C
17919
17920`GL_BYTE'
17921 2^7-1 , (2^8-1,)\u2062C-1,/2
17922
17923`GL_BITMAP'
17924 1 , 1
17925
17926`GL_UNSIGNED_SHORT'
17927 2^16-1 , (2^16-1,)\u2062C
17928
17929`GL_SHORT'
17930 2^15-1 , (2^16-1,)\u2062C-1,/2
17931
17932`GL_UNSIGNED_INT'
17933 2^32-1 , (2^32-1,)\u2062C
17934
17935`GL_INT'
17936 2^31-1 , (2^32-1,)\u2062C-1,/2
17937
17938`GL_FLOAT'
17939 none , C
17940
17941Return values are placed in memory as follows. If FORMAT is
17942`GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
17943`GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
17944returned and the data for the I th pixel in the J th row is placed in
17945location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
17946`GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
17947returns two values for each pixel, with all values corresponding to a
17948single pixel occupying contiguous space in DATA. Storage parameters set
17949by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
17950affect the way that data is written into memory. See `glPixelStore' for
17951a description.
17952
17953`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
17954value.
17955
17956`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
17957`GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
17958
17959`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
17960
17961`GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
17962the color buffers store RGBA color components.
17963
17964`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
17965there is no stencil buffer.
17966
17967`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
17968and there is no depth buffer.
17969
17970`GL_INVALID_OPERATION' is generated if TYPE is one of
17971`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
17972`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
17973is not `GL_RGB'.
17974
17975`GL_INVALID_OPERATION' is generated if TYPE is one of
17976`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
17977`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
17978`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
17979`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
17980FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
17981
17982The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
17983`GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
17984`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
17985`GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
17986`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
17987`GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
17988`GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
179891.2 or greater.
17990
17991`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17992bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
17993store is currently mapped.
17994
17995`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17996bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
17997to the buffer object such that the memory writes required would exceed
17998the data store size.
17999
18000`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18001bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
18002divisible into the number of bytes needed to store in memory a datum
18003indicated by TYPE.
8925f36f 18004
3c9b6116
AW
18005`GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
18006between the execution of `glBegin' and the corresponding execution of
18007`glEnd'.")
8925f36f 18008
25072f02 18009(define-gl-procedures
ca09631c
AW
18010 ((glRectf
18011 (x1 GLfloat)
18012 (y1 GLfloat)
18013 (x2 GLfloat)
18014 (y2 GLfloat)
bb894c9d
AW
18015 ->
18016 void)
18017 (glRecti
18018 (x1 GLint)
18019 (y1 GLint)
18020 (x2 GLint)
18021 (y2 GLint)
18022 ->
18023 void))
3c9b6116 18024 "Draw a rectangle.
8925f36f 18025
3c9b6116
AW
18026X1
18027 Y1
8925f36f 18028
3c9b6116 18029 Specify one vertex of a rectangle.
8925f36f 18030
3c9b6116
AW
18031X2
18032 Y2
8925f36f 18033
3c9b6116 18034 Specify the opposite vertex of the rectangle.
8925f36f 18035
3c9b6116
AW
18036`glRect' supports efficient specification of rectangles as two corner
18037points. Each rectangle command takes four arguments, organized either as
18038two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
18039each containing an (X,Y) pair. The resulting rectangle is defined in the
18040Z=0 plane.
8925f36f 18041
3c9b6116
AW
18042`glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
18043sequence: Note that if the second vertex is above and to the right of
18044the first vertex, the rectangle is constructed with a counterclockwise
18045winding.
8925f36f 18046
3c9b6116
AW
18047
18048 glBegin(`GL_POLYGON');
18049 glVertex2(X1, Y1);
18050 glVertex2(X2, Y1);
18051 glVertex2(X2, Y2);
18052 glVertex2(X1, Y2);
18053 glEnd();
8925f36f 18054
3c9b6116
AW
18055`GL_INVALID_OPERATION' is generated if `glRect' is executed between the
18056execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18057
25072f02 18058(define-gl-procedures
bb894c9d 18059 ((glRenderMode (mode GLenum) -> GLint))
3c9b6116 18060 "Set rasterization mode.
8925f36f 18061
3c9b6116
AW
18062MODE
18063 Specifies the rasterization mode. Three values are accepted:
18064 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
18065 `GL_RENDER'.
18066
18067`glRenderMode' sets the rasterization mode. It takes one argument, MODE,
18068which can assume one of three predefined values:
18069
18070`GL_RENDER'
18071 Render mode. Primitives are rasterized, producing pixel fragments,
18072 which are written into the frame buffer. This is the normal mode
18073 and also the default mode.
18074
18075`GL_SELECT'
18076 Selection mode. No pixel fragments are produced, and no change to
18077 the frame buffer contents is made. Instead, a record of the names
18078 of primitives that would have been drawn if the render mode had
18079 been `GL_RENDER' is returned in a select buffer, which must be
18080 created (see `glSelectBuffer') before selection mode is entered.
18081
18082`GL_FEEDBACK'
18083 Feedback mode. No pixel fragments are produced, and no change to
18084 the frame buffer contents is made. Instead, the coordinates and
18085 attributes of vertices that would have been drawn if the render
18086 mode had been `GL_RENDER' is returned in a feedback buffer, which
18087 must be created (see `glFeedbackBuffer') before feedback mode is
18088 entered.
18089
18090The return value of `glRenderMode' is determined by the render mode at
18091the time `glRenderMode' is called, rather than by MODE. The values
18092returned for the three render modes are as follows:
18093
18094`GL_RENDER'
18095 0.
18096
18097`GL_SELECT'
18098 The number of hit records transferred to the select buffer.
18099
18100`GL_FEEDBACK'
18101 The number of values (not vertices) transferred to the feedback
18102 buffer.
18103
18104See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
18105details concerning selection and feedback operation.
18106
18107`GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
18108values.
18109
18110`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
18111the render mode is `GL_SELECT', or if `glRenderMode' is called with
18112argument `GL_SELECT' before `glSelectBuffer' is called at least once.
18113
18114`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
18115while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
18116with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
18117once.
18118
18119`GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
18120between the execution of `glBegin' and the corresponding execution of
18121`glEnd'.")
8925f36f 18122
25072f02 18123(define-gl-procedures
bb894c9d 18124 ((glResetHistogram (target GLenum) -> void))
3c9b6116
AW
18125 "Reset histogram table entries to zero.
18126
18127TARGET
18128 Must be `GL_HISTOGRAM'.
18129
18130`glResetHistogram' resets all the elements of the current histogram
18131table to zero.
18132
18133`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
18134
18135`GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
18136between the execution of `glBegin' and the corresponding execution of
18137`glEnd'.")
8925f36f 18138
25072f02 18139(define-gl-procedures
bb894c9d 18140 ((glResetMinmax (target GLenum) -> void))
3c9b6116
AW
18141 "Reset minmax table entries to initial values.
18142
18143TARGET
18144 Must be `GL_MINMAX'.
18145
18146`glResetMinmax' resets the elements of the current minmax table to their
18147initial values: the ``maximum'' element receives the minimum possible
18148component values, and the ``minimum'' element receives the maximum
18149possible component values.
18150
18151`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
18152
18153`GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
18154between the execution of `glBegin' and the corresponding execution of
18155`glEnd'.")
8925f36f 18156
25072f02 18157(define-gl-procedures
ca09631c
AW
18158 ((glRotatef
18159 (angle GLfloat)
18160 (x GLfloat)
18161 (y GLfloat)
18162 (z GLfloat)
bb894c9d
AW
18163 ->
18164 void))
3c9b6116
AW
18165 "Multiply the current matrix by a rotation matrix.
18166
18167ANGLE
18168 Specifies the angle of rotation, in degrees.
18169
18170X
18171 Y
18172
18173 Z
18174
18175 Specify the X, Y, and Z coordinates of a vector, respectively.
18176
18177`glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
18178. The current matrix (see `glMatrixMode') is multiplied by a rotation
18179matrix with the product replacing the current matrix, as if
18180`glMultMatrix' were called with the following matrix as its argument:
18181
18182((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
18183Y^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
18184Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
18185
18186
18187
18188Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
18189will normalize this vector).
18190
18191
18192
18193
18194
18195If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18196objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
18197and `glPopMatrix' to save and restore the unrotated coordinate system.
18198
18199`GL_INVALID_OPERATION' is generated if `glRotate' is executed between
18200the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18201
25072f02 18202(define-gl-procedures
bb894c9d
AW
18203 ((glSampleCoverage
18204 (value GLclampf)
18205 (invert GLboolean)
18206 ->
18207 void))
3c9b6116
AW
18208 "Specify multisample coverage parameters.
18209
18210VALUE
18211 Specify a single floating-point sample coverage value. The value is
18212 clamped to the range [0,1] . The initial value is 1.0.
18213
18214INVERT
18215 Specify a single boolean value representing if the coverage masks
18216 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
18217 initial value is `GL_FALSE'.
18218
18219Multisampling samples a pixel multiple times at various
18220implementation-dependent subpixel locations to generate antialiasing
18221effects. Multisampling transparently antialiases points, lines,
18222polygons, bitmaps, and images if it is enabled.
18223
18224VALUE is used in constructing a temporary mask used in determining which
18225samples will be used in resolving the final fragment color. This mask is
18226bitwise-anded with the coverage mask generated from the multisampling
18227computation. If the INVERT flag is set, the temporary mask is inverted
18228(all bits flipped) and then the bitwise-and is computed.
18229
18230If an implementation does not have any multisample buffers available, or
18231multisampling is disabled, rasterization occurs with only a single
18232sample computing a pixel's final RGB color.
18233
18234Provided an implementation supports multisample buffers, and
18235multisampling is enabled, then a pixel's final color is generated by
18236combining several samples per pixel. Each sample contains color, depth,
18237and stencil information, allowing those operations to be performed on
18238each sample.
18239
18240`GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
18241between the execution of `glBegin' and the corresponding execution of
18242`glEnd'.")
8925f36f 18243
25072f02 18244(define-gl-procedures
ca09631c
AW
18245 ((glScalef
18246 (x GLfloat)
18247 (y GLfloat)
18248 (z GLfloat)
bb894c9d
AW
18249 ->
18250 void))
3c9b6116
AW
18251 "Multiply the current matrix by a general scaling matrix.
18252
18253X
18254 Y
18255
18256 Z
18257
18258 Specify scale factors along the X, Y, and Z axes, respectively.
18259
18260`glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
18261three parameters indicate the desired scale factor along each of the
18262three axes.
18263
18264The current matrix (see `glMatrixMode') is multiplied by this scale
18265matrix, and the product replaces the current matrix as if `glMultMatrix'
18266were called with the following matrix as its argument:
18267
18268((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
18269
18270If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18271objects drawn after `glScale' is called are scaled.
18272
18273Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
18274coordinate system.
18275
18276`GL_INVALID_OPERATION' is generated if `glScale' is executed between the
18277execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18278
25072f02 18279(define-gl-procedures
bb894c9d
AW
18280 ((glScissor
18281 (x GLint)
18282 (y GLint)
18283 (width GLsizei)
18284 (height GLsizei)
18285 ->
18286 void))
3c9b6116
AW
18287 "Define the scissor box.
18288
18289X
18290 Y
18291
18292 Specify the lower left corner of the scissor box. Initially (0, 0).
18293
18294WIDTH
18295 HEIGHT
18296
18297 Specify the width and height of the scissor box. When a GL context
18298 is first attached to a window, WIDTH and HEIGHT are set to the
18299 dimensions of that window.
8925f36f 18300
3c9b6116
AW
18301`glScissor' defines a rectangle, called the scissor box, in window
18302coordinates. The first two arguments, X and Y, specify the lower left
18303corner of the box. WIDTH and HEIGHT specify the width and height of the
18304box.
18305
18306To enable and disable the scissor test, call `glEnable' and `glDisable'
18307with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
18308the test is enabled, only pixels that lie within the scissor box can be
18309modified by drawing commands. Window coordinates have integer values at
18310the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
18311modification of only the lower left pixel in the window, and
18312`glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
18313window.
18314
18315When the scissor test is disabled, it is as though the scissor box
18316includes the entire window.
18317
18318`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
18319
18320`GL_INVALID_OPERATION' is generated if `glScissor' is executed between
18321the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18322
25072f02 18323(define-gl-procedures
bb894c9d
AW
18324 ((glSecondaryColorPointer
18325 (size GLint)
18326 (type GLenum)
18327 (stride GLsizei)
00239761 18328 (pointer const-GLvoid-*)
bb894c9d
AW
18329 ->
18330 void))
3c9b6116 18331 "Define an array of secondary colors.
8925f36f 18332
3c9b6116
AW
18333SIZE
18334 Specifies the number of components per color. Must be 3.
18335
18336TYPE
18337 Specifies the data type of each color component in the array.
18338 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
18339 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
18340 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
18341
18342STRIDE
18343 Specifies the byte offset between consecutive colors. If STRIDE is
18344 0, the colors are understood to be tightly packed in the array. The
18345 initial value is 0.
18346
18347POINTER
18348 Specifies a pointer to the first component of the first color
18349 element in the array. The initial value is 0.
18350
18351`glSecondaryColorPointer' specifies the location and data format of an
18352array of color components to use when rendering. SIZE specifies the
18353number of components per color, and must be 3. TYPE specifies the data
18354type of each color component, and STRIDE specifies the byte stride from
18355one color to the next, allowing vertices and attributes to be packed
18356into a single array or stored in separate arrays.
18357
18358If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
18359target (see `glBindBuffer') while a secondary color array is specified,
18360POINTER is treated as a byte offset into the buffer object's data store.
18361Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
18362secondary color vertex array client-side state
18363(`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
18364
18365When a secondary color array is specified, SIZE, TYPE, STRIDE, and
18366POINTER are saved as client-side state, in addition to the current
18367vertex array buffer object binding.
18368
18369To enable and disable the secondary color array, call
18370`glEnableClientState' and `glDisableClientState' with the argument
18371`GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
18372used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
18373`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
18374called.
18375
18376`GL_INVALID_VALUE' is generated if SIZE is not 3.
18377
18378`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
18379
18380`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 18381
25072f02 18382(define-gl-procedures
bb894c9d
AW
18383 ((glSecondaryColor3i
18384 (red GLint)
18385 (green GLint)
18386 (blue GLint)
18387 ->
18388 void)
ca09631c
AW
18389 (glSecondaryColor3f
18390 (red GLfloat)
18391 (green GLfloat)
18392 (blue GLfloat)
bb894c9d
AW
18393 ->
18394 void)
18395 (glSecondaryColor3ui
18396 (red GLuint)
18397 (green GLuint)
18398 (blue GLuint)
18399 ->
18400 void))
3c9b6116
AW
18401 "Set the current secondary color.
18402
18403RED
18404 GREEN
18405
18406 BLUE
18407
18408 Specify new red, green, and blue values for the current secondary
18409 color.
18410
18411The GL stores both a primary four-valued RGBA color and a secondary
18412four-valued RGBA color (where alpha is always set to 0.0) that is
18413associated with every vertex.
18414
18415The secondary color is interpolated and applied to each fragment during
18416rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
18417and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
18418secondary color is assigned the value computed from the specular term of
18419the lighting computation. Both the primary and secondary current colors
18420are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
18421under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
18422the value returned from querying the current secondary color is
18423undefined.
18424
18425`glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
18426take three signed byte, short, or long integers as arguments. When *v*
18427is appended to the name, the color commands can take a pointer to an
18428array of such values.
18429
18430Color values are stored in floating-point format, with unspecified
18431mantissa and exponent sizes. Unsigned integer color components, when
18432specified, are linearly mapped to floating-point values such that the
18433largest representable value maps to 1.0 (full intensity), and 0 maps to
184340.0 (zero intensity). Signed integer color components, when specified,
18435are linearly mapped to floating-point values such that the most positive
18436representable value maps to 1.0, and the most negative representable
18437value maps to -1.0 . (Note that this mapping does not convert 0
18438precisely to 0.0). Floating-point values are mapped directly.
18439
18440Neither floating-point nor signed integer values are clamped to the
18441range [0,1] before the current color is updated. However, color
18442components are clamped to this range before they are interpolated or
18443written into a color buffer.")
8925f36f 18444
25072f02 18445(define-gl-procedures
bb894c9d
AW
18446 ((glSelectBuffer
18447 (size GLsizei)
00239761 18448 (buffer GLuint-*)
bb894c9d
AW
18449 ->
18450 void))
3c9b6116
AW
18451 "Establish a buffer for selection mode values.
18452
18453SIZE
18454 Specifies the size of BUFFER.
18455
18456BUFFER
18457 Returns the selection data.
18458
18459`glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
18460unsigned integers, and SIZE indicates the size of the array. BUFFER
18461returns values from the name stack (see `glInitNames', `glLoadName',
18462`glPushName') when the rendering mode is `GL_SELECT' (see
18463`glRenderMode'). `glSelectBuffer' must be issued before selection mode
18464is enabled, and it must not be issued while the rendering mode is
18465`GL_SELECT'.
18466
18467A programmer can use selection to determine which primitives are drawn
18468into some region of a window. The region is defined by the current
18469modelview and perspective matrices.
18470
18471In selection mode, no pixel fragments are produced from rasterization.
18472Instead, if a primitive or a raster position intersects the clipping
18473volume defined by the viewing frustum and the user-defined clipping
18474planes, this primitive causes a selection hit. (With polygons, no hit
18475occurs if the polygon is culled.) When a change is made to the name
18476stack, or when `glRenderMode' is called, a hit record is copied to
18477BUFFER if any hits have occurred since the last such event (name stack
18478change or `glRenderMode' call). The hit record consists of the number of
18479names in the name stack at the time of the event, followed by the
18480minimum and maximum depth values of all vertices that hit since the
18481previous event, followed by the name stack contents, bottom name first.
18482
18483Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
18484before being placed in the hit record.
18485
18486An internal index into BUFFER is reset to 0 whenever selection mode is
18487entered. Each time a hit record is copied into BUFFER, the index is
18488incremented to point to the cell just past the end of the block of
18489names\\(emthat is, to the next available cell If the hit record is larger
18490than the number of remaining locations in BUFFER, as much data as can
18491fit is copied, and the overflow flag is set. If the name stack is empty
18492when a hit record is copied, that record consists of 0 followed by the
18493minimum and maximum depth values.
18494
18495To exit selection mode, call `glRenderMode' with an argument other than
18496`GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
18497`GL_SELECT', it returns the number of hit records copied to BUFFER,
18498resets the overflow flag and the selection buffer pointer, and
18499initializes the name stack to be empty. If the overflow bit was set when
18500`glRenderMode' was called, a negative hit record count is returned.
18501
18502`GL_INVALID_VALUE' is generated if SIZE is negative.
18503
18504`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
18505the render mode is `GL_SELECT', or if `glRenderMode' is called with
18506argument `GL_SELECT' before `glSelectBuffer' is called at least once.
18507
18508`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
18509between the execution of `glBegin' and the corresponding execution of
18510`glEnd'.")
8925f36f 18511
25072f02 18512(define-gl-procedures
bb894c9d
AW
18513 ((glSeparableFilter2D
18514 (target GLenum)
18515 (internalformat GLenum)
18516 (width GLsizei)
18517 (height GLsizei)
18518 (format GLenum)
18519 (type GLenum)
00239761
AW
18520 (row const-GLvoid-*)
18521 (column const-GLvoid-*)
bb894c9d
AW
18522 ->
18523 void))
3c9b6116 18524 "Define a separable two-dimensional convolution filter.
8925f36f 18525
3c9b6116
AW
18526TARGET
18527 Must be `GL_SEPARABLE_2D'.
18528
18529INTERNALFORMAT
18530 The internal format of the convolution filter kernel. The allowable
18531 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
18532 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
18533 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
18534 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
18535 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
18536 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
18537 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
18538 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
18539 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
18540 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
18541 `GL_RGBA12', or `GL_RGBA16'.
18542
18543WIDTH
18544 The number of elements in the pixel array referenced by ROW. (This
18545 is the width of the separable filter kernel.)
18546
18547HEIGHT
18548 The number of elements in the pixel array referenced by COLUMN.
18549 (This is the height of the separable filter kernel.)
18550
18551FORMAT
18552 The format of the pixel data in ROW and COLUMN. The allowable
18553 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
18554 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
18555 `GL_LUMINANCE_ALPHA'.
18556
18557TYPE
18558 The type of the pixel data in ROW and COLUMN. Symbolic constants
18559 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
18560 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
18561 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18562 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
18563 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18564 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18565 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18566 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
18567 are accepted.
18568
18569ROW
18570 Pointer to a one-dimensional array of pixel data that is processed
18571 to build the row filter kernel.
18572
18573COLUMN
18574 Pointer to a one-dimensional array of pixel data that is processed
18575 to build the column filter kernel.
18576
18577`glSeparableFilter2D' builds a two-dimensional separable convolution
18578filter kernel from two arrays of pixels.
18579
18580The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
18581FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
18582`glDrawPixels', but processing stops after the final expansion to RGBA
18583is completed.
18584
18585If a non-zero named buffer object is bound to the
18586`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
18587filter is specified, ROW and COLUMN are treated as byte offsets into the
18588buffer object's data store.
18589
18590Next, the R, G, B, and A components of all pixels in both arrays are
18591scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
18592and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
18593parameters. (The scale and bias parameters are set by
18594`glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
18595names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
18596The parameters themselves are vectors of four values that are applied to
18597red, green, blue, and alpha, in that order.) The R, G, B, and A values
18598are not clamped to [0,1] at any time during this process.
18599
18600Each pixel is then converted to the internal format specified by
18601INTERNALFORMAT. This conversion simply maps the component values of the
18602pixel (R, G, B, and A) to the values included in the internal format
18603(red, green, blue, alpha, luminance, and intensity). The mapping is as
18604follows:
18605
18606*Internal Format*
18607 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
18608
18609`GL_LUMINANCE'
18610 , , , , R ,
18611
18612`GL_LUMINANCE_ALPHA'
18613 , , , A , R ,
18614
18615`GL_INTENSITY'
18616 , , , , , R
18617
18618`GL_RGB'
18619 R , G , B , , ,
18620
18621`GL_RGBA'
18622 R , G , B , A , ,
18623
18624The red, green, blue, alpha, luminance, and/or intensity components of
18625the resulting pixels are stored in floating-point rather than integer
18626format. They form two one-dimensional filter kernel images. The row
18627image is indexed by coordinate I starting at zero and increasing from
18628left to right. Each location in the row image is derived from element I
18629of ROW. The column image is indexed by coordinate J starting at zero and
18630increasing from bottom to top. Each location in the column image is
18631derived from element J of COLUMN.
18632
18633Note that after a convolution is performed, the resulting color
18634components are also scaled by their corresponding
18635`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
18636corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
18637the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
18638set by `glPixelTransfer'.
18639
18640`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
18641
18642`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
18643allowable values.
18644
18645`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
18646values.
18647
18648`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
18649values.
18650
18651`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
18652than the maximum supported value. This value may be queried with
18653`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
18654`GL_MAX_CONVOLUTION_WIDTH'.
18655
18656`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
18657than the maximum supported value. This value may be queried with
18658`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
18659`GL_MAX_CONVOLUTION_HEIGHT'.
18660
18661`GL_INVALID_OPERATION' is generated if HEIGHT is one of
18662`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18663`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
18664is not `GL_RGB'.
18665
18666`GL_INVALID_OPERATION' is generated if HEIGHT is one of
18667`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18668`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18669`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18670`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
18671FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
18672
18673`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18674bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
18675data store is currently mapped.
18676
18677`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18678bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
18679unpacked from the buffer object such that the memory reads required
18680would exceed the data store size.
18681
18682`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18683bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
18684evenly divisible into the number of bytes needed to store in memory a
18685datum indicated by TYPE.
18686
18687`GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
18688between the execution of `glBegin' and the corresponding execution of
18689`glEnd'.")
8925f36f 18690
25072f02 18691(define-gl-procedures
bb894c9d 18692 ((glShadeModel (mode GLenum) -> void))
3c9b6116
AW
18693 "Select flat or smooth shading.
18694
18695MODE
18696 Specifies a symbolic value representing a shading technique.
18697 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
18698 `GL_SMOOTH'.
18699
18700GL primitives can have either flat or smooth shading. Smooth shading,
18701the default, causes the computed colors of vertices to be interpolated
18702as the primitive is rasterized, typically assigning different colors to
18703each resulting pixel fragment. Flat shading selects the computed color
18704of just one vertex and assigns it to all the pixel fragments generated
18705by rasterizing a single primitive. In either case, the computed color of
18706a vertex is the result of lighting if lighting is enabled, or it is the
18707current color at the time the vertex was specified if lighting is
18708disabled.
18709
18710Flat and smooth shading are indistinguishable for points. Starting when
18711`glBegin' is issued and counting vertices and primitives from 1, the GL
18712gives each flat-shaded line segment I the computed color of vertex I+1 ,
18713its second vertex. Counting similarly from 1, the GL gives each
18714flat-shaded polygon the computed color of the vertex listed in the
18715following table. This is the last vertex to specify the polygon in all
18716cases except single polygons, where the first vertex specifies the
18717flat-shaded color.
18718
18719
18720
18721* Primitive Type of Polygon I *
18722 *Vertex*
18723
18724Single polygon (I==1 )
18725 1
18726
18727Triangle strip
18728 I+2
18729
18730Triangle fan
18731 I+2
18732
18733Independent triangle
18734 3\u2062I
18735
18736Quad strip
18737 2\u2062I+2
18738
18739Independent quad
18740 4\u2062I
18741
18742Flat and smooth shading are specified by `glShadeModel' with MODE set to
18743`GL_FLAT' and `GL_SMOOTH', respectively.
18744
18745`GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
18746or `GL_SMOOTH'.
18747
18748`GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
18749between the execution of `glBegin' and the corresponding execution of
18750`glEnd'.")
8925f36f 18751
25072f02 18752(define-gl-procedures
bb894c9d
AW
18753 ((glShaderSource
18754 (shader GLuint)
18755 (count GLsizei)
00239761
AW
18756 (string const-GLchar-**)
18757 (length const-GLint-*)
bb894c9d
AW
18758 ->
18759 void))
3c9b6116
AW
18760 "Replaces the source code in a shader object.
18761
18762SHADER
18763 Specifies the handle of the shader object whose source code is to
18764 be replaced.
18765
18766COUNT
18767 Specifies the number of elements in the STRING and LENGTH arrays.
18768
18769STRING
18770 Specifies an array of pointers to strings containing the source
18771 code to be loaded into the shader.
18772
18773LENGTH
18774 Specifies an array of string lengths.
18775
18776`glShaderSource' sets the source code in SHADER to the source code in
18777the array of strings specified by STRING. Any source code previously
18778stored in the shader object is completely replaced. The number of
18779strings in the array is specified by COUNT. If LENGTH is `NULL', each
18780string is assumed to be null terminated. If LENGTH is a value other than
18781`NULL', it points to an array containing a string length for each of the
18782corresponding elements of STRING. Each element in the LENGTH array may
18783contain the length of the corresponding string (the null character is
18784not counted as part of the string length) or a value less than 0 to
18785indicate that the string is null terminated. The source code strings are
18786not scanned or parsed at this time; they are simply copied into the
18787specified shader object.
18788
18789`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
18790OpenGL.
18791
18792`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
18793
18794`GL_INVALID_VALUE' is generated if COUNT is less than 0.
18795
18796`GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
18797between the execution of `glBegin' and the corresponding execution of
18798`glEnd'.")
8925f36f 18799
25072f02 18800(define-gl-procedures
bb894c9d
AW
18801 ((glStencilFuncSeparate
18802 (face GLenum)
18803 (func GLenum)
18804 (ref GLint)
18805 (mask GLuint)
18806 ->
18807 void))
3c9b6116
AW
18808 "Set front and/or back function and reference value for stencil testing.
18809
18810FACE
18811 Specifies whether front and/or back stencil state is updated. Three
18812 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
18813 `GL_FRONT_AND_BACK'.
18814
18815FUNC
18816 Specifies the test function. Eight symbolic constants are valid:
18817 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
18818 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
18819 `GL_ALWAYS'.
18820
18821REF
18822 Specifies the reference value for the stencil test. REF is clamped
18823 to the range [0,2^N-1] , where N is the number of bitplanes in the
18824 stencil buffer. The initial value is 0.
18825
18826MASK
18827 Specifies a mask that is ANDed with both the reference value and
18828 the stored stencil value when the test is done. The initial value
18829 is all 1's.
18830
18831Stenciling, like depth-buffering, enables and disables drawing on a
18832per-pixel basis. You draw into the stencil planes using GL drawing
18833primitives, then render geometry and images, using the stencil planes to
18834mask out portions of the screen. Stenciling is typically used in
18835multipass rendering algorithms to achieve special effects, such as
18836decals, outlining, and constructive solid geometry rendering.
18837
18838The stencil test conditionally eliminates a pixel based on the outcome
18839of a comparison between the reference value and the value in the stencil
18840buffer. To enable and disable the test, call `glEnable' and `glDisable'
18841with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
18842of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
18843
18844There can be two separate sets of FUNC, REF, and MASK parameters; one
18845affects back-facing polygons, and the other affects front-facing
18846polygons as well as other non-polygon primitives. `glStencilFunc' sets
18847both front and back stencil state to the same values, as if
18848`glStencilFuncSeparate' were called with FACE set to
18849`GL_FRONT_AND_BACK'.
18850
18851FUNC is a symbolic constant that determines the stencil comparison
18852function. It accepts one of eight values, shown in the following list.
18853REF is an integer reference value that is used in the stencil
18854comparison. It is clamped to the range [0,2^N-1] , where N is the number
18855of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
18856reference value and the stored stencil value, with the ANDed values
18857participating in the comparison.
18858
18859If STENCIL represents the value stored in the corresponding stencil
18860buffer location, the following list shows the effect of each comparison
18861function that can be specified by FUNC. Only if the comparison succeeds
18862is the pixel passed through to the next stage in the rasterization
18863process (see `glStencilOp'). All tests treat STENCIL values as unsigned
18864integers in the range [0,2^N-1] , where N is the number of bitplanes in
18865the stencil buffer.
18866
18867The following values are accepted by FUNC:
18868
18869`GL_NEVER'
18870 Always fails.
18871
18872`GL_LESS'
18873 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
18874
18875`GL_LEQUAL'
18876 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
18877
18878`GL_GREATER'
18879 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
18880
18881`GL_GEQUAL'
18882 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
18883
18884`GL_EQUAL'
18885 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
18886
18887`GL_NOTEQUAL'
18888 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
18889
18890`GL_ALWAYS'
18891 Always passes.
18892
18893`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
18894values.
18895
18896`GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
18897executed between the execution of `glBegin' and the corresponding
18898execution of `glEnd'.")
8925f36f 18899
25072f02 18900(define-gl-procedures
bb894c9d
AW
18901 ((glStencilFunc
18902 (func GLenum)
18903 (ref GLint)
18904 (mask GLuint)
18905 ->
18906 void))
3c9b6116
AW
18907 "Set front and back function and reference value for stencil testing.
18908
18909FUNC
18910 Specifies the test function. Eight symbolic constants are valid:
18911 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
18912 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
18913 `GL_ALWAYS'.
18914
18915REF
18916 Specifies the reference value for the stencil test. REF is clamped
18917 to the range [0,2^N-1] , where N is the number of bitplanes in the
18918 stencil buffer. The initial value is 0.
18919
18920MASK
18921 Specifies a mask that is ANDed with both the reference value and
18922 the stored stencil value when the test is done. The initial value
18923 is all 1's.
18924
18925Stenciling, like depth-buffering, enables and disables drawing on a
18926per-pixel basis. Stencil planes are first drawn into using GL drawing
18927primitives, then geometry and images are rendered using the stencil
18928planes to mask out portions of the screen. Stenciling is typically used
18929in multipass rendering algorithms to achieve special effects, such as
18930decals, outlining, and constructive solid geometry rendering.
18931
18932The stencil test conditionally eliminates a pixel based on the outcome
18933of a comparison between the reference value and the value in the stencil
18934buffer. To enable and disable the test, call `glEnable' and `glDisable'
18935with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
18936of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
18937
18938There can be two separate sets of FUNC, REF, and MASK parameters; one
18939affects back-facing polygons, and the other affects front-facing
18940polygons as well as other non-polygon primitives. `glStencilFunc' sets
18941both front and back stencil state to the same values. Use
18942`glStencilFuncSeparate' to set front and back stencil state to different
18943values.
18944
18945FUNC is a symbolic constant that determines the stencil comparison
18946function. It accepts one of eight values, shown in the following list.
18947REF is an integer reference value that is used in the stencil
18948comparison. It is clamped to the range [0,2^N-1] , where N is the number
18949of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
18950reference value and the stored stencil value, with the ANDed values
18951participating in the comparison.
18952
18953If STENCIL represents the value stored in the corresponding stencil
18954buffer location, the following list shows the effect of each comparison
18955function that can be specified by FUNC. Only if the comparison succeeds
18956is the pixel passed through to the next stage in the rasterization
18957process (see `glStencilOp'). All tests treat STENCIL values as unsigned
18958integers in the range [0,2^N-1] , where N is the number of bitplanes in
18959the stencil buffer.
18960
18961The following values are accepted by FUNC:
18962
18963`GL_NEVER'
18964 Always fails.
18965
18966`GL_LESS'
18967 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
18968
18969`GL_LEQUAL'
18970 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
18971
18972`GL_GREATER'
18973 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
18974
18975`GL_GEQUAL'
18976 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
18977
18978`GL_EQUAL'
18979 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
18980
18981`GL_NOTEQUAL'
18982 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
18983
18984`GL_ALWAYS'
18985 Always passes.
18986
18987`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
18988values.
18989
18990`GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
18991between the execution of `glBegin' and the corresponding execution of
18992`glEnd'.")
8925f36f 18993
25072f02 18994(define-gl-procedures
bb894c9d
AW
18995 ((glStencilMaskSeparate
18996 (face GLenum)
18997 (mask GLuint)
18998 ->
18999 void))
3c9b6116
AW
19000 "Control the front and/or back writing of individual bits in the stencil
19001planes.
19002
19003FACE
19004 Specifies whether the front and/or back stencil writemask is
19005 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
19006 and `GL_FRONT_AND_BACK'.
19007
19008MASK
19009 Specifies a bit mask to enable and disable writing of individual
19010 bits in the stencil planes. Initially, the mask is all 1's.
19011
19012`glStencilMaskSeparate' controls the writing of individual bits in the
19013stencil planes. The least significant N bits of MASK, where N is the
19014number of bits in the stencil buffer, specify a mask. Where a 1 appears
19015in the mask, it's possible to write to the corresponding bit in the
19016stencil buffer. Where a 0 appears, the corresponding bit is
19017write-protected. Initially, all bits are enabled for writing.
19018
19019There can be two separate MASK writemasks; one affects back-facing
19020polygons, and the other affects front-facing polygons as well as other
19021non-polygon primitives. `glStencilMask' sets both front and back stencil
19022writemasks to the same values, as if `glStencilMaskSeparate' were called
19023with FACE set to `GL_FRONT_AND_BACK'.
19024
19025`GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
19026executed between the execution of `glBegin' and the corresponding
19027execution of `glEnd'.")
8925f36f 19028
25072f02 19029(define-gl-procedures
bb894c9d 19030 ((glStencilMask (mask GLuint) -> void))
3c9b6116
AW
19031 "Control the front and back writing of individual bits in the stencil
19032planes.
19033
19034MASK
19035 Specifies a bit mask to enable and disable writing of individual
19036 bits in the stencil planes. Initially, the mask is all 1's.
19037
19038`glStencilMask' controls the writing of individual bits in the stencil
19039planes. The least significant N bits of MASK, where N is the number of
19040bits in the stencil buffer, specify a mask. Where a 1 appears in the
19041mask, it's possible to write to the corresponding bit in the stencil
19042buffer. Where a 0 appears, the corresponding bit is write-protected.
19043Initially, all bits are enabled for writing.
19044
19045There can be two separate MASK writemasks; one affects back-facing
19046polygons, and the other affects front-facing polygons as well as other
19047non-polygon primitives. `glStencilMask' sets both front and back stencil
19048writemasks to the same values. Use `glStencilMaskSeparate' to set front
19049and back stencil writemasks to different values.
19050
19051`GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
19052between the execution of `glBegin' and the corresponding execution of
19053`glEnd'.")
8925f36f 19054
25072f02 19055(define-gl-procedures
bb894c9d
AW
19056 ((glStencilOpSeparate
19057 (face GLenum)
19058 (sfail GLenum)
19059 (dpfail GLenum)
19060 (dppass GLenum)
19061 ->
19062 void))
3c9b6116
AW
19063 "Set front and/or back stencil test actions.
19064
19065FACE
19066 Specifies whether front and/or back stencil state is updated. Three
19067 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
19068 `GL_FRONT_AND_BACK'.
19069
19070SFAIL
19071 Specifies the action to take when the stencil test fails. Eight
19072 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19073 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19074 and `GL_INVERT'. The initial value is `GL_KEEP'.
19075
19076DPFAIL
19077 Specifies the stencil action when the stencil test passes, but the
19078 depth test fails. DPFAIL accepts the same symbolic constants as
19079 SFAIL. The initial value is `GL_KEEP'.
19080
19081DPPASS
19082 Specifies the stencil action when both the stencil test and the
19083 depth test pass, or when the stencil test passes and either there
19084 is no depth buffer or depth testing is not enabled. DPPASS accepts
19085 the same symbolic constants as SFAIL. The initial value is
19086 `GL_KEEP'.
19087
19088Stenciling, like depth-buffering, enables and disables drawing on a
19089per-pixel basis. You draw into the stencil planes using GL drawing
19090primitives, then render geometry and images, using the stencil planes to
19091mask out portions of the screen. Stenciling is typically used in
19092multipass rendering algorithms to achieve special effects, such as
19093decals, outlining, and constructive solid geometry rendering.
19094
19095The stencil test conditionally eliminates a pixel based on the outcome
19096of a comparison between the value in the stencil buffer and a reference
19097value. To enable and disable the test, call `glEnable' and `glDisable'
19098with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19099`glStencilFuncSeparate'.
19100
19101There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19102one affects back-facing polygons, and the other affects front-facing
19103polygons as well as other non-polygon primitives. `glStencilOp' sets
19104both front and back stencil state to the same values, as if
19105`glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
19106
19107`glStencilOpSeparate' takes three arguments that indicate what happens
19108to the stored stencil value while stenciling is enabled. If the stencil
19109test fails, no change is made to the pixel's color or depth buffers, and
19110SFAIL specifies what happens to the stencil buffer contents. The
19111following eight actions are possible.
19112
19113`GL_KEEP'
19114 Keeps the current value.
19115
19116`GL_ZERO'
19117 Sets the stencil buffer value to 0.
19118
19119`GL_REPLACE'
19120 Sets the stencil buffer value to REF, as specified by
19121 `glStencilFunc'.
19122
19123`GL_INCR'
19124 Increments the current stencil buffer value. Clamps to the maximum
19125 representable unsigned value.
19126
19127`GL_INCR_WRAP'
19128 Increments the current stencil buffer value. Wraps stencil buffer
19129 value to zero when incrementing the maximum representable unsigned
19130 value.
19131
19132`GL_DECR'
19133 Decrements the current stencil buffer value. Clamps to 0.
19134
19135`GL_DECR_WRAP'
19136 Decrements the current stencil buffer value. Wraps stencil buffer
19137 value to the maximum representable unsigned value when decrementing
19138 a stencil buffer value of zero.
19139
19140`GL_INVERT'
19141 Bitwise inverts the current stencil buffer value.
19142
19143Stencil buffer values are treated as unsigned integers. When incremented
19144and decremented, values are clamped to 0 and 2^N-1 , where N is the
19145value returned by querying `GL_STENCIL_BITS'.
19146
19147The other two arguments to `glStencilOpSeparate' specify stencil buffer
19148actions that depend on whether subsequent depth buffer tests succeed
19149(DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
19150using the same eight symbolic constants as SFAIL. Note that DPFAIL is
19151ignored when there is no depth buffer, or when the depth buffer is not
19152enabled. In these cases, SFAIL and DPPASS specify stencil action when
19153the stencil test fails and passes, respectively.
19154
19155`GL_INVALID_ENUM' is generated if FACE is any value other than
19156`GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
19157
19158`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
19159other than the eight defined constant values.
19160
19161`GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
19162between the execution of `glBegin' and the corresponding execution of
19163`glEnd'.")
8925f36f 19164
25072f02 19165(define-gl-procedures
bb894c9d
AW
19166 ((glStencilOp
19167 (sfail GLenum)
19168 (dpfail GLenum)
19169 (dppass GLenum)
19170 ->
19171 void))
3c9b6116
AW
19172 "Set front and back stencil test actions.
19173
19174SFAIL
19175 Specifies the action to take when the stencil test fails. Eight
19176 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19177 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19178 and `GL_INVERT'. The initial value is `GL_KEEP'.
19179
19180DPFAIL
19181 Specifies the stencil action when the stencil test passes, but the
19182 depth test fails. DPFAIL accepts the same symbolic constants as
19183 SFAIL. The initial value is `GL_KEEP'.
19184
19185DPPASS
19186 Specifies the stencil action when both the stencil test and the
19187 depth test pass, or when the stencil test passes and either there
19188 is no depth buffer or depth testing is not enabled. DPPASS accepts
19189 the same symbolic constants as SFAIL. The initial value is
19190 `GL_KEEP'.
19191
19192Stenciling, like depth-buffering, enables and disables drawing on a
19193per-pixel basis. You draw into the stencil planes using GL drawing
19194primitives, then render geometry and images, using the stencil planes to
19195mask out portions of the screen. Stenciling is typically used in
19196multipass rendering algorithms to achieve special effects, such as
19197decals, outlining, and constructive solid geometry rendering.
19198
19199The stencil test conditionally eliminates a pixel based on the outcome
19200of a comparison between the value in the stencil buffer and a reference
19201value. To enable and disable the test, call `glEnable' and `glDisable'
19202with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19203`glStencilFuncSeparate'.
19204
19205There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19206one affects back-facing polygons, and the other affects front-facing
19207polygons as well as other non-polygon primitives. `glStencilOp' sets
19208both front and back stencil state to the same values. Use
19209`glStencilOpSeparate' to set front and back stencil state to different
19210values.
19211
19212`glStencilOp' takes three arguments that indicate what happens to the
19213stored stencil value while stenciling is enabled. If the stencil test
19214fails, no change is made to the pixel's color or depth buffers, and
19215SFAIL specifies what happens to the stencil buffer contents. The
19216following eight actions are possible.
19217
19218`GL_KEEP'
19219 Keeps the current value.
19220
19221`GL_ZERO'
19222 Sets the stencil buffer value to 0.
19223
19224`GL_REPLACE'
19225 Sets the stencil buffer value to REF, as specified by
19226 `glStencilFunc'.
19227
19228`GL_INCR'
19229 Increments the current stencil buffer value. Clamps to the maximum
19230 representable unsigned value.
19231
19232`GL_INCR_WRAP'
19233 Increments the current stencil buffer value. Wraps stencil buffer
19234 value to zero when incrementing the maximum representable unsigned
19235 value.
19236
19237`GL_DECR'
19238 Decrements the current stencil buffer value. Clamps to 0.
19239
19240`GL_DECR_WRAP'
19241 Decrements the current stencil buffer value. Wraps stencil buffer
19242 value to the maximum representable unsigned value when decrementing
19243 a stencil buffer value of zero.
19244
19245`GL_INVERT'
19246 Bitwise inverts the current stencil buffer value.
19247
19248Stencil buffer values are treated as unsigned integers. When incremented
19249and decremented, values are clamped to 0 and 2^N-1 , where N is the
19250value returned by querying `GL_STENCIL_BITS'.
19251
19252The other two arguments to `glStencilOp' specify stencil buffer actions
19253that depend on whether subsequent depth buffer tests succeed (DPPASS) or
19254fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
19255same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
19256there is no depth buffer, or when the depth buffer is not enabled. In
19257these cases, SFAIL and DPPASS specify stencil action when the stencil
19258test fails and passes, respectively.
19259
19260`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
19261other than the eight defined constant values.
19262
19263`GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
19264the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 19265
25072f02 19266(define-gl-procedures
bb894c9d
AW
19267 ((glTexCoordPointer
19268 (size GLint)
19269 (type GLenum)
19270 (stride GLsizei)
00239761 19271 (pointer const-GLvoid-*)
bb894c9d
AW
19272 ->
19273 void))
3c9b6116
AW
19274 "Define an array of texture coordinates.
19275
19276SIZE
19277 Specifies the number of coordinates per array element. Must be 1,
19278 2, 3, or 4. The initial value is 4.
19279
19280TYPE
19281 Specifies the data type of each texture coordinate. Symbolic
19282 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
19283 accepted. The initial value is `GL_FLOAT'.
19284
19285STRIDE
19286 Specifies the byte offset between consecutive texture coordinate
19287 sets. If STRIDE is 0, the array elements are understood to be
19288 tightly packed. The initial value is 0.
19289
19290POINTER
19291 Specifies a pointer to the first coordinate of the first texture
19292 coordinate set in the array. The initial value is 0.
19293
19294`glTexCoordPointer' specifies the location and data format of an array
19295of texture coordinates to use when rendering. SIZE specifies the number
19296of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
19297TYPE specifies the data type of each texture coordinate, and STRIDE
19298specifies the byte stride from one texture coordinate set to the next,
19299allowing vertices and attributes to be packed into a single array or
19300stored in separate arrays. (Single-array storage may be more efficient
19301on some implementations; see `glInterleavedArrays'.)
19302
19303If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
19304target (see `glBindBuffer') while a texture coordinate array is
19305specified, POINTER is treated as a byte offset into the buffer object's
19306data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
19307is saved as texture coordinate vertex array client-side state
19308(`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
19309
19310When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
19311POINTER are saved as client-side state, in addition to the current
19312vertex array buffer object binding.
19313
19314To enable and disable a texture coordinate array, call
19315`glEnableClientState' and `glDisableClientState' with the argument
19316`GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
19317used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
19318`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
19319called.
19320
19321`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
19322
19323`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
19324
19325`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 19326
25072f02 19327(define-gl-procedures
bb894c9d 19328 ((glTexCoord1i (s GLint) -> void)
ca09631c 19329 (glTexCoord1f (s GLfloat) -> void)
bb894c9d 19330 (glTexCoord2i (s GLint) (t GLint) -> void)
ca09631c 19331 (glTexCoord2f (s GLfloat) (t GLfloat) -> void)
bb894c9d
AW
19332 (glTexCoord3i
19333 (s GLint)
19334 (t GLint)
19335 (r GLint)
19336 ->
19337 void)
ca09631c
AW
19338 (glTexCoord3f
19339 (s GLfloat)
19340 (t GLfloat)
19341 (r GLfloat)
bb894c9d
AW
19342 ->
19343 void)
19344 (glTexCoord4i
19345 (s GLint)
19346 (t GLint)
19347 (r GLint)
19348 (q GLint)
19349 ->
19350 void)
ca09631c
AW
19351 (glTexCoord4f
19352 (s GLfloat)
19353 (t GLfloat)
19354 (r GLfloat)
19355 (q GLfloat)
bb894c9d
AW
19356 ->
19357 void))
3c9b6116
AW
19358 "Set the current texture coordinates.
19359
19360S
19361 T
19362
19363 R
19364
19365 Q
19366
19367 Specify S, T, R, and Q texture coordinates. Not all parameters are
19368 present in all forms of the command.
19369
19370`glTexCoord' specifies texture coordinates in one, two, three, or four
19371dimensions. `glTexCoord1' sets the current texture coordinates to
19372(S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
19373`glTexCoord3' specifies the texture coordinates as (S,TR1) , and
19374`glTexCoord4' defines all four components explicitly as (S,TRQ) .
19375
19376The current texture coordinates are part of the data that is associated
19377with each vertex and with the current raster position. Initially, the
19378values for S, T, R, and Q are (0, 0, 0, 1).")
8925f36f 19379
25072f02 19380(define-gl-procedures
bb894c9d
AW
19381 ((glTexEnvf
19382 (target GLenum)
19383 (pname GLenum)
19384 (param GLfloat)
19385 ->
19386 void)
19387 (glTexEnvi
19388 (target GLenum)
19389 (pname GLenum)
19390 (param GLint)
19391 ->
19392 void))
3c9b6116
AW
19393 "Set texture environment parameters.
19394
19395TARGET
19396 Specifies a texture environment. May be `GL_TEXTURE_ENV',
19397 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
19398
19399PNAME
19400 Specifies the symbolic name of a single-valued texture environment
19401 parameter. May be either `GL_TEXTURE_ENV_MODE',
19402 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
19403 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19404 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
19405 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
19406 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
19407 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
19408
19409PARAM
19410 Specifies a single symbolic constant, one of `GL_ADD',
19411 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
19412 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
19413 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
19414 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
19415 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
19416 sprite texture coordinate replacement, a single floating-point
19417 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
19418 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
19419
19420A texture environment specifies how texture values are interpreted when
19421a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
19422PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
19423PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
19424`GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
19425`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19426`GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
19427
19428If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
19429symbolic name of a texture function. Six texture functions may be
19430specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
19431`GL_REPLACE', or `GL_COMBINE'.
19432
19433The following table shows the correspondence of filtered texture values
19434R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
19435A_S are used by the texture functions described below.
19436
19437
19438
19439Texture Base Internal Format
19440 `C'_S , `A'_S
19441
19442`GL_ALPHA'
19443 (0, 0, 0) , A_T
19444
19445`GL_LUMINANCE'
19446 ( L_T , L_T , L_T ) , 1
19447
19448`GL_LUMINANCE_ALPHA'
19449 ( L_T , L_T , L_T ) , A_T
19450
19451`GL_INTENSITY'
19452 ( I_T , I_T , I_T ) , I_T
19453
19454`GL_RGB'
19455 ( R_T , G_T , B_T ) , 1
19456
19457`GL_RGBA'
19458 ( R_T , G_T , B_T ) , A_T
19459
19460A texture function acts on the fragment to be textured using the texture
19461image value that applies to the fragment (see `glTexParameter') and
19462produces an RGBA color for that fragment. The following table shows how
19463the RGBA color is produced for each of the first five texture functions
19464that can be chosen. C is a triple of color values (RGB) and A is the
19465associated alpha value. RGBA values extracted from a texture image are
19466in the range [0,1]. The subscript P refers to the color computed from
19467the previous texture stage (or the incoming fragment if processing
19468texture stage 0), the subscript S to the texture source color, the
19469subscript C to the texture environment color, and the subscript V
19470indicates a value produced by the texture function.
19471
19472
19473
19474Texture Base Internal Format
19475 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
19476 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
19477
19478`GL_ALPHA'
19479 C_V= , C_P , C_P , undefined , C_P , C_P
19480
19481
19482 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
19483
19484`GL_LUMINANCE'
19485 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19486
19487(or 1)
19488 A_V= , A_P , A_P , , A_P , A_P
19489
19490`GL_LUMINANCE_ALPHA'
19491 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19492
19493(or 2)
19494 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
19495
19496`GL_INTENSITY'
19497 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19498
19499
19500 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
19501
19502`GL_RGB'
19503 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
19504
19505(or 3)
19506 A_V= , A_P , A_P , A_P , A_P , A_P
19507
19508`GL_RGBA'
19509 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
19510 , C_P+C_S
19511
19512(or 4)
19513 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
19514
19515If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
19516of the texture function depends on the values of `GL_COMBINE_RGB' and
19517`GL_COMBINE_ALPHA'.
19518
19519The following describes how the texture sources, as specified by
19520`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
19521`GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
19522texture color. In the following tables, `GL_SRC0_c' is represented by
19523ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
19524represented by ARG2 .
19525
19526`GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
19527`GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
19528`GL_DOT3_RGBA'.
19529
19530
19531
19532*`GL_COMBINE_RGB'*
19533 *Texture Function*
19534
19535`GL_REPLACE'
19536 ARG0
19537
19538`GL_MODULATE'
19539 ARG0×ARG1
19540
19541`GL_ADD'
19542 ARG0+ARG1
19543
19544`GL_ADD_SIGNED'
19545 ARG0+ARG1-0.5
19546
19547`GL_INTERPOLATE'
19548 ARG0×ARG2+ARG1×(1-ARG2,)
19549
19550`GL_SUBTRACT'
19551 ARG0-ARG1
19552
19553`GL_DOT3_RGB' or `GL_DOT3_RGBA'
19554 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
19555 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
19556
19557The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
19558each of the 3 (RGB) or 4 (RGBA) components on output.
19559
19560Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
19561`GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
19562following table describes how alpha values are combined:
19563
19564
19565
19566*`GL_COMBINE_ALPHA'*
19567 *Texture Function*
19568
19569`GL_REPLACE'
19570 ARG0
19571
19572`GL_MODULATE'
19573 ARG0×ARG1
19574
19575`GL_ADD'
19576 ARG0+ARG1
19577
19578`GL_ADD_SIGNED'
19579 ARG0+ARG1-0.5
19580
19581`GL_INTERPOLATE'
19582 ARG0×ARG2+ARG1×(1-ARG2,)
19583
19584`GL_SUBTRACT'
19585 ARG0-ARG1
19586
19587In the following tables, the value C_S represents the color sampled from
19588the currently bound texture, C_C represents the constant
19589texture-environment color, C_F represents the primary color of the
19590incoming fragment, and C_P represents the color computed from the
19591previous texture stage or C_F if processing texture stage 0. Likewise,
19592A_S , A_C , A_F , and A_P represent the respective alpha values.
19593
19594The following table describes the values assigned to ARG0 , ARG1 , and
19595ARG2 based upon the RGB sources and operands:
19596
19597
19598
19599*`GL_SRCn_RGB'*
19600 *`GL_OPERANDn_RGB'*, *Argument Value*
19601
19602`GL_TEXTURE'
19603 `GL_SRC_COLOR', C_S,
19604
19605
19606 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
19607
19608
19609 `GL_SRC_ALPHA', A_S,
19610
19611
19612 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
19613
19614`GL_TEXTUREn'
19615 `GL_SRC_COLOR', C_S,
19616
19617
19618 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
19619
19620
19621 `GL_SRC_ALPHA', A_S,
19622
19623
19624 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
19625
19626`GL_CONSTANT'
19627 `GL_SRC_COLOR', C_C,
19628
19629
19630 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
19631
19632
19633 `GL_SRC_ALPHA', A_C,
19634
19635
19636 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
19637
19638`GL_PRIMARY_COLOR'
19639 `GL_SRC_COLOR', C_F,
19640
8925f36f 19641
3c9b6116 19642 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
8925f36f 19643
8925f36f 19644
3c9b6116 19645 `GL_SRC_ALPHA', A_F,
8925f36f 19646
8925f36f 19647
3c9b6116 19648 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
8925f36f 19649
3c9b6116
AW
19650`GL_PREVIOUS'
19651 `GL_SRC_COLOR', C_P,
8925f36f 19652
8925f36f 19653
3c9b6116 19654 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
8925f36f 19655
8925f36f 19656
3c9b6116 19657 `GL_SRC_ALPHA', A_P,
8925f36f 19658
8925f36f 19659
3c9b6116 19660 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
8925f36f 19661
3c9b6116
AW
19662For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
19663respectively, produced from texture stage N .
8925f36f 19664
3c9b6116
AW
19665The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
19666based upon the alpha sources and operands:
8925f36f 19667
8925f36f 19668
8925f36f 19669
3c9b6116
AW
19670*`GL_SRCn_ALPHA'*
19671 *`GL_OPERANDn_ALPHA'*, *Argument Value*
8925f36f 19672
3c9b6116
AW
19673`GL_TEXTURE'
19674 `GL_SRC_ALPHA', A_S,
8925f36f 19675
8925f36f 19676
3c9b6116 19677 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 19678
3c9b6116
AW
19679`GL_TEXTUREn'
19680 `GL_SRC_ALPHA', A_S,
8925f36f 19681
8925f36f 19682
3c9b6116 19683 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 19684
3c9b6116
AW
19685`GL_CONSTANT'
19686 `GL_SRC_ALPHA', A_C,
8925f36f 19687
8925f36f 19688
3c9b6116 19689 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
8925f36f 19690
3c9b6116
AW
19691`GL_PRIMARY_COLOR'
19692 `GL_SRC_ALPHA', A_F,
8925f36f 19693
8925f36f 19694
3c9b6116
AW
19695 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
19696
19697`GL_PREVIOUS'
19698 `GL_SRC_ALPHA', A_P,
19699
19700
19701 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
19702
19703The RGB and alpha results of the texture function are multipled by the
19704values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
19705to the range [0,1] .
19706
19707If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
19708holds an RGBA color consisting of four values. Integer color components
19709are interpreted linearly such that the most positive integer maps to
197101.0, and the most negative integer maps to -1.0. The values are clamped
19711to the range [0,1] when they are specified. C_C takes these four values.
19712
19713If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
19714texture level-of-detail parameter, that selects which mipmap, or mipmaps
19715depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
19716
19717`GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
19718`GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
8925f36f 19719
3c9b6116
AW
19720If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
19721boolean value specified is used to either enable or disable point sprite
19722texture coordinate replacement. The default value is `GL_FALSE'.
8925f36f 19723
3c9b6116
AW
19724`GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
19725accepted defined values, or when PARAMS should have a defined constant
19726value (based on the value of PNAME) and does not.
19727
19728`GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
19729or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
19730
19731`GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
19732the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 19733
25072f02 19734(define-gl-procedures
bb894c9d
AW
19735 ((glTexGeni
19736 (coord GLenum)
19737 (pname GLenum)
19738 (param GLint)
19739 ->
19740 void)
ca09631c 19741 (glTexGenf
bb894c9d
AW
19742 (coord GLenum)
19743 (pname GLenum)
ca09631c 19744 (param GLfloat)
bb894c9d
AW
19745 ->
19746 void))
3c9b6116 19747 "Control the generation of texture coordinates.
8925f36f 19748
3c9b6116
AW
19749COORD
19750 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
19751 `GL_R', or `GL_Q'.
8925f36f 19752
3c9b6116
AW
19753PNAME
19754 Specifies the symbolic name of the texture-coordinate generation
19755 function. Must be `GL_TEXTURE_GEN_MODE'.
8925f36f 19756
3c9b6116
AW
19757PARAM
19758 Specifies a single-valued texture generation parameter, one of
19759 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
19760 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
8925f36f 19761
3c9b6116
AW
19762`glTexGen' selects a texture-coordinate generation function or supplies
19763coefficients for one of the functions. COORD names one of the (S, T, R,
19764Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
19765`GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
19766`GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
19767`GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
19768`GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
19769or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
19770`GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
19771texture generation function.
8925f36f 19772
3c9b6116 19773If the texture generation function is `GL_OBJECT_LINEAR', the function
8925f36f 19774
3c9b6116 19775G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
8925f36f 19776
3c9b6116
AW
19777is used, where G is the value computed for the coordinate named in
19778COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
19779and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
19780This function can be used, for example, to texture-map terrain using sea
19781level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
19782altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
19783coordinate generation function as its distance from sea level; that
19784altitude can then be used to index the texture image to map white snow
19785onto peaks and green grass onto foothills.
8925f36f 19786
3c9b6116
AW
19787If the texture generation function is `GL_EYE_LINEAR', the function
19788
19789G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
19790
19791is used, where
19792
19793(P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
19794
19795and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
19796, P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
19797modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
19798or singular, texture coordinates generated by the resulting function may
19799be inaccurate or undefined.
19800
19801Note that the values in PARAMS define a reference plane in eye
19802coordinates. The modelview matrix that is applied to them may not be the
19803same one in effect when the polygon vertices are transformed. This
19804function establishes a field of texture coordinates that can produce
19805dynamic contour lines on moving objects.
19806
19807If the texture generation function is `GL_SPHERE_MAP' and COORD is
19808either `GL_S' or `GL_T', S and T texture coordinates are generated as
19809follows. Let U be the unit vector pointing from the origin to the
19810polygon vertex (in eye coordinates). Let N sup prime be the current
19811normal, after transformation to eye coordinates. Let
19812
19813F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
19814
19815F=U-2\u2062N^″\u2062N^″,^T\u2062U
19816
19817Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
19818to the S and T texture coordinates are
19819
19820S=F_X/M+1/2
19821
19822T=F_Y/M+1/2
19823
19824To enable or disable a texture-coordinate generation function, call
19825`glEnable' or `glDisable' with one of the symbolic texture-coordinate
19826names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
19827`GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
19828coordinate is computed according to the generating function associated
19829with that coordinate. When disabled, subsequent vertices take the
19830specified texture coordinate from the current set of texture
19831coordinates. Initially, all texture generation functions are set to
19832`GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
198330), both T plane equations are (0, 1, 0, 0), and all R and Q plane
19834equations are (0, 0, 0, 0).
19835
19836When the `ARB_multitexture' extension is supported, `glTexGen' sets the
19837texture generation parameters for the currently active texture unit,
19838selected with `glActiveTexture'.
19839
19840`GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
19841defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
19842an accepted defined value.
19843
19844`GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
19845PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
19846
19847`GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
19848the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 19849
25072f02 19850(define-gl-procedures
bb894c9d
AW
19851 ((glTexImage1D
19852 (target GLenum)
19853 (level GLint)
19854 (internalFormat GLint)
19855 (width GLsizei)
19856 (border GLint)
19857 (format GLenum)
19858 (type GLenum)
00239761 19859 (data const-GLvoid-*)
bb894c9d
AW
19860 ->
19861 void))
3c9b6116 19862 "Specify a one-dimensional texture image.
8925f36f 19863
3c9b6116
AW
19864TARGET
19865 Specifies the target texture. Must be `GL_TEXTURE_1D' or
19866 `GL_PROXY_TEXTURE_1D'.
8925f36f 19867
3c9b6116
AW
19868LEVEL
19869 Specifies the level-of-detail number. Level 0 is the base image
19870 level. Level N is the Nth mipmap reduction image.
8925f36f 19871
3c9b6116
AW
19872INTERNALFORMAT
19873 Specifies the number of color components in the texture. Must be 1,
19874 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
19875 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
19876 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
19877 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
19878 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
19879 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
19880 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
19881 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
19882 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
19883 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
19884 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
19885 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
19886 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
19887 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
19888 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
19889 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
19890 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
19891 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
19892 `GL_SRGB8_ALPHA8'.
8925f36f 19893
3c9b6116
AW
19894WIDTH
19895 Specifies the width of the texture image including the border if
19896 any. If the GL version does not support non-power-of-two sizes,
19897 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
19898 implementations support texture images that are at least 64 texels
19899 wide. The height of the 1D texture image is 1.
8925f36f 19900
3c9b6116
AW
19901BORDER
19902 Specifies the width of the border. Must be either 0 or 1.
8925f36f 19903
3c9b6116
AW
19904FORMAT
19905 Specifies the format of the pixel data. The following symbolic
19906 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
19907 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
19908 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 19909
3c9b6116
AW
19910TYPE
19911 Specifies the data type of the pixel data. The following symbolic
19912 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
19913 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
19914 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
19915 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
19916 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
19917 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
19918 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
19919 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
19920
19921DATA
19922 Specifies a pointer to the image data in memory.
19923
19924Texturing maps a portion of a specified texture image onto each
19925graphical primitive for which texturing is enabled. To enable and
19926disable one-dimensional texturing, call `glEnable' and `glDisable' with
19927argument `GL_TEXTURE_1D'.
19928
19929Texture images are defined with `glTexImage1D'. The arguments describe
19930the parameters of the texture image, such as width, width of the border,
19931level-of-detail number (see `glTexParameter'), and the internal
19932resolution and format used to store the image. The last three arguments
19933describe how the image is represented in memory; they are identical to
19934the pixel formats used for `glDrawPixels'.
19935
19936If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
19937of the texture image state is recalculated, checked for consistency, and
19938checked against the implementation's capabilities. If the implementation
19939cannot handle a texture of the requested texture size, it sets all of
19940the image state to 0, but does not generate an error (see `glGetError').
19941To query for an entire mipmap array, use an image array level greater
19942than or equal to 1.
19943
19944If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
19945signed or unsigned bytes, shorts, or longs, or single-precision
19946floating-point values, depending on TYPE. These values are grouped into
19947sets of one, two, three, or four values, depending on FORMAT, to form
19948elements. If TYPE is `GL_BITMAP', the data is considered as a string of
19949unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
19950treated as eight 1-bit elements, with bit ordering determined by
19951`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
19952
19953If a non-zero named buffer object is bound to the
19954`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
19955image is specified, DATA is treated as a byte offset into the buffer
19956object's data store.
19957
19958The first element corresponds to the left end of the texture array.
19959Subsequent elements progress left-to-right through the remaining texels
19960in the texture array. The final element corresponds to the right end of
19961the texture array.
19962
19963FORMAT determines the composition of each element in DATA. It can assume
19964one of these symbolic values:
19965
19966`GL_COLOR_INDEX'
19967 Each element is a single value, a color index. The GL converts it
19968 to fixed point (with an unspecified number of zero bits to the
19969 right of the binary point), shifted left or right depending on the
19970 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
19971 (see `glPixelTransfer'). The resulting index is converted to a set
19972 of color components using the `GL_PIXEL_MAP_I_TO_R',
19973 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
19974 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
19975
19976`GL_RED'
19977 Each element is a single red component. The GL converts it to
19978 floating point and assembles it into an RGBA element by attaching 0
19979 for green and blue, and 1 for alpha. Each component is then
19980 multiplied by the signed scale factor `GL_c_SCALE', added to the
19981 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
19982 `glPixelTransfer').
19983
19984`GL_GREEN'
19985 Each element is a single green component. The GL converts it to
19986 floating point and assembles it into an RGBA element by attaching 0
19987 for red and blue, and 1 for alpha. Each component is then
19988 multiplied by the signed scale factor `GL_c_SCALE', added to the
19989 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
19990 `glPixelTransfer').
19991
19992`GL_BLUE'
19993 Each element is a single blue component. The GL converts it to
19994 floating point and assembles it into an RGBA element by attaching 0
19995 for red and green, and 1 for alpha. Each component is then
19996 multiplied by the signed scale factor `GL_c_SCALE', added to the
19997 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
19998 `glPixelTransfer').
19999
20000`GL_ALPHA'
20001 Each element is a single alpha component. The GL converts it to
20002 floating point and assembles it into an RGBA element by attaching 0
20003 for red, green, and blue. Each component is then multiplied by the
20004 signed scale factor `GL_c_SCALE', added to the signed bias
20005 `GL_c_BIAS', and clamped to the range [0,1] (see
20006 `glPixelTransfer').
20007
20008`GL_INTENSITY'
20009 Each element is a single intensity value. The GL converts it to
20010 floating point, then assembles it into an RGBA element by
20011 replicating the intensity value three times for red, green, blue,
20012 and alpha. Each component is then multiplied by the signed scale
20013 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20014 clamped to the range [0,1] (see `glPixelTransfer').
20015
20016`GL_RGB'
20017`GL_BGR'
20018 Each element is an RGB triple. The GL converts it to floating point
20019 and assembles it into an RGBA element by attaching 1 for alpha.
20020 Each component is then multiplied by the signed scale factor
20021 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20022 the range [0,1] (see `glPixelTransfer').
20023
20024`GL_RGBA'
20025`GL_BGRA'
20026 Each element contains all four components. Each component is
20027 multiplied by the signed scale factor `GL_c_SCALE', added to the
20028 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20029 `glPixelTransfer').
20030
20031`GL_LUMINANCE'
20032 Each element is a single luminance value. The GL converts it to
20033 floating point, then assembles it into an RGBA element by
20034 replicating the luminance value three times for red, green, and
20035 blue and attaching 1 for alpha. Each component is then multiplied
20036 by the signed scale factor `GL_c_SCALE', added to the signed bias
20037 `GL_c_BIAS', and clamped to the range [0,1] (see
20038 `glPixelTransfer').
20039
20040`GL_LUMINANCE_ALPHA'
20041 Each element is a luminance/alpha pair. The GL converts it to
20042 floating point, then assembles it into an RGBA element by
20043 replicating the luminance value three times for red, green, and
20044 blue. Each component is then multiplied by the signed scale factor
20045 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20046 the range [0,1] (see `glPixelTransfer').
20047
20048`GL_DEPTH_COMPONENT'
20049 Each element is a single depth value. The GL converts it to
20050 floating point, multiplies by the signed scale factor
20051 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
20052 to the range [0,1] (see `glPixelTransfer').
20053
20054Refer to the `glDrawPixels' reference page for a description of the
20055acceptable values for the TYPE parameter.
20056
20057If an application wants to store the texture at a certain resolution or
20058in a certain format, it can request the resolution and format with
20059INTERNALFORMAT. The GL will choose an internal representation that
20060closely approximates that requested by INTERNALFORMAT, but it may not
20061match exactly. (The representations specified by `GL_LUMINANCE',
20062`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20063numeric values 1, 2, 3, and 4 may also be used to specify the above
20064representations.)
20065
20066If the INTERNALFORMAT parameter is one of the generic compressed
20067formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20068`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20069`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20070internal format with the symbolic constant for a specific internal
20071format and compress the texture before storage. If no corresponding
20072internal format is available, or the GL can not compress that image for
20073any reason, the internal format is instead replaced with a corresponding
20074base internal format.
20075
20076If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20077`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20078`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20079treated as if the red, green, blue, or luminance components are encoded
20080in the sRGB color space. Any alpha component is left unchanged. The
20081conversion from the sRGB encoded component C_S to a linear component C_L
20082is:
20083
20084C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20085C_S>0.04045)
20086
20087Assume C_S is the sRGB component in the range [0,1].
20088
20089Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
20090The implementation will update and recompute its best match for the
20091requested storage resolution and format. To then query this state, call
20092`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
20093state is set to 0.
20094
20095A one-component texture image uses only the red component of the RGBA
20096color from DATA. A two-component image uses the R and A values. A
20097three-component image uses the R, G, and B values. A four-component
20098image uses all of the RGBA components.
20099
20100Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
20101during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
20102\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
20103generate a boolean result. See `glTexParameter' for details on texture
20104comparison.
20105
20106`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
20107`GL_PROXY_TEXTURE_1D'.
20108
20109`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
20110constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
20111
20112`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20113
20114`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20115`GL_COLOR_INDEX'.
20116
20117`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8925f36f 20118
3c9b6116
AW
20119`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20120LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8925f36f 20121
3c9b6116
AW
20122`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20123one of the accepted resolution and format symbolic constants.
8925f36f 20124
3c9b6116
AW
20125`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
201262 + `GL_MAX_TEXTURE_SIZE'.
8925f36f 20127
3c9b6116
AW
20128`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20129supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
20130some integer value of N.
8925f36f 20131
3c9b6116 20132`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
8925f36f 20133
3c9b6116
AW
20134`GL_INVALID_OPERATION' is generated if TYPE is one of
20135`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20136`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20137is not `GL_RGB'.
8925f36f 20138
3c9b6116
AW
20139`GL_INVALID_OPERATION' is generated if TYPE is one of
20140`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20141`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20142`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20143`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20144FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 20145
3c9b6116
AW
20146`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
20147and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
20148`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
8925f36f 20149
3c9b6116
AW
20150`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
20151`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20152`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
8925f36f 20153
3c9b6116
AW
20154`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20155bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
20156data store is currently mapped.
8925f36f 20157
3c9b6116
AW
20158`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20159bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
20160unpacked from the buffer object such that the memory reads required
20161would exceed the data store size.
8925f36f 20162
3c9b6116
AW
20163`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20164bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
20165divisible into the number of bytes needed to store in memory a datum
20166indicated by TYPE.
20167
20168`GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
20169between the execution of `glBegin' and the corresponding execution of
20170`glEnd'.")
8925f36f 20171
25072f02 20172(define-gl-procedures
bb894c9d
AW
20173 ((glTexImage2D
20174 (target GLenum)
20175 (level GLint)
20176 (internalFormat GLint)
20177 (width GLsizei)
20178 (height GLsizei)
20179 (border GLint)
20180 (format GLenum)
20181 (type GLenum)
00239761 20182 (data const-GLvoid-*)
bb894c9d
AW
20183 ->
20184 void))
3c9b6116 20185 "Specify a two-dimensional texture image.
8925f36f 20186
3c9b6116
AW
20187TARGET
20188 Specifies the target texture. Must be `GL_TEXTURE_2D',
20189 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
20190 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
20191 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
20192 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
8925f36f 20193
3c9b6116
AW
20194LEVEL
20195 Specifies the level-of-detail number. Level 0 is the base image
20196 level. Level N is the Nth mipmap reduction image.
8925f36f 20197
3c9b6116
AW
20198INTERNALFORMAT
20199 Specifies the number of color components in the texture. Must be 1,
20200 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20201 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20202 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20203 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20204 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
20205 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
20206 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
20207 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
20208 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20209 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20210 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20211 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20212 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20213 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20214 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20215 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20216 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20217 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20218 `GL_SRGB8_ALPHA8'.
8925f36f 20219
3c9b6116
AW
20220WIDTH
20221 Specifies the width of the texture image including the border if
20222 any. If the GL version does not support non-power-of-two sizes,
20223 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20224 implementations support texture images that are at least 64 texels
20225 wide.
8925f36f 20226
3c9b6116
AW
20227HEIGHT
20228 Specifies the height of the texture image including the border if
20229 any. If the GL version does not support non-power-of-two sizes,
20230 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
20231 implementations support texture images that are at least 64 texels
20232 high.
8925f36f 20233
3c9b6116
AW
20234BORDER
20235 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20236
3c9b6116
AW
20237FORMAT
20238 Specifies the format of the pixel data. The following symbolic
20239 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20240 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20241 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20242
3c9b6116
AW
20243TYPE
20244 Specifies the data type of the pixel data. The following symbolic
20245 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20246 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20247 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20248 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20249 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20250 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20251 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20252 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 20253
3c9b6116
AW
20254DATA
20255 Specifies a pointer to the image data in memory.
8925f36f 20256
3c9b6116
AW
20257Texturing maps a portion of a specified texture image onto each
20258graphical primitive for which texturing is enabled. To enable and
20259disable two-dimensional texturing, call `glEnable' and `glDisable' with
20260argument `GL_TEXTURE_2D'. To enable and disable texturing using
20261cube-mapped texture, call `glEnable' and `glDisable' with argument
20262`GL_TEXTURE_CUBE_MAP'.
20263
20264To define texture images, call `glTexImage2D'. The arguments describe
20265the parameters of the texture image, such as height, width, width of the
20266border, level-of-detail number (see `glTexParameter'), and number of
20267color components provided. The last three arguments describe how the
20268image is represented in memory; they are identical to the pixel formats
20269used for `glDrawPixels'.
20270
20271If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
20272data is read from DATA, but all of the texture image state is
20273recalculated, checked for consistency, and checked against the
20274implementation's capabilities. If the implementation cannot handle a
20275texture of the requested texture size, it sets all of the image state to
202760, but does not generate an error (see `glGetError'). To query for an
20277entire mipmap array, use an image array level greater than or equal to
202781.
20279
20280If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
20281targets, data is read from DATA as a sequence of signed or unsigned
20282bytes, shorts, or longs, or single-precision floating-point values,
20283depending on TYPE. These values are grouped into sets of one, two,
20284three, or four values, depending on FORMAT, to form elements. If TYPE is
20285`GL_BITMAP', the data is considered as a string of unsigned bytes (and
20286FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
202871-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
20288(see `glPixelStore').
20289
20290If a non-zero named buffer object is bound to the
20291`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
20292image is specified, DATA is treated as a byte offset into the buffer
20293object's data store.
20294
20295The first element corresponds to the lower left corner of the texture
20296image. Subsequent elements progress left-to-right through the remaining
20297texels in the lowest row of the texture image, and then in successively
20298higher rows of the texture image. The final element corresponds to the
20299upper right corner of the texture image.
20300
20301FORMAT determines the composition of each element in DATA. It can assume
20302one of these symbolic values:
20303
20304`GL_COLOR_INDEX'
20305 Each element is a single value, a color index. The GL converts it
20306 to fixed point (with an unspecified number of zero bits to the
20307 right of the binary point), shifted left or right depending on the
20308 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
20309 (see `glPixelTransfer'). The resulting index is converted to a set
20310 of color components using the `GL_PIXEL_MAP_I_TO_R',
20311 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
20312 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
20313
20314`GL_RED'
20315 Each element is a single red component. The GL converts it to
20316 floating point and assembles it into an RGBA element by attaching 0
20317 for green and blue, and 1 for alpha. Each component is then
20318 multiplied by the signed scale factor `GL_c_SCALE', added to the
20319 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20320 `glPixelTransfer').
20321
20322`GL_GREEN'
20323 Each element is a single green component. The GL converts it to
20324 floating point and assembles it into an RGBA element by attaching 0
20325 for red and blue, and 1 for alpha. Each component is then
20326 multiplied by the signed scale factor `GL_c_SCALE', added to the
20327 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20328 `glPixelTransfer').
20329
20330`GL_BLUE'
20331 Each element is a single blue component. The GL converts it to
20332 floating point and assembles it into an RGBA element by attaching 0
20333 for red and green, and 1 for alpha. Each component is then
20334 multiplied by the signed scale factor `GL_c_SCALE', added to the
20335 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20336 `glPixelTransfer').
20337
20338`GL_ALPHA'
20339 Each element is a single alpha component. The GL converts it to
20340 floating point and assembles it into an RGBA element by attaching 0
20341 for red, green, and blue. Each component is then multiplied by the
20342 signed scale factor `GL_c_SCALE', added to the signed bias
20343 `GL_c_BIAS', and clamped to the range [0,1] (see
20344 `glPixelTransfer').
20345
20346`GL_INTENSITY'
20347 Each element is a single intensity value. The GL converts it to
20348 floating point, then assembles it into an RGBA element by
20349 replicating the intensity value three times for red, green, blue,
20350 and alpha. Each component is then multiplied by the signed scale
20351 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20352 clamped to the range [0,1] (see `glPixelTransfer').
20353
20354`GL_RGB'
20355`GL_BGR'
20356 Each element is an RGB triple. The GL converts it to floating point
20357 and assembles it into an RGBA element by attaching 1 for alpha.
20358 Each component is then multiplied by the signed scale factor
20359 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20360 the range [0,1] (see `glPixelTransfer').
20361
20362`GL_RGBA'
20363`GL_BGRA'
20364 Each element contains all four components. Each component is
20365 multiplied by the signed scale factor `GL_c_SCALE', added to the
20366 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20367 `glPixelTransfer').
20368
20369`GL_LUMINANCE'
20370 Each element is a single luminance value. The GL converts it to
20371 floating point, then assembles it into an RGBA element by
20372 replicating the luminance value three times for red, green, and
20373 blue and attaching 1 for alpha. Each component is then multiplied
20374 by the signed scale factor `GL_c_SCALE', added to the signed bias
20375 `GL_c_BIAS', and clamped to the range [0,1] (see
20376 `glPixelTransfer').
20377
20378`GL_LUMINANCE_ALPHA'
20379 Each element is a luminance/alpha pair. The GL converts it to
20380 floating point, then assembles it into an RGBA element by
20381 replicating the luminance value three times for red, green, and
20382 blue. Each component is then multiplied by the signed scale factor
20383 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20384 the range [0,1] (see `glPixelTransfer').
20385
20386`GL_DEPTH_COMPONENT'
20387 Each element is a single depth value. The GL converts it to
20388 floating point, multiplies by the signed scale factor
20389 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
20390 to the range [0,1] (see `glPixelTransfer').
20391
20392Refer to the `glDrawPixels' reference page for a description of the
20393acceptable values for the TYPE parameter.
20394
20395If an application wants to store the texture at a certain resolution or
20396in a certain format, it can request the resolution and format with
20397INTERNALFORMAT. The GL will choose an internal representation that
20398closely approximates that requested by INTERNALFORMAT, but it may not
20399match exactly. (The representations specified by `GL_LUMINANCE',
20400`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20401numeric values 1, 2, 3, and 4 may also be used to specify the above
20402representations.)
20403
20404If the INTERNALFORMAT parameter is one of the generic compressed
20405formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20406`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20407`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20408internal format with the symbolic constant for a specific internal
20409format and compress the texture before storage. If no corresponding
20410internal format is available, or the GL can not compress that image for
20411any reason, the internal format is instead replaced with a corresponding
20412base internal format.
20413
20414If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20415`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20416`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20417treated as if the red, green, blue, or luminance components are encoded
20418in the sRGB color space. Any alpha component is left unchanged. The
20419conversion from the sRGB encoded component C_S to a linear component C_L
20420is:
20421
20422C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20423C_S>0.04045)
20424
20425Assume C_S is the sRGB component in the range [0,1].
20426
20427Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
20428try out a resolution and format. The implementation will update and
20429recompute its best match for the requested storage resolution and
20430format. To then query this state, call `glGetTexLevelParameter'. If the
20431texture cannot be accommodated, texture state is set to 0.
20432
20433A one-component texture image uses only the red component of the RGBA
20434color extracted from DATA. A two-component image uses the R and A
20435values. A three-component image uses the R, G, and B values. A
20436four-component image uses all of the RGBA components.
20437
20438Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
20439during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
20440\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
20441generate a boolean result. See `glTexParameter' for details on texture
20442comparison.
20443
20444`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
20445`GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
20446`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
20447`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
20448`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
20449
20450`GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
20451image targets and the width and height parameters are not equal.
20452
20453`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20454
20455`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20456`GL_COLOR_INDEX'.
20457
20458`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
20459greater than 2 + `GL_MAX_TEXTURE_SIZE'.
20460
20461`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
20462
20463`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20464LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
20465
20466`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20467one of the accepted resolution and format symbolic constants.
20468
20469`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
20470greater than 2 + `GL_MAX_TEXTURE_SIZE'.
20471
20472`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20473supported and the WIDTH or HEIGHT cannot be represented as
204742^K+2\u2061(BORDER,) for some integer value of K.
20475
20476`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
20477
20478`GL_INVALID_OPERATION' is generated if TYPE is one of
20479`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20480`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20481is not `GL_RGB'.
20482
20483`GL_INVALID_OPERATION' is generated if TYPE is one of
20484`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20485`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20486`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20487`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20488FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 20489
3c9b6116
AW
20490`GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
20491`GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
20492`GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20493`GL_DEPTH_COMPONENT32'.
20494
20495`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
20496and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
20497`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
20498
20499`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
20500`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20501`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
20502
20503`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20504bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
20505data store is currently mapped.
20506
20507`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20508bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
20509unpacked from the buffer object such that the memory reads required
20510would exceed the data store size.
20511
20512`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20513bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
20514divisible into the number of bytes needed to store in memory a datum
20515indicated by TYPE.
20516
20517`GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
20518between the execution of `glBegin' and the corresponding execution of
20519`glEnd'.")
8925f36f 20520
25072f02 20521(define-gl-procedures
bb894c9d
AW
20522 ((glTexImage3D
20523 (target GLenum)
20524 (level GLint)
20525 (internalFormat GLint)
20526 (width GLsizei)
20527 (height GLsizei)
20528 (depth GLsizei)
20529 (border GLint)
20530 (format GLenum)
20531 (type GLenum)
00239761 20532 (data const-GLvoid-*)
bb894c9d
AW
20533 ->
20534 void))
3c9b6116 20535 "Specify a three-dimensional texture image.
8925f36f 20536
3c9b6116
AW
20537TARGET
20538 Specifies the target texture. Must be `GL_TEXTURE_3D' or
20539 `GL_PROXY_TEXTURE_3D'.
8925f36f 20540
3c9b6116
AW
20541LEVEL
20542 Specifies the level-of-detail number. Level 0 is the base image
20543 level. Level N is the N^TH mipmap reduction image.
8925f36f 20544
3c9b6116
AW
20545INTERNALFORMAT
20546 Specifies the number of color components in the texture. Must be 1,
20547 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20548 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20549 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20550 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20551 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
20552 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
20553 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20554 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20555 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20556 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20557 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20558 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20559 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20560 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20561 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20562 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20563 `GL_SRGB8_ALPHA8'.
8925f36f 20564
3c9b6116
AW
20565WIDTH
20566 Specifies the width of the texture image including the border if
20567 any. If the GL version does not support non-power-of-two sizes,
20568 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20569 implementations support 3D texture images that are at least 16
20570 texels wide.
8925f36f 20571
3c9b6116
AW
20572HEIGHT
20573 Specifies the height of the texture image including the border if
20574 any. If the GL version does not support non-power-of-two sizes,
20575 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
20576 implementations support 3D texture images that are at least 16
20577 texels high.
8925f36f 20578
3c9b6116
AW
20579DEPTH
20580 Specifies the depth of the texture image including the border if
20581 any. If the GL version does not support non-power-of-two sizes,
20582 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
20583 implementations support 3D texture images that are at least 16
20584 texels deep.
8925f36f 20585
3c9b6116
AW
20586BORDER
20587 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20588
3c9b6116
AW
20589FORMAT
20590 Specifies the format of the pixel data. The following symbolic
20591 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20592 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20593 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20594
3c9b6116
AW
20595TYPE
20596 Specifies the data type of the pixel data. The following symbolic
20597 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20598 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20599 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20600 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20601 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20602 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20603 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20604 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 20605
3c9b6116
AW
20606DATA
20607 Specifies a pointer to the image data in memory.
20608
20609Texturing maps a portion of a specified texture image onto each
20610graphical primitive for which texturing is enabled. To enable and
20611disable three-dimensional texturing, call `glEnable' and `glDisable'
20612with argument `GL_TEXTURE_3D'.
20613
20614To define texture images, call `glTexImage3D'. The arguments describe
20615the parameters of the texture image, such as height, width, depth, width
20616of the border, level-of-detail number (see `glTexParameter'), and number
20617of color components provided. The last three arguments describe how the
20618image is represented in memory; they are identical to the pixel formats
20619used for `glDrawPixels'.
20620
20621If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
20622of the texture image state is recalculated, checked for consistency, and
20623checked against the implementation's capabilities. If the implementation
20624cannot handle a texture of the requested texture size, it sets all of
20625the image state to 0, but does not generate an error (see `glGetError').
20626To query for an entire mipmap array, use an image array level greater
20627than or equal to 1.
20628
20629If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
20630signed or unsigned bytes, shorts, or longs, or single-precision
20631floating-point values, depending on TYPE. These values are grouped into
20632sets of one, two, three, or four values, depending on FORMAT, to form
20633elements. If TYPE is `GL_BITMAP', the data is considered as a string of
20634unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
20635treated as eight 1-bit elements, with bit ordering determined by
20636`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
20637
20638If a non-zero named buffer object is bound to the
20639`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
20640image is specified, DATA is treated as a byte offset into the buffer
20641object's data store.
20642
20643The first element corresponds to the lower left corner of the texture
20644image. Subsequent elements progress left-to-right through the remaining
20645texels in the lowest row of the texture image, and then in successively
20646higher rows of the texture image. The final element corresponds to the
20647upper right corner of the texture image.
20648
20649FORMAT determines the composition of each element in DATA. It can assume
20650one of these symbolic values:
20651
20652`GL_COLOR_INDEX'
20653 Each element is a single value, a color index. The GL converts it
20654 to fixed point (with an unspecified number of zero bits to the
20655 right of the binary point), shifted left or right depending on the
20656 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
20657 (see `glPixelTransfer'). The resulting index is converted to a set
20658 of color components using the `GL_PIXEL_MAP_I_TO_R',
20659 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
20660 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
20661
20662`GL_RED'
20663 Each element is a single red component. The GL converts it to
20664 floating point and assembles it into an RGBA element by attaching 0
20665 for green and blue, and 1 for alpha. Each component is then
20666 multiplied by the signed scale factor `GL_c_SCALE', added to the
20667 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20668 `glPixelTransfer').
20669
20670`GL_GREEN'
20671 Each element is a single green component. The GL converts it to
20672 floating point and assembles it into an RGBA element by attaching 0
20673 for red and blue, and 1 for alpha. Each component is then
20674 multiplied by the signed scale factor `GL_c_SCALE', added to the
20675 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20676 `glPixelTransfer').
20677
20678`GL_BLUE'
20679 Each element is a single blue component. The GL converts it to
20680 floating point and assembles it into an RGBA element by attaching 0
20681 for red and green, and 1 for alpha. Each component is then
20682 multiplied by the signed scale factor `GL_c_SCALE', added to the
20683 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20684 `glPixelTransfer').
20685
20686`GL_ALPHA'
20687 Each element is a single alpha component. The GL converts it to
20688 floating point and assembles it into an RGBA element by attaching 0
20689 for red, green, and blue. Each component is then multiplied by the
20690 signed scale factor `GL_c_SCALE', added to the signed bias
20691 `GL_c_BIAS', and clamped to the range [0,1] (see
20692 `glPixelTransfer').
20693
20694`GL_INTENSITY'
20695 Each element is a single intensity value. The GL converts it to
20696 floating point, then assembles it into an RGBA element by
20697 replicating the intensity value three times for red, green, blue,
20698 and alpha. Each component is then multiplied by the signed scale
20699 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20700 clamped to the range [0,1] (see `glPixelTransfer').
20701
20702`GL_RGB'
20703`GL_BGR'
20704 Each element is an RGB triple. The GL converts it to floating point
20705 and assembles it into an RGBA element by attaching 1 for alpha.
20706 Each component is then multiplied by the signed scale factor
20707 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20708 the range [0,1] (see `glPixelTransfer').
20709
20710`GL_RGBA'
20711`GL_BGRA'
20712 Each element contains all four components. Each component is
20713 multiplied by the signed scale factor `GL_c_SCALE', added to the
20714 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20715 `glPixelTransfer').
20716
20717`GL_LUMINANCE'
20718 Each element is a single luminance value. The GL converts it to
20719 floating point, then assembles it into an RGBA element by
20720 replicating the luminance value three times for red, green, and
20721 blue and attaching 1 for alpha. Each component is then multiplied
20722 by the signed scale factor `GL_c_SCALE', added to the signed bias
20723 `GL_c_BIAS', and clamped to the range [0,1] (see
20724 `glPixelTransfer').
20725
20726`GL_LUMINANCE_ALPHA'
20727 Each element is a luminance/alpha pair. The GL converts it to
20728 floating point, then assembles it into an RGBA element by
20729 replicating the luminance value three times for red, green, and
20730 blue. Each component is then multiplied by the signed scale factor
20731 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20732 the range [0,1] (see `glPixelTransfer').
20733
20734Refer to the `glDrawPixels' reference page for a description of the
20735acceptable values for the TYPE parameter.
20736
20737If an application wants to store the texture at a certain resolution or
20738in a certain format, it can request the resolution and format with
20739INTERNALFORMAT. The GL will choose an internal representation that
20740closely approximates that requested by INTERNALFORMAT, but it may not
20741match exactly. (The representations specified by `GL_LUMINANCE',
20742`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20743numeric values 1, 2, 3, and 4 may also be used to specify the above
20744representations.)
20745
20746If the INTERNALFORMAT parameter is one of the generic compressed
20747formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20748`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20749`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20750internal format with the symbolic constant for a specific internal
20751format and compress the texture before storage. If no corresponding
20752internal format is available, or the GL can not compress that image for
20753any reason, the internal format is instead replaced with a corresponding
20754base internal format.
20755
20756If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20757`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20758`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20759treated as if the red, green, blue, or luminance components are encoded
20760in the sRGB color space. Any alpha component is left unchanged. The
20761conversion from the sRGB encoded component C_S to a linear component C_L
20762is:
20763
20764C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20765C_S>0.04045)
20766
20767Assume C_S is the sRGB component in the range [0,1].
20768
20769Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
20770The implementation will update and recompute its best match for the
20771requested storage resolution and format. To then query this state, call
20772`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
20773state is set to 0.
20774
20775A one-component texture image uses only the red component of the RGBA
20776color extracted from DATA. A two-component image uses the R and A
20777values. A three-component image uses the R, G, and B values. A
20778four-component image uses all of the RGBA components.
20779
20780`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
20781`GL_PROXY_TEXTURE_3D'.
20782
20783`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
20784constant. Format constants other than `GL_STENCIL_INDEX' and
20785`GL_DEPTH_COMPONENT' are accepted.
20786
20787`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20788
20789`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20790`GL_COLOR_INDEX'.
20791
20792`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
20793
20794`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20795LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
20796
20797`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20798one of the accepted resolution and format symbolic constants.
20799
20800`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
208010 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
20802
20803`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20804supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
208052^K+2\u2061(BORDER,) for some integer value of K.
20806
20807`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
20808
20809`GL_INVALID_OPERATION' is generated if TYPE is one of
20810`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20811`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20812is not `GL_RGB'.
20813
20814`GL_INVALID_OPERATION' is generated if TYPE is one of
20815`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20816`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20817`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20818`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20819FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
20820
20821`GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
20822`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20823`GL_DEPTH_COMPONENT32'.
20824
20825`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20826bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
20827data store is currently mapped.
20828
20829`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20830bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
20831unpacked from the buffer object such that the memory reads required
20832would exceed the data store size.
20833
20834`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20835bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
20836divisible into the number of bytes needed to store in memory a datum
20837indicated by TYPE.
20838
20839`GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
20840between the execution of `glBegin' and the corresponding execution of
20841`glEnd'.")
8925f36f 20842
25072f02 20843(define-gl-procedures
bb894c9d
AW
20844 ((glTexParameterf
20845 (target GLenum)
20846 (pname GLenum)
20847 (param GLfloat)
20848 ->
20849 void)
20850 (glTexParameteri
20851 (target GLenum)
20852 (pname GLenum)
20853 (param GLint)
20854 ->
20855 void))
3c9b6116 20856 "Set texture parameters.
8925f36f 20857
3c9b6116
AW
20858TARGET
20859 Specifies the target texture, which must be either `GL_TEXTURE_1D',
20860 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
8925f36f 20861
3c9b6116
AW
20862PNAME
20863 Specifies the symbolic name of a single-valued texture parameter.
20864 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
20865 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
20866 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
20867 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
20868 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
20869 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
20870 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
20871
20872PARAM
20873 Specifies the value of PNAME.
20874
20875Texture mapping is a technique that applies an image onto an object's
20876surface as if the image were a decal or cellophane shrink-wrap. The
20877image is created in texture space, with an (S , T ) coordinate system. A
20878texture is a one- or two-dimensional image and a set of parameters that
20879determine how samples are derived from the image.
20880
20881`glTexParameter' assigns the value or values in PARAMS to the texture
20882parameter specified as PNAME. TARGET defines the target texture, either
20883`GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
20884symbols are accepted in PNAME:
20885
20886`GL_TEXTURE_MIN_FILTER'
20887 The texture minifying function is used whenever the pixel being
20888 textured maps to an area greater than one texture element. There
20889 are six defined minifying functions. Two of them use the nearest
20890 one or nearest four texture elements to compute the texture value.
20891 The other four use mipmaps.
20892
20893 A mipmap is an ordered set of arrays representing the same image at
20894 progressively lower resolutions. If the texture has dimensions
20895 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
20896 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
20897 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
20898 the previous mipmap, until either K=0 or L=0 . At that point,
20899 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
20900 final mipmap, which has dimension 1×1 . To define the mipmaps, call
20901 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
20902 or `glCopyTexImage2D' with the LEVEL argument indicating the order
20903 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
20904 the final 1×1 mipmap.
20905
20906 PARAMS supplies a function for minifying the texture as one of the
20907 following:
20908
20909 As more texture elements are sampled in the minification process,
20910 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
20911 and `GL_LINEAR' minification functions can be faster than the other
20912 four, they sample only one or four texture elements to determine
20913 the texture value of the pixel being rendered and can produce moire
20914 patterns or ragged transitions. The initial value of
20915 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
20916
20917`GL_TEXTURE_MAG_FILTER'
20918 The texture magnification function is used when the pixel being
20919 textured maps to an area less than or equal to one texture element.
20920 It sets the texture magnification function to either `GL_NEAREST'
20921 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
20922 `GL_LINEAR', but it can produce textured images with sharper edges
20923 because the transition between texture elements is not as smooth.
20924 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
20925
20926`GL_NEAREST'
20927 Returns the value of the texture element that is nearest (in
20928 Manhattan distance) to the center of the pixel being textured.
20929
20930`GL_LINEAR'
20931 Returns the weighted average of the four texture elements that are
20932 closest to the center of the pixel being textured. These can
20933 include border texture elements, depending on the values of
20934 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
20935 mapping.
20936
20937`GL_NEAREST_MIPMAP_NEAREST'
20938 Chooses the mipmap that most closely matches the size of the pixel
20939 being textured and uses the `GL_NEAREST' criterion (the texture
20940 element nearest to the center of the pixel) to produce a texture
20941 value.
20942
20943`GL_LINEAR_MIPMAP_NEAREST'
20944 Chooses the mipmap that most closely matches the size of the pixel
20945 being textured and uses the `GL_LINEAR' criterion (a weighted
20946 average of the four texture elements that are closest to the center
20947 of the pixel) to produce a texture value.
20948
20949`GL_NEAREST_MIPMAP_LINEAR'
20950 Chooses the two mipmaps that most closely match the size of the
20951 pixel being textured and uses the `GL_NEAREST' criterion (the
20952 texture element nearest to the center of the pixel) to produce a
20953 texture value from each mipmap. The final texture value is a
20954 weighted average of those two values.
20955
20956`GL_LINEAR_MIPMAP_LINEAR'
20957 Chooses the two mipmaps that most closely match the size of the
20958 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
20959 average of the four texture elements that are closest to the center
20960 of the pixel) to produce a texture value from each mipmap. The
20961 final texture value is a weighted average of those two values.
20962
20963`GL_NEAREST'
20964 Returns the value of the texture element that is nearest (in
20965 Manhattan distance) to the center of the pixel being textured.
20966
20967`GL_LINEAR'
20968 Returns the weighted average of the four texture elements that are
20969 closest to the center of the pixel being textured. These can
20970 include border texture elements, depending on the values of
20971 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
20972 mapping.
20973
20974
20975
20976`GL_TEXTURE_MIN_LOD'
20977 Sets the minimum level-of-detail parameter. This floating-point
20978 value limits the selection of highest resolution mipmap (lowest
20979 mipmap level). The initial value is -1000.
20980
20981
20982
20983`GL_TEXTURE_MAX_LOD'
20984 Sets the maximum level-of-detail parameter. This floating-point
20985 value limits the selection of the lowest resolution mipmap (highest
20986 mipmap level). The initial value is 1000.
20987
20988
20989
20990`GL_TEXTURE_BASE_LEVEL'
20991 Specifies the index of the lowest defined mipmap level. This is an
20992 integer value. The initial value is 0.
20993
20994
20995
20996`GL_TEXTURE_MAX_LEVEL'
20997 Sets the index of the highest defined mipmap level. This is an
20998 integer value. The initial value is 1000.
20999
21000
21001
21002`GL_TEXTURE_WRAP_S'
21003 Sets the wrap parameter for texture coordinate S to either
21004 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21005 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
21006 coordinates to be clamped to the range [0,1] and is useful for
21007 preventing wrapping artifacts when mapping a single image onto an
21008 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
21009 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
21010 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
21011 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
21012 the size of the texture in the direction of clamping. `GL_REPEAT'
21013 causes the integer part of the S coordinate to be ignored; the GL
21014 uses only the fractional part, thereby creating a repeating
21015 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
21016 the fractional part of the texture coordinate if the integer part
21017 of S is even; if the integer part of S is odd, then the S texture
21018 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
21019 fractional part of S . Border texture elements are accessed only if
21020 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
21021 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
21022
21023
21024
21025`GL_TEXTURE_WRAP_T'
21026 Sets the wrap parameter for texture coordinate T to either
21027 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21028 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21029 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
21030 `GL_REPEAT'.
21031
21032`GL_TEXTURE_WRAP_R'
21033 Sets the wrap parameter for texture coordinate R to either
21034 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21035 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21036 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
21037 `GL_REPEAT'.
21038
21039`GL_TEXTURE_BORDER_COLOR'
21040 Sets a border color. PARAMS contains four values that comprise the
21041 RGBA color of the texture border. Integer color components are
21042 interpreted linearly such that the most positive integer maps to
21043 1.0, and the most negative integer maps to -1.0. The values are
21044 clamped to the range [0,1] when they are specified. Initially, the
21045 border color is (0, 0, 0, 0).
21046
21047`GL_TEXTURE_PRIORITY'
21048 Specifies the texture residence priority of the currently bound
21049 texture. Permissible values are in the range [0,1] . See
21050 `glPrioritizeTextures' and `glBindTexture' for more information.
21051
21052`GL_TEXTURE_COMPARE_MODE'
21053 Specifies the texture comparison mode for currently bound depth
21054 textures. That is, a texture whose internal format is
21055 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
21056
21057`GL_TEXTURE_COMPARE_FUNC'
21058 Specifies the comparison operator used when
21059 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
21060 Permissible values are: where R is the current interpolated texture
21061 coordinate, and D_T is the depth texture value sampled from the
21062 currently bound depth texture. RESULT is assigned to the either the
21063 luminance, intensity, or alpha (as specified by
21064 `GL_DEPTH_TEXTURE_MODE'.)
21065
21066`GL_DEPTH_TEXTURE_MODE'
21067 Specifies a single symbolic constant indicating how depth values
21068 should be treated during filtering and texture application.
21069 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
21070 The initial value is `GL_LUMINANCE'.
21071
21072`GL_GENERATE_MIPMAP'
21073 Specifies a boolean value that indicates if all levels of a mipmap
21074 array should be automatically updated when any modification to the
21075 base level mipmap is done. The initial value is `GL_FALSE'.
21076
21077`GL_COMPARE_R_TO_TEXTURE'
21078 Specifies that the interpolated and clamped R texture coordinate
21079 should be compared to the value in the currently bound depth
21080 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
21081 details of how the comparison is evaluated. The result of the
21082 comparison is assigned to luminance, intensity, or alpha (as
21083 specified by `GL_DEPTH_TEXTURE_MODE').
21084
21085`GL_NONE'
21086 Specifies that the luminance, intensity, or alpha (as specified by
21087 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
21088 from the currently bound depth texture.
21089
21090*Texture Comparison Function*
21091 *Computed result*
21092
21093`GL_LEQUAL'
21094 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
21095
21096`GL_GEQUAL'
21097 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
21098
21099`GL_LESS'
21100 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
21101
21102`GL_GREATER'
21103 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
8925f36f 21104
3c9b6116
AW
21105`GL_EQUAL'
21106 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
8925f36f 21107
3c9b6116
AW
21108`GL_NOTEQUAL'
21109 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
8925f36f 21110
3c9b6116
AW
21111`GL_ALWAYS'
21112 RESULT=`1.0'
21113
21114`GL_NEVER'
21115 RESULT=`0.0'
21116
21117`GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
21118accepted defined values.
21119
21120`GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
21121value (based on the value of PNAME) and does not.
21122
21123`GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
21124between the execution of `glBegin' and the corresponding execution of
21125`glEnd'.")
8925f36f 21126
25072f02 21127(define-gl-procedures
bb894c9d
AW
21128 ((glTexSubImage1D
21129 (target GLenum)
21130 (level GLint)
21131 (xoffset GLint)
21132 (width GLsizei)
21133 (format GLenum)
21134 (type GLenum)
00239761 21135 (data const-GLvoid-*)
bb894c9d
AW
21136 ->
21137 void))
3c9b6116
AW
21138 "Specify a one-dimensional texture subimage.
21139
21140TARGET
21141 Specifies the target texture. Must be `GL_TEXTURE_1D'.
21142
21143LEVEL
21144 Specifies the level-of-detail number. Level 0 is the base image
21145 level. Level N is the Nth mipmap reduction image.
21146
21147XOFFSET
21148 Specifies a texel offset in the x direction within the texture
21149 array.
21150
21151WIDTH
21152 Specifies the width of the texture subimage.
21153
21154FORMAT
21155 Specifies the format of the pixel data. The following symbolic
21156 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21157 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21158 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21159
21160TYPE
21161 Specifies the data type of the pixel data. The following symbolic
21162 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21163 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21164 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21165 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21166 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21167 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21168 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21169 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21170
21171DATA
21172 Specifies a pointer to the image data in memory.
21173
21174Texturing maps a portion of a specified texture image onto each
21175graphical primitive for which texturing is enabled. To enable or disable
21176one-dimensional texturing, call `glEnable' and `glDisable' with argument
21177`GL_TEXTURE_1D'.
21178
21179`glTexSubImage1D' redefines a contiguous subregion of an existing
21180one-dimensional texture image. The texels referenced by DATA replace the
21181portion of the existing texture array with x indices XOFFSET and
21182XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
21183outside the range of the texture array as it was originally specified.
21184It is not an error to specify a subtexture with width of 0, but such a
21185specification has no effect.
21186
21187If a non-zero named buffer object is bound to the
21188`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21189image is specified, DATA is treated as a byte offset into the buffer
21190object's data store.
21191
21192`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
21193values.
21194
21195`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21196constant.
21197
21198`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21199
21200`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21201`GL_COLOR_INDEX'.
21202
21203`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21204
21205`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21206where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21207
21208`GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
21209(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
21210the width of the `GL_TEXTURE_BORDER' of the texture image being
21211modified. Note that W includes twice the border width.
21212
21213`GL_INVALID_VALUE' is generated if WIDTH is less than 0.
21214
21215`GL_INVALID_OPERATION' is generated if the texture array has not been
21216defined by a previous `glTexImage1D' operation.
21217
21218`GL_INVALID_OPERATION' is generated if TYPE is one of
21219`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21220`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21221is not `GL_RGB'.
21222
21223`GL_INVALID_OPERATION' is generated if TYPE is one of
21224`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21225`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21226`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21227`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21228FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21229
21230`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21231bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21232data store is currently mapped.
21233
21234`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21235bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21236unpacked from the buffer object such that the memory reads required
21237would exceed the data store size.
21238
21239`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21240bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21241divisible into the number of bytes needed to store in memory a datum
21242indicated by TYPE.
21243
21244`GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
21245between the execution of `glBegin' and the corresponding execution of
21246`glEnd'.")
8925f36f 21247
25072f02 21248(define-gl-procedures
bb894c9d
AW
21249 ((glTexSubImage2D
21250 (target GLenum)
21251 (level GLint)
21252 (xoffset GLint)
21253 (yoffset GLint)
21254 (width GLsizei)
21255 (height GLsizei)
21256 (format GLenum)
21257 (type GLenum)
00239761 21258 (data const-GLvoid-*)
bb894c9d
AW
21259 ->
21260 void))
3c9b6116
AW
21261 "Specify a two-dimensional texture subimage.
21262
21263TARGET
21264 Specifies the target texture. Must be `GL_TEXTURE_2D',
21265 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
21266 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
21267 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
21268 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
21269
21270LEVEL
21271 Specifies the level-of-detail number. Level 0 is the base image
21272 level. Level N is the Nth mipmap reduction image.
21273
21274XOFFSET
21275 Specifies a texel offset in the x direction within the texture
21276 array.
21277
21278YOFFSET
21279 Specifies a texel offset in the y direction within the texture
21280 array.
21281
21282WIDTH
21283 Specifies the width of the texture subimage.
21284
21285HEIGHT
21286 Specifies the height of the texture subimage.
21287
21288FORMAT
21289 Specifies the format of the pixel data. The following symbolic
21290 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21291 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21292 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21293
21294TYPE
21295 Specifies the data type of the pixel data. The following symbolic
21296 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21297 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21298 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21299 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21300 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21301 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21302 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21303 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21304
21305DATA
21306 Specifies a pointer to the image data in memory.
21307
21308Texturing maps a portion of a specified texture image onto each
21309graphical primitive for which texturing is enabled. To enable and
21310disable two-dimensional texturing, call `glEnable' and `glDisable' with
21311argument `GL_TEXTURE_2D'.
21312
21313`glTexSubImage2D' redefines a contiguous subregion of an existing
21314two-dimensional texture image. The texels referenced by DATA replace the
21315portion of the existing texture array with x indices XOFFSET and
21316XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
21317, inclusive. This region may not include any texels outside the range of
21318the texture array as it was originally specified. It is not an error to
21319specify a subtexture with zero width or height, but such a specification
21320has no effect.
21321
21322If a non-zero named buffer object is bound to the
21323`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21324image is specified, DATA is treated as a byte offset into the buffer
21325object's data store.
21326
21327`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
21328`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
21329`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
21330`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
21331
21332`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21333constant.
21334
21335`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21336
21337`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21338`GL_COLOR_INDEX'.
21339
21340`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21341
21342`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21343where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21344
21345`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
21346, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
21347`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
21348width of the texture image being modified. Note that W and H include
21349twice the border width.
21350
21351`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
21352
21353`GL_INVALID_OPERATION' is generated if the texture array has not been
21354defined by a previous `glTexImage2D' operation.
21355
21356`GL_INVALID_OPERATION' is generated if TYPE is one of
21357`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21358`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21359is not `GL_RGB'.
21360
21361`GL_INVALID_OPERATION' is generated if TYPE is one of
21362`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21363`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21364`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21365`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21366FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21367
21368`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21369bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21370data store is currently mapped.
21371
21372`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21373bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21374unpacked from the buffer object such that the memory reads required
21375would exceed the data store size.
21376
21377`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21378bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21379divisible into the number of bytes needed to store in memory a datum
21380indicated by TYPE.
21381
21382`GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
21383between the execution of `glBegin' and the corresponding execution of
21384`glEnd'.")
8925f36f 21385
25072f02 21386(define-gl-procedures
bb894c9d
AW
21387 ((glTexSubImage3D
21388 (target GLenum)
21389 (level GLint)
21390 (xoffset GLint)
21391 (yoffset GLint)
21392 (zoffset GLint)
21393 (width GLsizei)
21394 (height GLsizei)
21395 (depth GLsizei)
21396 (format GLenum)
21397 (type GLenum)
00239761 21398 (data const-GLvoid-*)
bb894c9d
AW
21399 ->
21400 void))
3c9b6116
AW
21401 "Specify a three-dimensional texture subimage.
21402
21403TARGET
21404 Specifies the target texture. Must be `GL_TEXTURE_3D'.
21405
21406LEVEL
21407 Specifies the level-of-detail number. Level 0 is the base image
21408 level. Level N is the Nth mipmap reduction image.
21409
21410XOFFSET
21411 Specifies a texel offset in the x direction within the texture
21412 array.
21413
21414YOFFSET
21415 Specifies a texel offset in the y direction within the texture
21416 array.
21417
21418ZOFFSET
21419 Specifies a texel offset in the z direction within the texture
21420 array.
21421
21422WIDTH
21423 Specifies the width of the texture subimage.
21424
21425HEIGHT
21426 Specifies the height of the texture subimage.
21427
21428DEPTH
21429 Specifies the depth of the texture subimage.
21430
21431FORMAT
21432 Specifies the format of the pixel data. The following symbolic
21433 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21434 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21435 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
21436
21437TYPE
21438 Specifies the data type of the pixel data. The following symbolic
21439 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21440 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21441 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21442 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21443 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21444 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21445 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21446 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
21447
21448DATA
21449 Specifies a pointer to the image data in memory.
21450
21451Texturing maps a portion of a specified texture image onto each
21452graphical primitive for which texturing is enabled. To enable and
21453disable three-dimensional texturing, call `glEnable' and `glDisable'
21454with argument `GL_TEXTURE_3D'.
21455
21456`glTexSubImage3D' redefines a contiguous subregion of an existing
21457three-dimensional texture image. The texels referenced by DATA replace
21458the portion of the existing texture array with x indices XOFFSET and
21459XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
21460inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
21461region may not include any texels outside the range of the texture array
21462as it was originally specified. It is not an error to specify a
21463subtexture with zero width, height, or depth but such a specification
21464has no effect.
21465
21466If a non-zero named buffer object is bound to the
21467`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21468image is specified, DATA is treated as a byte offset into the buffer
21469object's data store.
21470
21471`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
21472
21473`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21474constant.
21475
21476`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21477
21478`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21479`GL_COLOR_INDEX'.
21480
21481`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21482
21483`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
21484where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21485
21486`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
21487, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
21488(ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
21489`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
21490width of the texture image being modified. Note that W , H , and D
21491include twice the border width.
21492
21493`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
214940.
21495
21496`GL_INVALID_OPERATION' is generated if the texture array has not been
21497defined by a previous `glTexImage3D' operation.
21498
21499`GL_INVALID_OPERATION' is generated if TYPE is one of
21500`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21501`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21502is not `GL_RGB'.
21503
21504`GL_INVALID_OPERATION' is generated if TYPE is one of
21505`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21506`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21507`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21508`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21509FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21510
21511`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21512bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21513data store is currently mapped.
21514
21515`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21516bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21517unpacked from the buffer object such that the memory reads required
21518would exceed the data store size.
21519
21520`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21521bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21522divisible into the number of bytes needed to store in memory a datum
21523indicated by TYPE.
21524
21525`GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
21526between the execution of `glBegin' and the corresponding execution of
21527`glEnd'.")
8925f36f 21528
25072f02 21529(define-gl-procedures
ca09631c
AW
21530 ((glTranslatef
21531 (x GLfloat)
21532 (y GLfloat)
21533 (z GLfloat)
bb894c9d
AW
21534 ->
21535 void))
3c9b6116
AW
21536 "Multiply the current matrix by a translation matrix.
21537
21538X
21539 Y
21540
21541 Z
21542
21543 Specify the X, Y, and Z coordinates of a translation vector.
21544
21545`glTranslate' produces a translation by (X,YZ) . The current matrix (see
21546`glMatrixMode') is multiplied by this translation matrix, with the
21547product replacing the current matrix, as if `glMultMatrix' were called
21548with the following matrix for its argument:
21549
21550((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
21551
21552
21553
21554If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
21555objects drawn after a call to `glTranslate' are translated.
21556
21557Use `glPushMatrix' and `glPopMatrix' to save and restore the
21558untranslated coordinate system.
21559
21560`GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
21561the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 21562
25072f02 21563(define-gl-procedures
bb894c9d
AW
21564 ((glUniform1f
21565 (location GLint)
21566 (v0 GLfloat)
21567 ->
21568 void)
21569 (glUniform2f
21570 (location GLint)
21571 (v0 GLfloat)
21572 (v1 GLfloat)
21573 ->
21574 void)
21575 (glUniform3f
21576 (location GLint)
21577 (v0 GLfloat)
21578 (v1 GLfloat)
21579 (v2 GLfloat)
21580 ->
21581 void)
21582 (glUniform4f
21583 (location GLint)
21584 (v0 GLfloat)
21585 (v1 GLfloat)
21586 (v2 GLfloat)
21587 (v3 GLfloat)
21588 ->
21589 void)
21590 (glUniform1i (location GLint) (v0 GLint) -> void)
21591 (glUniform2i
21592 (location GLint)
21593 (v0 GLint)
21594 (v1 GLint)
21595 ->
21596 void)
21597 (glUniform3i
21598 (location GLint)
21599 (v0 GLint)
21600 (v1 GLint)
21601 (v2 GLint)
21602 ->
21603 void)
21604 (glUniform4i
21605 (location GLint)
21606 (v0 GLint)
21607 (v1 GLint)
21608 (v2 GLint)
21609 (v3 GLint)
21610 ->
b002944d
AW
21611 void)
21612 (glUniformMatrix2fv
21613 (location GLint)
21614 (count GLsizei)
21615 (transpose GLboolean)
21616 (value const-GLfloat-*)
21617 ->
21618 void)
21619 (glUniformMatrix3fv
21620 (location GLint)
21621 (count GLsizei)
21622 (transpose GLboolean)
21623 (value const-GLfloat-*)
21624 ->
21625 void)
21626 (glUniformMatrix4fv
21627 (location GLint)
21628 (count GLsizei)
21629 (transpose GLboolean)
21630 (value const-GLfloat-*)
21631 ->
21632 void)
21633 (glUniformMatrix2x3fv
21634 (location GLint)
21635 (count GLsizei)
21636 (transpose GLboolean)
21637 (value const-GLfloat-*)
21638 ->
21639 void)
21640 (glUniformMatrix3x2fv
21641 (location GLint)
21642 (count GLsizei)
21643 (transpose GLboolean)
21644 (value const-GLfloat-*)
21645 ->
21646 void)
21647 (glUniformMatrix2x4fv
21648 (location GLint)
21649 (count GLsizei)
21650 (transpose GLboolean)
21651 (value const-GLfloat-*)
21652 ->
21653 void)
21654 (glUniformMatrix4x2fv
21655 (location GLint)
21656 (count GLsizei)
21657 (transpose GLboolean)
21658 (value const-GLfloat-*)
21659 ->
21660 void)
21661 (glUniformMatrix3x4fv
21662 (location GLint)
21663 (count GLsizei)
21664 (transpose GLboolean)
21665 (value const-GLfloat-*)
21666 ->
21667 void)
21668 (glUniformMatrix4x3fv
21669 (location GLint)
21670 (count GLsizei)
21671 (transpose GLboolean)
21672 (value const-GLfloat-*)
21673 ->
bb894c9d 21674 void))
3c9b6116
AW
21675 "Specify the value of a uniform variable for the current program object.
21676
21677LOCATION
21678 Specifies the location of the uniform variable to be modified.
21679
21680V0, V1, V2, V3
21681 Specifies the new values to be used for the specified uniform
21682 variable.
21683
21684`glUniform' modifies the value of a uniform variable or a uniform
21685variable array. The location of the uniform variable to be modified is
21686specified by LOCATION, which should be a value returned by
21687`glGetUniformLocation'. `glUniform' operates on the program object that
21688was made part of current state by calling `glUseProgram'.
21689
21690The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
21691the uniform variable specified by LOCATION using the values passed as
21692arguments. The number specified in the command should match the number
21693of components in the data type of the specified uniform variable (e.g.,
21694`1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
21695`f' indicates that floating-point values are being passed; the suffix
21696`i' indicates that integer values are being passed, and this type should
21697also match the data type of the specified uniform variable. The `i'
21698variants of this function should be used to provide values for uniform
21699variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
21700`f' variants should be used to provide values for uniform variables of
21701type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
21702`f' variants may be used to provide values for uniform variables of type
21703bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
21704be set to false if the input value is 0 or 0.0f, and it will be set to
21705true otherwise.
21706
21707All active uniform variables defined in a program object are initialized
21708to 0 when the program object is linked successfully. They retain the
21709values assigned to them by a call to `glUniform ' until the next
21710successful link operation occurs on the program object, when they are
21711once again initialized to 0.
21712
21713The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
21714uniform variable or a uniform variable array. These commands pass a
21715count and a pointer to the values to be loaded into a uniform variable
21716or a uniform variable array. A count of 1 should be used if modifying
21717the value of a single uniform variable, and a count of 1 or greater can
21718be used to modify an entire array or part of an array. When loading N
21719elements starting at an arbitrary position M in a uniform variable
21720array, elements M + N - 1 in the array will be replaced with the new
21721values. If M + N - 1 is larger than the size of the uniform variable
21722array, values for all array elements beyond the end of the array will be
21723ignored. The number specified in the name of the command indicates the
21724number of components for each element in VALUE, and it should match the
21725number of components in the data type of the specified uniform variable
21726(e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
21727data type specified in the name of the command must match the data type
21728for the specified uniform variable as described previously for
21729`glUniform{1|2|3|4}{f|i}'.
21730
21731For uniform variable arrays, each element of the array is considered to
21732be of the type indicated in the name of the command (e.g., `glUniform3f'
21733or `glUniform3fv' can be used to load a uniform variable array of type
21734vec3). The number of elements of the uniform variable array to be
21735modified is specified by COUNT
21736
21737The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
21738to modify a matrix or an array of matrices. The numbers in the command
21739name are interpreted as the dimensionality of the matrix. The number `2'
21740indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
21741× 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
21742(i.e., 16 values). Non-square matrix dimensionality is explicit, with
21743the first number representing the number of columns and the second
21744number representing the number of rows. For example, `2x4' indicates a 2
21745× 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
21746`GL_FALSE', each matrix is assumed to be supplied in column major order.
21747If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
21748major order. The COUNT argument indicates the number of matrices to be
21749passed. A count of 1 should be used if modifying the value of a single
21750matrix, and a count greater than 1 can be used to modify an array of
21751matrices.
21752
21753`GL_INVALID_OPERATION' is generated if there is no current program
21754object.
21755
21756`GL_INVALID_OPERATION' is generated if the size of the uniform variable
21757declared in the shader does not match the size indicated by the
21758`glUniform' command.
21759
21760`GL_INVALID_OPERATION' is generated if one of the integer variants of
21761this function is used to load a uniform variable of type float, vec2,
21762vec3, vec4, or an array of these, or if one of the floating-point
21763variants of this function is used to load a uniform variable of type
21764int, ivec2, ivec3, or ivec4, or an array of these.
21765
21766`GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
21767location for the current program object and LOCATION is not equal to -1.
21768
21769`GL_INVALID_VALUE' is generated if COUNT is less than 0.
21770
21771`GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
21772indicated uniform variable is not an array variable.
21773
21774`GL_INVALID_OPERATION' is generated if a sampler is loaded using a
21775command other than `glUniform1i' and `glUniform1iv'.
21776
21777`GL_INVALID_OPERATION' is generated if `glUniform' is executed between
21778the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 21779
25072f02 21780(define-gl-procedures
bb894c9d 21781 ((glUseProgram (program GLuint) -> void))
3c9b6116
AW
21782 "Installs a program object as part of current rendering state.
21783
21784PROGRAM
21785 Specifies the handle of the program object whose executables are to
21786 be used as part of current rendering state.
21787
21788`glUseProgram' installs the program object specified by PROGRAM as part
21789of current rendering state. One or more executables are created in a
21790program object by successfully attaching shader objects to it with
21791`glAttachShader', successfully compiling the shader objects with
21792`glCompileShader', and successfully linking the program object with
21793`glLinkProgram'.
21794
21795A program object will contain an executable that will run on the vertex
21796processor if it contains one or more shader objects of type
21797`GL_VERTEX_SHADER' that have been successfully compiled and linked.
21798Similarly, a program object will contain an executable that will run on
21799the fragment processor if it contains one or more shader objects of type
21800`GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
21801
21802Successfully installing an executable on a programmable processor will
21803cause the corresponding fixed functionality of OpenGL to be disabled.
21804Specifically, if an executable is installed on the vertex processor, the
21805OpenGL fixed functionality will be disabled as follows.
21806
21807 * The projection matrix is not applied to vertex coordinates.
21808
21809 * The texture matrices are not applied to texture coordinates.
21810
21811 * Normals are not transformed to eye coordinates.
21812
21813 * Normals are not rescaled or normalized.
21814
21815 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
21816 performed.
21817
21818 * Texture coordinates are not generated automatically.
21819
21820 * Per-vertex lighting is not performed.
21821
21822 * Color material computations are not performed.
21823
21824 * Color index lighting is not performed.
21825
21826 * This list also applies when setting the current raster position.
21827
21828The executable that is installed on the vertex processor is expected to
21829implement any or all of the desired functionality from the preceding
21830list. Similarly, if an executable is installed on the fragment
21831processor, the OpenGL fixed functionality will be disabled as follows.
21832
21833 * Texture application is not applied.
21834
21835 * Color sum is not applied.
21836
21837 * Fog is not applied.
21838
21839Again, the fragment shader that is installed is expected to implement
21840any or all of the desired functionality from the preceding list.
21841
21842While a program object is in use, applications are free to modify
21843attached shader objects, compile attached shader objects, attach
21844additional shader objects, and detach or delete shader objects. None of
21845these operations will affect the executables that are part of the
21846current state. However, relinking the program object that is currently
21847in use will install the program object as part of the current rendering
21848state if the link operation was successful (see `glLinkProgram' ). If
21849the program object currently in use is relinked unsuccessfully, its link
21850status will be set to `GL_FALSE', but the executables and associated
21851state will remain part of the current state until a subsequent call to
21852`glUseProgram' removes it from use. After it is removed from use, it
21853cannot be made part of current state until it has been successfully
21854relinked.
21855
21856If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
21857does not contain shader objects of type `GL_FRAGMENT_SHADER', an
21858executable will be installed on the vertex processor, but fixed
21859functionality will be used for fragment processing. Similarly, if
21860PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
21861not contain shader objects of type `GL_VERTEX_SHADER', an executable
21862will be installed on the fragment processor, but fixed functionality
21863will be used for vertex processing. If PROGRAM is 0, the programmable
21864processors will be disabled, and fixed functionality will be used for
21865both vertex and fragment processing.
21866
21867`GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
21868generated by OpenGL.
21869
21870`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
21871
21872`GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
21873current state.
21874
21875`GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
21876between the execution of `glBegin' and the corresponding execution of
21877`glEnd'.")
8925f36f 21878
25072f02 21879(define-gl-procedures
bb894c9d 21880 ((glValidateProgram (program GLuint) -> void))
3c9b6116
AW
21881 "Validates a program object.
21882
21883PROGRAM
21884 Specifies the handle of the program object to be validated.
21885
21886`glValidateProgram' checks to see whether the executables contained in
21887PROGRAM can execute given the current OpenGL state. The information
21888generated by the validation process will be stored in PROGRAM's
21889information log. The validation information may consist of an empty
21890string, or it may be a string containing information about how the
21891current program object interacts with the rest of current OpenGL state.
21892This provides a way for OpenGL implementers to convey more information
21893about why the current program is inefficient, suboptimal, failing to
21894execute, and so on.
21895
21896The status of the validation operation will be stored as part of the
21897program object's state. This value will be set to `GL_TRUE' if the
21898validation succeeded, and `GL_FALSE' otherwise. It can be queried by
21899calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
21900If validation is successful, PROGRAM is guaranteed to execute given the
21901current state. Otherwise, PROGRAM is guaranteed to not execute.
21902
21903This function is typically useful only during application development.
21904The informational string stored in the information log is completely
21905implementation dependent; therefore, an application should not expect
21906different OpenGL implementations to produce identical information
21907strings.
21908
21909`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
21910OpenGL.
21911
21912`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
21913
21914`GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
21915between the execution of `glBegin' and the corresponding execution of
21916`glEnd'.")
8925f36f 21917
25072f02 21918(define-gl-procedures
bb894c9d
AW
21919 ((glVertexAttribPointer
21920 (index GLuint)
21921 (size GLint)
21922 (type GLenum)
21923 (normalized GLboolean)
21924 (stride GLsizei)
00239761 21925 (pointer const-GLvoid-*)
bb894c9d
AW
21926 ->
21927 void))
3c9b6116
AW
21928 "Define an array of generic vertex attribute data.
21929
21930INDEX
21931 Specifies the index of the generic vertex attribute to be modified.
21932
21933SIZE
21934 Specifies the number of components per generic vertex attribute.
21935 Must be 1, 2, 3, or 4. The initial value is 4.
21936
21937TYPE
21938 Specifies the data type of each component in the array. Symbolic
21939 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
21940 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
21941 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
21942
21943NORMALIZED
21944 Specifies whether fixed-point data values should be normalized
21945 (`GL_TRUE') or converted directly as fixed-point values
21946 (`GL_FALSE') when they are accessed.
21947
21948STRIDE
21949 Specifies the byte offset between consecutive generic vertex
21950 attributes. If STRIDE is 0, the generic vertex attributes are
21951 understood to be tightly packed in the array. The initial value is
21952 0.
21953
21954POINTER
21955 Specifies a pointer to the first component of the first generic
21956 vertex attribute in the array. The initial value is 0.
21957
21958`glVertexAttribPointer' specifies the location and data format of the
21959array of generic vertex attributes at index INDEX to use when rendering.
21960SIZE specifies the number of components per attribute and must be 1, 2,
219613, or 4. TYPE specifies the data type of each component, and STRIDE
21962specifies the byte stride from one attribute to the next, allowing
21963vertices and attributes to be packed into a single array or stored in
21964separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
21965stored in an integer format are to be mapped to the range [-1,1] (for
21966signed values) or [0,1] (for unsigned values) when they are accessed and
21967converted to floating point. Otherwise, values will be converted to
21968floats directly without normalization.
21969
21970If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
21971target (see `glBindBuffer') while a generic vertex attribute array is
21972specified, POINTER is treated as a byte offset into the buffer object's
21973data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
21974is saved as generic vertex attribute array client-side state
21975(`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
21976
21977When a generic vertex attribute array is specified, SIZE, TYPE,
21978NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
21979addition to the current vertex array buffer object binding.
21980
21981To enable and disable a generic vertex attribute array, call
21982`glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
21983If enabled, the generic vertex attribute array is used when
21984`glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
21985`glMultiDrawElements', or `glDrawRangeElements' is called.
21986
21987`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
21988`GL_MAX_VERTEX_ATTRIBS'.
21989
21990`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
21991
21992`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
21993
21994`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 21995
25072f02 21996(define-gl-procedures
ca09631c
AW
21997 ((glVertexAttrib1f
21998 (index GLuint)
21999 (v0 GLfloat)
22000 ->
22001 void)
22002 (glVertexAttrib1s
bb894c9d
AW
22003 (index GLuint)
22004 (v0 GLshort)
22005 ->
22006 void)
ca09631c 22007 (glVertexAttrib2f
bb894c9d 22008 (index GLuint)
ca09631c
AW
22009 (v0 GLfloat)
22010 (v1 GLfloat)
bb894c9d
AW
22011 ->
22012 void)
22013 (glVertexAttrib2s
22014 (index GLuint)
22015 (v0 GLshort)
22016 (v1 GLshort)
22017 ->
22018 void)
ca09631c 22019 (glVertexAttrib3f
bb894c9d 22020 (index GLuint)
ca09631c
AW
22021 (v0 GLfloat)
22022 (v1 GLfloat)
22023 (v2 GLfloat)
bb894c9d
AW
22024 ->
22025 void)
22026 (glVertexAttrib3s
22027 (index GLuint)
22028 (v0 GLshort)
22029 (v1 GLshort)
22030 (v2 GLshort)
22031 ->
22032 void)
ca09631c 22033 (glVertexAttrib4f
bb894c9d 22034 (index GLuint)
ca09631c
AW
22035 (v0 GLfloat)
22036 (v1 GLfloat)
22037 (v2 GLfloat)
22038 (v3 GLfloat)
bb894c9d
AW
22039 ->
22040 void)
22041 (glVertexAttrib4s
22042 (index GLuint)
22043 (v0 GLshort)
22044 (v1 GLshort)
22045 (v2 GLshort)
22046 (v3 GLshort)
22047 ->
22048 void)
bb894c9d
AW
22049 (glVertexAttrib4Nub
22050 (index GLuint)
22051 (v0 GLubyte)
22052 (v1 GLubyte)
22053 (v2 GLubyte)
22054 (v3 GLubyte)
22055 ->
b002944d
AW
22056 void)
22057 (glVertexAttrib4iv
22058 (index GLuint)
22059 (v const-GLint-*)
22060 ->
22061 void)
22062 (glVertexAttrib4uiv
22063 (index GLuint)
22064 (v const-GLuint-*)
22065 ->
22066 void)
22067 (glVertexAttrib4Niv
22068 (index GLuint)
22069 (v const-GLint-*)
22070 ->
22071 void)
22072 (glVertexAttrib4Nuiv
22073 (index GLuint)
22074 (v const-GLuint-*)
22075 ->
bb894c9d 22076 void))
3c9b6116
AW
22077 "Specifies the value of a generic vertex attribute.
22078
22079INDEX
22080 Specifies the index of the generic vertex attribute to be modified.
22081
22082V0, V1, V2, V3
22083 Specifies the new values to be used for the specified vertex
22084 attribute.
22085
22086OpenGL defines a number of standard vertex attributes that applications
22087can modify with standard API entry points (color, normal, texture
22088coordinates, etc.). The `glVertexAttrib' family of entry points allows
22089an application to pass generic vertex attributes in numbered locations.
22090
22091Generic attributes are defined as four-component values that are
22092organized into an array. The first entry of this array is numbered 0,
22093and the size of the array is specified by the implementation-dependent
22094constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
22095be modified with a `glVertexAttrib' call that specifies the index of the
22096element to be modified and a value for that element.
22097
22098These commands can be used to specify one, two, three, or all four
22099components of the generic vertex attribute specified by INDEX. A `1' in
22100the name of the command indicates that only one value is passed, and it
22101will be used to modify the first component of the generic vertex
22102attribute. The second and third components will be set to 0, and the
22103fourth component will be set to 1. Similarly, a `2' in the name of the
22104command indicates that values are provided for the first two components,
22105the third component will be set to 0, and the fourth component will be
22106set to 1. A `3' in the name of the command indicates that values are
22107provided for the first three components and the fourth component will be
22108set to 1, whereas a `4' in the name indicates that values are provided
22109for all four components.
22110
22111The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
22112the arguments are of type short, float, int, double, unsigned byte,
22113unsigned short, or unsigned int. When `v' is appended to the name, the
22114commands can take a pointer to an array of such values. The commands
22115containing `N' indicate that the arguments will be passed as fixed-point
22116values that are scaled to a normalized range according to the component
22117conversion rules defined by the OpenGL specification. Signed values are
22118understood to represent fixed-point values in the range [-1,1], and
22119unsigned values are understood to represent fixed-point values in the
22120range [0,1].
22121
22122OpenGL Shading Language attribute variables are allowed to be of type
22123mat2, mat3, or mat4. Attributes of these types may be loaded using the
22124`glVertexAttrib' entry points. Matrices must be loaded into successive
22125generic attribute slots in column major order, with one column of the
22126matrix in each generic attribute slot.
22127
22128A user-defined attribute variable declared in a vertex shader can be
22129bound to a generic attribute index by calling `glBindAttribLocation'.
22130This allows an application to use more descriptive variable names in a
22131vertex shader. A subsequent change to the specified generic vertex
22132attribute will be immediately reflected as a change to the corresponding
22133attribute variable in the vertex shader.
22134
22135The binding between a generic vertex attribute index and a user-defined
22136attribute variable in a vertex shader is part of the state of a program
22137object, but the current value of the generic vertex attribute is not.
22138The value of each generic vertex attribute is part of current state,
22139just like standard vertex attributes, and it is maintained even if a
22140different program object is used.
22141
22142An application may freely modify generic vertex attributes that are not
22143bound to a named vertex shader attribute variable. These values are
22144simply maintained as part of current state and will not be accessed by
22145the vertex shader. If a generic vertex attribute bound to an attribute
22146variable in a vertex shader is not updated while the vertex shader is
22147executing, the vertex shader will repeatedly use the current value for
22148the generic vertex attribute.
22149
22150The generic vertex attribute with index 0 is the same as the vertex
22151position attribute previously defined by OpenGL. A `glVertex2',
22152`glVertex3', or `glVertex4' command is completely equivalent to the
22153corresponding `glVertexAttrib' command with an index argument of 0. A
22154vertex shader can access generic vertex attribute 0 by using the
22155built-in attribute variable GL_VERTEX. There are no current values for
22156generic vertex attribute 0. This is the only generic vertex attribute
22157with this property; calls to set other standard vertex attributes can be
22158freely mixed with calls to set any of the other generic vertex
22159attributes.
22160
22161`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
22162`GL_MAX_VERTEX_ATTRIBS'.")
8925f36f 22163
25072f02 22164(define-gl-procedures
bb894c9d
AW
22165 ((glVertexPointer
22166 (size GLint)
22167 (type GLenum)
22168 (stride GLsizei)
00239761 22169 (pointer const-GLvoid-*)
bb894c9d
AW
22170 ->
22171 void))
3c9b6116
AW
22172 "Define an array of vertex data.
22173
22174SIZE
22175 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
22176 The initial value is 4.
22177
22178TYPE
22179 Specifies the data type of each coordinate in the array. Symbolic
22180 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
22181 accepted. The initial value is `GL_FLOAT'.
22182
22183STRIDE
22184 Specifies the byte offset between consecutive vertices. If STRIDE
22185 is 0, the vertices are understood to be tightly packed in the
22186 array. The initial value is 0.
22187
22188POINTER
22189 Specifies a pointer to the first coordinate of the first vertex in
22190 the array. The initial value is 0.
22191
22192`glVertexPointer' specifies the location and data format of an array of
22193vertex coordinates to use when rendering. SIZE specifies the number of
22194coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
22195type of each coordinate, and STRIDE specifies the byte stride from one
22196vertex to the next, allowing vertices and attributes to be packed into a
22197single array or stored in separate arrays. (Single-array storage may be
22198more efficient on some implementations; see `glInterleavedArrays'.)
22199
22200If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
22201target (see `glBindBuffer') while a vertex array is specified, POINTER
22202is treated as a byte offset into the buffer object's data store. Also,
22203the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
22204array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
22205
22206When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
22207saved as client-side state, in addition to the current vertex array
22208buffer object binding.
22209
22210To enable and disable the vertex array, call `glEnableClientState' and
22211`glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
22212the vertex array is used when `glArrayElement', `glDrawArrays',
22213`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
22214`glDrawRangeElements' is called.
22215
22216`GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
22217
22218`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
22219
22220`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 22221
25072f02 22222(define-gl-procedures
bb894c9d 22223 ((glVertex2i (x GLint) (y GLint) -> void)
ca09631c 22224 (glVertex2f (x GLfloat) (y GLfloat) -> void)
bb894c9d
AW
22225 (glVertex3i
22226 (x GLint)
22227 (y GLint)
22228 (z GLint)
22229 ->
22230 void)
ca09631c
AW
22231 (glVertex3f
22232 (x GLfloat)
22233 (y GLfloat)
22234 (z GLfloat)
bb894c9d
AW
22235 ->
22236 void)
22237 (glVertex4i
22238 (x GLint)
22239 (y GLint)
22240 (z GLint)
22241 (w GLint)
22242 ->
22243 void)
ca09631c
AW
22244 (glVertex4f
22245 (x GLfloat)
22246 (y GLfloat)
22247 (z GLfloat)
22248 (w GLfloat)
bb894c9d
AW
22249 ->
22250 void))
3c9b6116
AW
22251 "Specify a vertex.
22252
22253X
22254 Y
22255
22256 Z
22257
22258 W
22259
22260 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
22261 are present in all forms of the command.
22262
22263`glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
22264point, line, and polygon vertices. The current color, normal, texture
22265coordinates, and fog coordinate are associated with the vertex when
22266`glVertex' is called.
22267
22268When only X and Y are specified, Z defaults to 0 and W defaults to 1.
22269When X , Y , and Z are specified, W defaults to 1.")
8925f36f 22270
25072f02 22271(define-gl-procedures
bb894c9d
AW
22272 ((glViewport
22273 (x GLint)
22274 (y GLint)
22275 (width GLsizei)
22276 (height GLsizei)
22277 ->
22278 void))
3c9b6116
AW
22279 "Set the viewport.
22280
22281X
22282 Y
22283
22284 Specify the lower left corner of the viewport rectangle, in pixels.
22285 The initial value is (0,0).
22286
22287WIDTH
22288 HEIGHT
22289
22290 Specify the width and height of the viewport. When a GL context is
22291 first attached to a window, WIDTH and HEIGHT are set to the
22292 dimensions of that window.
22293
22294`glViewport' specifies the affine transformation of X and Y from
22295normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
22296normalized device coordinates. Then the window coordinates (X_W,Y_W) are
22297computed as follows:
22298
22299X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
22300
22301Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
22302
22303Viewport width and height are silently clamped to a range that depends
22304on the implementation. To query this range, call `glGet' with argument
22305`GL_MAX_VIEWPORT_DIMS'.
22306
22307`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
22308
22309`GL_INVALID_OPERATION' is generated if `glViewport' is executed between
22310the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 22311
25072f02 22312(define-gl-procedures
bb894c9d 22313 ((glWindowPos2i (x GLint) (y GLint) -> void)
ca09631c 22314 (glWindowPos2f (x GLfloat) (y GLfloat) -> void)
bb894c9d
AW
22315 (glWindowPos3i
22316 (x GLint)
22317 (y GLint)
22318 (z GLint)
22319 ->
22320 void)
ca09631c
AW
22321 (glWindowPos3f
22322 (x GLfloat)
22323 (y GLfloat)
22324 (z GLfloat)
bb894c9d
AW
22325 ->
22326 void))
3c9b6116
AW
22327 "Specify the raster position in window coordinates for pixel operations.
22328
22329X
22330 Y
22331
22332 Z
22333
22334 Specify the X , Y , Z coordinates for the raster position.
22335
22336The GL maintains a 3D position in window coordinates. This position,
22337called the raster position, is used to position pixel and bitmap write
22338operations. It is maintained with subpixel accuracy. See `glBitmap',
22339`glDrawPixels', and `glCopyPixels'.
22340
22341`glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
22342set to 0. `glWindowPos3' specifies all three coordinates. The W
22343coordinate of the current raster position is always set to 1.0.
22344
22345`glWindowPos' directly updates the X and Y coordinates of the current
22346raster position with the values specified. That is, the values are
22347neither transformed by the current modelview and projection matrices,
22348nor by the viewport-to-window transform. The Z coordinate of the current
22349raster position is updated in the following manner:
22350
22351Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
22352
22353
22354
22355where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
22356far value. See `glDepthRange'.
22357
22358The specified coordinates are not clip-tested, causing the raster
22359position to always be valid.
22360
8925f36f 22361The current raster position also includes some associated color data and
3c9b6116
AW
22362texture coordinates. If lighting is enabled, then
22363`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
8925f36f 22364(in color index mode) is set to the color produced by the lighting
3c9b6116
AW
22365calculation (see `glLight', `glLightModel', and `glShadeModel'). If
22366lighting is disabled, current color (in RGBA mode, state variable
22367`GL_CURRENT_COLOR') or color index (in color index mode, state variable
22368`GL_CURRENT_INDEX') is used to update the current raster color.
22369`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
22370
22371Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
22372`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
22373generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
22374is set to the `GL_CURRENT_FOG_COORD'.
22375
22376
22377
22378`GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
22379the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 22380