include all 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
78aa45b9
DH
88 glColor3b
89 glColor3s
bb894c9d 90 glColor3i
ca09631c 91 glColor3f
78aa45b9
DH
92 glColor3d
93 glColor3ub
94 glColor3us
bb894c9d 95 glColor3ui
78aa45b9
DH
96 glColor4b
97 glColor4s
bb894c9d 98 glColor4i
ca09631c 99 glColor4f
78aa45b9
DH
100 glColor4d
101 glColor4ub
102 glColor4us
bb894c9d 103 glColor4ui
78aa45b9
DH
104 glColor3bv
105 glColor3sv
106 glColor3iv
107 glColor3fv
108 glColor3dv
109 glColor3ubv
110 glColor3usv
111 glColor3uiv
112 glColor4bv
113 glColor4sv
114 glColor4iv
115 glColor4fv
116 glColor4dv
117 glColor4ubv
118 glColor4usv
119 glColor4uiv
8925f36f
AW
120 glCompileShader
121 glCompressedTexImage1D
122 glCompressedTexImage2D
123 glCompressedTexImage3D
124 glCompressedTexSubImage1D
125 glCompressedTexSubImage2D
126 glCompressedTexSubImage3D
127 glConvolutionFilter1D
128 glConvolutionFilter2D
bb894c9d
AW
129 glConvolutionParameterf
130 glConvolutionParameteri
78aa45b9
DH
131 glConvolutionParameterfv
132 glConvolutionParameteriv
8925f36f
AW
133 glCopyColorSubTable
134 glCopyColorTable
135 glCopyConvolutionFilter1D
136 glCopyConvolutionFilter2D
137 glCopyPixels
138 glCopyTexImage1D
139 glCopyTexImage2D
140 glCopyTexSubImage1D
141 glCopyTexSubImage2D
142 glCopyTexSubImage3D
143 glCreateProgram
144 glCreateShader
145 glCullFace
146 glDeleteBuffers
147 glDeleteLists
148 glDeleteProgram
149 glDeleteQueries
150 glDeleteShader
151 glDeleteTextures
152 glDepthFunc
153 glDepthMask
154 glDepthRange
155 glDetachShader
156 glDrawArrays
157 glDrawBuffers
158 glDrawBuffer
159 glDrawElements
160 glDrawPixels
161 glDrawRangeElements
162 glEdgeFlagPointer
163 glEdgeFlag
78aa45b9 164 glEdgeFlagv
8925f36f 165 glEnableClientState
bb894c9d 166 glDisableClientState
8925f36f 167 glEnableVertexAttribArray
bb894c9d 168 glDisableVertexAttribArray
8925f36f 169 glEnable
bb894c9d 170 glDisable
ca09631c 171 glEvalCoord1f
78aa45b9 172 glEvalCoord1d
ca09631c 173 glEvalCoord2f
78aa45b9
DH
174 glEvalCoord2d
175 glEvalCoord1fv
176 glEvalCoord1dv
177 glEvalCoord2fv
178 glEvalCoord2dv
bb894c9d
AW
179 glEvalMesh1
180 glEvalMesh2
181 glEvalPoint1
182 glEvalPoint2
8925f36f
AW
183 glFeedbackBuffer
184 glFinish
185 glFlush
186 glFogCoordPointer
78aa45b9 187 glFogCoordd
ca09631c 188 glFogCoordf
78aa45b9
DH
189 glFogCoorddv
190 glFogCoordfv
bb894c9d
AW
191 glFogf
192 glFogi
78aa45b9
DH
193 glFogfv
194 glFogiv
8925f36f
AW
195 glFrontFace
196 glFrustum
197 glGenBuffers
198 glGenLists
199 glGenQueries
200 glGenTextures
201 glGetActiveAttrib
202 glGetActiveUniform
203 glGetAttachedShaders
204 glGetAttribLocation
b002944d
AW
205 glGetBufferParameteriv
206 glGetBufferPointerv
8925f36f
AW
207 glGetBufferSubData
208 glGetClipPlane
b002944d
AW
209 glGetColorTableParameterfv
210 glGetColorTableParameteriv
8925f36f
AW
211 glGetColorTable
212 glGetCompressedTexImage
213 glGetConvolutionFilter
b002944d
AW
214 glGetConvolutionParameterfv
215 glGetConvolutionParameteriv
8925f36f 216 glGetError
b002944d
AW
217 glGetHistogramParameterfv
218 glGetHistogramParameteriv
8925f36f 219 glGetHistogram
b002944d
AW
220 glGetLightfv
221 glGetLightiv
78aa45b9 222 glGetMapdv
b002944d
AW
223 glGetMapfv
224 glGetMapiv
225 glGetMaterialfv
226 glGetMaterialiv
227 glGetMinmaxParameterfv
228 glGetMinmaxParameteriv
8925f36f 229 glGetMinmax
b002944d
AW
230 glGetPixelMapfv
231 glGetPixelMapuiv
78aa45b9 232 glGetPixelMapusv
b002944d 233 glGetPointerv
8925f36f
AW
234 glGetPolygonStipple
235 glGetProgramInfoLog
b002944d
AW
236 glGetProgramiv
237 glGetQueryiv
238 glGetQueryObjectiv
239 glGetQueryObjectuiv
8925f36f
AW
240 glGetSeparableFilter
241 glGetShaderInfoLog
242 glGetShaderSource
b002944d 243 glGetShaderiv
8925f36f 244 glGetString
b002944d
AW
245 glGetTexEnvfv
246 glGetTexEnviv
78aa45b9 247 glGetTexGendv
b002944d
AW
248 glGetTexGenfv
249 glGetTexGeniv
8925f36f 250 glGetTexImage
b002944d
AW
251 glGetTexLevelParameterfv
252 glGetTexLevelParameteriv
253 glGetTexParameterfv
254 glGetTexParameteriv
8925f36f 255 glGetUniformLocation
b002944d
AW
256 glGetUniformfv
257 glGetUniformiv
258 glGetVertexAttribPointerv
78aa45b9 259 glGetVertexAttribdv
b002944d
AW
260 glGetVertexAttribfv
261 glGetVertexAttribiv
262 glGetBooleanv
263 glGetDoublev
264 glGetFloatv
265 glGetIntegerv
8925f36f
AW
266 glHint
267 glHistogram
268 glIndexMask
269 glIndexPointer
78aa45b9 270 glIndexs
bb894c9d 271 glIndexi
ca09631c 272 glIndexf
78aa45b9 273 glIndexd
bb894c9d 274 glIndexub
78aa45b9
DH
275 glIndexsv
276 glIndexiv
277 glIndexfv
278 glIndexdv
279 glIndexubv
8925f36f
AW
280 glInitNames
281 glInterleavedArrays
282 glIsBuffer
283 glIsEnabled
284 glIsList
285 glIsProgram
286 glIsQuery
287 glIsShader
288 glIsTexture
bb894c9d
AW
289 glLightModelf
290 glLightModeli
78aa45b9
DH
291 glLightModelfv
292 glLightModeliv
bb894c9d
AW
293 glLightf
294 glLighti
78aa45b9
DH
295 glLightfv
296 glLightiv
8925f36f
AW
297 glLineStipple
298 glLineWidth
299 glLinkProgram
300 glListBase
301 glLoadIdentity
78aa45b9 302 glLoadMatrixd
ca09631c 303 glLoadMatrixf
8925f36f 304 glLoadName
78aa45b9 305 glLoadTransposeMatrixd
ca09631c 306 glLoadTransposeMatrixf
8925f36f 307 glLogicOp
ca09631c 308 glMap1f
78aa45b9 309 glMap1d
ca09631c 310 glMap2f
78aa45b9 311 glMap2d
8925f36f 312 glMapBuffer
bb894c9d 313 glUnmapBuffer
78aa45b9 314 glMapGrid1d
ca09631c 315 glMapGrid1f
78aa45b9 316 glMapGrid2d
ca09631c 317 glMapGrid2f
bb894c9d
AW
318 glMaterialf
319 glMateriali
78aa45b9
DH
320 glMaterialfv
321 glMaterialiv
8925f36f
AW
322 glMatrixMode
323 glMinmax
324 glMultiDrawArrays
325 glMultiDrawElements
78aa45b9 326 glMultiTexCoord1s
bb894c9d 327 glMultiTexCoord1i
ca09631c 328 glMultiTexCoord1f
78aa45b9
DH
329 glMultiTexCoord1d
330 glMultiTexCoord2s
bb894c9d 331 glMultiTexCoord2i
ca09631c 332 glMultiTexCoord2f
78aa45b9
DH
333 glMultiTexCoord2d
334 glMultiTexCoord3s
bb894c9d 335 glMultiTexCoord3i
ca09631c 336 glMultiTexCoord3f
78aa45b9
DH
337 glMultiTexCoord3d
338 glMultiTexCoord4s
bb894c9d 339 glMultiTexCoord4i
ca09631c 340 glMultiTexCoord4f
78aa45b9
DH
341 glMultiTexCoord4d
342 glMultiTexCoord1sv
343 glMultiTexCoord1iv
344 glMultiTexCoord1fv
345 glMultiTexCoord1dv
346 glMultiTexCoord2sv
347 glMultiTexCoord2iv
348 glMultiTexCoord2fv
349 glMultiTexCoord2dv
350 glMultiTexCoord3sv
351 glMultiTexCoord3iv
352 glMultiTexCoord3fv
353 glMultiTexCoord3dv
354 glMultiTexCoord4sv
355 glMultiTexCoord4iv
356 glMultiTexCoord4fv
357 glMultiTexCoord4dv
358 glMultMatrixd
ca09631c 359 glMultMatrixf
78aa45b9 360 glMultTransposeMatrixd
ca09631c 361 glMultTransposeMatrixf
8925f36f 362 glNewList
bb894c9d 363 glEndList
8925f36f 364 glNormalPointer
78aa45b9
DH
365 glNormal3b
366 glNormal3d
ca09631c 367 glNormal3f
bb894c9d 368 glNormal3i
78aa45b9
DH
369 glNormal3s
370 glNormal3bv
371 glNormal3dv
372 glNormal3fv
373 glNormal3iv
374 glNormal3sv
8925f36f
AW
375 glOrtho
376 glPassThrough
b002944d
AW
377 glPixelMapfv
378 glPixelMapuiv
78aa45b9 379 glPixelMapusv
bb894c9d
AW
380 glPixelStoref
381 glPixelStorei
382 glPixelTransferf
383 glPixelTransferi
8925f36f 384 glPixelZoom
bb894c9d
AW
385 glPointParameterf
386 glPointParameteri
78aa45b9
DH
387 glPointParameterfv
388 glPointParameteriv
8925f36f
AW
389 glPointSize
390 glPolygonMode
391 glPolygonOffset
392 glPolygonStipple
393 glPrioritizeTextures
394 glPushAttrib
bb894c9d 395 glPopAttrib
8925f36f 396 glPushClientAttrib
bb894c9d 397 glPopClientAttrib
8925f36f 398 glPushMatrix
bb894c9d 399 glPopMatrix
8925f36f 400 glPushName
bb894c9d 401 glPopName
78aa45b9 402 glRasterPos2s
bb894c9d 403 glRasterPos2i
ca09631c 404 glRasterPos2f
78aa45b9
DH
405 glRasterPos2d
406 glRasterPos3s
bb894c9d 407 glRasterPos3i
ca09631c 408 glRasterPos3f
78aa45b9
DH
409 glRasterPos3d
410 glRasterPos4s
bb894c9d 411 glRasterPos4i
ca09631c 412 glRasterPos4f
78aa45b9
DH
413 glRasterPos4d
414 glRasterPos2sv
415 glRasterPos2iv
416 glRasterPos2fv
417 glRasterPos2dv
418 glRasterPos3sv
419 glRasterPos3iv
420 glRasterPos3fv
421 glRasterPos3dv
422 glRasterPos4sv
423 glRasterPos4iv
424 glRasterPos4fv
425 glRasterPos4dv
8925f36f
AW
426 glReadBuffer
427 glReadPixels
78aa45b9 428 glRectd
ca09631c 429 glRectf
bb894c9d 430 glRecti
78aa45b9
DH
431 glRects
432 glRectdv
433 glRectfv
434 glRectiv
435 glRectsv
8925f36f
AW
436 glRenderMode
437 glResetHistogram
438 glResetMinmax
78aa45b9 439 glRotated
ca09631c 440 glRotatef
8925f36f 441 glSampleCoverage
78aa45b9 442 glScaled
ca09631c 443 glScalef
8925f36f
AW
444 glScissor
445 glSecondaryColorPointer
78aa45b9
DH
446 glSecondaryColor3b
447 glSecondaryColor3s
bb894c9d 448 glSecondaryColor3i
ca09631c 449 glSecondaryColor3f
78aa45b9
DH
450 glSecondaryColor3d
451 glSecondaryColor3ub
452 glSecondaryColor3us
bb894c9d 453 glSecondaryColor3ui
78aa45b9
DH
454 glSecondaryColor3bv
455 glSecondaryColor3sv
456 glSecondaryColor3iv
457 glSecondaryColor3fv
458 glSecondaryColor3dv
459 glSecondaryColor3ubv
460 glSecondaryColor3usv
461 glSecondaryColor3uiv
8925f36f
AW
462 glSelectBuffer
463 glSeparableFilter2D
464 glShadeModel
465 glShaderSource
466 glStencilFuncSeparate
467 glStencilFunc
468 glStencilMaskSeparate
469 glStencilMask
470 glStencilOpSeparate
471 glStencilOp
472 glTexCoordPointer
78aa45b9 473 glTexCoord1s
bb894c9d 474 glTexCoord1i
ca09631c 475 glTexCoord1f
78aa45b9
DH
476 glTexCoord1d
477 glTexCoord2s
bb894c9d 478 glTexCoord2i
ca09631c 479 glTexCoord2f
78aa45b9
DH
480 glTexCoord2d
481 glTexCoord3s
bb894c9d 482 glTexCoord3i
ca09631c 483 glTexCoord3f
78aa45b9
DH
484 glTexCoord3d
485 glTexCoord4s
bb894c9d 486 glTexCoord4i
ca09631c 487 glTexCoord4f
78aa45b9
DH
488 glTexCoord4d
489 glTexCoord1sv
490 glTexCoord1iv
491 glTexCoord1fv
492 glTexCoord1dv
493 glTexCoord2sv
494 glTexCoord2iv
495 glTexCoord2fv
496 glTexCoord2dv
497 glTexCoord3sv
498 glTexCoord3iv
499 glTexCoord3fv
500 glTexCoord3dv
501 glTexCoord4sv
502 glTexCoord4iv
503 glTexCoord4fv
504 glTexCoord4dv
bb894c9d
AW
505 glTexEnvf
506 glTexEnvi
78aa45b9
DH
507 glTexEnvfv
508 glTexEnviv
bb894c9d 509 glTexGeni
ca09631c 510 glTexGenf
78aa45b9
DH
511 glTexGend
512 glTexGeniv
513 glTexGenfv
514 glTexGendv
8925f36f
AW
515 glTexImage1D
516 glTexImage2D
517 glTexImage3D
bb894c9d
AW
518 glTexParameterf
519 glTexParameteri
78aa45b9
DH
520 glTexParameterfv
521 glTexParameteriv
8925f36f
AW
522 glTexSubImage1D
523 glTexSubImage2D
524 glTexSubImage3D
78aa45b9 525 glTranslated
ca09631c 526 glTranslatef
8925f36f 527 glUniform1f
bb894c9d
AW
528 glUniform2f
529 glUniform3f
530 glUniform4f
531 glUniform1i
532 glUniform2i
533 glUniform3i
534 glUniform4i
78aa45b9
DH
535 glUniform1fv
536 glUniform2fv
537 glUniform3fv
538 glUniform4fv
539 glUniform1iv
540 glUniform2iv
541 glUniform3iv
542 glUniform4iv
b002944d
AW
543 glUniformMatrix2fv
544 glUniformMatrix3fv
545 glUniformMatrix4fv
546 glUniformMatrix2x3fv
547 glUniformMatrix3x2fv
548 glUniformMatrix2x4fv
549 glUniformMatrix4x2fv
550 glUniformMatrix3x4fv
551 glUniformMatrix4x3fv
8925f36f
AW
552 glUseProgram
553 glValidateProgram
554 glVertexAttribPointer
ca09631c 555 glVertexAttrib1f
bb894c9d 556 glVertexAttrib1s
78aa45b9 557 glVertexAttrib1d
ca09631c 558 glVertexAttrib2f
bb894c9d 559 glVertexAttrib2s
78aa45b9 560 glVertexAttrib2d
ca09631c 561 glVertexAttrib3f
bb894c9d 562 glVertexAttrib3s
78aa45b9 563 glVertexAttrib3d
ca09631c 564 glVertexAttrib4f
bb894c9d 565 glVertexAttrib4s
78aa45b9 566 glVertexAttrib4d
bb894c9d 567 glVertexAttrib4Nub
78aa45b9
DH
568 glVertexAttrib1fv
569 glVertexAttrib1sv
570 glVertexAttrib1dv
571 glVertexAttrib2fv
572 glVertexAttrib2sv
573 glVertexAttrib2dv
574 glVertexAttrib3fv
575 glVertexAttrib3sv
576 glVertexAttrib3dv
577 glVertexAttrib4fv
578 glVertexAttrib4sv
579 glVertexAttrib4dv
b002944d 580 glVertexAttrib4iv
78aa45b9
DH
581 glVertexAttrib4bv
582 glVertexAttrib4ubv
583 glVertexAttrib4usv
b002944d 584 glVertexAttrib4uiv
78aa45b9
DH
585 glVertexAttrib4Nbv
586 glVertexAttrib4Nsv
b002944d 587 glVertexAttrib4Niv
78aa45b9
DH
588 glVertexAttrib4Nubv
589 glVertexAttrib4Nusv
b002944d 590 glVertexAttrib4Nuiv
8925f36f 591 glVertexPointer
78aa45b9 592 glVertex2s
bb894c9d 593 glVertex2i
ca09631c 594 glVertex2f
78aa45b9
DH
595 glVertex2d
596 glVertex3s
bb894c9d 597 glVertex3i
ca09631c 598 glVertex3f
78aa45b9
DH
599 glVertex3d
600 glVertex4s
bb894c9d 601 glVertex4i
ca09631c 602 glVertex4f
78aa45b9
DH
603 glVertex4d
604 glVertex2sv
605 glVertex2iv
606 glVertex2fv
607 glVertex2dv
608 glVertex3sv
609 glVertex3iv
610 glVertex3fv
611 glVertex3dv
612 glVertex4sv
613 glVertex4iv
614 glVertex4fv
615 glVertex4dv
8925f36f 616 glViewport
78aa45b9 617 glWindowPos2s
bb894c9d 618 glWindowPos2i
ca09631c 619 glWindowPos2f
78aa45b9
DH
620 glWindowPos2d
621 glWindowPos3s
bb894c9d 622 glWindowPos3i
78aa45b9
DH
623 glWindowPos3f
624 glWindowPos3d
625 glWindowPos2sv
626 glWindowPos2iv
627 glWindowPos2fv
628 glWindowPos2dv
629 glWindowPos3sv
630 glWindowPos3iv
631 glWindowPos3fv
632 glWindowPos3dv))
8925f36f 633
25072f02 634(define-gl-procedures
bb894c9d 635 ((glAccum (op GLenum) (value GLfloat) -> void))
3c9b6116
AW
636 "Operate on the accumulation buffer.
637
638OP
639 Specifies the accumulation buffer operation. Symbolic constants
640 `GL_ACCUM', `GL_LOAD', `GL_ADD', `GL_MULT', and `GL_RETURN' are
641 accepted.
642
643VALUE
644 Specifies a floating-point value used in the accumulation buffer
645 operation. OP determines how VALUE is used.
646
647The accumulation buffer is an extended-range color buffer. Images are
648not rendered into it. Rather, images rendered into one of the color
649buffers are added to the contents of the accumulation buffer after
650rendering. Effects such as antialiasing (of points, lines, and
651polygons), motion blur, and depth of field can be created by
652accumulating images generated with different transformation matrices.
653
654Each pixel in the accumulation buffer consists of red, green, blue, and
655alpha values. The number of bits per component in the accumulation
656buffer depends on the implementation. You can examine this number by
657calling `glGetIntegerv' four times, with arguments `GL_ACCUM_RED_BITS',
658`GL_ACCUM_GREEN_BITS', `GL_ACCUM_BLUE_BITS', and `GL_ACCUM_ALPHA_BITS'.
659Regardless of the number of bits per component, the range of values
660stored by each component is [-1,1] . The accumulation buffer pixels are
661mapped one-to-one with frame buffer pixels.
662
663`glAccum' operates on the accumulation buffer. The first argument, OP,
664is a symbolic constant that selects an accumulation buffer operation.
665The second argument, VALUE, is a floating-point value to be used in that
666operation. Five operations are specified: `GL_ACCUM', `GL_LOAD',
667`GL_ADD', `GL_MULT', and `GL_RETURN'.
668
669All accumulation buffer operations are limited to the area of the
670current scissor box and applied identically to the red, green, blue, and
671alpha components of each pixel. If a `glAccum' operation results in a
672value outside the range [-1,1] , the contents of an accumulation buffer
673pixel component are undefined.
674
675The operations are as follows:
676
677`GL_ACCUM'
678 Obtains R, G, B, and A values from the buffer currently selected
679 for reading (see `glReadBuffer'). Each component value is divided
680 by 2^N-1 , where N is the number of bits allocated to each color
681 component in the currently selected buffer. The result is a
682 floating-point value in the range [0,1] , which is multiplied by
683 VALUE and added to the corresponding pixel component in the
684 accumulation buffer, thereby updating the accumulation buffer.
685
686`GL_LOAD'
687 Similar to `GL_ACCUM', except that the current value in the
688 accumulation buffer is not used in the calculation of the new
689 value. That is, the R, G, B, and A values from the currently
690 selected buffer are divided by 2^N-1 , multiplied by VALUE, and
691 then stored in the corresponding accumulation buffer cell,
692 overwriting the current value.
693
694`GL_ADD'
695 Adds VALUE to each R, G, B, and A in the accumulation buffer.
696
697`GL_MULT'
698 Multiplies each R, G, B, and A in the accumulation buffer by VALUE
699 and returns the scaled component to its corresponding accumulation
700 buffer location.
701
702`GL_RETURN'
703 Transfers accumulation buffer values to the color buffer or buffers
704 currently selected for writing. Each R, G, B, and A component is
705 multiplied by VALUE, then multiplied by 2^N-1 , clamped to the
706 range [0,2^N-1] , and stored in the corresponding display buffer
707 cell. The only fragment operations that are applied to this
708 transfer are pixel ownership, scissor, dithering, and color
709 writemasks.
710
711To clear the accumulation buffer, call `glClearAccum' with R, G, B, and
712A values to set it to, then call `glClear' with the accumulation buffer
713enabled.
714
715`GL_INVALID_ENUM' is generated if OP is not an accepted value.
716
717`GL_INVALID_OPERATION' is generated if there is no accumulation buffer.
718
719`GL_INVALID_OPERATION' is generated if `glAccum' is executed between the
720execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 721
25072f02 722(define-gl-procedures
bb894c9d 723 ((glActiveTexture (texture GLenum) -> void))
3c9b6116
AW
724 "Select active texture unit.
725
726TEXTURE
727 Specifies which texture unit to make active. The number of texture
728 units is implementation dependent, but must be at least two.
729 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
730 the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
731 (`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1). The initial value is
732 `GL_TEXTURE0'.
733
734`glActiveTexture' selects which texture unit subsequent texture state
735calls will affect. The number of texture units an implementation
736supports is implementation dependent, but must be at least 2.
737
738Vertex arrays are client-side GL resources, which are selected by the
739`glClientActiveTexture' routine.
740
741`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
742where i ranges from 0 to the larger of (`GL_MAX_TEXTURE_COORDS' - 1) and
743(`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS' - 1).")
8925f36f 744
25072f02 745(define-gl-procedures
bb894c9d
AW
746 ((glAlphaFunc
747 (func GLenum)
748 (ref GLclampf)
749 ->
750 void))
3c9b6116
AW
751 "Specify the alpha test function.
752
753FUNC
754 Specifies the alpha comparison function. Symbolic constants
755 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
756 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
757 initial value is `GL_ALWAYS'.
758
759REF
760 Specifies the reference value that incoming alpha values are
761 compared to. This value is clamped to the range [0,1] , where 0
762 represents the lowest possible alpha value and 1 the highest
763 possible value. The initial reference value is 0.
764
765The alpha test discards fragments depending on the outcome of a
766comparison between an incoming fragment's alpha value and a constant
767reference value. `glAlphaFunc' specifies the reference value and the
768comparison function. The comparison is performed only if alpha testing
769is enabled. By default, it is not enabled. (See `glEnable' and
770`glDisable' of `GL_ALPHA_TEST'.)
771
772FUNC and REF specify the conditions under which the pixel is drawn. The
773incoming alpha value is compared to REF using the function specified by
774FUNC. If the value passes the comparison, the incoming fragment is drawn
775if it also passes subsequent stencil and depth buffer tests. If the
776value fails the comparison, no change is made to the frame buffer at
777that pixel location. The comparison functions are as follows:
778
779`GL_NEVER'
780 Never passes.
781
782`GL_LESS'
783 Passes if the incoming alpha value is less than the reference
784 value.
785
786`GL_EQUAL'
787 Passes if the incoming alpha value is equal to the reference value.
788
789`GL_LEQUAL'
790 Passes if the incoming alpha value is less than or equal to the
791 reference value.
792
793`GL_GREATER'
794 Passes if the incoming alpha value is greater than the reference
795 value.
796
797`GL_NOTEQUAL'
798 Passes if the incoming alpha value is not equal to the reference
799 value.
800
801`GL_GEQUAL'
802 Passes if the incoming alpha value is greater than or equal to the
803 reference value.
804
805`GL_ALWAYS'
806 Always passes (initial value).
807
808`glAlphaFunc' operates on all pixel write operations, including those
809resulting from the scan conversion of points, lines, polygons, and
810bitmaps, and from pixel draw and copy operations. `glAlphaFunc' does not
811affect screen clear operations.
812
813`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
814
815`GL_INVALID_OPERATION' is generated if `glAlphaFunc' is executed between
816the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 817
25072f02 818(define-gl-procedures
bb894c9d
AW
819 ((glAreTexturesResident
820 (n GLsizei)
00239761
AW
821 (textures const-GLuint-*)
822 (residences GLboolean-*)
bb894c9d
AW
823 ->
824 GLboolean))
3c9b6116
AW
825 "Determine if textures are loaded in texture memory.
826
827N
828 Specifies the number of textures to be queried.
829
830TEXTURES
831 Specifies an array containing the names of the textures to be
832 queried.
833
834RESIDENCES
835 Specifies an array in which the texture residence status is
836 returned. The residence status of a texture named by an element of
837 TEXTURES is returned in the corresponding element of RESIDENCES.
838
839GL establishes a ``working set'' of textures that are resident in
840texture memory. These textures can be bound to a texture target much
841more efficiently than textures that are not resident.
842
843`glAreTexturesResident' queries the texture residence status of the N
844textures named by the elements of TEXTURES. If all the named textures
845are resident, `glAreTexturesResident' returns `GL_TRUE', and the
846contents of RESIDENCES are undisturbed. If not all the named textures
847are resident, `glAreTexturesResident' returns `GL_FALSE', and detailed
848status is returned in the N elements of RESIDENCES. If an element of
849RESIDENCES is `GL_TRUE', then the texture named by the corresponding
850element of TEXTURES is resident.
851
852The residence status of a single bound texture may also be queried by
853calling `glGetTexParameter' with the TARGET argument set to the target
854to which the texture is bound, and the PNAME argument set to
855`GL_TEXTURE_RESIDENT'. This is the only way that the residence status of
856a default texture can be queried.
857
858`GL_INVALID_VALUE' is generated if N is negative.
859
860`GL_INVALID_VALUE' is generated if any element in TEXTURES is 0 or does
861not name a texture. In that case, the function returns `GL_FALSE' and
862the contents of RESIDENCES is indeterminate.
863
864`GL_INVALID_OPERATION' is generated if `glAreTexturesResident' is
865executed between the execution of `glBegin' and the corresponding
866execution of `glEnd'.")
8925f36f 867
25072f02 868(define-gl-procedures
bb894c9d 869 ((glArrayElement (i GLint) -> void))
3c9b6116
AW
870 "Render a vertex using the specified vertex array element.
871
872I
873 Specifies an index into the enabled vertex data arrays.
874
875`glArrayElement' commands are used within `glBegin'/`glEnd' pairs to
876specify vertex and attribute data for point, line, and polygon
877primitives. If `GL_VERTEX_ARRAY' is enabled when `glArrayElement' is
878called, a single vertex is drawn, using vertex and attribute data taken
879from location I of the enabled arrays. If `GL_VERTEX_ARRAY' is not
880enabled, no drawing occurs but the attributes corresponding to the
881enabled arrays are modified.
882
883Use `glArrayElement' to construct primitives by indexing vertex data,
884rather than by streaming through arrays of data in first-to-last order.
885Because each call specifies only a single vertex, it is possible to
886explicitly specify per-primitive attributes such as a single normal for
887each triangle.
888
889Changes made to array data between the execution of `glBegin' and the
890corresponding execution of `glEnd' may affect calls to `glArrayElement'
891that are made within the same `glBegin'/`glEnd' period in nonsequential
892ways. That is, a call to `glArrayElement' that precedes a change to
893array data may access the changed data, and a call that follows a change
894to array data may access original data.
895
896`GL_INVALID_VALUE' may be generated if I is negative.
897
898`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
899bound to an enabled array and the buffer object's data store is
900currently mapped.")
8925f36f 901
25072f02 902(define-gl-procedures
bb894c9d
AW
903 ((glAttachShader
904 (program GLuint)
905 (shader GLuint)
906 ->
907 void))
3c9b6116
AW
908 "Attaches a shader object to a program object.
909
910PROGRAM
911 Specifies the program object to which a shader object will be
912 attached.
913
914SHADER
915 Specifies the shader object that is to be attached.
916
917In order to create an executable, there must be a way to specify the
918list of things that will be linked together. Program objects provide
919this mechanism. Shaders that are to be linked together in a program
920object must first be attached to that program object. `glAttachShader'
921attaches the shader object specified by SHADER to the program object
922specified by PROGRAM. This indicates that SHADER will be included in
923link operations that will be performed on PROGRAM.
924
925All operations that can be performed on a shader object are valid
926whether or not the shader object is attached to a program object. It is
927permissible to attach a shader object to a program object before source
928code has been loaded into the shader object or before the shader object
929has been compiled. It is permissible to attach multiple shader objects
930of the same type because each may contain a portion of the complete
931shader. It is also permissible to attach a shader object to more than
932one program object. If a shader object is deleted while it is attached
933to a program object, it will be flagged for deletion, and deletion will
934not occur until `glDetachShader' is called to detach it from all program
935objects to which it is attached.
936
937`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is not a
938value generated by OpenGL.
939
940`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
941
942`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
943
944`GL_INVALID_OPERATION' is generated if SHADER is already attached to
945PROGRAM.
946
947`GL_INVALID_OPERATION' is generated if `glAttachShader' is executed
948between the execution of `glBegin' and the corresponding execution of
949`glEnd'.")
8925f36f 950
25072f02 951(define-gl-procedures
bb894c9d
AW
952 ((glBeginQuery
953 (target GLenum)
954 (id GLuint)
955 ->
956 void)
957 (glEndQuery (target GLenum) -> void))
3c9b6116
AW
958 "Delimit the boundaries of a query object.
959
960TARGET
961 Specifies the target type of query object established between
962 `glBeginQuery' and the subsequent `glEndQuery'. The symbolic
963 constant must be `GL_SAMPLES_PASSED'.
964
965ID
966 Specifies the name of a query object.
967
968`glBeginQuery' and `glEndQuery' delimit the boundaries of a query
969object. If a query object with name ID does not yet exist it is created.
970
971When `glBeginQuery' is executed, the query object's samples-passed
972counter is reset to 0. Subsequent rendering will increment the counter
973once for every sample that passes the depth test. When `glEndQuery' is
974executed, the samples-passed counter is assigned to the query object's
975result value. This value can be queried by calling `glGetQueryObject'
976with PNAME`GL_QUERY_RESULT'.
977
978Querying the `GL_QUERY_RESULT' implicitly flushes the GL pipeline until
979the rendering delimited by the query object has completed and the result
980is available. `GL_QUERY_RESULT_AVAILABLE' can be queried to determine if
981the result is immediately available or if the rendering is not yet
982complete.
983
984`GL_INVALID_ENUM' is generated if TARGET is not `GL_SAMPLES_PASSED'.
985
986`GL_INVALID_OPERATION' is generated if `glBeginQuery' is executed while
987a query object of the same TARGET is already active.
988
989`GL_INVALID_OPERATION' is generated if `glEndQuery' is executed when a
990query object of the same TARGET is not active.
991
992`GL_INVALID_OPERATION' is generated if ID is 0.
993
994`GL_INVALID_OPERATION' is generated if ID is the name of an already
995active query object.
996
997`GL_INVALID_OPERATION' is generated if `glBeginQuery' or `glEndQuery' is
998executed between the execution of `glBegin' and the corresponding
999execution of `glEnd'.")
8925f36f 1000
25072f02 1001(define-gl-procedures
bb894c9d 1002 ((glBegin (mode GLenum) -> void) (glEnd -> void))
3c9b6116
AW
1003 "Delimit the vertices of a primitive or a group of like primitives.
1004
1005MODE
1006 Specifies the primitive or primitives that will be created from
1007 vertices presented between `glBegin' and the subsequent `glEnd'.
1008 Ten symbolic constants are accepted: `GL_POINTS', `GL_LINES',
1009 `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_TRIANGLES',
1010 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_QUADS',
1011 `GL_QUAD_STRIP', and `GL_POLYGON'.
1012
1013`glBegin' and `glEnd' delimit the vertices that define a primitive or a
1014group of like primitives. `glBegin' accepts a single argument that
1015specifies in which of ten ways the vertices are interpreted. Taking N as
1016an integer count starting at one, and N as the total number of vertices
1017specified, the interpretations are as follows:
1018
1019`GL_POINTS'
1020 Treats each vertex as a single point. Vertex N defines point N . N
1021 points are drawn.
1022
1023`GL_LINES'
1024 Treats each pair of vertices as an independent line segment.
1025 Vertices 2\u2062N-1 and 2\u2062N define line N . N/2 lines are drawn.
1026
1027`GL_LINE_STRIP'
1028 Draws a connected group of line segments from the first vertex to
1029 the last. Vertices N and N+1 define line N . N-1 lines are drawn.
1030
1031`GL_LINE_LOOP'
1032 Draws a connected group of line segments from the first vertex to
1033 the last, then back to the first. Vertices N and N+1 define line N
1034 . The last line, however, is defined by vertices N and 1 . N lines
1035 are drawn.
1036
1037`GL_TRIANGLES'
1038 Treats each triplet of vertices as an independent triangle.
1039 Vertices 3\u2062N-2 , 3\u2062N-1 , and 3\u2062N define triangle N . N/3 triangles
1040 are drawn.
1041
1042`GL_TRIANGLE_STRIP'
1043 Draws a connected group of triangles. One triangle is defined for
1044 each vertex presented after the first two vertices. For odd N ,
1045 vertices N , N+1 , and N+2 define triangle N . For even N ,
1046 vertices N+1 , N , and N+2 define triangle N . N-2 triangles are
1047 drawn.
1048
1049`GL_TRIANGLE_FAN'
1050 Draws a connected group of triangles. One triangle is defined for
1051 each vertex presented after the first two vertices. Vertices 1 ,
1052 N+1 , and N+2 define triangle N . N-2 triangles are drawn.
1053
1054`GL_QUADS'
1055 Treats each group of four vertices as an independent quadrilateral.
1056 Vertices 4\u2062N-3 , 4\u2062N-2 , 4\u2062N-1 , and 4\u2062N define quadrilateral N .
1057 N/4 quadrilaterals are drawn.
1058
1059`GL_QUAD_STRIP'
1060 Draws a connected group of quadrilaterals. One quadrilateral is
1061 defined for each pair of vertices presented after the first pair.
1062 Vertices 2\u2062N-1 , 2\u2062N , 2\u2062N+2 , and 2\u2062N+1 define quadrilateral N .
1063 N/2-1 quadrilaterals are drawn. Note that the order in which
1064 vertices are used to construct a quadrilateral from strip data is
1065 different from that used with independent data.
1066
1067`GL_POLYGON'
1068 Draws a single, convex polygon. Vertices 1 through N define this
1069 polygon.
1070
1071Only a subset of GL commands can be used between `glBegin' and `glEnd'.
1072The commands are `glVertex', `glColor', `glSecondaryColor', `glIndex',
1073`glNormal', `glFogCoord', `glTexCoord', `glMultiTexCoord',
1074`glVertexAttrib', `glEvalCoord', `glEvalPoint', `glArrayElement',
1075`glMaterial', and `glEdgeFlag'. Also, it is acceptable to use
1076`glCallList' or `glCallLists' to execute display lists that include only
1077the preceding commands. If any other GL command is executed between
1078`glBegin' and `glEnd', the error flag is set and the command is ignored.
1079
1080Regardless of the value chosen for MODE, there is no limit to the number
1081of vertices that can be defined between `glBegin' and `glEnd'. Lines,
1082triangles, quadrilaterals, and polygons that are incompletely specified
1083are not drawn. Incomplete specification results when either too few
1084vertices are provided to specify even a single primitive or when an
1085incorrect multiple of vertices is specified. The incomplete primitive is
1086ignored; the rest are drawn.
1087
1088The minimum specification of vertices for each primitive is as follows:
10891 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral,
1090and 3 for a polygon. Modes that require a certain multiple of vertices
1091are `GL_LINES' (2), `GL_TRIANGLES' (3), `GL_QUADS' (4), and
1092`GL_QUAD_STRIP' (2).
1093
1094`GL_INVALID_ENUM' is generated if MODE is set to an unaccepted value.
1095
1096`GL_INVALID_OPERATION' is generated if `glBegin' is executed between a
1097`glBegin' and the corresponding execution of `glEnd'.
1098
1099`GL_INVALID_OPERATION' is generated if `glEnd' is executed without being
1100preceded by a `glBegin'.
1101
1102`GL_INVALID_OPERATION' is generated if a command other than `glVertex',
1103`glColor', `glSecondaryColor', `glIndex', `glNormal', `glFogCoord',
1104`glTexCoord', `glMultiTexCoord', `glVertexAttrib', `glEvalCoord',
1105`glEvalPoint', `glArrayElement', `glMaterial', `glEdgeFlag',
1106`glCallList', or `glCallLists' is executed between the execution of
1107`glBegin' and the corresponding execution `glEnd'.
1108
1109Execution of `glEnableClientState', `glDisableClientState',
1110`glEdgeFlagPointer', `glFogCoordPointer', `glTexCoordPointer',
1111`glColorPointer', `glSecondaryColorPointer', `glIndexPointer',
1112`glNormalPointer', `glVertexPointer', `glVertexAttribPointer',
1113`glInterleavedArrays', or `glPixelStore' is not allowed after a call to
1114`glBegin' and before the corresponding call to `glEnd', but an error may
1115or may not be generated.")
8925f36f 1116
25072f02 1117(define-gl-procedures
bb894c9d
AW
1118 ((glBindAttribLocation
1119 (program GLuint)
1120 (index GLuint)
00239761 1121 (name const-GLchar-*)
bb894c9d
AW
1122 ->
1123 void))
3c9b6116
AW
1124 "Associates a generic vertex attribute index with a named attribute
1125variable.
1126
1127PROGRAM
1128 Specifies the handle of the program object in which the association
1129 is to be made.
1130
1131INDEX
1132 Specifies the index of the generic vertex attribute to be bound.
1133
1134NAME
1135 Specifies a null terminated string containing the name of the
1136 vertex shader attribute variable to which INDEX is to be bound.
1137
1138`glBindAttribLocation' is used to associate a user-defined attribute
1139variable in the program object specified by PROGRAM with a generic
1140vertex attribute index. The name of the user-defined attribute variable
1141is passed as a null terminated string in NAME. The generic vertex
1142attribute index to be bound to this variable is specified by INDEX. When
1143PROGRAM is made part of current state, values provided via the generic
1144vertex attribute INDEX will modify the value of the user-defined
1145attribute variable specified by NAME.
1146
1147If NAME refers to a matrix attribute variable, INDEX refers to the first
1148column of the matrix. Other matrix columns are then automatically bound
1149to locations INDEX+1 for a matrix of type mat2; INDEX+1 and INDEX+2 for
1150a matrix of type mat3; and INDEX+1, INDEX+2, and INDEX+3 for a matrix of
1151type mat4.
1152
1153This command makes it possible for vertex shaders to use descriptive
1154names for attribute variables rather than generic variables that are
1155numbered from 0 to `GL_MAX_VERTEX_ATTRIBS' -1. The values sent to each
1156generic attribute index are part of current state, just like standard
1157vertex attributes such as color, normal, and vertex position. If a
1158different program object is made current by calling `glUseProgram', the
1159generic vertex attributes are tracked in such a way that the same values
1160will be observed by attributes in the new program object that are also
1161bound to INDEX.
1162
1163Attribute variable name-to-generic attribute index bindings for a
1164program object can be explicitly assigned at any time by calling
1165`glBindAttribLocation'. Attribute bindings do not go into effect until
1166`glLinkProgram' is called. After a program object has been linked
1167successfully, the index values for generic attributes remain fixed (and
1168their values can be queried) until the next link command occurs.
1169
1170Applications are not allowed to bind any of the standard OpenGL vertex
1171attributes using this command, as they are bound automatically when
1172needed. Any attribute binding that occurs after the program object has
1173been linked will not take effect until the next time the program object
1174is linked.
1175
1176`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
1177`GL_MAX_VERTEX_ATTRIBS'.
1178
1179`GL_INVALID_OPERATION' is generated if NAME starts with the reserved
1180prefix \"gl_\".
1181
1182`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
1183OpenGL.
1184
1185`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
1186
1187`GL_INVALID_OPERATION' is generated if `glBindAttribLocation' is
1188executed between the execution of `glBegin' and the corresponding
1189execution of `glEnd'.")
8925f36f 1190
25072f02 1191(define-gl-procedures
bb894c9d
AW
1192 ((glBindBuffer
1193 (target GLenum)
1194 (buffer GLuint)
1195 ->
1196 void))
3c9b6116
AW
1197 "Bind a named buffer object.
1198
1199TARGET
1200 Specifies the target to which the buffer object is bound. The
1201 symbolic constant must be `GL_ARRAY_BUFFER',
1202 `GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1203 `GL_PIXEL_UNPACK_BUFFER'.
1204
1205BUFFER
1206 Specifies the name of a buffer object.
1207
1208`glBindBuffer' lets you create or use a named buffer object. Calling
1209`glBindBuffer' with TARGET set to `GL_ARRAY_BUFFER',
1210`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER' or
1211`GL_PIXEL_UNPACK_BUFFER' and BUFFER set to the name of the new buffer
1212object binds the buffer object name to the target. When a buffer object
1213is bound to a target, the previous binding for that target is
1214automatically broken.
1215
1216Buffer object names are unsigned integers. The value zero is reserved,
1217but there is no default buffer object for each buffer object target.
1218Instead, BUFFER set to zero effectively unbinds any buffer object
1219previously bound, and restores client memory usage for that buffer
1220object target. Buffer object names and the corresponding buffer object
1221contents are local to the shared display-list space (see
1222`glXCreateContext') of the current GL rendering context; two rendering
1223contexts share buffer object names only if they also share display
1224lists.
1225
1226You may use `glGenBuffers' to generate a set of new buffer object names.
1227
1228The state of a buffer object immediately after it is first bound is an
1229unmapped zero-sized memory buffer with `GL_READ_WRITE' access and
1230`GL_STATIC_DRAW' usage.
1231
1232While a non-zero buffer object name is bound, GL operations on the
1233target to which it is bound affect the bound buffer object, and queries
1234of the target to which it is bound return state from the bound buffer
1235object. While buffer object name zero is bound, as in the initial state,
1236attempts to modify or query state on the target to which it is bound
1237generates an `GL_INVALID_OPERATION' error.
1238
1239When vertex array pointer state is changed, for example by a call to
1240`glNormalPointer', the current buffer object binding
1241(`GL_ARRAY_BUFFER_BINDING') is copied into the corresponding client
1242state for the vertex array type being changed, for example
1243`GL_NORMAL_ARRAY_BUFFER_BINDING'. While a non-zero buffer object is
1244bound to the `GL_ARRAY_BUFFER' target, the vertex array pointer
1245parameter that is traditionally interpreted as a pointer to client-side
1246memory is instead interpreted as an offset within the buffer object
1247measured in basic machine units.
1248
1249While a non-zero buffer object is bound to the `GL_ELEMENT_ARRAY_BUFFER'
1250target, the indices parameter of `glDrawElements',
1251`glDrawRangeElements', or `glMultiDrawElements' that is traditionally
1252interpreted as a pointer to client-side memory is instead interpreted as
1253an offset within the buffer object measured in basic machine units.
1254
1255While a non-zero buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
1256target, the following commands are affected: `glGetCompressedTexImage',
1257`glGetConvolutionFilter', `glGetHistogram', `glGetMinmax',
1258`glGetPixelMap', `glGetPolygonStipple', `glGetSeparableFilter',
1259`glGetTexImage', and `glReadPixels'. The pointer parameter that is
1260traditionally interpreted as a pointer to client-side memory where the
1261pixels are to be packed is instead interpreted as an offset within the
1262buffer object measured in basic machine units.
1263
1264While a non-zero buffer object is bound to the `GL_PIXEL_UNPACK_BUFFER'
1265target, the following commands are affected: `glBitmap',
1266`glColorSubTable', `glColorTable', `glCompressedTexImage1D',
1267`glCompressedTexImage2D', `glCompressedTexImage3D',
1268`glCompressedTexSubImage1D', `glCompressedTexSubImage2D',
1269`glCompressedTexSubImage3D', `glConvolutionFilter1D',
1270`glConvolutionFilter2D', `glDrawPixels', `glPixelMap',
1271`glPolygonStipple', `glSeparableFilter2D', `glTexImage1D',
1272`glTexImage2D', `glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
1273and `glTexSubImage3D'. The pointer parameter that is traditionally
1274interpreted as a pointer to client-side memory from which the pixels are
1275to be unpacked is instead interpreted as an offset within the buffer
1276object measured in basic machine units.
1277
1278A buffer object binding created with `glBindBuffer' remains active until
1279a different buffer object name is bound to the same target, or until the
1280bound buffer object is deleted with `glDeleteBuffers'.
1281
1282Once created, a named buffer object may be re-bound to any target as
1283often as needed. However, the GL implementation may make choices about
1284how to optimize the storage of a buffer object based on its initial
1285binding target.
1286
1287`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1288values.
1289
1290`GL_INVALID_OPERATION' is generated if `glBindBuffer' is executed
1291between the execution of `glBegin' and the corresponding execution of
1292`glEnd'.")
8925f36f 1293
25072f02 1294(define-gl-procedures
bb894c9d
AW
1295 ((glBindTexture
1296 (target GLenum)
1297 (texture GLuint)
1298 ->
1299 void))
3c9b6116
AW
1300 "Bind a named texture to a texturing target.
1301
1302TARGET
1303 Specifies the target to which the texture is bound. Must be either
1304 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
1305 `GL_TEXTURE_CUBE_MAP'.
1306
1307TEXTURE
1308 Specifies the name of a texture.
1309
1310`glBindTexture' lets you create or use a named texture. Calling
1311`glBindTexture' with TARGET set to `GL_TEXTURE_1D', `GL_TEXTURE_2D',
1312`GL_TEXTURE_3D' or `GL_TEXTURE_CUBE_MAP' and TEXTURE set to the name of
1313the new texture binds the texture name to the target. When a texture is
1314bound to a target, the previous binding for that target is automatically
1315broken.
1316
8925f36f 1317Texture names are unsigned integers. The value zero is reserved to
3c9b6116
AW
1318represent the default texture for each texture target. Texture names and
1319the corresponding texture contents are local to the shared display-list
1320space (see `glXCreateContext') of the current GL rendering context; two
1321rendering contexts share texture names only if they also share display
1322lists.
1323
1324You may use `glGenTextures' to generate a set of new texture names.
1325
1326When a texture is first bound, it assumes the specified target: A
1327texture first bound to `GL_TEXTURE_1D' becomes one-dimensional texture,
1328a texture first bound to `GL_TEXTURE_2D' becomes two-dimensional
1329texture, a texture first bound to `GL_TEXTURE_3D' becomes
1330three-dimensional texture, and a texture first bound to
1331`GL_TEXTURE_CUBE_MAP' becomes a cube-mapped texture. The state of a
1332one-dimensional texture immediately after it is first bound is
1333equivalent to the state of the default `GL_TEXTURE_1D' at GL
1334initialization, and similarly for two- and three-dimensional textures
1335and cube-mapped textures.
1336
8925f36f 1337While a texture is bound, GL operations on the target to which it is
3c9b6116
AW
1338bound affect the bound texture, and queries of the target to which it is
1339bound return state from the bound texture. If texture mapping is active
1340on the target to which a texture is bound, the bound texture is used. In
1341effect, the texture targets become aliases for the textures currently
1342bound to them, and the texture name zero refers to the default textures
1343that were bound to them at initialization.
1344
1345A texture binding created with `glBindTexture' remains active until a
1346different texture is bound to the same target, or until the bound
1347texture is deleted with `glDeleteTextures'.
1348
1349Once created, a named texture may be re-bound to its same original
1350target as often as needed. It is usually much faster to use
1351`glBindTexture' to bind an existing named texture to one of the texture
1352targets than it is to reload the texture image using `glTexImage1D',
1353`glTexImage2D', or `glTexImage3D'. For additional control over
1354performance, use `glPrioritizeTextures'.
1355
1356`glBindTexture' is included in display lists.
1357
1358`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
1359values.
1360
1361`GL_INVALID_OPERATION' is generated if TEXTURE was previously created
1362with a target that doesn't match that of TARGET.
1363
1364`GL_INVALID_OPERATION' is generated if `glBindTexture' is executed
1365between the execution of `glBegin' and the corresponding execution of
1366`glEnd'.")
8925f36f 1367
25072f02 1368(define-gl-procedures
bb894c9d
AW
1369 ((glBitmap
1370 (width GLsizei)
1371 (height GLsizei)
1372 (xorig GLfloat)
1373 (yorig GLfloat)
1374 (xmove GLfloat)
1375 (ymove GLfloat)
00239761 1376 (bitmap const-GLubyte-*)
bb894c9d
AW
1377 ->
1378 void))
3c9b6116
AW
1379 "Draw a bitmap.
1380
1381WIDTH
1382 HEIGHT
1383
1384 Specify the pixel width and height of the bitmap image.
1385
1386XORIG
1387 YORIG
1388
1389 Specify the location of the origin in the bitmap image. The origin
1390 is measured from the lower left corner of the bitmap, with right
1391 and up being the positive axes.
1392
1393XMOVE
1394 YMOVE
1395
1396 Specify the X and Y offsets to be added to the current raster
1397 position after the bitmap is drawn.
1398
1399BITMAP
1400 Specifies the address of the bitmap image.
1401
1402A bitmap is a binary image. When drawn, the bitmap is positioned
1403relative to the current raster position, and frame buffer pixels
1404corresponding to 1's in the bitmap are written using the current raster
1405color or index. Frame buffer pixels corresponding to 0's in the bitmap
1406are not modified.
1407
1408`glBitmap' takes seven arguments. The first pair specifies the width and
1409height of the bitmap image. The second pair specifies the location of
1410the bitmap origin relative to the lower left corner of the bitmap image.
1411The third pair of arguments specifies X and Y offsets to be added to the
1412current raster position after the bitmap has been drawn. The final
1413argument is a pointer to the bitmap image itself.
1414
1415If a non-zero named buffer object is bound to the
1416`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a bitmap
1417image is specified, BITMAP is treated as a byte offset into the buffer
1418object's data store.
1419
1420The bitmap image is interpreted like image data for the `glDrawPixels'
1421command, with WIDTH and HEIGHT corresponding to the width and height
1422arguments of that command, and with TYPE set to `GL_BITMAP' and FORMAT
1423set to `GL_COLOR_INDEX'. Modes specified using `glPixelStore' affect the
1424interpretation of bitmap image data; modes specified using
1425`glPixelTransfer' do not.
1426
1427If the current raster position is invalid, `glBitmap' is ignored.
1428Otherwise, the lower left corner of the bitmap image is positioned at
1429the window coordinates
1430
1431X_W=⌊X_R-X_O,⌋
1432
1433Y_W=⌊Y_R-Y_O,⌋
1434
1435where (X_R,Y_R) is the raster position and (X_O,Y_O) is the bitmap
1436origin. Fragments are then generated for each pixel corresponding to a 1
1437(one) in the bitmap image. These fragments are generated using the
1438current raster Z coordinate, color or color index, and current raster
1439texture coordinates. They are then treated just as if they had been
1440generated by a point, line, or polygon, including texture mapping,
1441fogging, and all per-fragment operations such as alpha and depth
1442testing.
1443
1444After the bitmap has been drawn, the X and Y coordinates of the current
1445raster position are offset by XMOVE and YMOVE. No change is made to the
1446Z coordinate of the current raster position, or to the current raster
1447color, texture coordinates, or index.
1448
1449`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is negative.
1450
1451`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1452bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
1453data store is currently mapped.
1454
1455`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
1456bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
1457unpacked from the buffer object such that the memory reads required
1458would exceed the data store size.
1459
1460`GL_INVALID_OPERATION' is generated if `glBitmap' is executed between
1461the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 1462
25072f02 1463(define-gl-procedures
bb894c9d
AW
1464 ((glBlendColor
1465 (red GLclampf)
1466 (green GLclampf)
1467 (blue GLclampf)
1468 (alpha GLclampf)
1469 ->
1470 void))
3c9b6116
AW
1471 "Set the blend color.
1472
1473RED
1474 GREEN
1475
1476 BLUE
1477
1478 ALPHA
1479
1480 specify the components of `GL_BLEND_COLOR'
1481
1482The `GL_BLEND_COLOR' may be used to calculate the source and destination
1483blending factors. The color components are clamped to the range [0,1]
1484before being stored. See `glBlendFunc' for a complete description of the
1485blending operations. Initially the `GL_BLEND_COLOR' is set to (0, 0, 0,
14860).
1487
1488`GL_INVALID_OPERATION' is generated if `glBlendColor' is executed
1489between the execution of `glBegin' and the corresponding execution of
1490`glEnd'.")
8925f36f 1491
25072f02 1492(define-gl-procedures
bb894c9d
AW
1493 ((glBlendEquationSeparate
1494 (modeRGB GLenum)
1495 (modeAlpha GLenum)
1496 ->
1497 void))
3c9b6116
AW
1498 "Set the RGB blend equation and the alpha blend equation separately.
1499
1500MODERGB
1501 specifies the RGB blend equation, how the red, green, and blue
1502 components of the source and destination colors are combined. It
1503 must be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
1504 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN', `GL_MAX'.
1505
1506MODEALPHA
1507 specifies the alpha blend equation, how the alpha component of the
1508 source and destination colors are combined. It must be
1509 `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1510 `GL_MIN', `GL_MAX'.
1511
1512The blend equations determines how a new pixel (the ''source'' color) is
1513combined with a pixel already in the framebuffer (the ''destination''
1514color). This function specifies one blend equation for the RGB-color
1515components and one blend equation for the alpha component.
1516
8925f36f 1517The blend equations use the source and destination blend factors
3c9b6116
AW
1518specified by either `glBlendFunc' or `glBlendFuncSeparate'. See
1519`glBlendFunc' or `glBlendFuncSeparate' for a description of the various
1520blend factors.
1521
1522In the equations that follow, source and destination color components
1523are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1524The result color is referred to as (R_R,G_RB_RA_R) . The source and
1525destination blend factors are denoted (S_R,S_GS_BS_A) and
1526(D_R,D_GD_BD_A) , respectively. For these equations all color components
1527are understood to have values in the range [0,1] .
1528
1529*Mode*
1530 *RGB Components*, *Alpha Component*
1531
1532`GL_FUNC_ADD'
1533 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 ,
1534 AR=A_S\u2062S_A+A_D\u2062D_A
1535
1536`GL_FUNC_SUBTRACT'
1537 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 ,
1538 AR=A_S\u2062S_A-A_D\u2062D_A
1539
1540`GL_FUNC_REVERSE_SUBTRACT'
1541 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 ,
1542 AR=A_D\u2062D_A-A_S\u2062S_A
1543
1544`GL_MIN'
1545 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1546 AR=MIN\u2061(A_S,A_D)
1547
1548`GL_MAX'
1549 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1550 AR=MAX\u2061(A_S,A_D)
1551
1552The results of these equations are clamped to the range [0,1] .
1553
1554The `GL_MIN' and `GL_MAX' equations are useful for applications that
1555analyze image data (image thresholding against a constant color, for
1556example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1557transparency, among other things.
1558
1559Initially, both the RGB blend equation and the alpha blend equation are
1560set to `GL_FUNC_ADD'.
1561
1562
1563
1564`GL_INVALID_ENUM' is generated if either MODERGB or MODEALPHA is not one
1565of `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1566`GL_MAX', or `GL_MIN'.
1567
1568`GL_INVALID_OPERATION' is generated if `glBlendEquationSeparate' is
1569executed between the execution of `glBegin' and the corresponding
1570execution of `glEnd'.")
8925f36f 1571
25072f02 1572(define-gl-procedures
bb894c9d 1573 ((glBlendEquation (mode GLenum) -> void))
3c9b6116
AW
1574 "Specify the equation used for both the RGB blend equation and the Alpha
1575blend equation.
1576
1577MODE
1578 specifies how source and destination colors are combined. It must
1579 be `GL_FUNC_ADD', `GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT',
1580 `GL_MIN', `GL_MAX'.
1581
1582The blend equations determine how a new pixel (the ''source'' color) is
1583combined with a pixel already in the framebuffer (the ''destination''
1584color). This function sets both the RGB blend equation and the alpha
1585blend equation to a single equation.
1586
1587These equations use the source and destination blend factors specified
1588by either `glBlendFunc' or `glBlendFuncSeparate'. See `glBlendFunc' or
1589`glBlendFuncSeparate' for a description of the various blend factors.
1590
1591In the equations that follow, source and destination color components
1592are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) , respectively.
1593The result color is referred to as (R_R,G_RB_RA_R) . The source and
1594destination blend factors are denoted (S_R,S_GS_BS_A) and
1595(D_R,D_GD_BD_A) , respectively. For these equations all color components
1596are understood to have values in the range [0,1] .
1597
1598*Mode*
1599 *RGB Components*, *Alpha Component*
1600
1601`GL_FUNC_ADD'
1602 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 ,
1603 AR=A_S\u2062S_A+A_D\u2062D_A
1604
1605`GL_FUNC_SUBTRACT'
1606 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 ,
1607 AR=A_S\u2062S_A-A_D\u2062D_A
1608
1609`GL_FUNC_REVERSE_SUBTRACT'
1610 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 ,
1611 AR=A_D\u2062D_A-A_S\u2062S_A
1612
1613`GL_MIN'
1614 RR=MIN\u2061(R_S,R_D) GR=MIN\u2061(G_S,G_D) BR=MIN\u2061(B_S,B_D) ,
1615 AR=MIN\u2061(A_S,A_D)
1616
1617`GL_MAX'
1618 RR=MAX\u2061(R_S,R_D) GR=MAX\u2061(G_S,G_D) BR=MAX\u2061(B_S,B_D) ,
1619 AR=MAX\u2061(A_S,A_D)
1620
1621The results of these equations are clamped to the range [0,1] .
1622
1623The `GL_MIN' and `GL_MAX' equations are useful for applications that
1624analyze image data (image thresholding against a constant color, for
1625example). The `GL_FUNC_ADD' equation is useful for antialiasing and
1626transparency, among other things.
1627
1628Initially, both the RGB blend equation and the alpha blend equation are
1629set to `GL_FUNC_ADD'.
1630
1631
1632
1633`GL_INVALID_ENUM' is generated if MODE is not one of `GL_FUNC_ADD',
1634`GL_FUNC_SUBTRACT', `GL_FUNC_REVERSE_SUBTRACT', `GL_MAX', or `GL_MIN'.
1635
1636`GL_INVALID_OPERATION' is generated if `glBlendEquation' is executed
1637between the execution of `glBegin' and the corresponding execution of
1638`glEnd'.")
8925f36f 1639
25072f02 1640(define-gl-procedures
bb894c9d
AW
1641 ((glBlendFuncSeparate
1642 (srcRGB GLenum)
1643 (dstRGB GLenum)
1644 (srcAlpha GLenum)
1645 (dstAlpha GLenum)
1646 ->
1647 void))
3c9b6116
AW
1648 "Specify pixel arithmetic for RGB and alpha components separately.
1649
1650SRCRGB
1651 Specifies how the red, green, and blue blending factors are
1652 computed. The following symbolic constants are accepted: `GL_ZERO',
1653 `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR',
1654 `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA',
1655 `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1656 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1657 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1658 initial value is `GL_ONE'.
1659
1660DSTRGB
1661 Specifies how the red, green, and blue destination blending factors
1662 are computed. The following symbolic constants are accepted:
1663 `GL_ZERO', `GL_ONE', `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR',
1664 `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR', `GL_SRC_ALPHA',
1665 `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA', `GL_ONE_MINUS_DST_ALPHA'.
1666 `GL_CONSTANT_COLOR', `GL_ONE_MINUS_CONSTANT_COLOR',
1667 `GL_CONSTANT_ALPHA', and `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial
1668 value is `GL_ZERO'.
1669
1670SRCALPHA
1671 Specified how the alpha source blending factor is computed. The
1672 same symbolic constants are accepted as for SRCRGB. The initial
1673 value is `GL_ONE'.
1674
1675DSTALPHA
1676 Specified how the alpha destination blending factor is computed.
1677 The same symbolic constants are accepted as for DSTRGB. The initial
1678 value is `GL_ZERO'.
1679
1680In RGBA mode, pixels can be drawn using a function that blends the
1681incoming (source) RGBA values with the RGBA values that are already in
1682the frame buffer (the destination values). Blending is initially
1683disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1684enable and disable blending.
1685
1686`glBlendFuncSeparate' defines the operation of blending when it is
1687enabled. SRCRGB specifies which method is used to scale the source
1688RGB-color components. DSTRGB specifies which method is used to scale the
1689destination RGB-color components. Likewise, SRCALPHA specifies which
1690method is used to scale the source alpha color component, and DSTALPHA
1691specifies which method is used to scale the destination alpha component.
1692The possible methods are described in the following table. Each method
1693defines four scale factors, one each for red, green, blue, and alpha.
1694
1695In the table and in subsequent equations, source and destination color
1696components are referred to as (R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The
1697color specified by `glBlendColor' is referred to as (R_C,G_CB_CA_C) .
1698They are understood to have integer values between 0 and (K_R,K_GK_BK_A)
1699, where
1700
1701K_C=2^M_C,-1
1702
1703and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1704bitplanes.
1705
1706Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1707and (D_R,D_GD_BD_A) . All scale factors have range [0,1] .
1708
1709
1710
1711*Parameter*
1712 *RGB Factor*, *Alpha Factor*
1713
1714`GL_ZERO'
1715 (0,00) , 0
1716
1717`GL_ONE'
1718 (1,11) , 1
1719
1720`GL_SRC_COLOR'
1721 (R_S/K_R,G_S/K_GB_S/K_B) , A_S/K_A
1722
1723`GL_ONE_MINUS_SRC_COLOR'
1724 (1,111)-(R_S/K_R,G_S/K_GB_S/K_B) , 1-A_S/K_A
1725
1726`GL_DST_COLOR'
1727 (R_D/K_R,G_D/K_GB_D/K_B) , A_D/K_A
1728
1729`GL_ONE_MINUS_DST_COLOR'
1730 (1,11)-(R_D/K_R,G_D/K_GB_D/K_B) , 1-A_D/K_A
1731
1732`GL_SRC_ALPHA'
1733 (A_S/K_A,A_S/K_AA_S/K_A) , A_S/K_A
1734
1735`GL_ONE_MINUS_SRC_ALPHA'
1736 (1,11)-(A_S/K_A,A_S/K_AA_S/K_A) , 1-A_S/K_A
1737
1738`GL_DST_ALPHA'
1739 (A_D/K_A,A_D/K_AA_D/K_A) , A_D/K_A
1740
1741`GL_ONE_MINUS_DST_ALPHA'
1742 (1,11)-(A_D/K_A,A_D/K_AA_D/K_A) , 1-A_D/K_A
1743
1744`GL_CONSTANT_COLOR'
1745 (R_C,G_CB_C) , A_C
1746
1747`GL_ONE_MINUS_CONSTANT_COLOR'
1748 (1,11)-(R_C,G_CB_C) , 1-A_C
1749
1750`GL_CONSTANT_ALPHA'
1751 (A_C,A_CA_C) , A_C
1752
1753`GL_ONE_MINUS_CONSTANT_ALPHA'
1754 (1,11)-(A_C,A_CA_C) , 1-A_C
1755
1756`GL_SRC_ALPHA_SATURATE'
1757 (I,II) , 1
1758
1759In the table,
1760
1761I=MIN\u2061(A_S,1-A_D,)
1762
1763To determine the blended RGBA values of a pixel when drawing in RGBA
1764mode, the system uses the following equations:
1765
1766R_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)
1767B_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)
1768
1769Despite the apparent precision of the above equations, blending
1770arithmetic is not exactly specified, because blending operates with
1771imprecise integer color values. However, a blend factor that should be
1772equal to 1 is guaranteed not to modify its multiplicand, and a blend
1773factor equal to 0 reduces its multiplicand to 0. For example, when
1774SRCRGB is `GL_SRC_ALPHA', DSTRGB is `GL_ONE_MINUS_SRC_ALPHA', and A_S is
1775equal to K_A , the equations reduce to simple replacement:
1776
1777R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1778
1779
1780
1781`GL_INVALID_ENUM' is generated if either SRCRGB or DSTRGB is not an
1782accepted value.
1783
1784`GL_INVALID_OPERATION' is generated if `glBlendFuncSeparate' is executed
1785between the execution of `glBegin' and the corresponding execution of
1786`glEnd'.")
8925f36f 1787
25072f02 1788(define-gl-procedures
bb894c9d
AW
1789 ((glBlendFunc
1790 (sfactor GLenum)
1791 (dfactor GLenum)
1792 ->
1793 void))
3c9b6116 1794 "Specify pixel arithmetic.
8925f36f 1795
3c9b6116
AW
1796SFACTOR
1797 Specifies how the red, green, blue, and alpha source blending
1798 factors are computed. The following symbolic constants are
1799 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1800 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1801 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1802 `GL_ONE_MINUS_DST_ALPHA', `GL_CONSTANT_COLOR',
1803 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA',
1804 `GL_ONE_MINUS_CONSTANT_ALPHA', and `GL_SRC_ALPHA_SATURATE'. The
1805 initial value is `GL_ONE'.
8925f36f 1806
3c9b6116
AW
1807DFACTOR
1808 Specifies how the red, green, blue, and alpha destination blending
1809 factors are computed. The following symbolic constants are
1810 accepted: `GL_ZERO', `GL_ONE', `GL_SRC_COLOR',
1811 `GL_ONE_MINUS_SRC_COLOR', `GL_DST_COLOR', `GL_ONE_MINUS_DST_COLOR',
1812 `GL_SRC_ALPHA', `GL_ONE_MINUS_SRC_ALPHA', `GL_DST_ALPHA',
1813 `GL_ONE_MINUS_DST_ALPHA'. `GL_CONSTANT_COLOR',
1814 `GL_ONE_MINUS_CONSTANT_COLOR', `GL_CONSTANT_ALPHA', and
1815 `GL_ONE_MINUS_CONSTANT_ALPHA'. The initial value is `GL_ZERO'.
8925f36f 1816
3c9b6116
AW
1817In RGBA mode, pixels can be drawn using a function that blends the
1818incoming (source) RGBA values with the RGBA values that are already in
1819the frame buffer (the destination values). Blending is initially
1820disabled. Use `glEnable' and `glDisable' with argument `GL_BLEND' to
1821enable and disable blending.
1822
1823`glBlendFunc' defines the operation of blending when it is enabled.
1824SFACTOR specifies which method is used to scale the source color
1825components. DFACTOR specifies which method is used to scale the
1826destination color components. The possible methods are described in the
1827following table. Each method defines four scale factors, one each for
1828red, green, blue, and alpha. In the table and in subsequent equations,
1829source and destination color components are referred to as
1830(R_S,G_SB_SA_S) and (R_D,G_DB_DA_D) . The color specified by
1831`glBlendColor' is referred to as (R_C,G_CB_CA_C) . They are understood
1832to have integer values between 0 and (K_R,K_GK_BK_A) , where
1833
1834K_C=2^M_C,-1
1835
1836and (M_R,M_GM_BM_A) is the number of red, green, blue, and alpha
1837bitplanes.
1838
1839Source and destination scale factors are referred to as (S_R,S_GS_BS_A)
1840and (D_R,D_GD_BD_A) . The scale factors described in the table, denoted
1841(F_R,F_GF_BF_A) , represent either source or destination factors. All
1842scale factors have range [0,1] .
1843
1844
1845
1846*Parameter*
1847 * (F_R,F_GF_BF_A) *
1848
1849`GL_ZERO'
1850 (0,000)
1851
1852`GL_ONE'
1853 (1,111)
1854
1855`GL_SRC_COLOR'
1856 (R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1857
1858`GL_ONE_MINUS_SRC_COLOR'
1859 (1,111)-(R_S/K_R,G_S/K_GB_S/K_BA_S/K_A)
1860
1861`GL_DST_COLOR'
1862 (R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1863
1864`GL_ONE_MINUS_DST_COLOR'
1865 (1,111)-(R_D/K_R,G_D/K_GB_D/K_BA_D/K_A)
1866
1867`GL_SRC_ALPHA'
1868 (A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1869
1870`GL_ONE_MINUS_SRC_ALPHA'
1871 (1,111)-(A_S/K_A,A_S/K_AA_S/K_AA_S/K_A)
1872
1873`GL_DST_ALPHA'
1874 (A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1875
1876`GL_ONE_MINUS_DST_ALPHA'
1877 (1,111)-(A_D/K_A,A_D/K_AA_D/K_AA_D/K_A)
1878
1879`GL_CONSTANT_COLOR'
1880 (R_C,G_CB_CA_C)
1881
1882`GL_ONE_MINUS_CONSTANT_COLOR'
1883 (1,111)-(R_C,G_CB_CA_C)
1884
1885`GL_CONSTANT_ALPHA'
1886 (A_C,A_CA_CA_C)
1887
1888`GL_ONE_MINUS_CONSTANT_ALPHA'
1889 (1,111)-(A_C,A_CA_CA_C)
1890
1891`GL_SRC_ALPHA_SATURATE'
1892 (I,II1)
1893
1894In the table,
1895
1896I=MIN\u2061(A_S,K_A-A_D)/K_A
1897
1898To determine the blended RGBA values of a pixel when drawing in RGBA
1899mode, the system uses the following equations:
1900
1901R_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)
1902B_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)
1903
1904Despite the apparent precision of the above equations, blending
1905arithmetic is not exactly specified, because blending operates with
1906imprecise integer color values. However, a blend factor that should be
1907equal to 1 is guaranteed not to modify its multiplicand, and a blend
1908factor equal to 0 reduces its multiplicand to 0. For example, when
1909SFACTOR is `GL_SRC_ALPHA', DFACTOR is `GL_ONE_MINUS_SRC_ALPHA', and A_S
1910is equal to K_A , the equations reduce to simple replacement:
1911
1912R_D=R_S G_D=G_S B_D=B_S A_D=A_S
1913
1914
1915
1916`GL_INVALID_ENUM' is generated if either SFACTOR or DFACTOR is not an
1917accepted value.
1918
1919`GL_INVALID_OPERATION' is generated if `glBlendFunc' is executed between
1920the execution of `glBegin' and the corresponding execution of `glEnd'.")
1921
25072f02 1922(define-gl-procedures
bb894c9d
AW
1923 ((glBufferData
1924 (target GLenum)
1925 (size GLsizeiptr)
00239761 1926 (data const-GLvoid-*)
bb894c9d
AW
1927 (usage GLenum)
1928 ->
1929 void))
3c9b6116
AW
1930 "Creates and initializes a buffer object's data store.
1931
1932TARGET
1933 Specifies the target buffer object. The symbolic constant must be
1934 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
1935 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
1936
1937SIZE
1938 Specifies the size in bytes of the buffer object's new data store.
1939
1940DATA
1941 Specifies a pointer to data that will be copied into the data store
1942 for initialization, or `NULL' if no data is to be copied.
1943
1944USAGE
1945 Specifies the expected usage pattern of the data store. The
1946 symbolic constant must be `GL_STREAM_DRAW', `GL_STREAM_READ',
1947 `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1948 `GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1949 `GL_DYNAMIC_COPY'.
1950
1951`glBufferData' creates a new data store for the buffer object currently
1952bound to TARGET. Any pre-existing data store is deleted. The new data
1953store is created with the specified SIZE in bytes and USAGE. If DATA is
1954not `NULL', the data store is initialized with data from this pointer.
1955In its initial state, the new data store is not mapped, it has a `NULL'
1956mapped pointer, and its mapped access is `GL_READ_WRITE'.
1957
1958USAGE is a hint to the GL implementation as to how a buffer object's
1959data store will be accessed. This enables the GL implementation to make
1960more intelligent decisions that may significantly impact buffer object
1961performance. It does not, however, constrain the actual usage of the
1962data store. USAGE can be broken down into two parts: first, the
1963frequency of access (modification and usage), and second, the nature of
1964that access. The frequency of access may be one of these:
1965
1966STREAM
1967 The data store contents will be modified once and used at most a
1968 few times.
1969
1970STATIC
1971 The data store contents will be modified once and used many times.
1972
1973DYNAMIC
1974 The data store contents will be modified repeatedly and used many
1975 times.
1976
1977The nature of access may be one of these:
1978
1979DRAW
1980 The data store contents are modified by the application, and used
1981 as the source for GL drawing and image specification commands.
1982
1983READ
1984 The data store contents are modified by reading data from the GL,
1985 and used to return that data when queried by the application.
1986
1987COPY
1988 The data store contents are modified by reading data from the GL,
1989 and used as the source for GL drawing and image specification
1990 commands.
1991
1992`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
1993`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
1994`GL_PIXEL_UNPACK_BUFFER'.
1995
1996`GL_INVALID_ENUM' is generated if USAGE is not `GL_STREAM_DRAW',
1997`GL_STREAM_READ', `GL_STREAM_COPY', `GL_STATIC_DRAW', `GL_STATIC_READ',
1998`GL_STATIC_COPY', `GL_DYNAMIC_DRAW', `GL_DYNAMIC_READ', or
1999`GL_DYNAMIC_COPY'.
2000
2001`GL_INVALID_VALUE' is generated if SIZE is negative.
2002
2003`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
2004is bound to TARGET.
2005
2006`GL_OUT_OF_MEMORY' is generated if the GL is unable to create a data
2007store with the specified SIZE.
2008
2009`GL_INVALID_OPERATION' is generated if `glBufferData' is executed
2010between the execution of `glBegin' and the corresponding execution of
2011`glEnd'.")
2012
25072f02 2013(define-gl-procedures
bb894c9d
AW
2014 ((glBufferSubData
2015 (target GLenum)
2016 (offset GLintptr)
2017 (size GLsizeiptr)
00239761 2018 (data const-GLvoid-*)
bb894c9d
AW
2019 ->
2020 void))
3c9b6116
AW
2021 "Updates a subset of a buffer object's data store.
2022
2023TARGET
2024 Specifies the target buffer object. The symbolic constant must be
2025 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
2026 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
2027
2028OFFSET
2029 Specifies the offset into the buffer object's data store where data
2030 replacement will begin, measured in bytes.
2031
2032SIZE
2033 Specifies the size in bytes of the data store region being
2034 replaced.
2035
2036DATA
2037 Specifies a pointer to the new data that will be copied into the
2038 data store.
2039
2040`glBufferSubData' redefines some or all of the data store for the buffer
2041object currently bound to TARGET. Data starting at byte offset OFFSET
2042and extending for SIZE bytes is copied to the data store from the memory
2043pointed to by DATA. An error is thrown if OFFSET and SIZE together
2044define a range beyond the bounds of the buffer object's data store.
2045
2046`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
2047`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
2048`GL_PIXEL_UNPACK_BUFFER'.
2049
2050`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
2051together they define a region of memory that extends beyond the buffer
2052object's allocated data store.
2053
2054`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
2055is bound to TARGET.
2056
2057`GL_INVALID_OPERATION' is generated if the buffer object being updated
2058is mapped.
2059
2060`GL_INVALID_OPERATION' is generated if `glBufferSubData' is executed
2061between the execution of `glBegin' and the corresponding execution of
2062`glEnd'.")
2063
25072f02 2064(define-gl-procedures
bb894c9d
AW
2065 ((glCallLists
2066 (n GLsizei)
2067 (type GLenum)
00239761 2068 (lists const-GLvoid-*)
bb894c9d
AW
2069 ->
2070 void))
3c9b6116
AW
2071 "Execute a list of display lists.
2072
2073N
2074 Specifies the number of display lists to be executed.
2075
2076TYPE
2077 Specifies the type of values in LISTS. Symbolic constants
2078 `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT',
2079 `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES',
2080 `GL_3_BYTES', and `GL_4_BYTES' are accepted.
2081
2082LISTS
2083 Specifies the address of an array of name offsets in the display
2084 list. The pointer type is void because the offsets can be bytes,
2085 shorts, ints, or floats, depending on the value of TYPE.
2086
2087`glCallLists' causes each display list in the list of names passed as
2088LISTS to be executed. As a result, the commands saved in each display
2089list are executed in order, just as if they were called without using a
2090display list. Names of display lists that have not been defined are
2091ignored.
2092
2093`glCallLists' provides an efficient means for executing more than one
2094display list. TYPE allows lists with various name formats to be
2095accepted. The formats are as follows:
2096
2097`GL_BYTE'
2098 LISTS is treated as an array of signed bytes, each in the range
2099 -128 through 127.
2100
2101`GL_UNSIGNED_BYTE'
2102 LISTS is treated as an array of unsigned bytes, each in the range 0
2103 through 255.
2104
2105`GL_SHORT'
2106 LISTS is treated as an array of signed two-byte integers, each in
2107 the range -32768 through 32767.
2108
2109`GL_UNSIGNED_SHORT'
2110 LISTS is treated as an array of unsigned two-byte integers, each in
2111 the range 0 through 65535.
2112
2113`GL_INT'
2114 LISTS is treated as an array of signed four-byte integers.
2115
2116`GL_UNSIGNED_INT'
2117 LISTS is treated as an array of unsigned four-byte integers.
2118
2119`GL_FLOAT'
2120 LISTS is treated as an array of four-byte floating-point values.
2121
2122`GL_2_BYTES'
2123 LISTS is treated as an array of unsigned bytes. Each pair of bytes
2124 specifies a single display-list name. The value of the pair is
2125 computed as 256 times the unsigned value of the first byte plus the
2126 unsigned value of the second byte.
2127
2128`GL_3_BYTES'
2129 LISTS is treated as an array of unsigned bytes. Each triplet of
2130 bytes specifies a single display-list name. The value of the
2131 triplet is computed as 65536 times the unsigned value of the first
2132 byte, plus 256 times the unsigned value of the second byte, plus
2133 the unsigned value of the third byte.
2134
2135`GL_4_BYTES'
2136 LISTS is treated as an array of unsigned bytes. Each quadruplet of
2137 bytes specifies a single display-list name. The value of the
2138 quadruplet is computed as 16777216 times the unsigned value of the
2139 first byte, plus 65536 times the unsigned value of the second byte,
2140 plus 256 times the unsigned value of the third byte, plus the
2141 unsigned value of the fourth byte.
2142
2143The list of display-list names is not null-terminated. Rather, N
2144specifies how many names are to be taken from LISTS.
2145
2146An additional level of indirection is made available with the
2147`glListBase' command, which specifies an unsigned offset that is added
2148to each display-list name specified in LISTS before that display list is
2149executed.
2150
2151`glCallLists' can appear inside a display list. To avoid the possibility
2152of infinite recursion resulting from display lists calling one another,
2153a limit is placed on the nesting level of display lists during
2154display-list execution. This limit must be at least 64, and it depends
2155on the implementation.
2156
2157GL state is not saved and restored across a call to `glCallLists'. Thus,
2158changes made to GL state during the execution of the display lists
2159remain after execution is completed. Use `glPushAttrib', `glPopAttrib',
2160`glPushMatrix', and `glPopMatrix' to preserve GL state across
2161`glCallLists' calls.
2162
2163`GL_INVALID_VALUE' is generated if N is negative.
2164
2165`GL_INVALID_ENUM' is generated if TYPE is not one of `GL_BYTE',
2166`GL_UNSIGNED_BYTE', `GL_SHORT', `GL_UNSIGNED_SHORT', `GL_INT',
2167`GL_UNSIGNED_INT', `GL_FLOAT', `GL_2_BYTES', `GL_3_BYTES', `GL_4_BYTES'.")
8925f36f 2168
25072f02 2169(define-gl-procedures
bb894c9d 2170 ((glCallList (list GLuint) -> void))
3c9b6116
AW
2171 "Execute a display list.
2172
2173LIST
2174 Specifies the integer name of the display list to be executed.
2175
2176`glCallList' causes the named display list to be executed. The commands
2177saved in the display list are executed in order, just as if they were
2178called without using a display list. If LIST has not been defined as a
2179display list, `glCallList' is ignored.
2180
2181`glCallList' can appear inside a display list. To avoid the possibility
2182of infinite recursion resulting from display lists calling one another,
2183a limit is placed on the nesting level of display lists during
2184display-list execution. This limit is at least 64, and it depends on the
2185implementation.
2186
2187GL state is not saved and restored across a call to `glCallList'. Thus,
2188changes made to GL state during the execution of a display list remain
2189after execution of the display list is completed. Use `glPushAttrib',
2190`glPopAttrib', `glPushMatrix', and `glPopMatrix' to preserve GL state
2191across `glCallList' calls.")
8925f36f 2192
25072f02 2193(define-gl-procedures
bb894c9d
AW
2194 ((glClearAccum
2195 (red GLfloat)
2196 (green GLfloat)
2197 (blue GLfloat)
2198 (alpha GLfloat)
2199 ->
2200 void))
3c9b6116
AW
2201 "Specify clear values for the accumulation buffer.
2202
2203RED
2204 GREEN
2205
2206 BLUE
2207
2208 ALPHA
2209
2210 Specify the red, green, blue, and alpha values used when the
2211 accumulation buffer is cleared. The initial values are all 0.
2212
2213`glClearAccum' specifies the red, green, blue, and alpha values used by
2214`glClear' to clear the accumulation buffer.
2215
2216Values specified by `glClearAccum' are clamped to the range [-1,1] .
2217
2218`GL_INVALID_OPERATION' is generated if `glClearAccum' is executed
2219between the execution of `glBegin' and the corresponding execution of
2220`glEnd'.")
8925f36f 2221
25072f02 2222(define-gl-procedures
bb894c9d
AW
2223 ((glClearColor
2224 (red GLclampf)
2225 (green GLclampf)
2226 (blue GLclampf)
2227 (alpha GLclampf)
2228 ->
2229 void))
3c9b6116
AW
2230 "Specify clear values for the color buffers.
2231
2232RED
2233 GREEN
2234
2235 BLUE
2236
2237 ALPHA
2238
2239 Specify the red, green, blue, and alpha values used when the color
2240 buffers are cleared. The initial values are all 0.
2241
2242`glClearColor' specifies the red, green, blue, and alpha values used by
2243`glClear' to clear the color buffers. Values specified by `glClearColor'
2244are clamped to the range [0,1] .
2245
2246`GL_INVALID_OPERATION' is generated if `glClearColor' is executed
2247between the execution of `glBegin' and the corresponding execution of
2248`glEnd'.")
8925f36f 2249
25072f02 2250(define-gl-procedures
bb894c9d 2251 ((glClearDepth (depth GLclampd) -> void))
3c9b6116
AW
2252 "Specify the clear value for the depth buffer.
2253
2254DEPTH
2255 Specifies the depth value used when the depth buffer is cleared.
2256 The initial value is 1.
2257
2258`glClearDepth' specifies the depth value used by `glClear' to clear the
2259depth buffer. Values specified by `glClearDepth' are clamped to the
2260range [0,1] .
2261
2262`GL_INVALID_OPERATION' is generated if `glClearDepth' is executed
2263between the execution of `glBegin' and the corresponding execution of
2264`glEnd'.")
8925f36f 2265
25072f02 2266(define-gl-procedures
bb894c9d 2267 ((glClearIndex (c GLfloat) -> void))
3c9b6116
AW
2268 "Specify the clear value for the color index buffers.
2269
2270C
2271 Specifies the index used when the color index buffers are cleared.
2272 The initial value is 0.
2273
2274`glClearIndex' specifies the index used by `glClear' to clear the color
2275index buffers. C is not clamped. Rather, C is converted to a fixed-point
2276value with unspecified precision to the right of the binary point. The
2277integer part of this value is then masked with 2^M-1 , where M is the
2278number of bits in a color index stored in the frame buffer.
2279
2280`GL_INVALID_OPERATION' is generated if `glClearIndex' is executed
2281between the execution of `glBegin' and the corresponding execution of
2282`glEnd'.")
8925f36f 2283
25072f02 2284(define-gl-procedures
bb894c9d 2285 ((glClearStencil (s GLint) -> void))
3c9b6116
AW
2286 "Specify the clear value for the stencil buffer.
2287
2288S
2289 Specifies the index used when the stencil buffer is cleared. The
2290 initial value is 0.
2291
2292`glClearStencil' specifies the index used by `glClear' to clear the
2293stencil buffer. S is masked with 2^M-1 , where M is the number of bits
2294in the stencil buffer.
2295
2296`GL_INVALID_OPERATION' is generated if `glClearStencil' is executed
2297between the execution of `glBegin' and the corresponding execution of
2298`glEnd'.")
8925f36f 2299
25072f02 2300(define-gl-procedures
bb894c9d 2301 ((glClear (mask GLbitfield) -> void))
3c9b6116
AW
2302 "Clear buffers to preset values.
2303
2304MASK
2305 Bitwise OR of masks that indicate the buffers to be cleared. The
2306 four masks are `GL_COLOR_BUFFER_BIT', `GL_DEPTH_BUFFER_BIT',
2307 `GL_ACCUM_BUFFER_BIT', and `GL_STENCIL_BUFFER_BIT'.
2308
2309`glClear' sets the bitplane area of the window to values previously
2310selected by `glClearColor', `glClearIndex', `glClearDepth',
2311`glClearStencil', and `glClearAccum'. Multiple color buffers can be
2312cleared simultaneously by selecting more than one buffer at a time using
2313`glDrawBuffer'.
2314
2315The pixel ownership test, the scissor test, dithering, and the buffer
2316writemasks affect the operation of `glClear'. The scissor box bounds the
2317cleared region. Alpha function, blend function, logical operation,
2318stenciling, texture mapping, and depth-buffering are ignored by
2319`glClear'.
2320
2321`glClear' takes a single argument that is the bitwise OR of several
2322values indicating which buffer is to be cleared.
2323
2324The values are as follows:
2325
2326`GL_COLOR_BUFFER_BIT'
2327 Indicates the buffers currently enabled for color writing.
2328
2329`GL_DEPTH_BUFFER_BIT'
2330 Indicates the depth buffer.
2331
2332`GL_ACCUM_BUFFER_BIT'
2333 Indicates the accumulation buffer.
2334
2335`GL_STENCIL_BUFFER_BIT'
2336 Indicates the stencil buffer.
2337
8925f36f 2338The value to which each buffer is cleared depends on the setting of the
3c9b6116
AW
2339clear value for that buffer.
2340
2341`GL_INVALID_VALUE' is generated if any bit other than the four defined
2342bits is set in MASK.
2343
2344`GL_INVALID_OPERATION' is generated if `glClear' is executed between the
2345execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2346
25072f02 2347(define-gl-procedures
bb894c9d 2348 ((glClientActiveTexture (texture GLenum) -> void))
3c9b6116
AW
2349 "Select active texture unit.
2350
2351TEXTURE
2352 Specifies which texture unit to make active. The number of texture
2353 units is implementation dependent, but must be at least two.
2354 TEXTURE must be one of `GL_TEXTURE' I , where i ranges from 0 to
2355 the value of `GL_MAX_TEXTURE_COORDS' - 1, which is an
2356 implementation-dependent value. The initial value is `GL_TEXTURE0'.
2357
2358`glClientActiveTexture' selects the vertex array client state parameters
2359to be modified by `glTexCoordPointer', and enabled or disabled with
2360`glEnableClientState' or `glDisableClientState', respectively, when
2361called with a parameter of `GL_TEXTURE_COORD_ARRAY'.
2362
2363`GL_INVALID_ENUM' is generated if TEXTURE is not one of `GL_TEXTURE'I ,
2364where i ranges from 0 to the value of `GL_MAX_TEXTURE_COORDS' - 1.")
8925f36f 2365
25072f02 2366(define-gl-procedures
00239761
AW
2367 ((glClipPlane
2368 (plane GLenum)
2369 (equation const-GLdouble-*)
2370 ->
2371 void))
3c9b6116
AW
2372 "Specify a plane against which all geometry is clipped.
2373
2374PLANE
2375 Specifies which clipping plane is being positioned. Symbolic names
2376 of the form `GL_CLIP_PLANE'I, where I is an integer between 0 and
2377 `GL_MAX_CLIP_PLANES' -1 , are accepted.
2378
2379EQUATION
2380 Specifies the address of an array of four double-precision
2381 floating-point values. These values are interpreted as a plane
2382 equation.
2383
8925f36f 2384Geometry is always clipped against the boundaries of a six-plane frustum
3c9b6116
AW
2385in X, Y, and Z. `glClipPlane' allows the specification of additional
2386planes, not necessarily perpendicular to the X, Y, or Z axis, against
2387which all geometry is clipped. To determine the maximum number of
2388additional clipping planes, call `glGetIntegerv' with argument
2389`GL_MAX_CLIP_PLANES'. All implementations support at least six such
2390clipping planes. Because the resulting clipping region is the
2391intersection of the defined half-spaces, it is always convex.
2392
2393`glClipPlane' specifies a half-space using a four-component plane
2394equation. When `glClipPlane' is called, EQUATION is transformed by the
2395inverse of the modelview matrix and stored in the resulting eye
2396coordinates. Subsequent changes to the modelview matrix have no effect
2397on the stored plane-equation components. If the dot product of the eye
2398coordinates of a vertex with the stored plane equation components is
2399positive or zero, the vertex is IN with respect to that clipping plane.
2400Otherwise, it is OUT.
2401
2402To enable and disable clipping planes, call `glEnable' and `glDisable'
2403with the argument `GL_CLIP_PLANE'I, where I is the plane number.
2404
2405All clipping planes are initially defined as (0, 0, 0, 0) in eye
2406coordinates and are disabled.
2407
2408`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
2409
2410`GL_INVALID_OPERATION' is generated if `glClipPlane' is executed between
2411the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2412
25072f02 2413(define-gl-procedures
bb894c9d
AW
2414 ((glColorMask
2415 (red GLboolean)
2416 (green GLboolean)
2417 (blue GLboolean)
2418 (alpha GLboolean)
2419 ->
2420 void))
3c9b6116
AW
2421 "Enable and disable writing of frame buffer color components.
2422
2423RED
2424 GREEN
2425
2426 BLUE
2427
2428 ALPHA
2429
2430 Specify whether red, green, blue, and alpha can or cannot be
2431 written into the frame buffer. The initial values are all
2432 `GL_TRUE', indicating that the color components can be written.
2433
2434`glColorMask' specifies whether the individual color components in the
2435frame buffer can or cannot be written. If RED is `GL_FALSE', for
2436example, no change is made to the red component of any pixel in any of
2437the color buffers, regardless of the drawing operation attempted.
2438
2439Changes to individual bits of components cannot be controlled. Rather,
2440changes are either enabled or disabled for entire color components.
2441
2442`GL_INVALID_OPERATION' is generated if `glColorMask' is executed between
2443the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 2444
25072f02 2445(define-gl-procedures
bb894c9d
AW
2446 ((glColorMaterial
2447 (face GLenum)
2448 (mode GLenum)
2449 ->
2450 void))
3c9b6116
AW
2451 "Cause a material color to track the current color.
2452
2453FACE
2454 Specifies whether front, back, or both front and back material
2455 parameters should track the current color. Accepted values are
2456 `GL_FRONT', `GL_BACK', and `GL_FRONT_AND_BACK'. The initial value
2457 is `GL_FRONT_AND_BACK'.
2458
2459MODE
2460 Specifies which of several material parameters track the current
2461 color. Accepted values are `GL_EMISSION', `GL_AMBIENT',
2462 `GL_DIFFUSE', `GL_SPECULAR', and `GL_AMBIENT_AND_DIFFUSE'. The
2463 initial value is `GL_AMBIENT_AND_DIFFUSE'.
2464
2465`glColorMaterial' specifies which material parameters track the current
2466color. When `GL_COLOR_MATERIAL' is enabled, the material parameter or
2467parameters specified by MODE, of the material or materials specified by
2468FACE, track the current color at all times.
2469
2470To enable and disable `GL_COLOR_MATERIAL', call `glEnable' and
2471`glDisable' with argument `GL_COLOR_MATERIAL'. `GL_COLOR_MATERIAL' is
2472initially disabled.
2473
2474`GL_INVALID_ENUM' is generated if FACE or MODE is not an accepted value.
2475
2476`GL_INVALID_OPERATION' is generated if `glColorMaterial' is executed
2477between the execution of `glBegin' and the corresponding execution of
2478`glEnd'.")
8925f36f 2479
25072f02 2480(define-gl-procedures
bb894c9d
AW
2481 ((glColorPointer
2482 (size GLint)
2483 (type GLenum)
2484 (stride GLsizei)
00239761 2485 (pointer const-GLvoid-*)
bb894c9d
AW
2486 ->
2487 void))
3c9b6116
AW
2488 "Define an array of colors.
2489
2490SIZE
2491 Specifies the number of components per color. Must be 3 or 4. The
2492 initial value is 4.
2493
2494TYPE
2495 Specifies the data type of each color component in the array.
2496 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
2497 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
2498 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
2499
2500STRIDE
2501 Specifies the byte offset between consecutive colors. If STRIDE is
2502 0, the colors are understood to be tightly packed in the array. The
2503 initial value is 0.
2504
2505POINTER
2506 Specifies a pointer to the first component of the first color
2507 element in the array. The initial value is 0.
2508
2509`glColorPointer' specifies the location and data format of an array of
2510color components to use when rendering. SIZE specifies the number of
2511components per color, and must be 3 or 4. TYPE specifies the data type
2512of each color component, and STRIDE specifies the byte stride from one
2513color to the next, allowing vertices and attributes to be packed into a
2514single array or stored in separate arrays. (Single-array storage may be
2515more efficient on some implementations; see `glInterleavedArrays'.)
2516
2517If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
2518target (see `glBindBuffer') while a color array is specified, POINTER is
2519treated as a byte offset into the buffer object's data store. Also, the
2520buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as color
2521vertex array client-side state (`GL_COLOR_ARRAY_BUFFER_BINDING').
2522
2523When a color array is specified, SIZE, TYPE, STRIDE, and POINTER are
2524saved as client-side state, in addition to the current vertex array
2525buffer object binding.
2526
2527To enable and disable the color array, call `glEnableClientState' and
2528`glDisableClientState' with the argument `GL_COLOR_ARRAY'. If enabled,
2529the color array is used when `glDrawArrays', `glMultiDrawArrays',
2530`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
2531`glArrayElement' is called.
2532
2533`GL_INVALID_VALUE' is generated if SIZE is not 3 or 4.
2534
2535`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
2536
2537`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 2538
25072f02 2539(define-gl-procedures
bb894c9d
AW
2540 ((glColorSubTable
2541 (target GLenum)
2542 (start GLsizei)
2543 (count GLsizei)
2544 (format GLenum)
2545 (type GLenum)
00239761 2546 (data const-GLvoid-*)
bb894c9d
AW
2547 ->
2548 void))
3c9b6116
AW
2549 "Respecify a portion of a color table.
2550
2551TARGET
2552 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2553 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2554
2555START
2556 The starting index of the portion of the color table to be
2557 replaced.
2558
2559COUNT
2560 The number of table entries to replace.
2561
2562FORMAT
2563 The format of the pixel data in DATA. The allowable values are
2564 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2565 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
2566
2567TYPE
2568 The type of the pixel data in DATA. The allowable values are
2569 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2570 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2571 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2572 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2573 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2574 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2575 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2576 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2577
2578DATA
2579 Pointer to a one-dimensional array of pixel data that is processed
2580 to replace the specified region of the color table.
2581
2582`glColorSubTable' is used to respecify a contiguous portion of a color
2583table previously defined using `glColorTable'. The pixels referenced by
2584DATA replace the portion of the existing table from indices START to
2585START+COUNT-1 , inclusive. This region may not include any entries
2586outside the range of the color table as it was originally specified. It
2587is not an error to specify a subtexture with width of 0, but such a
2588specification has no effect.
2589
2590If a non-zero named buffer object is bound to the
2591`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a portion of
2592a color table is respecified, DATA is treated as a byte offset into the
2593buffer object's data store.
2594
2595`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2596values.
2597
2598`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2599values.
2600
2601`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2602values.
2603
2604`GL_INVALID_VALUE' is generated if START+COUNT>WIDTH .
2605
2606`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2607bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2608data store is currently mapped.
2609
2610`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2611bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2612unpacked from the buffer object such that the memory reads required
2613would exceed the data store size.
2614
2615`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2616bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2617divisible into the number of bytes needed to store in memory a datum
2618indicated by TYPE.
2619
2620`GL_INVALID_OPERATION' is generated if `glColorSubTable' is executed
2621between the execution of `glBegin' and the corresponding execution of
2622`glEnd'.")
8925f36f 2623
b002944d
AW
2624(define-gl-procedures
2625 ((glColorTableParameterfv
2626 (target GLenum)
2627 (pname GLenum)
2628 (params const-GLfloat-*)
2629 ->
2630 void)
2631 (glColorTableParameteriv
2632 (target GLenum)
2633 (pname GLenum)
2634 (params const-GLint-*)
2635 ->
2636 void))
2637 "Set color lookup table parameters.
2638
2639TARGET
2640 The target color table. Must be `GL_COLOR_TABLE',
2641 `GL_POST_CONVOLUTION_COLOR_TABLE', or
2642 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2643
2644PNAME
2645 The symbolic name of a texture color lookup table parameter. Must
2646 be one of `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS'.
2647
2648PARAMS
2649 A pointer to an array where the values of the parameters are
2650 stored.
2651
2652`glColorTableParameter' is used to specify the scale factors and bias
2653terms applied to color components when they are loaded into a color
2654table. TARGET indicates which color table the scale and bias terms apply
2655to; it must be set to `GL_COLOR_TABLE',
2656`GL_POST_CONVOLUTION_COLOR_TABLE', or
2657`GL_POST_COLOR_MATRIX_COLOR_TABLE'.
2658
2659PNAME must be `GL_COLOR_TABLE_SCALE' to set the scale factors. In this
2660case, PARAMS points to an array of four values, which are the scale
2661factors for red, green, blue, and alpha, in that order.
2662
2663PNAME must be `GL_COLOR_TABLE_BIAS' to set the bias terms. In this case,
2664PARAMS points to an array of four values, which are the bias terms for
2665red, green, blue, and alpha, in that order.
2666
2667The color tables themselves are specified by calling `glColorTable'.
2668
2669`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
2670value.
2671
2672`GL_INVALID_OPERATION' is generated if `glColorTableParameter' is
2673executed between the execution of `glBegin' and the corresponding
2674execution of `glEnd'.")
2675
25072f02 2676(define-gl-procedures
bb894c9d
AW
2677 ((glColorTable
2678 (target GLenum)
2679 (internalformat GLenum)
2680 (width GLsizei)
2681 (format GLenum)
2682 (type GLenum)
00239761 2683 (data const-GLvoid-*)
bb894c9d
AW
2684 ->
2685 void))
3c9b6116 2686 "Define a color lookup table.
8925f36f 2687
3c9b6116
AW
2688TARGET
2689 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
2690 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
2691 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
2692 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8925f36f 2693
3c9b6116
AW
2694INTERNALFORMAT
2695 The internal format of the color table. The allowable values are
2696 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
2697 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
2698 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
2699 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
2700 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
2701 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
2702 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
2703 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
2704 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
2705 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', and `GL_RGBA16'.
8925f36f 2706
3c9b6116
AW
2707WIDTH
2708 The number of entries in the color lookup table specified by DATA.
8925f36f 2709
3c9b6116
AW
2710FORMAT
2711 The format of the pixel data in DATA. The allowable values are
2712 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
2713 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8925f36f 2714
3c9b6116
AW
2715TYPE
2716 The type of the pixel data in DATA. The allowable values are
2717 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
2718 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
2719 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
2720 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
2721 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
2722 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
2723 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
2724 `GL_UNSIGNED_INT_2_10_10_10_REV'.
2725
2726DATA
2727 Pointer to a one-dimensional array of pixel data that is processed
2728 to build the color table.
2729
2730`glColorTable' may be used in two ways: to test the actual size and
2731color resolution of a lookup table given a particular set of parameters,
2732or to load the contents of a color lookup table. Use the targets
2733`GL_PROXY_*' for the first case and the other targets for the second
2734case.
2735
2736If a non-zero named buffer object is bound to the
2737`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a color table
2738is specified, DATA is treated as a byte offset into the buffer object's
2739data store.
2740
2741If TARGET is `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
2742`GL_POST_COLOR_MATRIX_COLOR_TABLE', `glColorTable' builds a color lookup
2743table from an array of pixels. The pixel array specified by WIDTH,
2744FORMAT, TYPE, and DATA is extracted from memory and processed just as if
2745`glDrawPixels' were called, but processing stops after the final
2746expansion to RGBA is completed.
2747
2748The four scale parameters and the four bias parameters that are defined
2749for the table are then used to scale and bias the R, G, B, and A
2750components of each pixel. (Use `glColorTableParameter' to set these
2751scale and bias parameters.)
2752
2753Next, the R, G, B, and A values are clamped to the range [0,1] . Each
2754pixel is then converted to the internal format specified by
2755INTERNALFORMAT. This conversion simply maps the component values of the
2756pixel (R, G, B, and A) to the values included in the internal format
2757(red, green, blue, alpha, luminance, and intensity). The mapping is as
2758follows:
2759
2760
2761
2762*Internal Format*
2763 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
2764
2765`GL_ALPHA'
2766 , , , A , ,
2767
2768`GL_LUMINANCE'
2769 , , , , R ,
2770
2771`GL_LUMINANCE_ALPHA'
2772 , , , A , R ,
2773
2774`GL_INTENSITY'
2775 , , , , , R
2776
2777`GL_RGB'
2778 R , G , B , , ,
2779
2780`GL_RGBA'
2781 R , G , B , A , ,
2782
2783Finally, the red, green, blue, alpha, luminance, and/or intensity
2784components of the resulting pixels are stored in the color table. They
2785form a one-dimensional table with indices in the range [0,WIDTH-1] .
2786
2787If TARGET is `GL_PROXY_*', `glColorTable' recomputes and stores the
2788values of the proxy color table's state variables
2789`GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
2790`GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
2791`GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
2792`GL_COLOR_TABLE_LUMINANCE_SIZE', and `GL_COLOR_TABLE_INTENSITY_SIZE'.
2793There is no effect on the image or state of any actual color table. If
2794the specified color table is too large to be supported, then all the
2795proxy state variables listed above are set to zero. Otherwise, the color
2796table could be supported by `glColorTable' using the corresponding
2797non-proxy target, and the proxy state variables are set as if that
2798target were being defined.
2799
2800The proxy state variables can be retrieved by calling
2801`glGetColorTableParameter' with a target of `GL_PROXY_*'. This allows
2802the application to decide if a particular `glColorTable' command would
2803succeed, and to determine what the resulting color table attributes
2804would be.
2805
2806If a color table is enabled, and its width is non-zero, then its
2807contents are used to replace a subset of the components of each RGBA
2808pixel group, based on the internal format of the table.
2809
2810Each pixel group has color components (R, G, B, A) that are in the range
2811[0.0,1.0] . The color components are rescaled to the size of the color
2812lookup table to form an index. Then a subset of the components based on
2813the internal format of the table are replaced by the table entry
2814selected by that index. If the color components and contents of the
2815table are represented as follows:
2816
2817
2818
2819*Representation*
2820 *Meaning*
2821
2822`r'
2823 Table index computed from `R'
2824
2825`g'
2826 Table index computed from `G'
2827
2828`b'
2829 Table index computed from `B'
2830
2831`a'
2832 Table index computed from `A'
2833
2834`L[i]'
2835 Luminance value at table index `i'
2836
2837`I[i]'
2838 Intensity value at table index `i'
2839
2840`R[i]'
2841 Red value at table index `i'
2842
2843`G[i]'
2844 Green value at table index `i'
2845
2846`B[i]'
2847 Blue value at table index `i'
2848
2849`A[i]'
2850 Alpha value at table index `i'
2851
2852then the result of color table lookup is as follows:
2853
2854
2855
2856**
2857 *Resulting Texture Components*
2858
2859*Table Internal Format*
2860 *R*, *G*, *B*, *A*
2861
2862`GL_ALPHA'
2863 `R', `G', `B', `A[a]'
2864
2865`GL_LUMINANCE'
2866 `L[r]', `L[g]', `L[b]', `At'
2867
2868`GL_LUMINANCE_ALPHA'
2869 `L[r]', `L[g]', `L[b]', `A[a]'
2870
2871`GL_INTENSITY'
2872 `I[r]', `I[g]', `I[b]', `I[a]'
2873
2874`GL_RGB'
2875 `R[r]', `G[g]', `B[b]', `A'
2876
2877`GL_RGBA'
2878 `R[r]', `G[g]', `B[b]', `A[a]'
2879
2880When `GL_COLOR_TABLE' is enabled, the colors resulting from the pixel
2881map operation (if it is enabled) are mapped by the color lookup table
2882before being passed to the convolution operation. The colors resulting
2883from the convolution operation are modified by the post convolution
2884color lookup table when `GL_POST_CONVOLUTION_COLOR_TABLE' is enabled.
2885These modified colors are then sent to the color matrix operation.
2886Finally, if `GL_POST_COLOR_MATRIX_COLOR_TABLE' is enabled, the colors
2887resulting from the color matrix operation are mapped by the post color
2888matrix color lookup table before being used by the histogram operation.
2889
2890
2891
2892`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
2893values.
2894
2895`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
2896allowable values.
2897
2898`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
2899values.
2900
2901`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
2902values.
2903
2904`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
2905
2906`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
2907large to be supported by the implementation, and TARGET is not a
2908`GL_PROXY_*' target.
2909
2910`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2911bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
2912data store is currently mapped.
2913
2914`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2915bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
2916unpacked from the buffer object such that the memory reads required
2917would exceed the data store size.
2918
2919`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
2920bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
2921divisible into the number of bytes needed to store in memory a datum
2922indicated by TYPE.
2923
2924`GL_INVALID_OPERATION' is generated if `glColorTable' is executed
2925between the execution of `glBegin' and the corresponding execution of
2926`glEnd'.")
2927
25072f02 2928(define-gl-procedures
78aa45b9
DH
2929 ((glColor3b
2930 (red GLbyte)
2931 (green GLbyte)
2932 (blue GLbyte)
2933 ->
2934 void)
2935 (glColor3s
2936 (red GLshort)
2937 (green GLshort)
2938 (blue GLshort)
2939 ->
2940 void)
2941 (glColor3i
bb894c9d
AW
2942 (red GLint)
2943 (green GLint)
2944 (blue GLint)
2945 ->
2946 void)
ca09631c
AW
2947 (glColor3f
2948 (red GLfloat)
2949 (green GLfloat)
2950 (blue GLfloat)
bb894c9d
AW
2951 ->
2952 void)
78aa45b9
DH
2953 (glColor3d
2954 (red GLdouble)
2955 (green GLdouble)
2956 (blue GLdouble)
2957 ->
2958 void)
2959 (glColor3ub
2960 (red GLubyte)
2961 (green GLubyte)
2962 (blue GLubyte)
2963 ->
2964 void)
2965 (glColor3us
2966 (red GLushort)
2967 (green GLushort)
2968 (blue GLushort)
2969 ->
2970 void)
bb894c9d
AW
2971 (glColor3ui
2972 (red GLuint)
2973 (green GLuint)
2974 (blue GLuint)
2975 ->
2976 void)
78aa45b9
DH
2977 (glColor4b
2978 (red GLbyte)
2979 (green GLbyte)
2980 (blue GLbyte)
2981 (alpha GLbyte)
2982 ->
2983 void)
2984 (glColor4s
2985 (red GLshort)
2986 (green GLshort)
2987 (blue GLshort)
2988 (alpha GLshort)
2989 ->
2990 void)
bb894c9d
AW
2991 (glColor4i
2992 (red GLint)
2993 (green GLint)
2994 (blue GLint)
2995 (alpha GLint)
2996 ->
2997 void)
ca09631c
AW
2998 (glColor4f
2999 (red GLfloat)
3000 (green GLfloat)
3001 (blue GLfloat)
3002 (alpha GLfloat)
bb894c9d
AW
3003 ->
3004 void)
78aa45b9
DH
3005 (glColor4d
3006 (red GLdouble)
3007 (green GLdouble)
3008 (blue GLdouble)
3009 (alpha GLdouble)
3010 ->
3011 void)
3012 (glColor4ub
3013 (red GLubyte)
3014 (green GLubyte)
3015 (blue GLubyte)
3016 (alpha GLubyte)
3017 ->
3018 void)
3019 (glColor4us
3020 (red GLushort)
3021 (green GLushort)
3022 (blue GLushort)
3023 (alpha GLushort)
3024 ->
3025 void)
bb894c9d
AW
3026 (glColor4ui
3027 (red GLuint)
3028 (green GLuint)
3029 (blue GLuint)
3030 (alpha GLuint)
3031 ->
78aa45b9
DH
3032 void)
3033 (glColor3bv (v const-GLbyte-*) -> void)
3034 (glColor3sv (v const-GLshort-*) -> void)
3035 (glColor3iv (v const-GLint-*) -> void)
3036 (glColor3fv (v const-GLfloat-*) -> void)
3037 (glColor3dv (v const-GLdouble-*) -> void)
3038 (glColor3ubv (v const-GLubyte-*) -> void)
3039 (glColor3usv (v const-GLushort-*) -> void)
3040 (glColor3uiv (v const-GLuint-*) -> void)
3041 (glColor4bv (v const-GLbyte-*) -> void)
3042 (glColor4sv (v const-GLshort-*) -> void)
3043 (glColor4iv (v const-GLint-*) -> void)
3044 (glColor4fv (v const-GLfloat-*) -> void)
3045 (glColor4dv (v const-GLdouble-*) -> void)
3046 (glColor4ubv (v const-GLubyte-*) -> void)
3047 (glColor4usv (v const-GLushort-*) -> void)
3048 (glColor4uiv (v const-GLuint-*) -> void))
3c9b6116
AW
3049 "Set the current color.
3050
3051RED
3052 GREEN
3053
3054 BLUE
3055
3056 Specify new red, green, and blue values for the current color.
3057
3058ALPHA
3059 Specifies a new alpha value for the current color. Included only in
3060 the four-argument `glColor4' commands.
3061
3062The GL stores both a current single-valued color index and a current
3063four-valued RGBA color. `glColor' sets a new four-valued RGBA color.
3064`glColor' has two major variants: `glColor3' and `glColor4'. `glColor3'
3065variants specify new red, green, and blue values explicitly and set the
3066current alpha value to 1.0 (full intensity) implicitly. `glColor4'
3067variants specify all four color components explicitly.
3068
3069`glColor3b', `glColor4b', `glColor3s', `glColor4s', `glColor3i', and
3070`glColor4i' take three or four signed byte, short, or long integers as
3071arguments. When *v* is appended to the name, the color commands can take
3072a pointer to an array of such values.
3073
3074Current color values are stored in floating-point format, with
3075unspecified mantissa and exponent sizes. Unsigned integer color
3076components, when specified, are linearly mapped to floating-point values
3077such that the largest representable value maps to 1.0 (full intensity),
3078and 0 maps to 0.0 (zero intensity). Signed integer color components,
3079when specified, are linearly mapped to floating-point values such that
3080the most positive representable value maps to 1.0, and the most negative
3081representable value maps to -1.0 . (Note that this mapping does not
3082convert 0 precisely to 0.0.) Floating-point values are mapped directly.
3083
3084Neither floating-point nor signed integer values are clamped to the
3085range [0,1] before the current color is updated. However, color
3086components are clamped to this range before they are interpolated or
3087written into a color buffer.")
3088
25072f02 3089(define-gl-procedures
bb894c9d 3090 ((glCompileShader (shader GLuint) -> void))
3c9b6116
AW
3091 "Compiles a shader object.
3092
3093SHADER
3094 Specifies the shader object to be compiled.
3095
3096`glCompileShader' compiles the source code strings that have been stored
3097in the shader object specified by SHADER.
3098
3099The compilation status will be stored as part of the shader object's
3100state. This value will be set to `GL_TRUE' if the shader was compiled
3101without errors and is ready for use, and `GL_FALSE' otherwise. It can be
3102queried by calling `glGetShader' with arguments SHADER and
3103`GL_COMPILE_STATUS'.
3104
3105Compilation of a shader can fail for a number of reasons as specified by
3106the OpenGL Shading Language Specification. Whether or not the
3107compilation was successful, information about the compilation can be
3108obtained from the shader object's information log by calling
3109`glGetShaderInfoLog'.
3110
3111`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
3112OpenGL.
3113
3114`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
3115
3116`GL_INVALID_OPERATION' is generated if `glCompileShader' is executed
3117between the execution of `glBegin' and the corresponding execution of
3118`glEnd'.")
3119
25072f02 3120(define-gl-procedures
bb894c9d
AW
3121 ((glCompressedTexImage1D
3122 (target GLenum)
3123 (level GLint)
3124 (internalformat GLenum)
3125 (width GLsizei)
3126 (border GLint)
3127 (imageSize GLsizei)
00239761 3128 (data const-GLvoid-*)
bb894c9d
AW
3129 ->
3130 void))
3c9b6116
AW
3131 "Specify a one-dimensional texture image in a compressed format.
3132
3133TARGET
3134 Specifies the target texture. Must be `GL_TEXTURE_1D' or
3135 `GL_PROXY_TEXTURE_1D'.
3136
3137LEVEL
3138 Specifies the level-of-detail number. Level 0 is the base image
3139 level. Level N is the Nth mipmap reduction image.
3140
3141INTERNALFORMAT
3142 Specifies the format of the compressed image data stored at address
3143 DATA.
3144
3145WIDTH
3146 Specifies the width of the texture image including the border if
3147 any. If the GL version does not support non-power-of-two sizes,
3148 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3149 implementations support texture images that are at least 64 texels
3150 wide. The height of the 1D texture image is 1.
3151
3152BORDER
3153 Specifies the width of the border. Must be either 0 or 1.
3154
3155IMAGESIZE
3156 Specifies the number of unsigned bytes of image data starting at
3157 the address specified by DATA.
3158
3159DATA
3160 Specifies a pointer to the compressed image data in memory.
3161
3162Texturing maps a portion of a specified texture image onto each
3163graphical primitive for which texturing is enabled. To enable and
3164disable one-dimensional texturing, call `glEnable' and `glDisable' with
3165argument `GL_TEXTURE_1D'.
3166
3167`glCompressedTexImage1D' loads a previously defined, and retrieved,
3168compressed one-dimensional texture image if TARGET is `GL_TEXTURE_1D'
3169(see `glTexImage1D').
3170
3171If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
3172of the texture image state is recalculated, checked for consistency, and
3173checked against the implementation's capabilities. If the implementation
3174cannot handle a texture of the requested texture size, it sets all of
3175the image state to 0, but does not generate an error (see `glGetError').
3176To query for an entire mipmap array, use an image array level greater
3177than or equal to 1.
3178
3179INTERNALFORMAT must be extension-specified compressed-texture format.
3180When a texture is loaded with `glTexImage1D' using a generic compressed
3181texture format (e.g., `GL_COMPRESSED_RGB') the GL selects from one of
3182its extensions supporting compressed textures. In order to load the
3183compressed texture image using `glCompressedTexImage1D', query the
3184compressed texture image's size and format using
3185`glGetTexLevelParameter'.
3186
3187If a non-zero named buffer object is bound to the
3188`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3189image is specified, DATA is treated as a byte offset into the buffer
3190object's data store.
3191
3192`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3193compressed internal formats: `GL_COMPRESSED_ALPHA',
3194`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3195`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3196
3197`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3198format, dimensions, and contents of the specified compressed image data.
3199
3200`GL_INVALID_OPERATION' is generated if parameter combinations are not
3201supported by the specific compressed internal format as specified in the
3202specific texture compression extension.
3203
3204`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3205bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3206data store is currently mapped.
3207
3208`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3209bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3210unpacked from the buffer object such that the memory reads required
3211would exceed the data store size.
3212
3213`GL_INVALID_OPERATION' is generated if `glCompressedTexImage1D' is
3214executed between the execution of `glBegin' and the corresponding
3215execution of `glEnd'.
3216
3217Undefined results, including abnormal program termination, are generated
3218if DATA is not encoded in a manner consistent with the extension
3219specification defining the internal compression format.")
3220
25072f02 3221(define-gl-procedures
bb894c9d
AW
3222 ((glCompressedTexImage2D
3223 (target GLenum)
3224 (level GLint)
3225 (internalformat GLenum)
3226 (width GLsizei)
3227 (height GLsizei)
3228 (border GLint)
3229 (imageSize GLsizei)
00239761 3230 (data const-GLvoid-*)
bb894c9d
AW
3231 ->
3232 void))
3c9b6116
AW
3233 "Specify a two-dimensional texture image in a compressed format.
3234
3235TARGET
3236 Specifies the target texture. Must be `GL_TEXTURE_2D',
3237 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
3238 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
3239 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
3240 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
3241
3242LEVEL
3243 Specifies the level-of-detail number. Level 0 is the base image
3244 level. Level N is the Nth mipmap reduction image.
3245
3246INTERNALFORMAT
3247 Specifies the format of the compressed image data stored at address
3248 DATA.
3249
3250WIDTH
3251 Specifies the width of the texture image including the border if
3252 any. If the GL version does not support non-power-of-two sizes,
3253 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3254 implementations support 2D texture images that are at least 64
3255 texels wide and cube-mapped texture images that are at least 16
3256 texels wide.
3257
3258HEIGHT
3259 Specifies the height of the texture image including the border if
3260 any. If the GL version does not support non-power-of-two sizes,
3261 this value must be Must be 2^N+2\u2061(BORDER,) for some integer N . All
3262 implementations support 2D texture images that are at least 64
3263 texels high and cube-mapped texture images that are at least 16
3264 texels high.
3265
3266BORDER
3267 Specifies the width of the border. Must be either 0 or 1.
3268
3269IMAGESIZE
3270 Specifies the number of unsigned bytes of image data starting at
3271 the address specified by DATA.
3272
3273DATA
3274 Specifies a pointer to the compressed image data in memory.
3275
3276Texturing maps a portion of a specified texture image onto each
3277graphical primitive for which texturing is enabled. To enable and
3278disable two-dimensional texturing, call `glEnable' and `glDisable' with
3279argument `GL_TEXTURE_2D'. To enable and disable texturing using
3280cube-mapped textures, call `glEnable' and `glDisable' with argument
3281`GL_TEXTURE_CUBE_MAP'.
3282
3283`glCompressedTexImage2D' loads a previously defined, and retrieved,
3284compressed two-dimensional texture image if TARGET is `GL_TEXTURE_2D'
3285(see `glTexImage2D').
3286
3287If TARGET is `GL_PROXY_TEXTURE_2D', no data is read from DATA, but all
3288of the texture image state is recalculated, checked for consistency, and
3289checked against the implementation's capabilities. If the implementation
3290cannot handle a texture of the requested texture size, it sets all of
3291the image state to 0, but does not generate an error (see `glGetError').
3292To query for an entire mipmap array, use an image array level greater
3293than or equal to 1.
3294
3295INTERNALFORMAT must be an extension-specified compressed-texture format.
3296When a texture is loaded with `glTexImage2D' using a generic compressed
3297texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
3298its extensions supporting compressed textures. In order to load the
3299compressed texture image using `glCompressedTexImage2D', query the
3300compressed texture image's size and format using
3301`glGetTexLevelParameter'.
3302
3303If a non-zero named buffer object is bound to the
3304`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3305image is specified, DATA is treated as a byte offset into the buffer
3306object's data store.
3307
3308`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3309compressed internal formats: `GL_COMPRESSED_ALPHA',
3310`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3311`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3312
3313`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3314format, dimensions, and contents of the specified compressed image data.
3315
3316`GL_INVALID_OPERATION' is generated if parameter combinations are not
3317supported by the specific compressed internal format as specified in the
3318specific texture compression extension.
3319
3320`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3321bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3322data store is currently mapped.
3323
3324`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3325bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3326unpacked from the buffer object such that the memory reads required
3327would exceed the data store size.
3328
3329`GL_INVALID_OPERATION' is generated if `glCompressedTexImage2D' is
3330executed between the execution of `glBegin' and the corresponding
3331execution of `glEnd'.
3332
3333Undefined results, including abnormal program termination, are generated
3334if DATA is not encoded in a manner consistent with the extension
3335specification defining the internal compression format.")
3336
25072f02 3337(define-gl-procedures
bb894c9d
AW
3338 ((glCompressedTexImage3D
3339 (target GLenum)
3340 (level GLint)
3341 (internalformat GLenum)
3342 (width GLsizei)
3343 (height GLsizei)
3344 (depth GLsizei)
3345 (border GLint)
3346 (imageSize GLsizei)
00239761 3347 (data const-GLvoid-*)
bb894c9d
AW
3348 ->
3349 void))
3c9b6116
AW
3350 "Specify a three-dimensional texture image in a compressed format.
3351
3352TARGET
3353 Specifies the target texture. Must be `GL_TEXTURE_3D' or
3354 `GL_PROXY_TEXTURE_3D'.
3355
3356LEVEL
3357 Specifies the level-of-detail number. Level 0 is the base image
3358 level. Level N is the Nth mipmap reduction image.
3359
3360INTERNALFORMAT
3361 Specifies the format of the compressed image data stored at address
3362 DATA.
3363
3364WIDTH
3365 Specifies the width of the texture image including the border if
3366 any. If the GL version does not support non-power-of-two sizes,
3367 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3368 implementations support 3D texture images that are at least 16
3369 texels wide.
3370
3371HEIGHT
3372 Specifies the height of the texture image including the border if
3373 any. If the GL version does not support non-power-of-two sizes,
3374 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3375 implementations support 3D texture images that are at least 16
3376 texels high.
3377
3378DEPTH
3379 Specifies the depth of the texture image including the border if
3380 any. If the GL version does not support non-power-of-two sizes,
3381 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
3382 implementations support 3D texture images that are at least 16
3383 texels deep.
3384
3385BORDER
3386 Specifies the width of the border. Must be either 0 or 1.
3387
3388IMAGESIZE
3389 Specifies the number of unsigned bytes of image data starting at
3390 the address specified by DATA.
3391
3392DATA
3393 Specifies a pointer to the compressed image data in memory.
3394
3395Texturing maps a portion of a specified texture image onto each
3396graphical primitive for which texturing is enabled. To enable and
3397disable three-dimensional texturing, call `glEnable' and `glDisable'
3398with argument `GL_TEXTURE_3D'.
3399
3400`glCompressedTexImage3D' loads a previously defined, and retrieved,
3401compressed three-dimensional texture image if TARGET is `GL_TEXTURE_3D'
3402(see `glTexImage3D').
3403
3404If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
3405of the texture image state is recalculated, checked for consistency, and
3406checked against the implementation's capabilities. If the implementation
3407cannot handle a texture of the requested texture size, it sets all of
3408the image state to 0, but does not generate an error (see `glGetError').
3409To query for an entire mipmap array, use an image array level greater
3410than or equal to 1.
3411
3412INTERNALFORMAT must be an extension-specified compressed-texture format.
3413When a texture is loaded with `glTexImage2D' using a generic compressed
3414texture format (e.g., `GL_COMPRESSED_RGB'), the GL selects from one of
3415its extensions supporting compressed textures. In order to load the
3416compressed texture image using `glCompressedTexImage3D', query the
3417compressed texture image's size and format using
3418`glGetTexLevelParameter'.
3419
3420If a non-zero named buffer object is bound to the
3421`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3422image is specified, DATA is treated as a byte offset into the buffer
3423object's data store.
3424
3425`GL_INVALID_ENUM' is generated if INTERNALFORMAT is one of the generic
3426compressed internal formats: `GL_COMPRESSED_ALPHA',
3427`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3428`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA'.
3429
3430`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3431format, dimensions, and contents of the specified compressed image data.
3432
3433`GL_INVALID_OPERATION' is generated if parameter combinations are not
3434supported by the specific compressed internal format as specified in the
3435specific texture compression extension.
3436
3437`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3438bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3439data store is currently mapped.
3440
3441`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3442bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3443unpacked from the buffer object such that the memory reads required
3444would exceed the data store size.
3445
3446`GL_INVALID_OPERATION' is generated if `glCompressedTexImage3D' is
3447executed between the execution of `glBegin' and the corresponding
3448execution of `glEnd'.
3449
3450Undefined results, including abnormal program termination, are generated
3451if DATA is not encoded in a manner consistent with the extension
3452specification defining the internal compression format.")
8925f36f 3453
25072f02 3454(define-gl-procedures
bb894c9d
AW
3455 ((glCompressedTexSubImage1D
3456 (target GLenum)
3457 (level GLint)
3458 (xoffset GLint)
3459 (width GLsizei)
3460 (format GLenum)
3461 (imageSize GLsizei)
00239761 3462 (data const-GLvoid-*)
bb894c9d
AW
3463 ->
3464 void))
3c9b6116
AW
3465 "Specify a one-dimensional texture subimage in a compressed format.
3466
3467TARGET
3468 Specifies the target texture. Must be `GL_TEXTURE_1D'.
3469
3470LEVEL
3471 Specifies the level-of-detail number. Level 0 is the base image
3472 level. Level N is the Nth mipmap reduction image.
3473
3474XOFFSET
3475 Specifies a texel offset in the x direction within the texture
3476 array.
3477
3478WIDTH
3479 Specifies the width of the texture subimage.
3480
3481FORMAT
3482 Specifies the format of the compressed image data stored at address
3483 DATA.
3484
3485IMAGESIZE
3486 Specifies the number of unsigned bytes of image data starting at
3487 the address specified by DATA.
3488
3489DATA
3490 Specifies a pointer to the compressed image data in memory.
3491
3492Texturing maps a portion of a specified texture image onto each
3493graphical primitive for which texturing is enabled. To enable and
3494disable one-dimensional texturing, call `glEnable' and `glDisable' with
3495argument `GL_TEXTURE_1D'.
3496
3497`glCompressedTexSubImage1D' redefines a contiguous subregion of an
3498existing one-dimensional texture image. The texels referenced by DATA
3499replace the portion of the existing texture array with x indices XOFFSET
3500and XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
3501outside the range of the texture array as it was originally specified.
3502It is not an error to specify a subtexture with width of 0, but such a
3503specification has no effect.
3504
3505FORMAT must be an extension-specified compressed-texture format. The
3506FORMAT of the compressed texture image is selected by the GL
3507implementation that compressed it (see `glTexImage1D'), and should be
3508queried at the time the texture was compressed with
3509`glGetTexLevelParameter'.
3510
3511If a non-zero named buffer object is bound to the
3512`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3513image is specified, DATA is treated as a byte offset into the buffer
3514object's data store.
3515
3516`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3517compressed internal formats: `GL_COMPRESSED_ALPHA',
3518`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3519`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3520`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3521`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3522`GL_COMPRESSED_SRGB_ALPHA'.
3523
3524`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3525format, dimensions, and contents of the specified compressed image data.
3526
3527`GL_INVALID_OPERATION' is generated if parameter combinations are not
3528supported by the specific compressed internal format as specified in the
3529specific texture compression extension.
3530
3531`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3532bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3533data store is currently mapped.
3534
3535`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3536bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3537unpacked from the buffer object such that the memory reads required
3538would exceed the data store size.
3539
3540`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage1D' is
3541executed between the execution of `glBegin' and the corresponding
3542execution of `glEnd'.
3543
3544Undefined results, including abnormal program termination, are generated
3545if DATA is not encoded in a manner consistent with the extension
3546specification defining the internal compression format.")
8925f36f 3547
25072f02 3548(define-gl-procedures
bb894c9d
AW
3549 ((glCompressedTexSubImage2D
3550 (target GLenum)
3551 (level GLint)
3552 (xoffset GLint)
3553 (yoffset GLint)
3554 (width GLsizei)
3555 (height GLsizei)
3556 (format GLenum)
3557 (imageSize GLsizei)
00239761 3558 (data const-GLvoid-*)
bb894c9d
AW
3559 ->
3560 void))
3c9b6116
AW
3561 "Specify a two-dimensional texture subimage in a compressed format.
3562
3563TARGET
3564 Specifies the target texture. Must be `GL_TEXTURE_2D',
3565 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
3566 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
3567 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
3568 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
3569
3570LEVEL
3571 Specifies the level-of-detail number. Level 0 is the base image
3572 level. Level N is the Nth mipmap reduction image.
3573
3574XOFFSET
3575 Specifies a texel offset in the x direction within the texture
3576 array.
3577
3578YOFFSET
3579 Specifies a texel offset in the y direction within the texture
3580 array.
3581
3582WIDTH
3583 Specifies the width of the texture subimage.
3584
3585HEIGHT
3586 Specifies the height of the texture subimage.
3587
3588FORMAT
3589 Specifies the format of the compressed image data stored at address
3590 DATA.
3591
3592IMAGESIZE
3593 Specifies the number of unsigned bytes of image data starting at
3594 the address specified by DATA.
3595
3596DATA
3597 Specifies a pointer to the compressed image data in memory.
3598
3599Texturing maps a portion of a specified texture image onto each
3600graphical primitive for which texturing is enabled. To enable and
3601disable two-dimensional texturing, call `glEnable' and `glDisable' with
3602argument `GL_TEXTURE_2D'. To enable and disable texturing using
3603cube-mapped texture, call `glEnable' and `glDisable' with argument
3604`GL_TEXTURE_CUBE_MAP'.
3605
3606`glCompressedTexSubImage2D' redefines a contiguous subregion of an
3607existing two-dimensional texture image. The texels referenced by DATA
3608replace the portion of the existing texture array with x indices XOFFSET
3609and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3610inclusive. This region may not include any texels outside the range of
3611the texture array as it was originally specified. It is not an error to
3612specify a subtexture with width of 0, but such a specification has no
3613effect.
3614
3615FORMAT must be an extension-specified compressed-texture format. The
3616FORMAT of the compressed texture image is selected by the GL
3617implementation that compressed it (see `glTexImage2D') and should be
3618queried at the time the texture was compressed with
3619`glGetTexLevelParameter'.
3620
3621If a non-zero named buffer object is bound to the
3622`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3623image is specified, DATA is treated as a byte offset into the buffer
3624object's data store.
3625
3626`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3627compressed internal formats: `GL_COMPRESSED_ALPHA',
3628`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3629`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3630`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3631`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3632`GL_COMPRESSED_SRGB_ALPHA'.
3633
3634`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3635format, dimensions, and contents of the specified compressed image data.
3636
3637`GL_INVALID_OPERATION' is generated if parameter combinations are not
3638supported by the specific compressed internal format as specified in the
3639specific texture compression extension.
3640
3641`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3642bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3643data store is currently mapped.
3644
3645`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3646bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3647unpacked from the buffer object such that the memory reads required
3648would exceed the data store size.
3649
3650`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage2D' is
3651executed between the execution of `glBegin' and the corresponding
3652execution of `glEnd'.
3653
3654Undefined results, including abnormal program termination, are generated
3655if DATA is not encoded in a manner consistent with the extension
3656specification defining the internal compression format.")
8925f36f 3657
25072f02 3658(define-gl-procedures
bb894c9d
AW
3659 ((glCompressedTexSubImage3D
3660 (target GLenum)
3661 (level GLint)
3662 (xoffset GLint)
3663 (yoffset GLint)
3664 (zoffset GLint)
3665 (width GLsizei)
3666 (height GLsizei)
3667 (depth GLsizei)
3668 (format GLenum)
3669 (imageSize GLsizei)
00239761 3670 (data const-GLvoid-*)
bb894c9d
AW
3671 ->
3672 void))
3c9b6116
AW
3673 "Specify a three-dimensional texture subimage in a compressed format.
3674
3675TARGET
3676 Specifies the target texture. Must be `GL_TEXTURE_3D'.
3677
3678LEVEL
3679 Specifies the level-of-detail number. Level 0 is the base image
3680 level. Level N is the Nth mipmap reduction image.
3681
3682XOFFSET
3683 Specifies a texel offset in the x direction within the texture
3684 array.
3685
3686YOFFSET
3687 Specifies a texel offset in the y direction within the texture
3688 array.
3689
3690WIDTH
3691 Specifies the width of the texture subimage.
3692
3693HEIGHT
3694 Specifies the height of the texture subimage.
3695
3696DEPTH
3697 Specifies the depth of the texture subimage.
3698
3699FORMAT
3700 Specifies the format of the compressed image data stored at address
3701 DATA.
3702
3703IMAGESIZE
3704 Specifies the number of unsigned bytes of image data starting at
3705 the address specified by DATA.
3706
3707DATA
3708 Specifies a pointer to the compressed image data in memory.
3709
3710Texturing maps a portion of a specified texture image onto each
3711graphical primitive for which texturing is enabled. To enable and
3712disable three-dimensional texturing, call `glEnable' and `glDisable'
3713with argument `GL_TEXTURE_3D'.
3714
3715`glCompressedTexSubImage3D' redefines a contiguous subregion of an
3716existing three-dimensional texture image. The texels referenced by DATA
3717replace the portion of the existing texture array with x indices XOFFSET
3718and XOFFSET+WIDTH-1 , and the y indices YOFFSET and YOFFSET+HEIGHT-1 ,
3719and the z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This region
3720may not include any texels outside the range of the texture array as it
3721was originally specified. It is not an error to specify a subtexture
3722with width of 0, but such a specification has no effect.
3723
3724FORMAT must be an extension-specified compressed-texture format. The
3725FORMAT of the compressed texture image is selected by the GL
3726implementation that compressed it (see `glTexImage3D') and should be
3727queried at the time the texture was compressed with
3728`glGetTexLevelParameter'.
3729
3730If a non-zero named buffer object is bound to the
3731`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
3732image is specified, DATA is treated as a byte offset into the buffer
3733object's data store.
3734
3735`GL_INVALID_ENUM' is generated if FORMAT is one of these generic
3736compressed internal formats: `GL_COMPRESSED_ALPHA',
3737`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
3738`GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA',
3739`GL_COMPRESSED_SLUMINANCE', `GL_COMPRESSED_SLUMINANCE_ALPHA',
3740`GL_COMPRESSED_SRGB', `GL_COMPRESSED_SRGBA', or
3741`GL_COMPRESSED_SRGB_ALPHA'.
3742
3743`GL_INVALID_VALUE' is generated if IMAGESIZE is not consistent with the
3744format, dimensions, and contents of the specified compressed image data.
3745
3746`GL_INVALID_OPERATION' is generated if parameter combinations are not
3747supported by the specific compressed internal format as specified in the
3748specific texture compression extension.
3749
3750`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3751bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3752data store is currently mapped.
3753
3754`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3755bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3756unpacked from the buffer object such that the memory reads required
3757would exceed the data store size.
3758
3759`GL_INVALID_OPERATION' is generated if `glCompressedTexSubImage3D' is
3760executed between the execution of `glBegin' and the corresponding
3761execution of `glEnd'.
3762
3763Undefined results, including abnormal program termination, are generated
3764if DATA is not encoded in a manner consistent with the extension
3765specification defining the internal compression format.")
8925f36f 3766
25072f02 3767(define-gl-procedures
bb894c9d
AW
3768 ((glConvolutionFilter1D
3769 (target GLenum)
3770 (internalformat GLenum)
3771 (width GLsizei)
3772 (format GLenum)
3773 (type GLenum)
00239761 3774 (data const-GLvoid-*)
bb894c9d
AW
3775 ->
3776 void))
3c9b6116 3777 "Define a one-dimensional convolution filter.
8925f36f 3778
3c9b6116
AW
3779TARGET
3780 Must be `GL_CONVOLUTION_1D'.
3781
3782INTERNALFORMAT
3783 The internal format of the convolution filter kernel. The allowable
3784 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3785 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3786 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3787 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3788 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3789 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3790 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3791 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3792 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3793 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3794 `GL_RGBA12', or `GL_RGBA16'.
3795
3796WIDTH
3797 The width of the pixel array referenced by DATA.
3798
3799FORMAT
3800 The format of the pixel data in DATA. The allowable values are
3801 `GL_ALPHA', `GL_LUMINANCE', `GL_LUMINANCE_ALPHA', `GL_INTENSITY',
3802 `GL_RGB', and `GL_RGBA'.
3803
3804TYPE
3805 The type of the pixel data in DATA. Symbolic constants
3806 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3807 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3808 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3809 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3810 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3811 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3812 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3813 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3814 are accepted.
3815
3816DATA
3817 Pointer to a one-dimensional array of pixel data that is processed
3818 to build the convolution filter kernel.
3819
3820`glConvolutionFilter1D' builds a one-dimensional convolution filter
3821kernel from an array of pixels.
3822
3823The pixel array specified by WIDTH, FORMAT, TYPE, and DATA is extracted
3824from memory and processed just as if `glDrawPixels' were called, but
3825processing stops after the final expansion to RGBA is completed.
3826
3827If a non-zero named buffer object is bound to the
3828`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3829filter is specified, DATA is treated as a byte offset into the buffer
3830object's data store.
3831
3832The R, G, B, and A components of each pixel are next scaled by the four
38331D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 1D
3834`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
3835are set by `glConvolutionParameter' using the `GL_CONVOLUTION_1D' target
3836and the names `GL_CONVOLUTION_FILTER_SCALE' and
3837`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
3838four values that are applied to red, green, blue, and alpha, in that
3839order.) The R, G, B, and A values are not clamped to [0,1] at any time
3840during this process.
3841
3842Each pixel is then converted to the internal format specified by
3843INTERNALFORMAT. This conversion simply maps the component values of the
3844pixel (R, G, B, and A) to the values included in the internal format
3845(red, green, blue, alpha, luminance, and intensity). The mapping is as
3846follows:
3847
3848
3849
3850*Internal Format*
3851 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
3852
3853`GL_ALPHA'
3854 , , , A , ,
3855
3856`GL_LUMINANCE'
3857 , , , , R ,
3858
3859`GL_LUMINANCE_ALPHA'
3860 , , , A , R ,
3861
3862`GL_INTENSITY'
3863 , , , , , R
3864
3865`GL_RGB'
3866 R , G , B , , ,
3867
3868`GL_RGBA'
3869 R , G , B , A , ,
3870
3871The red, green, blue, alpha, luminance, and/or intensity components of
3872the resulting pixels are stored in floating-point rather than integer
3873format. They form a one-dimensional filter kernel image indexed with
3874coordinate I such that I starts at 0 and increases from left to right.
3875Kernel location I is derived from the Ith pixel, counting from 0.
3876
3877Note that after a convolution is performed, the resulting color
3878components are also scaled by their corresponding
3879`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
3880corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
3881the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
3882set by `glPixelTransfer'.
3883
3884`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
3885
3886`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
3887allowable values.
3888
3889`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
3890values.
3891
3892`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
3893values.
3894
3895`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
3896than the maximum supported value. This value may be queried with
3897`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
3898`GL_MAX_CONVOLUTION_WIDTH'.
3899
3900`GL_INVALID_OPERATION' is generated if FORMAT is one of
3901`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3902`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and TYPE is
3903not `GL_RGB'.
3904
3905`GL_INVALID_OPERATION' is generated if FORMAT is one of
3906`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3907`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3908`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3909`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
3910TYPE is neither `GL_RGBA' nor `GL_BGRA'.
3911
3912`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3913bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
3914data store is currently mapped.
3915
3916`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3917bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
3918unpacked from the buffer object such that the memory reads required
3919would exceed the data store size.
3920
3921`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
3922bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
3923divisible into the number of bytes needed to store in memory a datum
3924indicated by TYPE.
3925
3926`GL_INVALID_OPERATION' is generated if `glConvolutionFilter1D' is
3927executed between the execution of `glBegin' and the corresponding
3928execution of `glEnd'.")
3929
25072f02 3930(define-gl-procedures
bb894c9d
AW
3931 ((glConvolutionFilter2D
3932 (target GLenum)
3933 (internalformat GLenum)
3934 (width GLsizei)
3935 (height GLsizei)
3936 (format GLenum)
3937 (type GLenum)
00239761 3938 (data const-GLvoid-*)
bb894c9d
AW
3939 ->
3940 void))
3c9b6116
AW
3941 "Define a two-dimensional convolution filter.
3942
3943TARGET
3944 Must be `GL_CONVOLUTION_2D'.
3945
3946INTERNALFORMAT
3947 The internal format of the convolution filter kernel. The allowable
3948 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
3949 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
3950 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
3951 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
3952 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
3953 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
3954 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
3955 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
3956 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
3957 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
3958 `GL_RGBA12', or `GL_RGBA16'.
3959
3960WIDTH
3961 The width of the pixel array referenced by DATA.
3962
3963HEIGHT
3964 The height of the pixel array referenced by DATA.
3965
3966FORMAT
3967 The format of the pixel data in DATA. The allowable values are
3968 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
3969 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
3970
3971TYPE
3972 The type of the pixel data in DATA. Symbolic constants
3973 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
3974 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
3975 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
3976 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
3977 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
3978 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
3979 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
3980 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
3981 are accepted.
3982
3983DATA
3984 Pointer to a two-dimensional array of pixel data that is processed
3985 to build the convolution filter kernel.
3986
3987`glConvolutionFilter2D' builds a two-dimensional convolution filter
3988kernel from an array of pixels.
3989
3990The pixel array specified by WIDTH, HEIGHT, FORMAT, TYPE, and DATA is
3991extracted from memory and processed just as if `glDrawPixels' were
3992called, but processing stops after the final expansion to RGBA is
3993completed.
3994
3995If a non-zero named buffer object is bound to the
3996`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
3997filter is specified, DATA is treated as a byte offset into the buffer
3998object's data store.
3999
8925f36f 4000The R, G, B, and A components of each pixel are next scaled by the four
3c9b6116
AW
40012D `GL_CONVOLUTION_FILTER_SCALE' parameters and biased by the four 2D
4002`GL_CONVOLUTION_FILTER_BIAS' parameters. (The scale and bias parameters
4003are set by `glConvolutionParameter' using the `GL_CONVOLUTION_2D' target
4004and the names `GL_CONVOLUTION_FILTER_SCALE' and
4005`GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors of
4006four values that are applied to red, green, blue, and alpha, in that
4007order.) The R, G, B, and A values are not clamped to [0,1] at any time
4008during this process.
4009
4010Each pixel is then converted to the internal format specified by
4011INTERNALFORMAT. This conversion simply maps the component values of the
4012pixel (R, G, B, and A) to the values included in the internal format
4013(red, green, blue, alpha, luminance, and intensity). The mapping is as
4014follows:
4015
4016
4017
4018*Internal Format*
4019 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4020
4021`GL_ALPHA'
4022 , , , A , ,
4023
4024`GL_LUMINANCE'
4025 , , , , R ,
4026
4027`GL_LUMINANCE_ALPHA'
4028 , , , A , R ,
4029
4030`GL_INTENSITY'
4031 , , , , , R
4032
4033`GL_RGB'
4034 R , G , B , , ,
4035
4036`GL_RGBA'
4037 R , G , B , A , ,
4038
8925f36f 4039The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4040the resulting pixels are stored in floating-point rather than integer
4041format. They form a two-dimensional filter kernel image indexed with
4042coordinates I and J such that I starts at zero and increases from left
4043to right, and J starts at zero and increases from bottom to top. Kernel
4044location I,J is derived from the Nth pixel, where N is I+J*WIDTH.
4045
8925f36f 4046Note that after a convolution is performed, the resulting color
3c9b6116
AW
4047components are also scaled by their corresponding
4048`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4049corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4050the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4051set by `glPixelTransfer'.
4052
4053`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4054
4055`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4056allowable values.
4057
4058`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
4059values.
4060
4061`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
4062values.
4063
4064`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4065than the maximum supported value. This value may be queried with
4066`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4067`GL_MAX_CONVOLUTION_WIDTH'.
4068
4069`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4070than the maximum supported value. This value may be queried with
4071`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4072`GL_MAX_CONVOLUTION_HEIGHT'.
4073
4074`GL_INVALID_OPERATION' is generated if HEIGHT is one of
4075`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
4076`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
4077is not `GL_RGB'.
4078
4079`GL_INVALID_OPERATION' is generated if HEIGHT is one of
4080`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
4081`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
4082`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
4083`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
4084FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
4085
4086`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
4087bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
4088data store is currently mapped.
4089
4090`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
4091bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
4092unpacked from the buffer object such that the memory reads required
4093would exceed the data store size.
4094
4095`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
4096bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
4097divisible into the number of bytes needed to store in memory a datum
4098indicated by TYPE.
4099
4100`GL_INVALID_OPERATION' is generated if `glConvolutionFilter2D' is
4101executed between the execution of `glBegin' and the corresponding
4102execution of `glEnd'.")
8925f36f 4103
25072f02 4104(define-gl-procedures
bb894c9d
AW
4105 ((glConvolutionParameterf
4106 (target GLenum)
4107 (pname GLenum)
4108 (params GLfloat)
4109 ->
4110 void)
4111 (glConvolutionParameteri
4112 (target GLenum)
4113 (pname GLenum)
4114 (params GLint)
4115 ->
78aa45b9
DH
4116 void)
4117 (glConvolutionParameterfv
4118 (target GLenum)
4119 (pname GLenum)
4120 (params const-GLfloat-*)
4121 ->
4122 void)
4123 (glConvolutionParameteriv
4124 (target GLenum)
4125 (pname GLenum)
4126 (params const-GLint-*)
4127 ->
bb894c9d 4128 void))
3c9b6116
AW
4129 "Set convolution parameters.
4130
4131TARGET
4132 The target for the convolution parameter. Must be one of
4133 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
4134
4135PNAME
4136 The parameter to be set. Must be `GL_CONVOLUTION_BORDER_MODE'.
4137
4138PARAMS
4139 The parameter value. Must be one of `GL_REDUCE',
4140 `GL_CONSTANT_BORDER', `GL_REPLICATE_BORDER'.
4141
4142
4143
4144`glConvolutionParameter' sets the value of a convolution parameter.
4145
4146TARGET selects the convolution filter to be affected:
4147`GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D' for the
41481D, 2D, or separable 2D filter, respectively.
4149
4150PNAME selects the parameter to be changed. `GL_CONVOLUTION_FILTER_SCALE'
4151and `GL_CONVOLUTION_FILTER_BIAS' affect the definition of the
4152convolution filter kernel; see `glConvolutionFilter1D',
4153`glConvolutionFilter2D', and `glSeparableFilter2D' for details. In these
4154cases, PARAMSv is an array of four values to be applied to red, green,
4155blue, and alpha values, respectively. The initial value for
4156`GL_CONVOLUTION_FILTER_SCALE' is (1, 1, 1, 1), and the initial value for
4157`GL_CONVOLUTION_FILTER_BIAS' is (0, 0, 0, 0).
4158
4159A PNAME value of `GL_CONVOLUTION_BORDER_MODE' controls the convolution
4160border mode. The accepted modes are:
4161
4162`GL_REDUCE'
4163 The image resulting from convolution is smaller than the source
4164 image. If the filter width is WF and height is HF , and the source
4165 image width is WS and height is HS , then the convolved image width
4166 will be WS-WF+1 and height will be HS-HF+1 . (If this reduction
4167 would generate an image with zero or negative width and/or height,
4168 the output is simply null, with no error generated.) The
4169 coordinates of the image resulting from convolution are zero
4170 through WS-WF in width and zero through HS-HF in height.
4171
4172`GL_CONSTANT_BORDER'
4173 The image resulting from convolution is the same size as the source
4174 image, and processed as if the source image were surrounded by
4175 pixels with their color specified by the
4176 `GL_CONVOLUTION_BORDER_COLOR'.
4177
4178`GL_REPLICATE_BORDER'
4179 The image resulting from convolution is the same size as the source
4180 image, and processed as if the outermost pixel on the border of the
4181 source image were replicated.
4182
4183`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4184values.
4185
4186`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
4187values.
4188
4189`GL_INVALID_ENUM' is generated if PNAME is `GL_CONVOLUTION_BORDER_MODE'
4190and PARAMS is not one of `GL_REDUCE', `GL_CONSTANT_BORDER', or
4191`GL_REPLICATE_BORDER'.
4192
4193`GL_INVALID_OPERATION' is generated if `glConvolutionParameter' is
4194executed between the execution of `glBegin' and the corresponding
4195execution of `glEnd'.")
8925f36f 4196
25072f02 4197(define-gl-procedures
bb894c9d
AW
4198 ((glCopyColorSubTable
4199 (target GLenum)
4200 (start GLsizei)
4201 (x GLint)
4202 (y GLint)
4203 (width GLsizei)
4204 ->
4205 void))
3c9b6116
AW
4206 "Respecify a portion of a color table.
4207
4208TARGET
4209 Must be one of `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE',
4210 or `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
4211
4212START
4213 The starting index of the portion of the color table to be
4214 replaced.
4215
4216X
4217 Y
4218
4219 The window coordinates of the left corner of the row of pixels to
4220 be copied.
4221
4222WIDTH
4223 The number of table entries to replace.
4224
4225`glCopyColorSubTable' is used to respecify a contiguous portion of a
4226color table previously defined using `glColorTable'. The pixels copied
4227from the framebuffer replace the portion of the existing table from
4228indices START to START+X-1 , inclusive. This region may not include any
4229entries outside the range of the color table, as was originally
4230specified. It is not an error to specify a subtexture with width of 0,
4231but such a specification has no effect.
4232
4233`GL_INVALID_VALUE' is generated if TARGET is not a previously defined
4234color table.
4235
4236`GL_INVALID_VALUE' is generated if TARGET is not one of the allowable
4237values.
4238
4239`GL_INVALID_VALUE' is generated if START+X>WIDTH .
4240
4241`GL_INVALID_OPERATION' is generated if `glCopyColorSubTable' is executed
4242between the execution of `glBegin' and the corresponding execution of
4243`glEnd'.")
8925f36f 4244
25072f02 4245(define-gl-procedures
bb894c9d
AW
4246 ((glCopyColorTable
4247 (target GLenum)
4248 (internalformat GLenum)
4249 (x GLint)
4250 (y GLint)
4251 (width GLsizei)
4252 ->
4253 void))
3c9b6116
AW
4254 "Copy pixels into a color table.
4255
4256TARGET
4257 The color table target. Must be `GL_COLOR_TABLE',
4258 `GL_POST_CONVOLUTION_COLOR_TABLE', or
4259 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
4260
4261INTERNALFORMAT
4262 The internal storage format of the texture image. Must be one of
4263 the following symbolic constants: `GL_ALPHA', `GL_ALPHA4',
4264 `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16', `GL_LUMINANCE',
4265 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4266 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4267 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4268 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4269 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4270 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
4271 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
4272 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
4273 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
4274
4275X
4276 The x coordinate of the lower-left corner of the pixel rectangle to
4277 be transferred to the color table.
4278
4279Y
4280 The y coordinate of the lower-left corner of the pixel rectangle to
4281 be transferred to the color table.
4282
4283WIDTH
4284 The width of the pixel rectangle.
4285
4286`glCopyColorTable' loads a color table with pixels from the current
4287`GL_READ_BUFFER' (rather than from main memory, as is the case for
4288`glColorTable').
4289
4290The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y)
4291having width WIDTH and height 1 is loaded into the color table. If any
4292pixels within this region are outside the window that is associated with
4293the GL context, the values obtained for those pixels are undefined.
4294
4295The pixels in the rectangle are processed just as if `glReadPixels' were
4296called, with INTERNALFORMAT set to RGBA, but processing stops after the
4297final conversion to RGBA.
4298
8925f36f 4299The four scale parameters and the four bias parameters that are defined
3c9b6116
AW
4300for the table are then used to scale and bias the R, G, B, and A
4301components of each pixel. The scale and bias parameters are set by
4302calling `glColorTableParameter'.
4303
4304Next, the R, G, B, and A values are clamped to the range [0,1] . Each
4305pixel is then converted to the internal format specified by
4306INTERNALFORMAT. This conversion simply maps the component values of the
4307pixel (R, G, B, and A) to the values included in the internal format
4308(red, green, blue, alpha, luminance, and intensity). The mapping is as
4309follows:
4310
4311
4312
4313*Internal Format*
4314 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4315
4316`GL_ALPHA'
4317 , , , A , ,
4318
4319`GL_LUMINANCE'
4320 , , , , R ,
4321
4322`GL_LUMINANCE_ALPHA'
4323 , , , A , R ,
4324
4325`GL_INTENSITY'
4326 , , , , , R
4327
4328`GL_RGB'
4329 R , G , B , , ,
4330
4331`GL_RGBA'
4332 R , G , B , A , ,
4333
4334Finally, the red, green, blue, alpha, luminance, and/or intensity
4335components of the resulting pixels are stored in the color table. They
4336form a one-dimensional table with indices in the range [0,WIDTH-1] .
4337
4338
4339
4340`GL_INVALID_ENUM' is generated when TARGET is not one of the allowable
4341values.
4342
4343`GL_INVALID_VALUE' is generated if WIDTH is less than zero.
4344
4345`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not one of the
4346allowable values.
4347
4348`GL_TABLE_TOO_LARGE' is generated if the requested color table is too
4349large to be supported by the implementation.
4350
4351`GL_INVALID_OPERATION' is generated if `glCopyColorTable' is executed
4352between the execution of `glBegin' and the corresponding execution of
4353`glEnd'.")
8925f36f 4354
25072f02 4355(define-gl-procedures
bb894c9d
AW
4356 ((glCopyConvolutionFilter1D
4357 (target GLenum)
4358 (internalformat GLenum)
4359 (x GLint)
4360 (y GLint)
4361 (width GLsizei)
4362 ->
4363 void))
3c9b6116
AW
4364 "Copy pixels into a one-dimensional convolution filter.
4365
4366TARGET
4367 Must be `GL_CONVOLUTION_1D'.
4368
4369INTERNALFORMAT
4370 The internal format of the convolution filter kernel. The allowable
4371 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4372 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4373 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4374 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4375 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4376 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4377 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4378 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4379 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4380 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4381 `GL_RGBA12', or `GL_RGBA16'.
4382
4383X
4384 Y
4385
4386 The window space coordinates of the lower-left coordinate of the
4387 pixel array to copy.
4388
4389WIDTH
4390 The width of the pixel array to copy.
4391
4392`glCopyConvolutionFilter1D' defines a one-dimensional convolution filter
4393kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4394main memory, as is the case for `glConvolutionFilter1D').
4395
4396The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4397width WIDTH and height 1 is used to define the convolution filter. If
4398any pixels within this region are outside the window that is associated
4399with the GL context, the values obtained for those pixels are undefined.
4400
4401The pixels in the rectangle are processed exactly as if `glReadPixels'
4402had been called with FORMAT set to RGBA, but the process stops just
4403before final conversion. The R, G, B, and A components of each pixel are
4404next scaled by the four 1D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4405biased by the four 1D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4406scale and bias parameters are set by `glConvolutionParameter' using the
4407`GL_CONVOLUTION_1D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4408and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4409of four values that are applied to red, green, blue, and alpha, in that
4410order.) The R, G, B, and A values are not clamped to [0,1] at any time
4411during this process.
4412
4413Each pixel is then converted to the internal format specified by
4414INTERNALFORMAT. This conversion simply maps the component values of the
4415pixel (R, G, B, and A) to the values included in the internal format
4416(red, green, blue, alpha, luminance, and intensity). The mapping is as
4417follows:
4418
4419
4420
4421*Internal Format*
4422 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4423
4424`GL_ALPHA'
4425 , , , A , ,
4426
4427`GL_LUMINANCE'
4428 , , , , R ,
4429
4430`GL_LUMINANCE_ALPHA'
4431 , , , A , R ,
4432
4433`GL_INTENSITY'
4434 , , , , , R
4435
4436`GL_RGB'
4437 R , G , B , , ,
4438
4439`GL_RGBA'
4440 R , G , B , A , ,
4441
8925f36f 4442The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4443the resulting pixels are stored in floating-point rather than integer
4444format.
4445
8925f36f 4446Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4447lower I filter image coordinates.
4448
8925f36f 4449Note that after a convolution is performed, the resulting color
3c9b6116
AW
4450components are also scaled by their corresponding
4451`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4452corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4453the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4454set by `glPixelTransfer'.
4455
4456`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_1D'.
4457
4458`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4459allowable values.
4460
4461`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4462than the maximum supported value. This value may be queried with
4463`glGetConvolutionParameter' using target `GL_CONVOLUTION_1D' and name
4464`GL_MAX_CONVOLUTION_WIDTH'.
4465
4466`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter1D' is
4467executed between the execution of `glBegin' and the corresponding
4468execution of `glEnd'.")
8925f36f 4469
25072f02 4470(define-gl-procedures
bb894c9d
AW
4471 ((glCopyConvolutionFilter2D
4472 (target GLenum)
4473 (internalformat GLenum)
4474 (x GLint)
4475 (y GLint)
4476 (width GLsizei)
4477 (height GLsizei)
4478 ->
4479 void))
3c9b6116
AW
4480 "Copy pixels into a two-dimensional convolution filter.
4481
4482TARGET
4483 Must be `GL_CONVOLUTION_2D'.
4484
4485INTERNALFORMAT
4486 The internal format of the convolution filter kernel. The allowable
4487 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
4488 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
4489 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
4490 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
4491 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
4492 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
4493 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
4494 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
4495 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
4496 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
4497 `GL_RGBA12', or `GL_RGBA16'.
4498
4499X
4500 Y
4501
4502 The window space coordinates of the lower-left coordinate of the
4503 pixel array to copy.
4504
4505WIDTH
4506 The width of the pixel array to copy.
4507
4508HEIGHT
4509 The height of the pixel array to copy.
4510
4511`glCopyConvolutionFilter2D' defines a two-dimensional convolution filter
4512kernel with pixels from the current `GL_READ_BUFFER' (rather than from
4513main memory, as is the case for `glConvolutionFilter2D').
4514
4515The screen-aligned pixel rectangle with lower-left corner at (X,\\ Y),
4516width WIDTH and height HEIGHT is used to define the convolution filter.
4517If any pixels within this region are outside the window that is
4518associated with the GL context, the values obtained for those pixels are
4519undefined.
4520
4521The pixels in the rectangle are processed exactly as if `glReadPixels'
4522had been called with FORMAT set to RGBA, but the process stops just
4523before final conversion. The R, G, B, and A components of each pixel are
4524next scaled by the four 2D `GL_CONVOLUTION_FILTER_SCALE' parameters and
4525biased by the four 2D `GL_CONVOLUTION_FILTER_BIAS' parameters. (The
4526scale and bias parameters are set by `glConvolutionParameter' using the
4527`GL_CONVOLUTION_2D' target and the names `GL_CONVOLUTION_FILTER_SCALE'
4528and `GL_CONVOLUTION_FILTER_BIAS'. The parameters themselves are vectors
4529of four values that are applied to red, green, blue, and alpha, in that
4530order.) The R, G, B, and A values are not clamped to [0,1] at any time
4531during this process.
4532
4533Each pixel is then converted to the internal format specified by
4534INTERNALFORMAT. This conversion simply maps the component values of the
4535pixel (R, G, B, and A) to the values included in the internal format
4536(red, green, blue, alpha, luminance, and intensity). The mapping is as
4537follows:
4538
4539
4540
4541*Internal Format*
4542 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
4543
4544`GL_ALPHA'
4545 , , , A , ,
4546
4547`GL_LUMINANCE'
4548 , , , , R ,
4549
4550`GL_LUMINANCE_ALPHA'
4551 , , , A , R ,
4552
4553`GL_INTENSITY'
4554 , , , , , R
4555
4556`GL_RGB'
4557 R , G , B , , ,
4558
4559`GL_RGBA'
4560 R , G , B , A , ,
4561
8925f36f 4562The red, green, blue, alpha, luminance, and/or intensity components of
3c9b6116
AW
4563the resulting pixels are stored in floating-point rather than integer
4564format.
4565
8925f36f 4566Pixel ordering is such that lower x screen coordinates correspond to
3c9b6116
AW
4567lower I filter image coordinates, and lower y screen coordinates
4568correspond to lower J filter image coordinates.
4569
8925f36f 4570Note that after a convolution is performed, the resulting color
3c9b6116
AW
4571components are also scaled by their corresponding
4572`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
4573corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
4574the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
4575set by `glPixelTransfer'.
4576
4577`GL_INVALID_ENUM' is generated if TARGET is not `GL_CONVOLUTION_2D'.
4578
4579`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
4580allowable values.
4581
4582`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
4583than the maximum supported value. This value may be queried with
4584`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4585`GL_MAX_CONVOLUTION_WIDTH'.
4586
4587`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
4588than the maximum supported value. This value may be queried with
4589`glGetConvolutionParameter' using target `GL_CONVOLUTION_2D' and name
4590`GL_MAX_CONVOLUTION_HEIGHT'.
4591
4592`GL_INVALID_OPERATION' is generated if `glCopyConvolutionFilter2D' is
4593executed between the execution of `glBegin' and the corresponding
4594execution of `glEnd'.")
8925f36f 4595
25072f02 4596(define-gl-procedures
bb894c9d
AW
4597 ((glCopyPixels
4598 (x GLint)
4599 (y GLint)
4600 (width GLsizei)
4601 (height GLsizei)
4602 (type GLenum)
4603 ->
4604 void))
3c9b6116
AW
4605 "Copy pixels in the frame buffer.
4606
4607X
4608 Y
4609
4610 Specify the window coordinates of the lower left corner of the
4611 rectangular region of pixels to be copied.
4612
4613WIDTH
4614 HEIGHT
4615
4616 Specify the dimensions of the rectangular region of pixels to be
4617 copied. Both must be nonnegative.
4618
4619TYPE
4620 Specifies whether color values, depth values, or stencil values are
4621 to be copied. Symbolic constants `GL_COLOR', `GL_DEPTH', and
4622 `GL_STENCIL' are accepted.
4623
4624`glCopyPixels' copies a screen-aligned rectangle of pixels from the
4625specified frame buffer location to a region relative to the current
4626raster position. Its operation is well defined only if the entire pixel
4627source region is within the exposed portion of the window. Results of
4628copies from outside the window, or from regions of the window that are
4629not exposed, are hardware dependent and undefined.
4630
4631X and Y specify the window coordinates of the lower left corner of the
4632rectangular region to be copied. WIDTH and HEIGHT specify the dimensions
4633of the rectangular region to be copied. Both WIDTH and HEIGHT must not
4634be negative.
4635
4636Several parameters control the processing of the pixel data while it is
4637being copied. These parameters are set with three commands:
4638`glPixelTransfer', `glPixelMap', and `glPixelZoom'. This reference page
4639describes the effects on `glCopyPixels' of most, but not all, of the
4640parameters specified by these three commands.
4641
4642`glCopyPixels' copies values from each pixel with the lower left-hand
4643corner at (X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said
4644to be the I th pixel in the J th row. Pixels are copied in row order
4645from the lowest to the highest row, left to right in each row.
4646
4647TYPE specifies whether color, depth, or stencil data is to be copied.
4648The details of the transfer for each data type are as follows:
4649
4650`GL_COLOR'
4651 Indices or RGBA colors are read from the buffer currently specified
4652 as the read source buffer (see `glReadBuffer'). If the GL is in
4653 color index mode, each index that is read from this buffer is
4654 converted to a fixed-point format with an unspecified number of
4655 bits to the right of the binary point. Each index is then shifted
4656 left by `GL_INDEX_SHIFT' bits, and added to `GL_INDEX_OFFSET'. If
4657 `GL_INDEX_SHIFT' is negative, the shift is to the right. In either
4658 case, zero bits fill otherwise unspecified bit locations in the
4659 result. If `GL_MAP_COLOR' is true, the index is replaced with the
4660 value that it references in lookup table `GL_PIXEL_MAP_I_TO_I'.
4661 Whether the lookup replacement of the index is done or not, the
4662 integer part of the index is then ANDed with 2^B-1 , where B is the
4663 number of bits in a color index buffer.
4664
4665 If the GL is in RGBA mode, the red, green, blue, and alpha
4666 components of each pixel that is read are converted to an internal
4667 floating-point format with unspecified precision. The conversion
4668 maps the largest representable component value to 1.0, and
4669 component value 0 to 0.0. The resulting floating-point color values
4670 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
4671 C is RED, GREEN, BLUE, and ALPHA for the respective color
4672 components. The results are clamped to the range [0,1]. If
4673 `GL_MAP_COLOR' is true, each color component is scaled by the size
4674 of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the value
4675 that it references in that table. C is R, G, B, or A.
4676
4677 If the `ARB_imaging' extension is supported, the color values may
4678 be additionally processed by color-table lookups, color-matrix
4679 transformations, and convolution filters.
4680
4681 The GL then converts the resulting indices or RGBA colors to
4682 fragments by attaching the current raster position Z coordinate and
4683 texture coordinates to each pixel, then assigning window
4684 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4685 position, and the pixel was the I th pixel in the J th row. These
4686 pixel fragments are then treated just like the fragments generated
4687 by rasterizing points, lines, or polygons. Texture mapping, fog,
4688 and all the fragment operations are applied before the fragments
4689 are written to the frame buffer.
4690
4691`GL_DEPTH'
4692 Depth values are read from the depth buffer and converted directly
4693 to an internal floating-point format with unspecified precision.
4694 The resulting floating-point depth value is then multiplied by
4695 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
4696 clamped to the range [0,1].
4697
4698 The GL then converts the resulting depth components to fragments by
4699 attaching the current raster position color or color index and
4700 texture coordinates to each pixel, then assigning window
4701 coordinates (X_R+I,Y_R+J) , where (X_R,Y_R) is the current raster
4702 position, and the pixel was the I th pixel in the J th row. These
4703 pixel fragments are then treated just like the fragments generated
4704 by rasterizing points, lines, or polygons. Texture mapping, fog,
4705 and all the fragment operations are applied before the fragments
4706 are written to the frame buffer.
4707
4708`GL_STENCIL'
4709 Stencil indices are read from the stencil buffer and converted to
4710 an internal fixed-point format with an unspecified number of bits
4711 to the right of the binary point. Each fixed-point index is then
4712 shifted left by `GL_INDEX_SHIFT' bits, and added to
4713 `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is negative, the shift is to
4714 the right. In either case, zero bits fill otherwise unspecified bit
4715 locations in the result. If `GL_MAP_STENCIL' is true, the index is
4716 replaced with the value that it references in lookup table
4717 `GL_PIXEL_MAP_S_TO_S'. Whether the lookup replacement of the index
4718 is done or not, the integer part of the index is then ANDed with
4719 2^B-1 , where B is the number of bits in the stencil buffer. The
4720 resulting stencil indices are then written to the stencil buffer
4721 such that the index read from the I th location of the J th row is
4722 written to location (X_R+I,Y_R+J) , where (X_R,Y_R) is the current
4723 raster position. Only the pixel ownership test, the scissor test,
4724 and the stencil writemask affect these write operations.
4725
8925f36f 4726The rasterization described thus far assumes pixel zoom factors of 1.0.
3c9b6116
AW
4727If `glPixelZoom' is used to change the X and Y pixel zoom factors,
4728pixels are converted to fragments as follows. If (X_R,Y_R) is the
4729current raster position, and a given pixel is in the I th location in
4730the J th row of the source pixel rectangle, then fragments are generated
4731for pixels whose centers are in the rectangle with corners at
4732
4733(X_R+ZOOM_X,\u2062I,Y_R+ZOOM_Y,\u2062J)
4734
4735and
4736
4737(X_R+ZOOM_X,\u2061(I+1,),Y_R+ZOOM_Y,\u2061(J+1,))
4738
4739where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
4740`GL_ZOOM_Y'.
4741
4742`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
4743
4744`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
4745
4746`GL_INVALID_OPERATION' is generated if TYPE is `GL_DEPTH' and there is
4747no depth buffer.
4748
4749`GL_INVALID_OPERATION' is generated if TYPE is `GL_STENCIL' and there is
4750no stencil buffer.
4751
4752`GL_INVALID_OPERATION' is generated if `glCopyPixels' is executed
4753between the execution of `glBegin' and the corresponding execution of
4754`glEnd'.")
8925f36f 4755
25072f02 4756(define-gl-procedures
bb894c9d
AW
4757 ((glCopyTexImage1D
4758 (target GLenum)
4759 (level GLint)
4760 (internalformat GLenum)
4761 (x GLint)
4762 (y GLint)
4763 (width GLsizei)
4764 (border GLint)
4765 ->
4766 void))
3c9b6116
AW
4767 "Copy pixels into a 1D texture image.
4768
4769TARGET
4770 Specifies the target texture. Must be `GL_TEXTURE_1D'.
4771
4772LEVEL
4773 Specifies the level-of-detail number. Level 0 is the base image
4774 level. Level N is the Nth mipmap reduction image.
4775
4776INTERNALFORMAT
4777 Specifies the internal format of the texture. Must be one of the
4778 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4779 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4780 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4781 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4782 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4783 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4784 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4785 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4786 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4787 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4788 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4789 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4790 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4791 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4792 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4793 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4794 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4795 `GL_SRGB8_ALPHA8'.
4796
4797X
4798 Y
4799
4800 Specify the window coordinates of the left corner of the row of
4801 pixels to be copied.
4802
4803WIDTH
4804 Specifies the width of the texture image. Must be 0 or
4805 2^N+2\u2061(BORDER,) for some integer N . The height of the texture
4806 image is 1.
4807
4808BORDER
4809 Specifies the width of the border. Must be either 0 or 1.
4810
4811`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4812from the current `GL_READ_BUFFER'.
4813
4814The screen-aligned pixel row with left corner at (X,Y) and with a length
4815of WIDTH+2\u2061(BORDER,) defines the texture array at the mipmap level
4816specified by LEVEL. INTERNALFORMAT specifies the internal format of the
4817texture array.
4818
4819The pixels in the row are processed exactly as if `glCopyPixels' had
4820been called, but the process stops just before final conversion. At this
4821point all pixel component values are clamped to the range [0,1] and then
4822converted to the texture's internal format for storage in the texel
4823array.
4824
4825Pixel ordering is such that lower X screen coordinates correspond to
4826lower texture coordinates.
4827
4828If any of the pixels within the specified row of the current
4829`GL_READ_BUFFER' are outside the window associated with the current
4830rendering context, then the values obtained for those pixels are
4831undefined.
4832
4833`glCopyTexImage1D' defines a one-dimensional texture image with pixels
4834from the current `GL_READ_BUFFER'.
4835
4836When INTERNALFORMAT is one of the sRGB types, the GL does not
4837automatically convert the source pixels to the sRGB color space. In this
4838case, the `glPixelMap' function can be used to accomplish the
4839conversion.
4840
4841`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
4842values.
4843
4844`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4845
4846`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4847where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4848
4849`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an allowable
4850value.
4851
4852`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
48532 + `GL_MAX_TEXTURE_SIZE'.
4854
4855`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4856supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
4857some integer value of N.
4858
4859`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4860
4861`GL_INVALID_OPERATION' is generated if `glCopyTexImage1D' is executed
4862between the execution of `glBegin' and the corresponding execution of
4863`glEnd'.
4864
4865`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4866`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4867`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4868
25072f02 4869(define-gl-procedures
bb894c9d
AW
4870 ((glCopyTexImage2D
4871 (target GLenum)
4872 (level GLint)
4873 (internalformat GLenum)
4874 (x GLint)
4875 (y GLint)
4876 (width GLsizei)
4877 (height GLsizei)
4878 (border GLint)
4879 ->
4880 void))
3c9b6116
AW
4881 "Copy pixels into a 2D texture image.
4882
4883TARGET
4884 Specifies the target texture. Must be `GL_TEXTURE_2D',
4885 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4886 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4887 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
4888 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4889
4890LEVEL
4891 Specifies the level-of-detail number. Level 0 is the base image
4892 level. Level N is the Nth mipmap reduction image.
4893
4894INTERNALFORMAT
4895 Specifies the internal format of the texture. Must be one of the
4896 following symbolic constants: `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8',
4897 `GL_ALPHA12', `GL_ALPHA16', `GL_COMPRESSED_ALPHA',
4898 `GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
4899 `GL_COMPRESSED_INTENSITY', `GL_COMPRESSED_RGB',
4900 `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
4901 `GL_DEPTH_COMPONENT24', `GL_DEPTH_COMPONENT32', `GL_LUMINANCE',
4902 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
4903 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
4904 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
4905 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
4906 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
4907 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_RGB',
4908 `GL_R3_G3_B2', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10',
4909 `GL_RGB12', `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4',
4910 `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
4911 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
4912 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
4913 `GL_SRGB8_ALPHA8'.
4914
4915X
4916 Y
4917
4918 Specify the window coordinates of the lower left corner of the
4919 rectangular region of pixels to be copied.
4920
4921WIDTH
4922 Specifies the width of the texture image. Must be 0 or
4923 2^N+2\u2061(BORDER,) for some integer N .
4924
4925HEIGHT
4926 Specifies the height of the texture image. Must be 0 or
4927 2^M+2\u2061(BORDER,) for some integer M .
4928
4929BORDER
4930 Specifies the width of the border. Must be either 0 or 1.
4931
4932`glCopyTexImage2D' defines a two-dimensional texture image, or cube-map
4933texture image with pixels from the current `GL_READ_BUFFER'.
4934
4935The screen-aligned pixel rectangle with lower left corner at (X, Y) and
4936with a width of WIDTH+2\u2061(BORDER,) and a height of HEIGHT+2\u2061(BORDER,)
4937defines the texture array at the mipmap level specified by LEVEL.
4938INTERNALFORMAT specifies the internal format of the texture array.
4939
4940The pixels in the rectangle are processed exactly as if `glCopyPixels'
4941had been called, but the process stops just before final conversion. At
4942this point all pixel component values are clamped to the range [0,1] and
4943then converted to the texture's internal format for storage in the texel
4944array.
4945
4946Pixel ordering is such that lower X and Y screen coordinates correspond
4947to lower S and T texture coordinates.
4948
4949If any of the pixels within the specified rectangle of the current
4950`GL_READ_BUFFER' are outside the window associated with the current
4951rendering context, then the values obtained for those pixels are
4952undefined.
4953
4954When INTERNALFORMAT is one of the sRGB types, the GL does not
4955automatically convert the source pixels to the sRGB color space. In this
4956case, the `glPixelMap' function can be used to accomplish the
4957conversion.
4958
4959`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
4960`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
4961`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
4962`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
4963
4964`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
4965
4966`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2\u2062MAX ,
4967where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
4968
4969`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
49702 + `GL_MAX_TEXTURE_SIZE'.
4971
4972`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
4973supported and the WIDTH or DEPTH cannot be represented as
49742^K+2\u2061(BORDER,) for some integer K .
4975
4976`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
4977
4978`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not an accepted
4979format.
4980
4981`GL_INVALID_OPERATION' is generated if `glCopyTexImage2D' is executed
4982between the execution of `glBegin' and the corresponding execution of
4983`glEnd'.
4984
4985`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
4986`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
4987`GL_DEPTH_COMPONENT32' and there is no depth buffer.")
8925f36f 4988
25072f02 4989(define-gl-procedures
bb894c9d
AW
4990 ((glCopyTexSubImage1D
4991 (target GLenum)
4992 (level GLint)
4993 (xoffset GLint)
4994 (x GLint)
4995 (y GLint)
4996 (width GLsizei)
4997 ->
4998 void))
3c9b6116
AW
4999 "Copy a one-dimensional texture subimage.
5000
5001TARGET
5002 Specifies the target texture. Must be `GL_TEXTURE_1D'.
5003
5004LEVEL
5005 Specifies the level-of-detail number. Level 0 is the base image
5006 level. Level N is the Nth mipmap reduction image.
5007
5008XOFFSET
5009 Specifies the texel offset within the texture array.
5010
5011X
5012 Y
5013
5014 Specify the window coordinates of the left corner of the row of
5015 pixels to be copied.
5016
5017WIDTH
5018 Specifies the width of the texture subimage.
5019
5020`glCopyTexSubImage1D' replaces a portion of a one-dimensional texture
5021image with pixels from the current `GL_READ_BUFFER' (rather than from
5022main memory, as is the case for `glTexSubImage1D').
5023
5024The screen-aligned pixel row with left corner at (X,\\ Y), and with
5025length WIDTH replaces the portion of the texture array with x indices
5026XOFFSET through XOFFSET+WIDTH-1 , inclusive. The destination in the
5027texture array may not include any texels outside the texture array as it
5028was originally specified.
5029
5030The pixels in the row are processed exactly as if `glCopyPixels' had
5031been called, but the process stops just before final conversion. At this
5032point, all pixel component values are clamped to the range [0,1] and
5033then converted to the texture's internal format for storage in the texel
5034array.
5035
5036It is not an error to specify a subtexture with zero width, but such a
5037specification has no effect. If any of the pixels within the specified
5038row of the current `GL_READ_BUFFER' are outside the read window
5039associated with the current rendering context, then the values obtained
5040for those pixels are undefined.
5041
5042No change is made to the INTERNALFORMAT, WIDTH, or BORDER parameters of
5043the specified texture array or to texel values outside the specified
5044subregion.
5045
5046`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_1D'.
5047
5048`GL_INVALID_OPERATION' is generated if the texture array has not been
5049defined by a previous `glTexImage1D' or `glCopyTexImage1D' operation.
5050
5051`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
5052
5053`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
5054the returned value of `GL_MAX_TEXTURE_SIZE'.
5055
5056`GL_INVALID_VALUE' is generated if XOFFSET<-B , or
5057(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH' and B is the
5058`GL_TEXTURE_BORDER' of the texture image being modified. Note that W
5059includes twice the border width.")
8925f36f 5060
25072f02 5061(define-gl-procedures
bb894c9d
AW
5062 ((glCopyTexSubImage2D
5063 (target GLenum)
5064 (level GLint)
5065 (xoffset GLint)
5066 (yoffset GLint)
5067 (x GLint)
5068 (y GLint)
5069 (width GLsizei)
5070 (height GLsizei)
5071 ->
5072 void))
3c9b6116
AW
5073 "Copy a two-dimensional texture subimage.
5074
5075TARGET
5076 Specifies the target texture. Must be `GL_TEXTURE_2D',
5077 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
5078 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
5079 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
5080 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
5081
5082LEVEL
5083 Specifies the level-of-detail number. Level 0 is the base image
5084 level. Level N is the Nth mipmap reduction image.
5085
5086XOFFSET
5087 Specifies a texel offset in the x direction within the texture
5088 array.
5089
5090YOFFSET
5091 Specifies a texel offset in the y direction within the texture
5092 array.
5093
5094X
5095 Y
5096
5097 Specify the window coordinates of the lower left corner of the
5098 rectangular region of pixels to be copied.
5099
5100WIDTH
5101 Specifies the width of the texture subimage.
5102
5103HEIGHT
5104 Specifies the height of the texture subimage.
5105
5106`glCopyTexSubImage2D' replaces a rectangular portion of a
5107two-dimensional texture image or cube-map texture image with pixels from
5108the current `GL_READ_BUFFER' (rather than from main memory, as is the
5109case for `glTexSubImage2D').
5110
5111The screen-aligned pixel rectangle with lower left corner at (X,Y) and
5112with width WIDTH and height HEIGHT replaces the portion of the texture
5113array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
5114indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at the mipmap
5115level specified by LEVEL.
5116
5117The pixels in the rectangle are processed exactly as if `glCopyPixels'
5118had been called, but the process stops just before final conversion. At
5119this point, all pixel component values are clamped to the range [0,1]
5120and then converted to the texture's internal format for storage in the
5121texel array.
5122
5123The destination rectangle in the texture array may not include any
5124texels outside the texture array as it was originally specified. It is
5125not an error to specify a subtexture with zero width or height, but such
5126a specification has no effect.
5127
5128If any of the pixels within the specified rectangle of the current
5129`GL_READ_BUFFER' are outside the read window associated with the current
5130rendering context, then the values obtained for those pixels are
5131undefined.
5132
5133No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, or BORDER
5134parameters of the specified texture array or to texel values outside the
5135specified subregion.
5136
5137`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
5138`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
5139`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
5140`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
5141
5142`GL_INVALID_OPERATION' is generated if the texture array has not been
5143defined by a previous `glTexImage2D' or `glCopyTexImage2D' operation.
5144
5145`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
5146
5147`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
5148the returned value of `GL_MAX_TEXTURE_SIZE'.
5149
5150`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
5151, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
5152`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the
5153`GL_TEXTURE_BORDER' of the texture image being modified. Note that W and
5154H include twice the border width.
5155
5156`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage2D' is executed
5157between the execution of `glBegin' and the corresponding execution of
5158`glEnd'.")
8925f36f 5159
25072f02 5160(define-gl-procedures
bb894c9d
AW
5161 ((glCopyTexSubImage3D
5162 (target GLenum)
5163 (level GLint)
5164 (xoffset GLint)
5165 (yoffset GLint)
5166 (zoffset GLint)
5167 (x GLint)
5168 (y GLint)
5169 (width GLsizei)
5170 (height GLsizei)
5171 ->
5172 void))
3c9b6116
AW
5173 "Copy a three-dimensional texture subimage.
5174
5175TARGET
5176 Specifies the target texture. Must be `GL_TEXTURE_3D'
5177
5178LEVEL
5179 Specifies the level-of-detail number. Level 0 is the base image
5180 level. Level N is the Nth mipmap reduction image.
5181
5182XOFFSET
5183 Specifies a texel offset in the x direction within the texture
5184 array.
5185
5186YOFFSET
5187 Specifies a texel offset in the y direction within the texture
5188 array.
5189
5190ZOFFSET
5191 Specifies a texel offset in the z direction within the texture
5192 array.
5193
5194X
5195 Y
5196
5197 Specify the window coordinates of the lower left corner of the
5198 rectangular region of pixels to be copied.
5199
5200WIDTH
5201 Specifies the width of the texture subimage.
5202
5203HEIGHT
5204 Specifies the height of the texture subimage.
5205
5206`glCopyTexSubImage3D' replaces a rectangular portion of a
5207three-dimensional texture image with pixels from the current
5208`GL_READ_BUFFER' (rather than from main memory, as is the case for
5209`glTexSubImage3D').
5210
5211The screen-aligned pixel rectangle with lower left corner at (X,\\ Y) and
5212with width WIDTH and height HEIGHT replaces the portion of the texture
5213array with x indices XOFFSET through XOFFSET+WIDTH-1 , inclusive, and y
5214indices YOFFSET through YOFFSET+HEIGHT-1 , inclusive, at z index ZOFFSET
5215and at the mipmap level specified by LEVEL.
5216
5217The pixels in the rectangle are processed exactly as if `glCopyPixels'
5218had been called, but the process stops just before final conversion. At
5219this point, all pixel component values are clamped to the range [0,1]
5220and then converted to the texture's internal format for storage in the
5221texel array.
5222
5223The destination rectangle in the texture array may not include any
5224texels outside the texture array as it was originally specified. It is
5225not an error to specify a subtexture with zero width or height, but such
5226a specification has no effect.
5227
5228If any of the pixels within the specified rectangle of the current
5229`GL_READ_BUFFER' are outside the read window associated with the current
5230rendering context, then the values obtained for those pixels are
5231undefined.
5232
5233No change is made to the INTERNALFORMAT, WIDTH, HEIGHT, DEPTH, or BORDER
5234parameters of the specified texture array or to texel values outside the
5235specified subregion.
5236
5237`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
5238
5239`GL_INVALID_OPERATION' is generated if the texture array has not been
5240defined by a previous `glTexImage3D' operation.
5241
5242`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
5243
5244`GL_INVALID_VALUE' may be generated if LEVEL>LOG_2\u2061(MAX,) , where MAX is
5245the returned value of `GL_MAX_3D_TEXTURE_SIZE'.
5246
5247`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
5248, YOFFSET<-B , (YOFFSET+HEIGHT,)>(H-B,) , ZOFFSET<-B , or
5249(ZOFFSET+1,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
5250`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH', and B is the
5251`GL_TEXTURE_BORDER' of the texture image being modified. Note that W , H
5252, and D include twice the border width.
5253
5254`GL_INVALID_OPERATION' is generated if `glCopyTexSubImage3D' is executed
5255between the execution of `glBegin' and the corresponding execution of
5256`glEnd'.")
8925f36f 5257
25072f02 5258(define-gl-procedures
bb894c9d 5259 ((glCreateProgram -> GLuint))
3c9b6116
AW
5260 "Creates a program object.
5261
5262`glCreateProgram' creates an empty program object and returns a non-zero
5263value by which it can be referenced. A program object is an object to
5264which shader objects can be attached. This provides a mechanism to
5265specify the shader objects that will be linked to create a program. It
5266also provides a means for checking the compatibility of the shaders that
5267will be used to create a program (for instance, checking the
5268compatibility between a vertex shader and a fragment shader). When no
5269longer needed as part of a program object, shader objects can be
5270detached.
5271
5272One or more executables are created in a program object by successfully
5273attaching shader objects to it with `glAttachShader', successfully
5274compiling the shader objects with `glCompileShader', and successfully
5275linking the program object with `glLinkProgram'. These executables are
5276made part of current state when `glUseProgram' is called. Program
5277objects can be deleted by calling `glDeleteProgram'. The memory
5278associated with the program object will be deleted when it is no longer
5279part of current rendering state for any context.
5280
5281This function returns 0 if an error occurs creating the program object.
5282
5283`GL_INVALID_OPERATION' is generated if `glCreateProgram' is executed
5284between the execution of `glBegin' and the corresponding execution of
5285`glEnd'.")
8925f36f 5286
25072f02 5287(define-gl-procedures
bb894c9d 5288 ((glCreateShader (shaderType GLenum) -> GLuint))
3c9b6116
AW
5289 "Creates a shader object.
5290
5291SHADERTYPE
5292 Specifies the type of shader to be created. Must be either
5293 `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER'.
5294
5295`glCreateShader' creates an empty shader object and returns a non-zero
5296value by which it can be referenced. A shader object is used to maintain
5297the source code strings that define a shader. SHADERTYPE indicates the
5298type of shader to be created. Two types of shaders are supported. A
5299shader of type `GL_VERTEX_SHADER' is a shader that is intended to run on
5300the programmable vertex processor and replace the fixed functionality
5301vertex processing in OpenGL. A shader of type `GL_FRAGMENT_SHADER' is a
5302shader that is intended to run on the programmable fragment processor
5303and replace the fixed functionality fragment processing in OpenGL.
5304
5305When created, a shader object's `GL_SHADER_TYPE' parameter is set to
5306either `GL_VERTEX_SHADER' or `GL_FRAGMENT_SHADER', depending on the
5307value of SHADERTYPE.
5308
5309This function returns 0 if an error occurs creating the shader object.
5310
5311`GL_INVALID_ENUM' is generated if SHADERTYPE is not an accepted value.
5312
5313`GL_INVALID_OPERATION' is generated if `glCreateShader' is executed
5314between the execution of `glBegin' and the corresponding execution of
5315`glEnd'.")
8925f36f 5316
25072f02 5317(define-gl-procedures
bb894c9d 5318 ((glCullFace (mode GLenum) -> void))
3c9b6116
AW
5319 "Specify whether front- or back-facing facets can be culled.
5320
5321MODE
5322 Specifies whether front- or back-facing facets are candidates for
5323 culling. Symbolic constants `GL_FRONT', `GL_BACK', and
5324 `GL_FRONT_AND_BACK' are accepted. The initial value is `GL_BACK'.
5325
5326`glCullFace' specifies whether front- or back-facing facets are culled
5327(as specified by MODE) when facet culling is enabled. Facet culling is
5328initially disabled. To enable and disable facet culling, call the
5329`glEnable' and `glDisable' commands with the argument `GL_CULL_FACE'.
5330Facets include triangles, quadrilaterals, polygons, and rectangles.
5331
5332`glFrontFace' specifies which of the clockwise and counterclockwise
5333facets are front-facing and back-facing. See `glFrontFace'.
5334
5335`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5336
5337`GL_INVALID_OPERATION' is generated if `glCullFace' is executed between
5338the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5339
25072f02 5340(define-gl-procedures
00239761
AW
5341 ((glDeleteBuffers
5342 (n GLsizei)
5343 (buffers const-GLuint-*)
5344 ->
5345 void))
3c9b6116
AW
5346 "Delete named buffer objects.
5347
5348N
5349 Specifies the number of buffer objects to be deleted.
5350
5351BUFFERS
5352 Specifies an array of buffer objects to be deleted.
5353
5354`glDeleteBuffers' deletes N buffer objects named by the elements of the
5355array BUFFERS. After a buffer object is deleted, it has no contents, and
5356its name is free for reuse (for example by `glGenBuffers'). If a buffer
5357object that is currently bound is deleted, the binding reverts to 0 (the
5358absence of any buffer object, which reverts to client memory usage).
5359
5360`glDeleteBuffers' silently ignores 0's and names that do not correspond
5361to existing buffer objects.
5362
5363`GL_INVALID_VALUE' is generated if N is negative.
5364
5365`GL_INVALID_OPERATION' is generated if `glDeleteBuffers' is executed
5366between the execution of `glBegin' and the corresponding execution of
5367`glEnd'.")
8925f36f 5368
25072f02 5369(define-gl-procedures
bb894c9d
AW
5370 ((glDeleteLists
5371 (list GLuint)
5372 (range GLsizei)
5373 ->
5374 void))
3c9b6116
AW
5375 "Delete a contiguous group of display lists.
5376
5377LIST
5378 Specifies the integer name of the first display list to delete.
5379
5380RANGE
5381 Specifies the number of display lists to delete.
5382
5383`glDeleteLists' causes a contiguous group of display lists to be
5384deleted. LIST is the name of the first display list to be deleted, and
5385RANGE is the number of display lists to delete. All display lists D with
5386LIST<=D<=LIST+RANGE-1 are deleted.
5387
5388All storage locations allocated to the specified display lists are
5389freed, and the names are available for reuse at a later time. Names
5390within the range that do not have an associated display list are
5391ignored. If RANGE is 0, nothing happens.
5392
5393`GL_INVALID_VALUE' is generated if RANGE is negative.
5394
5395`GL_INVALID_OPERATION' is generated if `glDeleteLists' is executed
5396between the execution of `glBegin' and the corresponding execution of
5397`glEnd'.")
8925f36f 5398
25072f02 5399(define-gl-procedures
bb894c9d 5400 ((glDeleteProgram (program GLuint) -> void))
3c9b6116
AW
5401 "Deletes a program object.
5402
5403PROGRAM
5404 Specifies the program object to be deleted.
5405
5406`glDeleteProgram' frees the memory and invalidates the name associated
5407with the program object specified by PROGRAM. This command effectively
5408undoes the effects of a call to `glCreateProgram'.
5409
5410If a program object is in use as part of current rendering state, it
5411will be flagged for deletion, but it will not be deleted until it is no
5412longer part of current state for any rendering context. If a program
5413object to be deleted has shader objects attached to it, those shader
5414objects will be automatically detached but not deleted unless they have
5415already been flagged for deletion by a previous call to
5416`glDeleteShader'. A value of 0 for PROGRAM will be silently ignored.
5417
5418To determine whether a program object has been flagged for deletion,
5419call `glGetProgram' with arguments PROGRAM and `GL_DELETE_STATUS'.
5420
5421`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
5422OpenGL.
5423
5424`GL_INVALID_OPERATION' is generated if `glDeleteProgram' is executed
5425between the execution of `glBegin' and the corresponding execution of
5426`glEnd'.")
8925f36f 5427
25072f02 5428(define-gl-procedures
00239761
AW
5429 ((glDeleteQueries
5430 (n GLsizei)
5431 (ids const-GLuint-*)
5432 ->
5433 void))
3c9b6116
AW
5434 "Delete named query objects.
5435
5436N
5437 Specifies the number of query objects to be deleted.
5438
5439IDS
5440 Specifies an array of query objects to be deleted.
5441
5442`glDeleteQueries' deletes N query objects named by the elements of the
5443array IDS. After a query object is deleted, it has no contents, and its
5444name is free for reuse (for example by `glGenQueries').
5445
5446`glDeleteQueries' silently ignores 0's and names that do not correspond
5447to existing query objects.
5448
5449`GL_INVALID_VALUE' is generated if N is negative.
5450
5451`GL_INVALID_OPERATION' is generated if `glDeleteQueries' is executed
5452between the execution of `glBegin' and the corresponding execution of
5453`glEnd'.")
8925f36f 5454
25072f02 5455(define-gl-procedures
bb894c9d 5456 ((glDeleteShader (shader GLuint) -> void))
3c9b6116
AW
5457 "Deletes a shader object.
5458
5459SHADER
5460 Specifies the shader object to be deleted.
5461
5462`glDeleteShader' frees the memory and invalidates the name associated
5463with the shader object specified by SHADER. This command effectively
5464undoes the effects of a call to `glCreateShader'.
5465
5466If a shader object to be deleted is attached to a program object, it
5467will be flagged for deletion, but it will not be deleted until it is no
5468longer attached to any program object, for any rendering context (i.e.,
5469it must be detached from wherever it was attached before it will be
5470deleted). A value of 0 for SHADER will be silently ignored.
5471
5472To determine whether an object has been flagged for deletion, call
5473`glGetShader' with arguments SHADER and `GL_DELETE_STATUS'.
5474
5475`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
5476OpenGL.
5477
5478`GL_INVALID_OPERATION' is generated if `glDeleteShader' is executed
5479between the execution of `glBegin' and the corresponding execution of
5480`glEnd'.")
8925f36f 5481
25072f02 5482(define-gl-procedures
bb894c9d
AW
5483 ((glDeleteTextures
5484 (n GLsizei)
00239761 5485 (textures const-GLuint-*)
bb894c9d
AW
5486 ->
5487 void))
3c9b6116
AW
5488 "Delete named textures.
5489
5490N
5491 Specifies the number of textures to be deleted.
5492
5493TEXTURES
5494 Specifies an array of textures to be deleted.
5495
5496`glDeleteTextures' deletes N textures named by the elements of the array
5497TEXTURES. After a texture is deleted, it has no contents or
5498dimensionality, and its name is free for reuse (for example by
5499`glGenTextures'). If a texture that is currently bound is deleted, the
5500binding reverts to 0 (the default texture).
5501
5502`glDeleteTextures' silently ignores 0's and names that do not correspond
5503to existing textures.
5504
5505`GL_INVALID_VALUE' is generated if N is negative.
5506
5507`GL_INVALID_OPERATION' is generated if `glDeleteTextures' is executed
5508between the execution of `glBegin' and the corresponding execution of
5509`glEnd'.")
8925f36f 5510
25072f02 5511(define-gl-procedures
bb894c9d 5512 ((glDepthFunc (func GLenum) -> void))
3c9b6116
AW
5513 "Specify the value used for depth buffer comparisons.
5514
5515FUNC
5516 Specifies the depth comparison function. Symbolic constants
5517 `GL_NEVER', `GL_LESS', `GL_EQUAL', `GL_LEQUAL', `GL_GREATER',
5518 `GL_NOTEQUAL', `GL_GEQUAL', and `GL_ALWAYS' are accepted. The
5519 initial value is `GL_LESS'.
5520
5521`glDepthFunc' specifies the function used to compare each incoming pixel
5522depth value with the depth value present in the depth buffer. The
5523comparison is performed only if depth testing is enabled. (See
5524`glEnable' and `glDisable' of `GL_DEPTH_TEST'.)
5525
5526FUNC specifies the conditions under which the pixel will be drawn. The
5527comparison functions are as follows:
5528
5529`GL_NEVER'
5530 Never passes.
5531
5532`GL_LESS'
5533 Passes if the incoming depth value is less than the stored depth
5534 value.
5535
5536`GL_EQUAL'
5537 Passes if the incoming depth value is equal to the stored depth
5538 value.
5539
5540`GL_LEQUAL'
5541 Passes if the incoming depth value is less than or equal to the
5542 stored depth value.
5543
5544`GL_GREATER'
5545 Passes if the incoming depth value is greater than the stored depth
5546 value.
5547
5548`GL_NOTEQUAL'
5549 Passes if the incoming depth value is not equal to the stored depth
5550 value.
5551
5552`GL_GEQUAL'
5553 Passes if the incoming depth value is greater than or equal to the
5554 stored depth value.
5555
5556`GL_ALWAYS'
5557 Always passes.
5558
5559The initial value of FUNC is `GL_LESS'. Initially, depth testing is
5560disabled. If depth testing is disabled or if no depth buffer exists, it
5561is as if the depth test always passes.
5562
5563`GL_INVALID_ENUM' is generated if FUNC is not an accepted value.
5564
5565`GL_INVALID_OPERATION' is generated if `glDepthFunc' is executed between
5566the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5567
25072f02 5568(define-gl-procedures
bb894c9d 5569 ((glDepthMask (flag GLboolean) -> void))
3c9b6116
AW
5570 "Enable or disable writing into the depth buffer.
5571
5572FLAG
5573 Specifies whether the depth buffer is enabled for writing. If FLAG
5574 is `GL_FALSE', depth buffer writing is disabled. Otherwise, it is
5575 enabled. Initially, depth buffer writing is enabled.
5576
5577`glDepthMask' specifies whether the depth buffer is enabled for writing.
5578If FLAG is `GL_FALSE', depth buffer writing is disabled. Otherwise, it
5579is enabled. Initially, depth buffer writing is enabled.
5580
5581`GL_INVALID_OPERATION' is generated if `glDepthMask' is executed between
5582the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 5583
25072f02 5584(define-gl-procedures
bb894c9d
AW
5585 ((glDepthRange
5586 (nearVal GLclampd)
5587 (farVal GLclampd)
5588 ->
5589 void))
3c9b6116
AW
5590 "Specify mapping of depth values from normalized device coordinates to
5591window coordinates.
5592
5593NEARVAL
5594 Specifies the mapping of the near clipping plane to window
5595 coordinates. The initial value is 0.
5596
5597FARVAL
5598 Specifies the mapping of the far clipping plane to window
5599 coordinates. The initial value is 1.
5600
5601After clipping and division by W, depth coordinates range from -1 to 1,
5602corresponding to the near and far clipping planes. `glDepthRange'
5603specifies a linear mapping of the normalized depth coordinates in this
5604range to window depth coordinates. Regardless of the actual depth buffer
5605implementation, window coordinate depth values are treated as though
5606they range from 0 through 1 (like color components). Thus, the values
5607accepted by `glDepthRange' are both clamped to this range before they
5608are accepted.
5609
5610The setting of (0,1) maps the near plane to 0 and the far plane to 1.
5611With this mapping, the depth buffer range is fully utilized.
5612
5613`GL_INVALID_OPERATION' is generated if `glDepthRange' is executed
5614between the execution of `glBegin' and the corresponding execution of
5615`glEnd'.")
8925f36f 5616
25072f02 5617(define-gl-procedures
bb894c9d
AW
5618 ((glDetachShader
5619 (program GLuint)
5620 (shader GLuint)
5621 ->
5622 void))
3c9b6116
AW
5623 "Detaches a shader object from a program object to which it is attached.
5624
5625PROGRAM
5626 Specifies the program object from which to detach the shader
5627 object.
5628
5629SHADER
5630 Specifies the shader object to be detached.
5631
5632`glDetachShader' detaches the shader object specified by SHADER from the
5633program object specified by PROGRAM. This command can be used to undo
5634the effect of the command `glAttachShader'.
5635
5636If SHADER has already been flagged for deletion by a call to
5637`glDeleteShader' and it is not attached to any other program object, it
5638will be deleted after it has been detached.
5639
5640`GL_INVALID_VALUE' is generated if either PROGRAM or SHADER is a value
5641that was not generated by OpenGL.
5642
5643`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
5644
5645`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
5646
5647`GL_INVALID_OPERATION' is generated if SHADER is not attached to
5648PROGRAM.
5649
5650`GL_INVALID_OPERATION' is generated if `glDetachShader' is executed
5651between the execution of `glBegin' and the corresponding execution of
5652`glEnd'.")
8925f36f 5653
25072f02 5654(define-gl-procedures
bb894c9d
AW
5655 ((glDrawArrays
5656 (mode GLenum)
5657 (first GLint)
5658 (count GLsizei)
5659 ->
5660 void))
3c9b6116
AW
5661 "Render primitives from array data.
5662
5663MODE
5664 Specifies what kind of primitives to render. Symbolic constants
5665 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5666 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5667 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5668
5669FIRST
5670 Specifies the starting index in the enabled arrays.
5671
5672COUNT
5673 Specifies the number of indices to be rendered.
5674
5675`glDrawArrays' specifies multiple geometric primitives with very few
5676subroutine calls. Instead of calling a GL procedure to pass each
5677individual vertex, normal, texture coordinate, edge flag, or color, you
5678can prespecify separate arrays of vertices, normals, and colors and use
5679them to construct a sequence of primitives with a single call to
5680`glDrawArrays'.
5681
5682When `glDrawArrays' is called, it uses COUNT sequential elements from
5683each enabled array to construct a sequence of geometric primitives,
5684beginning with element FIRST. MODE specifies what kind of primitives are
5685constructed and how the array elements construct those primitives. If
5686`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
5687
5688Vertex attributes that are modified by `glDrawArrays' have an
5689unspecified value after `glDrawArrays' returns. For example, if
5690`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5691after `glDrawArrays' executes. Attributes that aren't modified remain
5692well defined.
5693
5694`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5695
5696`GL_INVALID_VALUE' is generated if COUNT is negative.
5697
5698`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5699bound to an enabled array and the buffer object's data store is
5700currently mapped.
5701
5702`GL_INVALID_OPERATION' is generated if `glDrawArrays' is executed
5703between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5704
25072f02 5705(define-gl-procedures
00239761
AW
5706 ((glDrawBuffers
5707 (n GLsizei)
5708 (bufs const-GLenum-*)
5709 ->
5710 void))
3c9b6116
AW
5711 "Specifies a list of color buffers to be drawn into.
5712
5713N
5714 Specifies the number of buffers in BUFS.
5715
5716BUFS
5717 Points to an array of symbolic constants specifying the buffers
5718 into which fragment colors or data values will be written.
5719
5720`glDrawBuffers' defines an array of buffers into which fragment color
5721values or fragment data will be written. If no fragment shader is
5722active, rendering operations will generate only one fragment color per
5723fragment and it will be written into each of the buffers specified by
5724BUFS. If a fragment shader is active and it writes a value to the output
5725variable `gl_FragColor', then that value will be written into each of
5726the buffers specified by BUFS. If a fragment shader is active and it
5727writes a value to one or more elements of the output array variable
5728`gl_FragData[]', then the value of `gl_FragData[0] ' will be written
5729into the first buffer specified by BUFS, the value of `gl_FragData[1] '
5730will be written into the second buffer specified by BUFS, and so on up
5731to `gl_FragData[n-1]'. The draw buffer used for `gl_FragData[n]' and
5732beyond is implicitly set to be `GL_NONE'.
5733
5734The symbolic constants contained in BUFS may be any of the following:
5735
5736`GL_NONE'
5737 The fragment color/data value is not written into any color buffer.
5738
5739`GL_FRONT_LEFT'
5740 The fragment color/data value is written into the front left color
5741 buffer.
5742
5743`GL_FRONT_RIGHT'
5744 The fragment color/data value is written into the front right color
5745 buffer.
5746
5747`GL_BACK_LEFT'
5748 The fragment color/data value is written into the back left color
5749 buffer.
5750
5751`GL_BACK_RIGHT'
5752 The fragment color/data value is written into the back right color
5753 buffer.
5754
5755`GL_AUXi'
5756 The fragment color/data value is written into auxiliary buffer `i'.
5757
5758Except for `GL_NONE', the preceding symbolic constants may not appear
5759more than once in BUFS. The maximum number of draw buffers supported is
5760implementation dependent and can be queried by calling `glGet' with the
5761argument `GL_MAX_DRAW_BUFFERS'. The number of auxiliary buffers can be
5762queried by calling `glGet' with the argument `GL_AUX_BUFFERS'.
5763
5764`GL_INVALID_ENUM' is generated if one of the values in BUFS is not an
5765accepted value.
5766
5767`GL_INVALID_ENUM' is generated if N is less than 0.
5768
5769`GL_INVALID_OPERATION' is generated if a symbolic constant other than
5770`GL_NONE' appears more than once in BUFS.
5771
5772`GL_INVALID_OPERATION' is generated if any of the entries in BUFS (other
5773than `GL_NONE' ) indicates a color buffer that does not exist in the
5774current GL context.
5775
5776`GL_INVALID_VALUE' is generated if N is greater than
5777`GL_MAX_DRAW_BUFFERS'.
5778
5779`GL_INVALID_OPERATION' is generated if `glDrawBuffers' is executed
5780between the execution of `glBegin' and the corresponding execution of
5781`glEnd'.")
8925f36f 5782
25072f02 5783(define-gl-procedures
bb894c9d 5784 ((glDrawBuffer (mode GLenum) -> void))
3c9b6116
AW
5785 "Specify which color buffers are to be drawn into.
5786
5787MODE
5788 Specifies up to four color buffers to be drawn into. Symbolic
5789 constants `GL_NONE', `GL_FRONT_LEFT', `GL_FRONT_RIGHT',
5790 `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT', `GL_BACK', `GL_LEFT',
5791 `GL_RIGHT', `GL_FRONT_AND_BACK', and `GL_AUX'I, where I is between
5792 0 and the value of `GL_AUX_BUFFERS' minus 1, are accepted.
5793 (`GL_AUX_BUFFERS' is not the upper limit; use `glGet' to query the
5794 number of available aux buffers.) The initial value is `GL_FRONT'
5795 for single-buffered contexts, and `GL_BACK' for double-buffered
5796 contexts.
5797
5798When colors are written to the frame buffer, they are written into the
5799color buffers specified by `glDrawBuffer'. The specifications are as
5800follows:
5801
5802`GL_NONE'
5803 No color buffers are written.
5804
5805`GL_FRONT_LEFT'
5806 Only the front left color buffer is written.
5807
5808`GL_FRONT_RIGHT'
5809 Only the front right color buffer is written.
5810
5811`GL_BACK_LEFT'
5812 Only the back left color buffer is written.
5813
5814`GL_BACK_RIGHT'
5815 Only the back right color buffer is written.
5816
5817`GL_FRONT'
5818 Only the front left and front right color buffers are written. If
5819 there is no front right color buffer, only the front left color
5820 buffer is written.
5821
5822`GL_BACK'
5823 Only the back left and back right color buffers are written. If
5824 there is no back right color buffer, only the back left color
5825 buffer is written.
5826
5827`GL_LEFT'
5828 Only the front left and back left color buffers are written. If
5829 there is no back left color buffer, only the front left color
5830 buffer is written.
5831
5832`GL_RIGHT'
5833 Only the front right and back right color buffers are written. If
5834 there is no back right color buffer, only the front right color
5835 buffer is written.
5836
5837`GL_FRONT_AND_BACK'
5838 All the front and back color buffers (front left, front right, back
5839 left, back right) are written. If there are no back color buffers,
5840 only the front left and front right color buffers are written. If
5841 there are no right color buffers, only the front left and back left
5842 color buffers are written. If there are no right or back color
5843 buffers, only the front left color buffer is written.
5844
5845`GL_AUX'I
5846 Only auxiliary color buffer I is written.
5847
5848If more than one color buffer is selected for drawing, then blending or
5849logical operations are computed and applied independently for each color
5850buffer and can produce different results in each buffer.
5851
5852Monoscopic contexts include only LEFT buffers, and stereoscopic contexts
5853include both LEFT and RIGHT buffers. Likewise, single-buffered contexts
5854include only FRONT buffers, and double-buffered contexts include both
5855FRONT and BACK buffers. The context is selected at GL initialization.
5856
5857`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5858
5859`GL_INVALID_OPERATION' is generated if none of the buffers indicated by
5860MODE exists.
5861
5862`GL_INVALID_OPERATION' is generated if `glDrawBuffer' is executed
5863between the execution of `glBegin' and the corresponding execution of
5864`glEnd'.")
8925f36f 5865
25072f02 5866(define-gl-procedures
bb894c9d
AW
5867 ((glDrawElements
5868 (mode GLenum)
5869 (count GLsizei)
5870 (type GLenum)
00239761 5871 (indices const-GLvoid-*)
bb894c9d
AW
5872 ->
5873 void))
3c9b6116
AW
5874 "Render primitives from array data.
5875
5876MODE
5877 Specifies what kind of primitives to render. Symbolic constants
5878 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
5879 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
5880 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
5881
5882COUNT
5883 Specifies the number of elements to be rendered.
5884
5885TYPE
5886 Specifies the type of the values in INDICES. Must be one of
5887 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
5888
5889INDICES
5890 Specifies a pointer to the location where the indices are stored.
5891
5892`glDrawElements' specifies multiple geometric primitives with very few
5893subroutine calls. Instead of calling a GL function to pass each
5894individual vertex, normal, texture coordinate, edge flag, or color, you
5895can prespecify separate arrays of vertices, normals, and so on, and use
5896them to construct a sequence of primitives with a single call to
5897`glDrawElements'.
5898
5899When `glDrawElements' is called, it uses COUNT sequential elements from
5900an enabled array, starting at INDICES to construct a sequence of
5901geometric primitives. MODE specifies what kind of primitives are
5902constructed and how the array elements construct these primitives. If
5903more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
5904not enabled, no geometric primitives are constructed.
5905
5906Vertex attributes that are modified by `glDrawElements' have an
5907unspecified value after `glDrawElements' returns. For example, if
5908`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
5909after `glDrawElements' executes. Attributes that aren't modified
5910maintain their previous values.
5911
5912`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
5913
5914`GL_INVALID_VALUE' is generated if COUNT is negative.
5915
5916`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
5917bound to an enabled array or the element array and the buffer object's
5918data store is currently mapped.
5919
5920`GL_INVALID_OPERATION' is generated if `glDrawElements' is executed
5921between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 5922
25072f02 5923(define-gl-procedures
bb894c9d
AW
5924 ((glDrawPixels
5925 (width GLsizei)
5926 (height GLsizei)
5927 (format GLenum)
5928 (type GLenum)
00239761 5929 (data const-GLvoid-*)
bb894c9d
AW
5930 ->
5931 void))
3c9b6116 5932 "Write a block of pixels to the frame buffer.
8925f36f 5933
3c9b6116
AW
5934WIDTH
5935 HEIGHT
8925f36f 5936
3c9b6116
AW
5937 Specify the dimensions of the pixel rectangle to be written into
5938 the frame buffer.
8925f36f 5939
3c9b6116
AW
5940FORMAT
5941 Specifies the format of the pixel data. Symbolic constants
5942 `GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT',
5943 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_RED', `GL_GREEN',
5944 `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA' are
5945 accepted.
8925f36f 5946
3c9b6116
AW
5947TYPE
5948 Specifies the data type for DATA. Symbolic constants
5949 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
5950 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
5951 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
5952 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
5953 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5954 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
5955 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
5956 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
5957 are accepted.
8925f36f 5958
3c9b6116
AW
5959DATA
5960 Specifies a pointer to the pixel data.
8925f36f 5961
3c9b6116
AW
5962`glDrawPixels' reads pixel data from memory and writes it into the frame
5963buffer relative to the current raster position, provided that the raster
5964position is valid. Use `glRasterPos' or `glWindowPos' to set the current
5965raster position; use `glGet' with argument
5966`GL_CURRENT_RASTER_POSITION_VALID' to determine if the specified raster
5967position is valid, and `glGet' with argument
5968`GL_CURRENT_RASTER_POSITION' to query the raster position.
8925f36f 5969
3c9b6116
AW
5970Several parameters define the encoding of pixel data in memory and
5971control the processing of the pixel data before it is placed in the
5972frame buffer. These parameters are set with four commands:
5973`glPixelStore', `glPixelTransfer', `glPixelMap', and `glPixelZoom'. This
5974reference page describes the effects on `glDrawPixels' of many, but not
5975all, of the parameters specified by these four commands.
8925f36f 5976
3c9b6116
AW
5977Data is read from DATA as a sequence of signed or unsigned bytes, signed
5978or unsigned shorts, signed or unsigned integers, or single-precision
5979floating-point values, depending on TYPE. When TYPE is one of
5980`GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
5981`GL_UNSIGNED_INT', `GL_INT', or `GL_FLOAT' each of these bytes, shorts,
5982integers, or floating-point values is interpreted as one color or depth
5983component, or one index, depending on FORMAT. When TYPE is one of
5984`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_SHORT_5_6_5',
5985`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_5_5_5_1',
5986`GL_UNSIGNED_INT_8_8_8_8', or `GL_UNSIGNED_INT_10_10_10_2', each
5987unsigned value is interpreted as containing all the components for a
5988single pixel, with the color components arranged according to FORMAT.
5989When TYPE is one of `GL_UNSIGNED_BYTE_2_3_3_REV',
5990`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
5991`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8_REV', or
5992`GL_UNSIGNED_INT_2_10_10_10_REV', each unsigned value is interpreted as
5993containing all color components, specified by FORMAT, for a single pixel
5994in a reversed order. Indices are always treated individually. Color
5995components are treated as groups of one, two, three, or four values,
5996again based on FORMAT. Both individual indices and groups of components
5997are referred to as pixels. If TYPE is `GL_BITMAP', the data must be
5998unsigned bytes, and FORMAT must be either `GL_COLOR_INDEX' or
5999`GL_STENCIL_INDEX'. Each unsigned byte is treated as eight 1-bit pixels,
6000with bit ordering determined by `GL_UNPACK_LSB_FIRST' (see
6001`glPixelStore').
8925f36f 6002
3c9b6116
AW
6003WIDTH×HEIGHT pixels are read from memory, starting at location DATA. By
6004default, these pixels are taken from adjacent memory locations, except
6005that after all WIDTH pixels are read, the read pointer is advanced to
6006the next four-byte boundary. The four-byte row alignment is specified by
6007`glPixelStore' with argument `GL_UNPACK_ALIGNMENT', and it can be set to
6008one, two, four, or eight bytes. Other pixel store parameters specify
6009different read pointer advancements, both before the first pixel is read
6010and after all WIDTH pixels are read. See the `glPixelStore' reference
6011page for details on these options.
6012
6013If a non-zero named buffer object is bound to the
6014`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a block of
6015pixels is specified, DATA is treated as a byte offset into the buffer
6016object's data store.
6017
6018The WIDTH×HEIGHT pixels that are read from memory are each operated on
6019in the same way, based on the values of several parameters specified by
6020`glPixelTransfer' and `glPixelMap'. The details of these operations, as
6021well as the target buffer into which the pixels are drawn, are specific
6022to the format of the pixels, as specified by FORMAT. FORMAT can assume
6023one of 13 symbolic values:
6024
6025`GL_COLOR_INDEX'
6026 Each pixel is a single value, a color index. It is converted to
6027 fixed-point format, with an unspecified number of bits to the right
6028 of the binary point, regardless of the memory data type.
6029 Floating-point values convert to true fixed-point values. Signed
6030 and unsigned integer data is converted with all fraction bits set
6031 to 0. Bitmap data convert to either 0 or 1.
6032
6033 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
6034 bits and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
6035 negative, the shift is to the right. In either case, zero bits fill
6036 otherwise unspecified bit locations in the result.
6037
6038 If the GL is in RGBA mode, the resulting index is converted to an
6039 RGBA pixel with the help of the `GL_PIXEL_MAP_I_TO_R',
6040 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
6041 `GL_PIXEL_MAP_I_TO_A' tables. If the GL is in color index mode, and
6042 if `GL_MAP_COLOR' is true, the index is replaced with the value
6043 that it references in lookup table `GL_PIXEL_MAP_I_TO_I'. Whether
6044 the lookup replacement of the index is done or not, the integer
6045 part of the index is then ANDed with 2^B-1 , where B is the number
6046 of bits in a color index buffer.
6047
6048 The GL then converts the resulting indices or RGBA colors to
6049 fragments by attaching the current raster position Z coordinate and
6050 texture coordinates to each pixel, then assigning X and Y window
6051 coordinates to the N th fragment such that X_N=X_R+N%WIDTH
6052 Y_N=Y_R+⌊N/WIDTH,⌋
6053
6054 where (X_R,Y_R) is the current raster position. These pixel
6055 fragments are then treated just like the fragments generated by
6056 rasterizing points, lines, or polygons. Texture mapping, fog, and
6057 all the fragment operations are applied before the fragments are
6058 written to the frame buffer.
6059
6060`GL_STENCIL_INDEX'
6061 Each pixel is a single value, a stencil index. It is converted to
6062 fixed-point format, with an unspecified number of bits to the right
6063 of the binary point, regardless of the memory data type.
6064 Floating-point values convert to true fixed-point values. Signed
6065 and unsigned integer data is converted with all fraction bits set
6066 to 0. Bitmap data convert to either 0 or 1.
6067
6068 Each fixed-point index is then shifted left by `GL_INDEX_SHIFT'
6069 bits, and added to `GL_INDEX_OFFSET'. If `GL_INDEX_SHIFT' is
6070 negative, the shift is to the right. In either case, zero bits fill
6071 otherwise unspecified bit locations in the result. If
6072 `GL_MAP_STENCIL' is true, the index is replaced with the value that
6073 it references in lookup table `GL_PIXEL_MAP_S_TO_S'. Whether the
6074 lookup replacement of the index is done or not, the integer part of
6075 the index is then ANDed with 2^B-1 , where B is the number of bits
6076 in the stencil buffer. The resulting stencil indices are then
6077 written to the stencil buffer such that the N th index is written
6078 to location
6079
6080 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
6081
6082 where (X_R,Y_R) is the current raster position. Only the pixel
6083 ownership test, the scissor test, and the stencil writemask affect
6084 these write operations.
6085
6086`GL_DEPTH_COMPONENT'
6087 Each pixel is a single-depth component. Floating-point data is
6088 converted directly to an internal floating-point format with
6089 unspecified precision. Signed integer data is mapped linearly to
6090 the internal floating-point format such that the most positive
6091 representable integer value maps to 1.0, and the most negative
6092 representable value maps to -1.0 . Unsigned integer data is mapped
6093 similarly: the largest integer value maps to 1.0, and 0 maps to
6094 0.0. The resulting floating-point depth value is then multiplied by
6095 `GL_DEPTH_SCALE' and added to `GL_DEPTH_BIAS'. The result is
6096 clamped to the range [0,1] .
6097
6098 The GL then converts the resulting depth components to fragments by
6099 attaching the current raster position color or color index and
6100 texture coordinates to each pixel, then assigning X and Y window
6101 coordinates to the N th fragment such that
6102
6103 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
6104
6105 where (X_R,Y_R) is the current raster position. These pixel
6106 fragments are then treated just like the fragments generated by
6107 rasterizing points, lines, or polygons. Texture mapping, fog, and
6108 all the fragment operations are applied before the fragments are
6109 written to the frame buffer.
6110
6111`GL_RGBA'
6112`GL_BGRA'
6113 Each pixel is a four-component group: For `GL_RGBA', the red
6114 component is first, followed by green, followed by blue, followed
6115 by alpha; for `GL_BGRA' the order is blue, green, red and then
6116 alpha. Floating-point values are converted directly to an internal
6117 floating-point format with unspecified precision. Signed integer
6118 values are mapped linearly to the internal floating-point format
6119 such that the most positive representable integer value maps to
6120 1.0, and the most negative representable value maps to -1.0 . (Note
6121 that this mapping does not convert 0 precisely to 0.0.) Unsigned
6122 integer data is mapped similarly: The largest integer value maps to
6123 1.0, and 0 maps to 0.0. The resulting floating-point color values
6124 are then multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where
6125 C is RED, GREEN, BLUE, and ALPHA for the respective color
6126 components. The results are clamped to the range [0,1] .
6127
6128 If `GL_MAP_COLOR' is true, each color component is scaled by the
6129 size of lookup table `GL_PIXEL_MAP_c_TO_c', then replaced by the
6130 value that it references in that table. C is R, G, B, or A
6131 respectively.
6132
6133 The GL then converts the resulting RGBA colors to fragments by
6134 attaching the current raster position Z coordinate and texture
6135 coordinates to each pixel, then assigning X and Y window
6136 coordinates to the N th fragment such that
6137
6138 X_N=X_R+N%WIDTH Y_N=Y_R+⌊N/WIDTH,⌋
6139
6140 where (X_R,Y_R) is the current raster position. These pixel
6141 fragments are then treated just like the fragments generated by
6142 rasterizing points, lines, or polygons. Texture mapping, fog, and
6143 all the fragment operations are applied before the fragments are
6144 written to the frame buffer.
6145
6146`GL_RED'
6147 Each pixel is a single red component. This component is converted
6148 to the internal floating-point format in the same way the red
6149 component of an RGBA pixel is. It is then converted to an RGBA
6150 pixel with green and blue set to 0, and alpha set to 1. After this
6151 conversion, the pixel is treated as if it had been read as an RGBA
6152 pixel.
6153
6154`GL_GREEN'
6155 Each pixel is a single green component. This component is converted
6156 to the internal floating-point format in the same way the green
6157 component of an RGBA pixel is. It is then converted to an RGBA
6158 pixel with red and blue set to 0, and alpha set to 1. After this
6159 conversion, the pixel is treated as if it had been read as an RGBA
6160 pixel.
6161
6162`GL_BLUE'
6163 Each pixel is a single blue component. This component is converted
6164 to the internal floating-point format in the same way the blue
6165 component of an RGBA pixel is. It is then converted to an RGBA
6166 pixel with red and green set to 0, and alpha set to 1. After this
6167 conversion, the pixel is treated as if it had been read as an RGBA
6168 pixel.
6169
6170`GL_ALPHA'
6171 Each pixel is a single alpha component. This component is converted
6172 to the internal floating-point format in the same way the alpha
6173 component of an RGBA pixel is. It is then converted to an RGBA
6174 pixel with red, green, and blue set to 0. After this conversion,
6175 the pixel is treated as if it had been read as an RGBA pixel.
6176
6177`GL_RGB'
6178`GL_BGR'
6179 Each pixel is a three-component group: red first, followed by
6180 green, followed by blue; for `GL_BGR', the first component is blue,
6181 followed by green and then red. Each component is converted to the
6182 internal floating-point format in the same way the red, green, and
6183 blue components of an RGBA pixel are. The color triple is converted
6184 to an RGBA pixel with alpha set to 1. After this conversion, the
6185 pixel is treated as if it had been read as an RGBA pixel.
6186
6187`GL_LUMINANCE'
6188 Each pixel is a single luminance component. This component is
6189 converted to the internal floating-point format in the same way the
6190 red component of an RGBA pixel is. It is then converted to an RGBA
6191 pixel with red, green, and blue set to the converted luminance
6192 value, and alpha set to 1. After this conversion, the pixel is
6193 treated as if it had been read as an RGBA pixel.
6194
6195`GL_LUMINANCE_ALPHA'
6196 Each pixel is a two-component group: luminance first, followed by
6197 alpha. The two components are converted to the internal
6198 floating-point format in the same way the red component of an RGBA
6199 pixel is. They are then converted to an RGBA pixel with red, green,
6200 and blue set to the converted luminance value, and alpha set to the
6201 converted alpha value. After this conversion, the pixel is treated
6202 as if it had been read as an RGBA pixel.
6203
6204The following table summarizes the meaning of the valid constants for
6205the TYPE parameter:
6206
6207
6208
6209*Type*
6210 *Corresponding Type*
6211
6212`GL_UNSIGNED_BYTE'
6213 unsigned 8-bit integer
6214
6215`GL_BYTE'
6216 signed 8-bit integer
6217
6218`GL_BITMAP'
6219 single bits in unsigned 8-bit integers
6220
6221`GL_UNSIGNED_SHORT'
6222 unsigned 16-bit integer
6223
6224`GL_SHORT'
6225 signed 16-bit integer
6226
6227`GL_UNSIGNED_INT'
6228 unsigned 32-bit integer
6229
6230`GL_INT'
6231 32-bit integer
6232
6233`GL_FLOAT'
6234 single-precision floating-point
6235
6236`GL_UNSIGNED_BYTE_3_3_2'
6237 unsigned 8-bit integer
6238
6239`GL_UNSIGNED_BYTE_2_3_3_REV'
6240 unsigned 8-bit integer with reversed component ordering
6241
6242`GL_UNSIGNED_SHORT_5_6_5'
6243 unsigned 16-bit integer
6244
6245`GL_UNSIGNED_SHORT_5_6_5_REV'
6246 unsigned 16-bit integer with reversed component ordering
6247
6248`GL_UNSIGNED_SHORT_4_4_4_4'
6249 unsigned 16-bit integer
6250
6251`GL_UNSIGNED_SHORT_4_4_4_4_REV'
6252 unsigned 16-bit integer with reversed component ordering
6253
6254`GL_UNSIGNED_SHORT_5_5_5_1'
6255 unsigned 16-bit integer
6256
6257`GL_UNSIGNED_SHORT_1_5_5_5_REV'
6258 unsigned 16-bit integer with reversed component ordering
6259
6260`GL_UNSIGNED_INT_8_8_8_8'
6261 unsigned 32-bit integer
6262
6263`GL_UNSIGNED_INT_8_8_8_8_REV'
6264 unsigned 32-bit integer with reversed component ordering
6265
6266`GL_UNSIGNED_INT_10_10_10_2'
6267 unsigned 32-bit integer
6268
6269`GL_UNSIGNED_INT_2_10_10_10_REV'
6270 unsigned 32-bit integer with reversed component ordering
6271
6272
6273
6274The rasterization described so far assumes pixel zoom factors of 1. If
6275`glPixelZoom' is used to change the X and Y pixel zoom factors, pixels
6276are converted to fragments as follows. If (X_R,Y_R) is the current
6277raster position, and a given pixel is in the N th column and M th row of
6278the pixel rectangle, then fragments are generated for pixels whose
6279centers are in the rectangle with corners at
6280
6281(X_R+ZOOM_X,\u2062N,Y_R+ZOOM_Y,\u2062M) (X_R+ZOOM_X,\u2061(N+1,),Y_R+ZOOM_Y,\u2061(M+1,))
6282
6283where ZOOM_X is the value of `GL_ZOOM_X' and ZOOM_Y is the value of
6284`GL_ZOOM_Y'.
6285
6286`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not one of the
6287accepted values.
6288
6289`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
6290either `GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
6291
6292`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
6293
6294`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
6295there is no stencil buffer.
6296
6297`GL_INVALID_OPERATION' is generated if FORMAT is `GL_RED', `GL_GREEN',
6298`GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_RGBA', `GL_BGR', `GL_BGRA',
6299`GL_LUMINANCE', or `GL_LUMINANCE_ALPHA', and the GL is in color index
6300mode.
6301
6302`GL_INVALID_OPERATION' is generated if FORMAT is one of
6303`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
6304`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
6305is not `GL_RGB'.
6306
6307`GL_INVALID_OPERATION' is generated if FORMAT is one of
6308`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
6309`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
6310`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
6311`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
6312FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
6313
6314`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6315bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
6316data store is currently mapped.
6317
6318`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6319bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
6320unpacked from the buffer object such that the memory reads required
6321would exceed the data store size.
6322
6323`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6324bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
6325divisible into the number of bytes needed to store in memory a datum
6326indicated by TYPE.
6327
6328`GL_INVALID_OPERATION' is generated if `glDrawPixels' is executed
6329between the execution of `glBegin' and the corresponding execution of
6330`glEnd'.")
8925f36f 6331
25072f02 6332(define-gl-procedures
bb894c9d
AW
6333 ((glDrawRangeElements
6334 (mode GLenum)
6335 (start GLuint)
6336 (end GLuint)
6337 (count GLsizei)
6338 (type GLenum)
00239761 6339 (indices const-GLvoid-*)
bb894c9d
AW
6340 ->
6341 void))
3c9b6116 6342 "Render primitives from array data.
8925f36f 6343
3c9b6116
AW
6344MODE
6345 Specifies what kind of primitives to render. Symbolic constants
6346 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
6347 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
6348 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
8925f36f 6349
3c9b6116
AW
6350START
6351 Specifies the minimum array index contained in INDICES.
6352
6353END
6354 Specifies the maximum array index contained in INDICES.
6355
6356COUNT
6357 Specifies the number of elements to be rendered.
6358
6359TYPE
6360 Specifies the type of the values in INDICES. Must be one of
6361 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
6362
6363INDICES
6364 Specifies a pointer to the location where the indices are stored.
6365
6366`glDrawRangeElements' is a restricted form of `glDrawElements'. MODE,
6367START, END, and COUNT match the corresponding arguments to
6368`glDrawElements', with the additional constraint that all values in the
6369arrays COUNT must lie between START and END, inclusive.
6370
6371Implementations denote recommended maximum amounts of vertex and index
6372data, which may be queried by calling `glGet' with argument
6373`GL_MAX_ELEMENTS_VERTICES' and `GL_MAX_ELEMENTS_INDICES'. If END-START+1
6374is greater than the value of `GL_MAX_ELEMENTS_VERTICES', or if COUNT is
6375greater than the value of `GL_MAX_ELEMENTS_INDICES', then the call may
6376operate at reduced performance. There is no requirement that all
6377vertices in the range [START,END] be referenced. However, the
6378implementation may partially process unused vertices, reducing
6379performance from what could be achieved with an optimal index set.
6380
6381When `glDrawRangeElements' is called, it uses COUNT sequential elements
6382from an enabled array, starting at START to construct a sequence of
6383geometric primitives. MODE specifies what kind of primitives are
6384constructed, and how the array elements construct these primitives. If
6385more than one array is enabled, each is used. If `GL_VERTEX_ARRAY' is
6386not enabled, no geometric primitives are constructed.
6387
6388Vertex attributes that are modified by `glDrawRangeElements' have an
6389unspecified value after `glDrawRangeElements' returns. For example, if
6390`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
6391after `glDrawRangeElements' executes. Attributes that aren't modified
6392maintain their previous values.
6393
6394It is an error for indices to lie outside the range [START,END] , but
6395implementations may not check for this situation. Such indices cause
6396implementation-dependent behavior.
6397
6398`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
6399
6400`GL_INVALID_VALUE' is generated if COUNT is negative.
6401
6402`GL_INVALID_VALUE' is generated if END<START .
6403
6404`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
6405bound to an enabled array or the element array and the buffer object's
6406data store is currently mapped.
6407
6408`GL_INVALID_OPERATION' is generated if `glDrawRangeElements' is executed
6409between the execution of `glBegin' and the corresponding `glEnd'.")
8925f36f 6410
25072f02 6411(define-gl-procedures
bb894c9d
AW
6412 ((glEdgeFlagPointer
6413 (stride GLsizei)
00239761 6414 (pointer const-GLvoid-*)
bb894c9d
AW
6415 ->
6416 void))
3c9b6116 6417 "Define an array of edge flags.
8925f36f 6418
3c9b6116
AW
6419STRIDE
6420 Specifies the byte offset between consecutive edge flags. If STRIDE
6421 is 0, the edge flags are understood to be tightly packed in the
6422 array. The initial value is 0.
8925f36f 6423
3c9b6116
AW
6424POINTER
6425 Specifies a pointer to the first edge flag in the array. The
6426 initial value is 0.
8925f36f 6427
3c9b6116
AW
6428`glEdgeFlagPointer' specifies the location and data format of an array
6429of boolean edge flags to use when rendering. STRIDE specifies the byte
6430stride from one edge flag to the next, allowing vertices and attributes
6431to be packed into a single array or stored in separate arrays.
8925f36f 6432
3c9b6116
AW
6433If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
6434target (see `glBindBuffer') while an edge flag array is specified,
6435POINTER is treated as a byte offset into the buffer object's data store.
6436Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
6437edge flag vertex array client-side state
6438(`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING').
8925f36f 6439
3c9b6116
AW
6440When an edge flag array is specified, STRIDE and POINTER are saved as
6441client-side state, in addition to the current vertex array buffer object
6442binding.
6443
6444To enable and disable the edge flag array, call `glEnableClientState'
6445and `glDisableClientState' with the argument `GL_EDGE_FLAG_ARRAY'. If
6446enabled, the edge flag array is used when `glDrawArrays',
6447`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
6448`glDrawRangeElements', or `glArrayElement' is called.
6449
6450`GL_INVALID_ENUM' is generated if STRIDE is negative.")
8925f36f 6451
25072f02 6452(define-gl-procedures
78aa45b9
DH
6453 ((glEdgeFlag (flag GLboolean) -> void)
6454 (glEdgeFlagv (flag const-GLboolean-*) -> void))
3c9b6116
AW
6455 "Flag edges as either boundary or nonboundary.
6456
6457FLAG
6458 Specifies the current edge flag value, either `GL_TRUE' or
6459 `GL_FALSE'. The initial value is `GL_TRUE'.
6460
6461Each vertex of a polygon, separate triangle, or separate quadrilateral
6462specified between a `glBegin'/`glEnd' pair is marked as the start of
6463either a boundary or nonboundary edge. If the current edge flag is true
6464when the vertex is specified, the vertex is marked as the start of a
6465boundary edge. Otherwise, the vertex is marked as the start of a
6466nonboundary edge. `glEdgeFlag' sets the edge flag bit to `GL_TRUE' if
6467FLAG is `GL_TRUE' and to `GL_FALSE' otherwise.
6468
6469The vertices of connected triangles and connected quadrilaterals are
6470always marked as boundary, regardless of the value of the edge flag.
6471
6472Boundary and nonboundary edge flags on vertices are significant only if
6473`GL_POLYGON_MODE' is set to `GL_POINT' or `GL_LINE'. See
6474`glPolygonMode'.")
8925f36f 6475
25072f02 6476(define-gl-procedures
bb894c9d
AW
6477 ((glEnableClientState (cap GLenum) -> void)
6478 (glDisableClientState (cap GLenum) -> void))
3c9b6116
AW
6479 "Enable or disable client-side capability.
6480
6481CAP
6482 Specifies the capability to enable. Symbolic constants
6483 `GL_COLOR_ARRAY', `GL_EDGE_FLAG_ARRAY', `GL_FOG_COORD_ARRAY',
6484 `GL_INDEX_ARRAY', `GL_NORMAL_ARRAY', `GL_SECONDARY_COLOR_ARRAY',
6485 `GL_TEXTURE_COORD_ARRAY', and `GL_VERTEX_ARRAY' are accepted.
6486
6487`glEnableClientState' and `glDisableClientState' enable or disable
6488individual client-side capabilities. By default, all client-side
6489capabilities are disabled. Both `glEnableClientState' and
6490`glDisableClientState' take a single argument, CAP, which can assume one
6491of the following values:
6492
6493`GL_COLOR_ARRAY'
6494 If enabled, the color array is enabled for writing and used during
6495 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6496 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6497 is called. See `glColorPointer'.
6498
6499`GL_EDGE_FLAG_ARRAY'
6500 If enabled, the edge flag array is enabled for writing and used
6501 during rendering when `glArrayElement', `glDrawArrays',
6502 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6503 `glMultiDrawElements' is called. See `glEdgeFlagPointer'.
6504
6505`GL_FOG_COORD_ARRAY'
6506 If enabled, the fog coordinate array is enabled for writing and
6507 used during rendering when `glArrayElement', `glDrawArrays',
6508 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6509 `glMultiDrawElements' is called. See `glFogCoordPointer'.
6510
6511`GL_INDEX_ARRAY'
6512 If enabled, the index array is enabled for writing and used during
6513 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6514 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6515 is called. See `glIndexPointer'.
6516
6517`GL_NORMAL_ARRAY'
6518 If enabled, the normal array is enabled for writing and used during
6519 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6520 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6521 is called. See `glNormalPointer'.
6522
6523`GL_SECONDARY_COLOR_ARRAY'
6524 If enabled, the secondary color array is enabled for writing and
6525 used during rendering when `glArrayElement', `glDrawArrays',
6526 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6527 `glMultiDrawElements' is called. See `glColorPointer'.
6528
6529`GL_TEXTURE_COORD_ARRAY'
6530 If enabled, the texture coordinate array is enabled for writing and
6531 used during rendering when `glArrayElement', `glDrawArrays',
6532 `glDrawElements', `glDrawRangeElements'`glMultiDrawArrays', or
6533 `glMultiDrawElements' is called. See `glTexCoordPointer'.
6534
6535`GL_VERTEX_ARRAY'
6536 If enabled, the vertex array is enabled for writing and used during
6537 rendering when `glArrayElement', `glDrawArrays', `glDrawElements',
6538 `glDrawRangeElements'`glMultiDrawArrays', or `glMultiDrawElements'
6539 is called. See `glVertexPointer'.
6540
6541`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
6542
6543`glEnableClientState' is not allowed between the execution of `glBegin'
6544and the corresponding `glEnd', but an error may or may not be generated.
6545If no error is generated, the behavior is undefined.")
8925f36f 6546
25072f02 6547(define-gl-procedures
bb894c9d
AW
6548 ((glEnableVertexAttribArray
6549 (index GLuint)
6550 ->
6551 void)
6552 (glDisableVertexAttribArray
6553 (index GLuint)
6554 ->
6555 void))
3c9b6116
AW
6556 "Enable or disable a generic vertex attribute array.
6557
6558INDEX
6559 Specifies the index of the generic vertex attribute to be enabled
6560 or disabled.
6561
6562`glEnableVertexAttribArray' enables the generic vertex attribute array
6563specified by INDEX. `glDisableVertexAttribArray' disables the generic
6564vertex attribute array specified by INDEX. By default, all client-side
6565capabilities are disabled, including all generic vertex attribute
6566arrays. If enabled, the values in the generic vertex attribute array
6567will be accessed and used for rendering when calls are made to vertex
6568array commands such as `glDrawArrays', `glDrawElements',
6569`glDrawRangeElements', `glArrayElement', `glMultiDrawElements', or
6570`glMultiDrawArrays'.
6571
6572`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
6573`GL_MAX_VERTEX_ATTRIBS'.
6574
6575`GL_INVALID_OPERATION' is generated if either `glEnableVertexAttribArray
6576' or `glDisableVertexAttribArray ' is executed between the execution of
6577`glBegin' and the corresponding execution of `glEnd'.")
8925f36f 6578
25072f02 6579(define-gl-procedures
bb894c9d
AW
6580 ((glEnable (cap GLenum) -> void)
6581 (glDisable (cap GLenum) -> void))
3c9b6116
AW
6582 "Enable or disable server-side GL capabilities.
6583
6584CAP
6585 Specifies a symbolic constant indicating a GL capability.
6586
6587`glEnable' and `glDisable' enable and disable various capabilities. Use
6588`glIsEnabled' or `glGet' to determine the current setting of any
6589capability. The initial value for each capability with the exception of
6590`GL_DITHER' and `GL_MULTISAMPLE' is `GL_FALSE'. The initial value for
6591`GL_DITHER' and `GL_MULTISAMPLE' is `GL_TRUE'.
6592
6593Both `glEnable' and `glDisable' take a single argument, CAP, which can
6594assume one of the following values:
6595
6596`GL_ALPHA_TEST'
6597
6598
6599 If enabled, do alpha testing. See `glAlphaFunc'.
6600
6601`GL_AUTO_NORMAL'
6602
6603
6604 If enabled, generate normal vectors when either `GL_MAP2_VERTEX_3'
6605 or `GL_MAP2_VERTEX_4' is used to generate vertices. See `glMap2'.
6606
6607`GL_BLEND'
6608
6609
6610 If enabled, blend the computed fragment color values with the
6611 values in the color buffers. See `glBlendFunc'.
6612
6613`GL_CLIP_PLANE'I
6614
6615
6616 If enabled, clip geometry against user-defined clipping plane I.
6617 See `glClipPlane'.
6618
6619`GL_COLOR_LOGIC_OP'
6620
6621
6622 If enabled, apply the currently selected logical operation to the
6623 computed fragment color and color buffer values. See `glLogicOp'.
6624
6625`GL_COLOR_MATERIAL'
6626
6627
6628 If enabled, have one or more material parameters track the current
6629 color. See `glColorMaterial'.
6630
6631`GL_COLOR_SUM'
6632
6633
6634 If enabled and no fragment shader is active, add the secondary
6635 color value to the computed fragment color. See `glSecondaryColor'.
6636
6637`GL_COLOR_TABLE'
6638
6639
6640 If enabled, perform a color table lookup on the incoming RGBA color
6641 values. See `glColorTable'.
6642
6643`GL_CONVOLUTION_1D'
6644
6645
6646 If enabled, perform a 1D convolution operation on incoming RGBA
6647 color values. See `glConvolutionFilter1D'.
6648
6649`GL_CONVOLUTION_2D'
6650
6651
6652 If enabled, perform a 2D convolution operation on incoming RGBA
6653 color values. See `glConvolutionFilter2D'.
6654
6655`GL_CULL_FACE'
6656
6657
6658 If enabled, cull polygons based on their winding in window
6659 coordinates. See `glCullFace'.
6660
6661`GL_DEPTH_TEST'
6662
6663
6664 If enabled, do depth comparisons and update the depth buffer. Note
6665 that even if the depth buffer exists and the depth mask is
6666 non-zero, the depth buffer is not updated if the depth test is
6667 disabled. See `glDepthFunc' and `glDepthRange'.
6668
6669`GL_DITHER'
6670
6671
6672 If enabled, dither color components or indices before they are
6673 written to the color buffer.
6674
6675`GL_FOG'
6676
6677
6678 If enabled and no fragment shader is active, blend a fog color into
6679 the post-texturing color. See `glFog'.
6680
6681`GL_HISTOGRAM'
6682
6683
6684 If enabled, histogram incoming RGBA color values. See
6685 `glHistogram'.
6686
6687`GL_INDEX_LOGIC_OP'
6688
6689
6690 If enabled, apply the currently selected logical operation to the
6691 incoming index and color buffer indices. See `glLogicOp'.
6692
6693`GL_LIGHT'I
6694
6695
6696 If enabled, include light I in the evaluation of the lighting
6697 equation. See `glLightModel' and `glLight'.
6698
6699`GL_LIGHTING'
6700
6701
6702 If enabled and no vertex shader is active, use the current lighting
6703 parameters to compute the vertex color or index. Otherwise, simply
6704 associate the current color or index with each vertex. See
6705 `glMaterial', `glLightModel', and `glLight'.
6706
6707`GL_LINE_SMOOTH'
6708
6709
6710 If enabled, draw lines with correct filtering. Otherwise, draw
6711 aliased lines. See `glLineWidth'.
6712
6713`GL_LINE_STIPPLE'
6714
6715
6716 If enabled, use the current line stipple pattern when drawing
6717 lines. See `glLineStipple'.
6718
6719`GL_MAP1_COLOR_4'
6720
6721
6722 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6723 `glEvalPoint1' generate RGBA values. See `glMap1'.
6724
6725`GL_MAP1_INDEX'
6726
6727
6728 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6729 `glEvalPoint1' generate color indices. See `glMap1'.
6730
6731`GL_MAP1_NORMAL'
6732
6733
6734 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6735 `glEvalPoint1' generate normals. See `glMap1'.
6736
6737`GL_MAP1_TEXTURE_COORD_1'
6738
6739
6740 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6741 `glEvalPoint1' generate S texture coordinates. See `glMap1'.
6742
6743`GL_MAP1_TEXTURE_COORD_2'
6744
6745
6746 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6747 `glEvalPoint1' generate S and T texture coordinates. See `glMap1'.
6748
6749`GL_MAP1_TEXTURE_COORD_3'
6750
6751
6752 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6753 `glEvalPoint1' generate S, T, and R texture coordinates. See
6754 `glMap1'.
6755
6756`GL_MAP1_TEXTURE_COORD_4'
6757
6758
6759 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6760 `glEvalPoint1' generate S, T, R, and Q texture coordinates. See
6761 `glMap1'.
6762
6763`GL_MAP1_VERTEX_3'
6764
6765
6766 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6767 `glEvalPoint1' generate X, Y, and Z vertex coordinates. See
6768 `glMap1'.
6769
6770`GL_MAP1_VERTEX_4'
6771
6772
6773 If enabled, calls to `glEvalCoord1', `glEvalMesh1', and
6774 `glEvalPoint1' generate homogeneous X, Y, Z, and W vertex
6775 coordinates. See `glMap1'.
6776
6777`GL_MAP2_COLOR_4'
6778
6779
6780 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6781 `glEvalPoint2' generate RGBA values. See `glMap2'.
6782
6783`GL_MAP2_INDEX'
6784
6785
6786 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6787 `glEvalPoint2' generate color indices. See `glMap2'.
6788
6789`GL_MAP2_NORMAL'
6790
6791
6792 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6793 `glEvalPoint2' generate normals. See `glMap2'.
6794
6795`GL_MAP2_TEXTURE_COORD_1'
6796
6797
6798 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6799 `glEvalPoint2' generate S texture coordinates. See `glMap2'.
6800
6801`GL_MAP2_TEXTURE_COORD_2'
6802
6803
6804 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6805 `glEvalPoint2' generate S and T texture coordinates. See `glMap2'.
6806
6807`GL_MAP2_TEXTURE_COORD_3'
6808
6809
6810 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6811 `glEvalPoint2' generate S, T, and R texture coordinates. See
6812 `glMap2'.
6813
6814`GL_MAP2_TEXTURE_COORD_4'
6815
6816
6817 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6818 `glEvalPoint2' generate S, T, R, and Q texture coordinates. See
6819 `glMap2'.
6820
6821`GL_MAP2_VERTEX_3'
6822
6823
6824 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6825 `glEvalPoint2' generate X, Y, and Z vertex coordinates. See
6826 `glMap2'.
6827
6828`GL_MAP2_VERTEX_4'
6829
6830
6831 If enabled, calls to `glEvalCoord2', `glEvalMesh2', and
6832 `glEvalPoint2' generate homogeneous X, Y, Z, and W vertex
6833 coordinates. See `glMap2'.
6834
6835`GL_MINMAX'
6836
6837
6838 If enabled, compute the minimum and maximum values of incoming RGBA
6839 color values. See `glMinmax'.
6840
6841`GL_MULTISAMPLE'
6842
6843
6844 If enabled, use multiple fragment samples in computing the final
6845 color of a pixel. See `glSampleCoverage'.
6846
6847`GL_NORMALIZE'
6848
6849
6850 If enabled and no vertex shader is active, normal vectors are
6851 normalized to unit length after transformation and before lighting.
6852 This method is generally less efficient than `GL_RESCALE_NORMAL'.
6853 See `glNormal' and `glNormalPointer'.
6854
6855`GL_POINT_SMOOTH'
6856
6857
6858 If enabled, draw points with proper filtering. Otherwise, draw
6859 aliased points. See `glPointSize'.
6860
6861`GL_POINT_SPRITE'
6862
6863
6864 If enabled, calculate texture coordinates for points based on
6865 texture environment and point parameter settings. Otherwise texture
6866 coordinates are constant across points.
6867
6868`GL_POLYGON_OFFSET_FILL'
6869
6870
6871 If enabled, and if the polygon is rendered in `GL_FILL' mode, an
6872 offset is added to depth values of a polygon's fragments before the
6873 depth comparison is performed. See `glPolygonOffset'.
6874
6875`GL_POLYGON_OFFSET_LINE'
6876
6877
6878 If enabled, and if the polygon is rendered in `GL_LINE' mode, an
6879 offset is added to depth values of a polygon's fragments before the
6880 depth comparison is performed. See `glPolygonOffset'.
6881
6882`GL_POLYGON_OFFSET_POINT'
6883
6884
6885 If enabled, an offset is added to depth values of a polygon's
6886 fragments before the depth comparison is performed, if the polygon
6887 is rendered in `GL_POINT' mode. See `glPolygonOffset'.
6888
6889`GL_POLYGON_SMOOTH'
6890
6891
6892 If enabled, draw polygons with proper filtering. Otherwise, draw
6893 aliased polygons. For correct antialiased polygons, an alpha buffer
6894 is needed and the polygons must be sorted front to back.
6895
6896`GL_POLYGON_STIPPLE'
6897
6898
6899 If enabled, use the current polygon stipple pattern when rendering
6900 polygons. See `glPolygonStipple'.
6901
6902`GL_POST_COLOR_MATRIX_COLOR_TABLE'
6903
6904
6905 If enabled, perform a color table lookup on RGBA color values after
6906 color matrix transformation. See `glColorTable'.
6907
6908`GL_POST_CONVOLUTION_COLOR_TABLE'
6909
6910
6911 If enabled, perform a color table lookup on RGBA color values after
6912 convolution. See `glColorTable'.
6913
6914`GL_RESCALE_NORMAL'
6915
6916
6917 If enabled and no vertex shader is active, normal vectors are
6918 scaled after transformation and before lighting by a factor
6919 computed from the modelview matrix. If the modelview matrix scales
6920 space uniformly, this has the effect of restoring the transformed
6921 normal to unit length. This method is generally more efficient than
6922 `GL_NORMALIZE'. See `glNormal' and `glNormalPointer'.
6923
6924`GL_SAMPLE_ALPHA_TO_COVERAGE'
6925
6926
6927 If enabled, compute a temporary coverage value where each bit is
6928 determined by the alpha value at the corresponding sample location.
6929 The temporary coverage value is then ANDed with the fragment
6930 coverage value.
6931
6932`GL_SAMPLE_ALPHA_TO_ONE'
6933
6934
6935 If enabled, each sample alpha value is replaced by the maximum
6936 representable alpha value.
6937
6938`GL_SAMPLE_COVERAGE'
6939
6940
6941 If enabled, the fragment's coverage is ANDed with the temporary
6942 coverage value. If `GL_SAMPLE_COVERAGE_INVERT' is set to `GL_TRUE',
6943 invert the coverage value. See `glSampleCoverage'.
6944
6945`GL_SEPARABLE_2D'
6946
6947
6948 If enabled, perform a two-dimensional convolution operation using a
6949 separable convolution filter on incoming RGBA color values. See
6950 `glSeparableFilter2D'.
6951
6952`GL_SCISSOR_TEST'
6953
6954
6955 If enabled, discard fragments that are outside the scissor
6956 rectangle. See `glScissor'.
6957
6958`GL_STENCIL_TEST'
6959
6960
6961 If enabled, do stencil testing and update the stencil buffer. See
6962 `glStencilFunc' and `glStencilOp'.
6963
6964`GL_TEXTURE_1D'
6965
6966
6967 If enabled and no fragment shader is active, one-dimensional
6968 texturing is performed (unless two- or three-dimensional or
6969 cube-mapped texturing is also enabled). See `glTexImage1D'.
6970
6971`GL_TEXTURE_2D'
6972
6973
6974 If enabled and no fragment shader is active, two-dimensional
6975 texturing is performed (unless three-dimensional or cube-mapped
6976 texturing is also enabled). See `glTexImage2D'.
6977
6978`GL_TEXTURE_3D'
6979
6980
6981 If enabled and no fragment shader is active, three-dimensional
6982 texturing is performed (unless cube-mapped texturing is also
6983 enabled). See `glTexImage3D'.
6984
6985`GL_TEXTURE_CUBE_MAP'
6986
6987
6988 If enabled and no fragment shader is active, cube-mapped texturing
6989 is performed. See `glTexImage2D'.
6990
6991`GL_TEXTURE_GEN_Q'
6992
6993
6994 If enabled and no vertex shader is active, the Q texture coordinate
6995 is computed using the texture generation function defined with
6996 `glTexGen'. Otherwise, the current Q texture coordinate is used.
6997 See `glTexGen'.
6998
6999`GL_TEXTURE_GEN_R'
7000
7001
7002 If enabled and no vertex shader is active, the R texture coordinate
7003 is computed using the texture generation function defined with
7004 `glTexGen'. Otherwise, the current R texture coordinate is used.
7005 See `glTexGen'.
7006
7007`GL_TEXTURE_GEN_S'
7008
7009
7010 If enabled and no vertex shader is active, the S texture coordinate
7011 is computed using the texture generation function defined with
7012 `glTexGen'. Otherwise, the current S texture coordinate is used.
7013 See `glTexGen'.
7014
7015`GL_TEXTURE_GEN_T'
7016
7017
7018 If enabled and no vertex shader is active, the T texture coordinate
7019 is computed using the texture generation function defined with
7020 `glTexGen'. Otherwise, the current T texture coordinate is used.
7021 See `glTexGen'.
7022
7023`GL_VERTEX_PROGRAM_POINT_SIZE'
7024
7025
7026 If enabled and a vertex shader is active, then the derived point
7027 size is taken from the (potentially clipped) shader builtin
7028 `gl_PointSize' and clamped to the implementation-dependent point
7029 size range.
7030
7031`GL_VERTEX_PROGRAM_TWO_SIDE'
7032
7033
7034 If enabled and a vertex shader is active, it specifies that the GL
7035 will choose between front and back colors based on the polygon's
7036 face direction of which the vertex being shaded is a part. It has
7037 no effect on points or lines.
7038
7039`GL_INVALID_ENUM' is generated if CAP is not one of the values listed
7040previously.
7041
7042`GL_INVALID_OPERATION' is generated if `glEnable' or `glDisable' is
7043executed between the execution of `glBegin' and the corresponding
7044execution of `glEnd'.")
7045
25072f02 7046(define-gl-procedures
ca09631c 7047 ((glEvalCoord1f (u GLfloat) -> void)
78aa45b9
DH
7048 (glEvalCoord1d (u GLdouble) -> void)
7049 (glEvalCoord2f (u GLfloat) (v GLfloat) -> void)
7050 (glEvalCoord2d (u GLdouble) (v GLdouble) -> void)
7051 (glEvalCoord1fv (u const-GLfloat-*) -> void)
7052 (glEvalCoord1dv (u const-GLdouble-*) -> void)
7053 (glEvalCoord2fv (u const-GLfloat-*) -> void)
7054 (glEvalCoord2dv (u const-GLdouble-*) -> void))
3c9b6116
AW
7055 "Evaluate enabled one- and two-dimensional maps.
7056
7057U
7058 Specifies a value that is the domain coordinate U to the basis
7059 function defined in a previous `glMap1' or `glMap2' command.
7060
7061V
7062 Specifies a value that is the domain coordinate V to the basis
7063 function defined in a previous `glMap2' command. This argument is
7064 not present in a `glEvalCoord1' command.
7065
7066`glEvalCoord1' evaluates enabled one-dimensional maps at argument U.
7067`glEvalCoord2' does the same for two-dimensional maps using two domain
7068values, U and V. To define a map, call `glMap1' and `glMap2'; to enable
7069and disable it, call `glEnable' and `glDisable'.
7070
7071When one of the `glEvalCoord' commands is issued, all currently enabled
7072maps of the indicated dimension are evaluated. Then, for each enabled
7073map, it is as if the corresponding GL command had been issued with the
7074computed value. That is, if `GL_MAP1_INDEX' or `GL_MAP2_INDEX' is
7075enabled, a `glIndex' command is simulated. If `GL_MAP1_COLOR_4' or
7076`GL_MAP2_COLOR_4' is enabled, a `glColor' command is simulated. If
7077`GL_MAP1_NORMAL' or `GL_MAP2_NORMAL' is enabled, a normal vector is
7078produced, and if any of `GL_MAP1_TEXTURE_COORD_1',
7079`GL_MAP1_TEXTURE_COORD_2', `GL_MAP1_TEXTURE_COORD_3',
7080`GL_MAP1_TEXTURE_COORD_4', `GL_MAP2_TEXTURE_COORD_1',
7081`GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3', or
7082`GL_MAP2_TEXTURE_COORD_4' is enabled, then an appropriate `glTexCoord'
7083command is simulated.
7084
7085For color, color index, normal, and texture coordinates the GL uses
7086evaluated values instead of current values for those evaluations that
7087are enabled, and current values otherwise, However, the evaluated values
7088do not update the current values. Thus, if `glVertex' commands are
7089interspersed with `glEvalCoord' commands, the color, normal, and texture
7090coordinates associated with the `glVertex' commands are not affected by
7091the values generated by the `glEvalCoord' commands, but only by the most
7092recent `glColor', `glIndex', `glNormal', and `glTexCoord' commands.
7093
7094No commands are issued for maps that are not enabled. If more than one
7095texture evaluation is enabled for a particular dimension (for example,
7096`GL_MAP2_TEXTURE_COORD_1' and `GL_MAP2_TEXTURE_COORD_2'), then only the
7097evaluation of the map that produces the larger number of coordinates (in
7098this case, `GL_MAP2_TEXTURE_COORD_2') is carried out. `GL_MAP1_VERTEX_4'
7099overrides `GL_MAP1_VERTEX_3', and `GL_MAP2_VERTEX_4' overrides
7100`GL_MAP2_VERTEX_3', in the same manner. If neither a three- nor a
7101four-component vertex map is enabled for the specified dimension, the
7102`glEvalCoord' command is ignored.
7103
7104If you have enabled automatic normal generation, by calling `glEnable'
7105with argument `GL_AUTO_NORMAL', `glEvalCoord2' generates surface normals
7106analytically, regardless of the contents or enabling of the
7107`GL_MAP2_NORMAL' map. Let
7108
7109`m'=∂`p',/∂U,,×∂`p',/∂V,,
7110
7111Then the generated normal `n' is `n'=`m'/∥`m',∥,
7112
7113If automatic normal generation is disabled, the corresponding normal map
7114`GL_MAP2_NORMAL', if enabled, is used to produce a normal. If neither
7115automatic normal generation nor a normal map is enabled, no normal is
7116generated for `glEvalCoord2' commands.")
7117
25072f02 7118(define-gl-procedures
bb894c9d
AW
7119 ((glEvalMesh1
7120 (mode GLenum)
7121 (i1 GLint)
7122 (i2 GLint)
7123 ->
7124 void)
7125 (glEvalMesh2
7126 (mode GLenum)
7127 (i1 GLint)
7128 (i2 GLint)
7129 (j1 GLint)
7130 (j2 GLint)
7131 ->
7132 void))
3c9b6116
AW
7133 "Compute a one- or two-dimensional grid of points or lines.
7134
7135MODE
7136 In `glEvalMesh1', specifies whether to compute a one-dimensional
7137 mesh of points or lines. Symbolic constants `GL_POINT' and
7138 `GL_LINE' are accepted.
7139
7140I1
7141 I2
7142
7143 Specify the first and last integer values for grid domain variable
7144 I .
7145
7146`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
7147and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
7148steps through the integer domain of a one- or two-dimensional grid,
7149whose range is the domain of the evaluation maps specified by `glMap1'
7150and `glMap2'. MODE determines whether the resulting vertices are
7151connected as points, lines, or filled polygons.
7152
7153In the one-dimensional case, `glEvalMesh1', the mesh is generated as if
7154the following code fragment were executed:
7155
7156where
7157
7158
7159 glBegin( TYPE );
7160 for ( i = I1; i <= I2; i += 1 )
7161 glEvalCoord1( i·ΔU+U_1
7162
7163 );
7164 glEnd();
7165
7166ΔU=(U_2-U_1,)/N
7167
7168and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
7169command. TYPE is `GL_POINTS' if MODE is `GL_POINT', or `GL_LINES' if
7170MODE is `GL_LINE'.
7171
7172The one absolute numeric requirement is that if I=N , then the value
7173computed from I·ΔU+U_1 is exactly U_2 .
7174
7175In the two-dimensional case, `glEvalMesh2', let .cp ΔU=(U_2-U_1,)/N
7176
7177ΔV=(V_2-V_1,)/M
7178
7179where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
7180recent `glMapGrid2' command. Then, if MODE is `GL_FILL', the
7181`glEvalMesh2' command is equivalent to:
7182
7183
7184
7185
7186 for ( j = J1; j < J2; j += 1 ) {
7187 glBegin( GL_QUAD_STRIP );
7188 for ( i = I1; i <= I2; i += 1 ) {
7189 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7190
7191 );
7192 glEvalCoord2( i·ΔU+U_1,(j+1,)·ΔV+V_1
7193
7194 );
7195 }
7196 glEnd();
7197 }
7198
7199If MODE is `GL_LINE', then a call to `glEvalMesh2' is equivalent to:
7200
7201
7202
7203
7204 for ( j = J1; j <= J2; j += 1 ) {
7205 glBegin( GL_LINE_STRIP );
7206 for ( i = I1; i <= I2; i += 1 )
7207 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7208
7209 );
7210 glEnd();
7211 }
7212
7213 for ( i = I1; i <= I2; i += 1 ) {
7214 glBegin( GL_LINE_STRIP );
7215 for ( j = J1; j <= J1; j += 1 )
7216 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7217
7218 );
7219 glEnd();
7220 }
7221
7222And finally, if MODE is `GL_POINT', then a call to `glEvalMesh2' is
7223equivalent to:
7224
7225
7226
7227
7228 glBegin( GL_POINTS );
7229 for ( j = J1; j <= J2; j += 1 )
7230 for ( i = I1; i <= I2; i += 1 )
7231 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7232
7233 );
7234 glEnd();
7235
7236In all three cases, the only absolute numeric requirements are that if
7237I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
7238, then the value computed from J·ΔV+V_1 is exactly V_2 .
7239
7240`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7241
7242`GL_INVALID_OPERATION' is generated if `glEvalMesh' is executed between
7243the execution of `glBegin' and the corresponding execution of `glEnd'.")
7244
25072f02 7245(define-gl-procedures
bb894c9d
AW
7246 ((glEvalPoint1 (i GLint) -> void)
7247 (glEvalPoint2 (i GLint) (j GLint) -> void))
3c9b6116
AW
7248 "Generate and evaluate a single point in a mesh.
7249
7250I
7251 Specifies the integer value for grid domain variable I .
7252
7253J
7254 Specifies the integer value for grid domain variable J
7255 (`glEvalPoint2' only).
7256
7257`glMapGrid' and `glEvalMesh' are used in tandem to efficiently generate
7258and evaluate a series of evenly spaced map domain values. `glEvalPoint'
7259can be used to evaluate a single grid point in the same gridspace that
7260is traversed by `glEvalMesh'. Calling `glEvalPoint1' is equivalent to
7261calling where ΔU=(U_2-U_1,)/N
7262
7263
7264 glEvalCoord1( i·ΔU+U_1
7265
7266 );
7267
7268and N , U_1 , and U_2 are the arguments to the most recent `glMapGrid1'
7269command. The one absolute numeric requirement is that if I=N , then the
7270value computed from I·ΔU+U_1 is exactly U_2 .
7271
7272In the two-dimensional case, `glEvalPoint2', let
7273
7274ΔU=(U_2-U_1,)/N ΔV=(V_2-V_1,)/M
7275
7276where N , U_1 , U_2 , M , V_1 , and V_2 are the arguments to the most
7277recent `glMapGrid2' command. Then the `glEvalPoint2' command is
7278equivalent to calling The only absolute numeric requirements are that if
7279I=N , then the value computed from I·ΔU+U_1 is exactly U_2 , and if J=M
7280, then the value computed from J·ΔV+V_1 is exactly V_2 .
7281
7282
7283 glEvalCoord2( i·ΔU+U_1,j·ΔV+V_1
7284
7285 );")
7286
25072f02 7287(define-gl-procedures
bb894c9d
AW
7288 ((glFeedbackBuffer
7289 (size GLsizei)
7290 (type GLenum)
00239761 7291 (buffer GLfloat-*)
bb894c9d
AW
7292 ->
7293 void))
3c9b6116
AW
7294 "Controls feedback mode.
7295
7296SIZE
7297 Specifies the maximum number of values that can be written into
7298 BUFFER.
7299
7300TYPE
7301 Specifies a symbolic constant that describes the information that
7302 will be returned for each vertex. `GL_2D', `GL_3D', `GL_3D_COLOR',
7303 `GL_3D_COLOR_TEXTURE', and `GL_4D_COLOR_TEXTURE' are accepted.
7304
7305BUFFER
7306 Returns the feedback data.
7307
7308The `glFeedbackBuffer' function controls feedback. Feedback, like
7309selection, is a GL mode. The mode is selected by calling `glRenderMode'
7310with `GL_FEEDBACK'. When the GL is in feedback mode, no pixels are
7311produced by rasterization. Instead, information about primitives that
7312would have been rasterized is fed back to the application using the GL.
7313
7314`glFeedbackBuffer' has three arguments: BUFFER is a pointer to an array
7315of floating-point values into which feedback information is placed. SIZE
7316indicates the size of the array. TYPE is a symbolic constant describing
7317the information that is fed back for each vertex. `glFeedbackBuffer'
7318must be issued before feedback mode is enabled (by calling
7319`glRenderMode' with argument `GL_FEEDBACK'). Setting `GL_FEEDBACK'
7320without establishing the feedback buffer, or calling `glFeedbackBuffer'
7321while the GL is in feedback mode, is an error.
7322
7323When `glRenderMode' is called while in feedback mode, it returns the
7324number of entries placed in the feedback array and resets the feedback
7325array pointer to the base of the feedback buffer. The returned value
7326never exceeds SIZE. If the feedback data required more room than was
7327available in BUFFER, `glRenderMode' returns a negative value. To take
7328the GL out of feedback mode, call `glRenderMode' with a parameter value
7329other than `GL_FEEDBACK'.
7330
7331While in feedback mode, each primitive, bitmap, or pixel rectangle that
7332would be rasterized generates a block of values that are copied into the
7333feedback array. If doing so would cause the number of entries to exceed
7334the maximum, the block is partially written so as to fill the array (if
7335there is any room left at all), and an overflow flag is set. Each block
7336begins with a code indicating the primitive type, followed by values
7337that describe the primitive's vertices and associated data. Entries are
7338also written for bitmaps and pixel rectangles. Feedback occurs after
7339polygon culling and `glPolygonMode' interpretation of polygons has taken
7340place, so polygons that are culled are not returned in the feedback
7341buffer. It can also occur after polygons with more than three edges are
7342broken up into triangles, if the GL implementation renders polygons by
7343performing this decomposition.
7344
7345The `glPassThrough' command can be used to insert a marker into the
7346feedback buffer. See `glPassThrough'.
7347
7348Following is the grammar for the blocks of values written into the
7349feedback buffer. Each primitive is indicated with a unique identifying
7350value followed by some number of vertices. Polygon entries include an
7351integer value indicating how many vertices follow. A vertex is fed back
7352as some number of floating-point values, as determined by TYPE. Colors
7353are fed back as four values in RGBA mode and one value in color index
7354mode.
7355
7356feedbackList ← feedbackItem feedbackList | feedbackItem feedbackItem ←
7357point | lineSegment | polygon | bitmap | pixelRectangle | passThru point
7358← `GL_POINT_TOKEN' vertex lineSegment ← `GL_LINE_TOKEN' vertex vertex |
7359`GL_LINE_RESET_TOKEN' vertex vertex polygon ← `GL_POLYGON_TOKEN' n
7360polySpec polySpec ← polySpec vertex | vertex vertex vertex bitmap ←
7361`GL_BITMAP_TOKEN' vertex pixelRectangle ← `GL_DRAW_PIXEL_TOKEN' vertex |
7362`GL_COPY_PIXEL_TOKEN' vertex passThru ← `GL_PASS_THROUGH_TOKEN' value
7363vertex ← 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture 2d ← value
7364value 3d ← value value value 3dColor ← value value value color
73653dColorTexture ← value value value color tex 4dColorTexture ← value
7366value value value color tex color ← rgba | index rgba ← value value
7367value value index ← value tex ← value value value value
7368
7369VALUE is a floating-point number, and N is a floating-point integer
7370giving the number of vertices in the polygon. `GL_POINT_TOKEN',
7371`GL_LINE_TOKEN', `GL_LINE_RESET_TOKEN', `GL_POLYGON_TOKEN',
7372`GL_BITMAP_TOKEN', `GL_DRAW_PIXEL_TOKEN', `GL_COPY_PIXEL_TOKEN' and
7373`GL_PASS_THROUGH_TOKEN' are symbolic floating-point constants.
7374`GL_LINE_RESET_TOKEN' is returned whenever the line stipple pattern is
7375reset. The data returned as a vertex depends on the feedback TYPE.
7376
7377The following table gives the correspondence between TYPE and the number
7378of values per vertex. K is 1 in color index mode and 4 in RGBA mode.
7379
7380
7381
7382*Type*
7383 *Coordinates*, *Color*, *Texture*, *Total Number of Values*
7384
7385`GL_2D'
7386 X, Y, , , 2
7387
7388`GL_3D'
7389 X, Y, Z, , , 3
7390
7391`GL_3D_COLOR'
7392 X, Y, Z, K , , 3+K
7393
7394`GL_3D_COLOR_TEXTURE'
7395 X, Y, Z, K , 4 , 7+K
7396
7397`GL_4D_COLOR_TEXTURE'
7398 X, Y, Z, W, K , 4 , 8+K
7399
7400Feedback vertex coordinates are in window coordinates, except W, which
7401is in clip coordinates. Feedback colors are lighted, if lighting is
7402enabled. Feedback texture coordinates are generated, if texture
7403coordinate generation is enabled. They are always transformed by the
7404texture matrix.
7405
7406`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
7407
7408`GL_INVALID_VALUE' is generated if SIZE is negative.
7409
7410`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
7411while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
7412with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
7413once.
7414
7415`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is executed
7416between the execution of `glBegin' and the corresponding execution of
7417`glEnd'.")
7418
25072f02 7419(define-gl-procedures
bb894c9d 7420 ((glFinish -> void))
3c9b6116
AW
7421 "Block until all GL execution is complete.
7422
7423`glFinish' does not return until the effects of all previously called GL
7424commands are complete. Such effects include all changes to GL state, all
7425changes to connection state, and all changes to the frame buffer
7426contents.
7427
7428`GL_INVALID_OPERATION' is generated if `glFinish' is executed between
7429the execution of `glBegin' and the corresponding execution of `glEnd'.")
7430
25072f02 7431(define-gl-procedures
bb894c9d 7432 ((glFlush -> void))
3c9b6116
AW
7433 "Force execution of GL commands in finite time.
7434
7435Different GL implementations buffer commands in several different
7436locations, including network buffers and the graphics accelerator
7437itself. `glFlush' empties all of these buffers, causing all issued
7438commands to be executed as quickly as they are accepted by the actual
7439rendering engine. Though this execution may not be completed in any
7440particular time period, it does complete in finite time.
7441
7442Because any GL program might be executed over a network, or on an
7443accelerator that buffers commands, all programs should call `glFlush'
7444whenever they count on having all of their previously issued commands
7445completed. For example, call `glFlush' before waiting for user input
7446that depends on the generated image.
7447
7448`GL_INVALID_OPERATION' is generated if `glFlush' is executed between the
7449execution of `glBegin' and the corresponding execution of `glEnd'.")
7450
25072f02 7451(define-gl-procedures
bb894c9d
AW
7452 ((glFogCoordPointer
7453 (type GLenum)
7454 (stride GLsizei)
00239761 7455 (pointer GLvoid-*)
bb894c9d
AW
7456 ->
7457 void))
3c9b6116
AW
7458 "Define an array of fog coordinates.
7459
7460TYPE
7461 Specifies the data type of each fog coordinate. Symbolic constants
7462 `GL_FLOAT', or `GL_DOUBLE' are accepted. The initial value is
7463 `GL_FLOAT'.
7464
7465STRIDE
7466 Specifies the byte offset between consecutive fog coordinates. If
7467 STRIDE is 0, the array elements are understood to be tightly
7468 packed. The initial value is 0.
7469
7470POINTER
7471 Specifies a pointer to the first coordinate of the first fog
7472 coordinate in the array. The initial value is 0.
7473
7474`glFogCoordPointer' specifies the location and data format of an array
7475of fog coordinates to use when rendering. TYPE specifies the data type
7476of each fog coordinate, and STRIDE specifies the byte stride from one
7477fog coordinate to the next, allowing vertices and attributes to be
7478packed into a single array or stored in separate arrays.
7479
7480If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
7481target (see `glBindBuffer') while a fog coordinate array is specified,
7482POINTER is treated as a byte offset into the buffer object's data store.
7483Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
7484fog coordinate vertex array client-side state
7485(`GL_FOG_COORD_ARRAY_BUFFER_BINDING').
7486
7487When a fog coordinate array is specified, TYPE, STRIDE, and POINTER are
7488saved as client-side state, in addition to the current vertex array
7489buffer object binding.
7490
7491To enable and disable the fog coordinate array, call
7492`glEnableClientState' and `glDisableClientState' with the argument
7493`GL_FOG_COORD_ARRAY'. If enabled, the fog coordinate array is used when
7494`glDrawArrays', `glMultiDrawArrays', `glDrawElements',
7495`glMultiDrawElements', `glDrawRangeElements', or `glArrayElement' is
7496called.
7497
7498`GL_INVALID_ENUM' is generated if TYPE is not either `GL_FLOAT' or
7499`GL_DOUBLE'.
7500
7501`GL_INVALID_VALUE' is generated if STRIDE is negative.")
7502
25072f02 7503(define-gl-procedures
78aa45b9
DH
7504 ((glFogCoordd (coord GLdouble) -> void)
7505 (glFogCoordf (coord GLfloat) -> void)
7506 (glFogCoorddv (coord GLdouble-*) -> void)
7507 (glFogCoordfv (coord GLfloat-*) -> void))
3c9b6116
AW
7508 "Set the current fog coordinates.
7509
7510COORD
7511 Specify the fog distance.
7512
7513`glFogCoord' specifies the fog coordinate that is associated with each
7514vertex and the current raster position. The value specified is
7515interpolated and used in computing the fog color (see `glFog').")
7516
25072f02 7517(define-gl-procedures
bb894c9d 7518 ((glFogf (pname GLenum) (param GLfloat) -> void)
78aa45b9
DH
7519 (glFogi (pname GLenum) (param GLint) -> void)
7520 (glFogfv
7521 (pname GLenum)
7522 (params const-GLfloat-*)
7523 ->
7524 void)
7525 (glFogiv
7526 (pname GLenum)
7527 (params const-GLint-*)
7528 ->
7529 void))
3c9b6116
AW
7530 "Specify fog parameters.
7531
7532PNAME
7533 Specifies a single-valued fog parameter. `GL_FOG_MODE',
7534 `GL_FOG_DENSITY', `GL_FOG_START', `GL_FOG_END', `GL_FOG_INDEX', and
7535 `GL_FOG_COORD_SRC' are accepted.
7536
7537PARAM
7538 Specifies the value that PNAME will be set to.
7539
7540Fog is initially disabled. While enabled, fog affects rasterized
7541geometry, bitmaps, and pixel blocks, but not buffer clear operations. To
7542enable and disable fog, call `glEnable' and `glDisable' with argument
7543`GL_FOG'.
7544
7545`glFog' assigns the value or values in PARAMS to the fog parameter
7546specified by PNAME. The following values are accepted for PNAME:
7547
7548`GL_FOG_MODE'
7549 PARAMS is a single integer or floating-point value that specifies
7550 the equation to be used to compute the fog blend factor, F . Three
7551 symbolic constants are accepted: `GL_LINEAR', `GL_EXP', and
7552 `GL_EXP2'. The equations corresponding to these symbolic constants
7553 are defined below. The initial fog mode is `GL_EXP'.
7554
7555`GL_FOG_DENSITY'
7556 PARAMS is a single integer or floating-point value that specifies
7557 DENSITY , the fog density used in both exponential fog equations.
7558 Only nonnegative densities are accepted. The initial fog density is
7559 1.
7560
7561`GL_FOG_START'
7562 PARAMS is a single integer or floating-point value that specifies
7563 START , the near distance used in the linear fog equation. The
7564 initial near distance is 0.
7565
7566`GL_FOG_END'
7567 PARAMS is a single integer or floating-point value that specifies
7568 END , the far distance used in the linear fog equation. The initial
7569 far distance is 1.
7570
7571`GL_FOG_INDEX'
7572 PARAMS is a single integer or floating-point value that specifies
7573 I_F , the fog color index. The initial fog index is 0.
7574
7575`GL_FOG_COLOR'
7576 PARAMS contains four integer or floating-point values that specify
7577 C_F , the fog color. Integer values are mapped linearly such that
7578 the most positive representable value maps to 1.0, and the most
7579 negative representable value maps to -1.0 . Floating-point values
7580 are mapped directly. After conversion, all color components are
7581 clamped to the range [0,1] . The initial fog color is (0, 0, 0, 0).
7582
7583`GL_FOG_COORD_SRC'
7584 PARAMS contains either of the following symbolic constants:
7585 `GL_FOG_COORD' or `GL_FRAGMENT_DEPTH'. `GL_FOG_COORD' specifies
7586 that the current fog coordinate should be used as distance value in
7587 the fog color computation. `GL_FRAGMENT_DEPTH' specifies that the
7588 current fragment depth should be used as distance value in the fog
7589 computation.
7590
7591Fog blends a fog color with each rasterized pixel fragment's
7592post-texturing color using a blending factor F . Factor F is computed in
7593one of three ways, depending on the fog mode. Let C be either the
7594distance in eye coordinate from the origin (in the case that the
7595`GL_FOG_COORD_SRC' is `GL_FRAGMENT_DEPTH') or the current fog coordinate
7596(in the case that `GL_FOG_COORD_SRC' is `GL_FOG_COORD'). The equation
7597for `GL_LINEAR' fog is F=END-C,/END-START,
7598
7599The equation for `GL_EXP' fog is F=E^-(DENSITY·C,),
7600
7601The equation for `GL_EXP2' fog is F=E^-(DENSITY·C,),^2
7602
7603Regardless of the fog mode, F is clamped to the range [0,1] after it is
7604computed. Then, if the GL is in RGBA color mode, the fragment's red,
7605green, and blue colors, represented by C_R , are replaced by
7606
7607C_R,^″=F×C_R+(1-F,)×C_F
7608
7609Fog does not affect a fragment's alpha component.
7610
7611In color index mode, the fragment's color index I_R is replaced by
7612
7613I_R,^″=I_R+(1-F,)×I_F
7614
7615
7616
7617`GL_INVALID_ENUM' is generated if PNAME is not an accepted value, or if
7618PNAME is `GL_FOG_MODE' and PARAMS is not an accepted value.
7619
7620`GL_INVALID_VALUE' is generated if PNAME is `GL_FOG_DENSITY' and PARAMS
7621is negative.
7622
7623`GL_INVALID_OPERATION' is generated if `glFog' is executed between the
7624execution of `glBegin' and the corresponding execution of `glEnd'.")
7625
25072f02 7626(define-gl-procedures
bb894c9d 7627 ((glFrontFace (mode GLenum) -> void))
3c9b6116
AW
7628 "Define front- and back-facing polygons.
7629
7630MODE
7631 Specifies the orientation of front-facing polygons. `GL_CW' and
7632 `GL_CCW' are accepted. The initial value is `GL_CCW'.
7633
7634In a scene composed entirely of opaque closed surfaces, back-facing
7635polygons are never visible. Eliminating these invisible polygons has the
7636obvious benefit of speeding up the rendering of the image. To enable and
7637disable elimination of back-facing polygons, call `glEnable' and
7638`glDisable' with argument `GL_CULL_FACE'.
7639
7640The projection of a polygon to window coordinates is said to have
7641clockwise winding if an imaginary object following the path from its
7642first vertex, its second vertex, and so on, to its last vertex, and
7643finally back to its first vertex, moves in a clockwise direction about
7644the interior of the polygon. The polygon's winding is said to be
7645counterclockwise if the imaginary object following the same path moves
7646in a counterclockwise direction about the interior of the polygon.
7647`glFrontFace' specifies whether polygons with clockwise winding in
7648window coordinates, or counterclockwise winding in window coordinates,
7649are taken to be front-facing. Passing `GL_CCW' to MODE selects
7650counterclockwise polygons as front-facing; `GL_CW' selects clockwise
7651polygons as front-facing. By default, counterclockwise polygons are
7652taken to be front-facing.
7653
7654`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
7655
7656`GL_INVALID_OPERATION' is generated if `glFrontFace' is executed between
7657the execution of `glBegin' and the corresponding execution of `glEnd'.")
7658
25072f02 7659(define-gl-procedures
bb894c9d
AW
7660 ((glFrustum
7661 (left GLdouble)
7662 (right GLdouble)
7663 (bottom GLdouble)
7664 (top GLdouble)
7665 (nearVal GLdouble)
7666 (farVal GLdouble)
7667 ->
7668 void))
3c9b6116
AW
7669 "Multiply the current matrix by a perspective matrix.
7670
7671LEFT
7672 RIGHT
7673
7674 Specify the coordinates for the left and right vertical clipping
7675 planes.
7676
7677BOTTOM
7678 TOP
7679
7680 Specify the coordinates for the bottom and top horizontal clipping
7681 planes.
7682
7683NEARVAL
7684 FARVAL
7685
7686 Specify the distances to the near and far depth clipping planes.
7687 Both distances must be positive.
7688
7689`glFrustum' describes a perspective matrix that produces a perspective
7690projection. The current matrix (see `glMatrixMode') is multiplied by
7691this matrix and the result replaces the current matrix, as if
7692`glMultMatrix' were called with the following matrix as its argument:
7693
7694
7695
7696[(2\u2062NEARVAL,/RIGHT-LEFT,, 0 A 0), (0 2\u2062NEARVAL,/TOP-BOTTOM,, B 0), (0 0
7697C D), (0 0 -1 0),]
7698
7699A=RIGHT+LEFT,/RIGHT-LEFT,
7700
7701B=TOP+BOTTOM,/TOP-BOTTOM,
7702
7703C=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
7704
7705D=-2\u2062FARVAL\u2062NEARVAL,/FARVAL-NEARVAL,,
7706
7707
7708
7709Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
7710and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
7711that are mapped to the lower left and upper right corners of the window,
7712assuming that the eye is located at (0, 0, 0). -FARVAL specifies the
7713location of the far clipping plane. Both NEARVAL and FARVAL must be
7714positive.
7715
7716Use `glPushMatrix' and `glPopMatrix' to save and restore the current
7717matrix stack.
7718
7719`GL_INVALID_VALUE' is generated if NEARVAL or FARVAL is not positive, or
7720if LEFT = RIGHT, or BOTTOM = TOP, or NEAR = FAR.
7721
7722`GL_INVALID_OPERATION' is generated if `glFrustum' is executed between
7723the execution of `glBegin' and the corresponding execution of `glEnd'.")
7724
25072f02 7725(define-gl-procedures
00239761
AW
7726 ((glGenBuffers
7727 (n GLsizei)
7728 (buffers GLuint-*)
7729 ->
7730 void))
3c9b6116
AW
7731 "Generate buffer object names.
7732
7733N
7734 Specifies the number of buffer object names to be generated.
7735
7736BUFFERS
7737 Specifies an array in which the generated buffer object names are
7738 stored.
7739
7740`glGenBuffers' returns N buffer object names in BUFFERS. There is no
7741guarantee that the names form a contiguous set of integers; however, it
7742is guaranteed that none of the returned names was in use immediately
7743before the call to `glGenBuffers'.
7744
7745Buffer object names returned by a call to `glGenBuffers' are not
7746returned by subsequent calls, unless they are first deleted with
7747`glDeleteBuffers'.
7748
7749No buffer objects are associated with the returned buffer object names
7750until they are first bound by calling `glBindBuffer'.
7751
7752`GL_INVALID_VALUE' is generated if N is negative.
7753
7754`GL_INVALID_OPERATION' is generated if `glGenBuffers' is executed
7755between the execution of `glBegin' and the corresponding execution of
7756`glEnd'.")
7757
25072f02 7758(define-gl-procedures
bb894c9d 7759 ((glGenLists (range GLsizei) -> GLuint))
3c9b6116
AW
7760 "Generate a contiguous set of empty display lists.
7761
7762RANGE
7763 Specifies the number of contiguous empty display lists to be
7764 generated.
7765
7766`glGenLists' has one argument, RANGE. It returns an integer N such that
7767RANGE contiguous empty display lists, named N , N+1 , ... , N+RANGE-1 ,
7768are created. If RANGE is 0, if there is no group of RANGE contiguous
7769names available, or if any error is generated, no display lists are
7770generated, and 0 is returned.
7771
7772`GL_INVALID_VALUE' is generated if RANGE is negative.
7773
7774`GL_INVALID_OPERATION' is generated if `glGenLists' is executed between
7775the execution of `glBegin' and the corresponding execution of `glEnd'.")
7776
25072f02 7777(define-gl-procedures
00239761 7778 ((glGenQueries (n GLsizei) (ids GLuint-*) -> void))
3c9b6116
AW
7779 "Generate query object names.
7780
7781N
7782 Specifies the number of query object names to be generated.
7783
7784IDS
7785 Specifies an array in which the generated query object names are
7786 stored.
7787
7788`glGenQueries' returns N query object names in IDS. There is no
7789guarantee that the names form a contiguous set of integers; however, it
7790is guaranteed that none of the returned names was in use immediately
7791before the call to `glGenQueries'.
7792
7793Query object names returned by a call to `glGenQueries' are not returned
7794by subsequent calls, unless they are first deleted with
7795`glDeleteQueries'.
7796
7797No query objects are associated with the returned query object names
7798until they are first used by calling `glBeginQuery'.
7799
7800`GL_INVALID_VALUE' is generated if N is negative.
7801
7802`GL_INVALID_OPERATION' is generated if `glGenQueries' is executed
7803between the execution of `glBegin' and the corresponding execution of
7804`glEnd'.")
7805
25072f02 7806(define-gl-procedures
00239761
AW
7807 ((glGenTextures
7808 (n GLsizei)
7809 (textures GLuint-*)
7810 ->
7811 void))
3c9b6116
AW
7812 "Generate texture names.
7813
7814N
7815 Specifies the number of texture names to be generated.
7816
7817TEXTURES
7818 Specifies an array in which the generated texture names are stored.
7819
7820`glGenTextures' returns N texture names in TEXTURES. There is no
7821guarantee that the names form a contiguous set of integers; however, it
7822is guaranteed that none of the returned names was in use immediately
7823before the call to `glGenTextures'.
7824
7825The generated textures have no dimensionality; they assume the
7826dimensionality of the texture target to which they are first bound (see
7827`glBindTexture').
7828
7829Texture names returned by a call to `glGenTextures' are not returned by
7830subsequent calls, unless they are first deleted with `glDeleteTextures'.
7831
7832`GL_INVALID_VALUE' is generated if N is negative.
7833
7834`GL_INVALID_OPERATION' is generated if `glGenTextures' is executed
7835between the execution of `glBegin' and the corresponding execution of
7836`glEnd'.")
7837
25072f02 7838(define-gl-procedures
bb894c9d
AW
7839 ((glGetActiveAttrib
7840 (program GLuint)
7841 (index GLuint)
7842 (bufSize GLsizei)
00239761
AW
7843 (length GLsizei-*)
7844 (size GLint-*)
7845 (type GLenum-*)
7846 (name GLchar-*)
bb894c9d
AW
7847 ->
7848 void))
3c9b6116
AW
7849 "Returns information about an active attribute variable for the specified
7850program object.
7851
7852PROGRAM
7853 Specifies the program object to be queried.
7854
7855INDEX
7856 Specifies the index of the attribute variable to be queried.
7857
7858BUFSIZE
7859 Specifies the maximum number of characters OpenGL is allowed to
7860 write in the character buffer indicated by NAME.
7861
7862LENGTH
7863 Returns the number of characters actually written by OpenGL in the
7864 string indicated by NAME (excluding the null terminator) if a value
7865 other than `NULL' is passed.
7866
7867SIZE
7868 Returns the size of the attribute variable.
7869
7870TYPE
7871 Returns the data type of the attribute variable.
7872
7873NAME
7874 Returns a null terminated string containing the name of the
7875 attribute variable.
7876
7877`glGetActiveAttrib' returns information about an active attribute
7878variable in the program object specified by PROGRAM. The number of
7879active attributes can be obtained by calling `glGetProgram' with the
7880value `GL_ACTIVE_ATTRIBUTES'. A value of 0 for INDEX selects the first
7881active attribute variable. Permissible values for INDEX range from 0 to
7882the number of active attribute variables minus 1.
7883
7884A vertex shader may use either built-in attribute variables,
7885user-defined attribute variables, or both. Built-in attribute variables
7886have a prefix of \"gl_\" and reference conventional OpenGL vertex
7887attribtes (e.g., GL_VERTEX, GL_NORMAL, etc., see the OpenGL Shading
7888Language specification for a complete list.) User-defined attribute
7889variables have arbitrary names and obtain their values through numbered
7890generic vertex attributes. An attribute variable (either built-in or
7891user-defined) is considered active if it is determined during the link
7892operation that it may be accessed during program execution. Therefore,
7893PROGRAM should have previously been the target of a call to
7894`glLinkProgram', but it is not necessary for it to have been linked
7895successfully.
7896
7897The size of the character buffer required to store the longest attribute
7898variable name in PROGRAM can be obtained by calling `glGetProgram' with
7899the value `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'. This value should be used to
7900allocate a buffer of sufficient size to store the returned attribute
7901name. The size of this character buffer is passed in BUFSIZE, and a
7902pointer to this character buffer is passed in NAME.
7903
7904`glGetActiveAttrib' returns the name of the attribute variable indicated
7905by INDEX, storing it in the character buffer specified by NAME. The
7906string returned will be null terminated. The actual number of characters
7907written into this buffer is returned in LENGTH, and this count does not
7908include the null termination character. If the length of the returned
7909string is not required, a value of `NULL' can be passed in the LENGTH
7910argument.
7911
7912The TYPE argument will return a pointer to the attribute variable's data
7913type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
7914`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3',
7915`GL_FLOAT_MAT4', `GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4',
7916`GL_FLOAT_MAT3x2', `GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', or
7917`GL_FLOAT_MAT4x3' may be returned. The SIZE argument will return the
7918size of the attribute, in units of the type returned in TYPE.
7919
7920The list of active attribute variables may include both built-in
7921attribute variables (which begin with the prefix \"gl_\") as well as
7922user-defined attribute variable names.
7923
7924This function will return as much information as it can about the
7925specified active attribute variable. If no information is available,
7926LENGTH will be 0, and NAME will be an empty string. This situation could
7927occur if this function is called after a link operation that failed. If
7928an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
7929unmodified.
7930
7931`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
7932OpenGL.
7933
7934`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
7935
7936`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
7937number of active attribute variables in PROGRAM.
7938
7939`GL_INVALID_OPERATION' is generated if `glGetActiveAttrib' is executed
7940between the execution of `glBegin' and the corresponding execution of
7941`glEnd'.
7942
7943`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
7944
25072f02 7945(define-gl-procedures
bb894c9d
AW
7946 ((glGetActiveUniform
7947 (program GLuint)
7948 (index GLuint)
7949 (bufSize GLsizei)
00239761
AW
7950 (length GLsizei-*)
7951 (size GLint-*)
7952 (type GLenum-*)
7953 (name GLchar-*)
bb894c9d
AW
7954 ->
7955 void))
3c9b6116
AW
7956 "Returns information about an active uniform variable for the specified
7957program object.
7958
7959PROGRAM
7960 Specifies the program object to be queried.
7961
7962INDEX
7963 Specifies the index of the uniform variable to be queried.
7964
7965BUFSIZE
7966 Specifies the maximum number of characters OpenGL is allowed to
7967 write in the character buffer indicated by NAME.
7968
7969LENGTH
7970 Returns the number of characters actually written by OpenGL in the
7971 string indicated by NAME (excluding the null terminator) if a value
7972 other than `NULL' is passed.
7973
7974SIZE
7975 Returns the size of the uniform variable.
7976
7977TYPE
7978 Returns the data type of the uniform variable.
7979
7980NAME
7981 Returns a null terminated string containing the name of the uniform
7982 variable.
7983
7984`glGetActiveUniform' returns information about an active uniform
7985variable in the program object specified by PROGRAM. The number of
7986active uniform variables can be obtained by calling `glGetProgram' with
7987the value `GL_ACTIVE_UNIFORMS'. A value of 0 for INDEX selects the first
7988active uniform variable. Permissible values for INDEX range from 0 to
7989the number of active uniform variables minus 1.
7990
7991Shaders may use either built-in uniform variables, user-defined uniform
7992variables, or both. Built-in uniform variables have a prefix of \"gl_\"
7993and reference existing OpenGL state or values derived from such state
7994(e.g., GL_FOG, GL_MODELVIEWMATRIX, etc., see the OpenGL Shading Language
7995specification for a complete list.) User-defined uniform variables have
7996arbitrary names and obtain their values from the application through
7997calls to `glUniform'. A uniform variable (either built-in or
7998user-defined) is considered active if it is determined during the link
7999operation that it may be accessed during program execution. Therefore,
8000PROGRAM should have previously been the target of a call to
8001`glLinkProgram', but it is not necessary for it to have been linked
8002successfully.
8003
8004The size of the character buffer required to store the longest uniform
8005variable name in PROGRAM can be obtained by calling `glGetProgram' with
8006the value `GL_ACTIVE_UNIFORM_MAX_LENGTH'. This value should be used to
8007allocate a buffer of sufficient size to store the returned uniform
8008variable name. The size of this character buffer is passed in BUFSIZE,
8009and a pointer to this character buffer is passed in NAME.
8010
8011`glGetActiveUniform' returns the name of the uniform variable indicated
8012by INDEX, storing it in the character buffer specified by NAME. The
8013string returned will be null terminated. The actual number of characters
8014written into this buffer is returned in LENGTH, and this count does not
8015include the null termination character. If the length of the returned
8016string is not required, a value of `NULL' can be passed in the LENGTH
8017argument.
8018
8019The TYPE argument will return a pointer to the uniform variable's data
8020type. The symbolic constants `GL_FLOAT', `GL_FLOAT_VEC2',
8021`GL_FLOAT_VEC3', `GL_FLOAT_VEC4', `GL_INT', `GL_INT_VEC2',
8022`GL_INT_VEC3', `GL_INT_VEC4', `GL_BOOL', `GL_BOOL_VEC2', `GL_BOOL_VEC3',
8023`GL_BOOL_VEC4', `GL_FLOAT_MAT2', `GL_FLOAT_MAT3', `GL_FLOAT_MAT4',
8024`GL_FLOAT_MAT2x3', `GL_FLOAT_MAT2x4', `GL_FLOAT_MAT3x2',
8025`GL_FLOAT_MAT3x4', `GL_FLOAT_MAT4x2', `GL_FLOAT_MAT4x3',
8026`GL_SAMPLER_1D', `GL_SAMPLER_2D', `GL_SAMPLER_3D', `GL_SAMPLER_CUBE',
8027`GL_SAMPLER_1D_SHADOW', or `GL_SAMPLER_2D_SHADOW' may be returned.
8028
8029If one or more elements of an array are active, the name of the array is
8030returned in NAME, the type is returned in TYPE, and the SIZE parameter
8031returns the highest array element index used, plus one, as determined by
8032the compiler and/or linker. Only one active uniform variable will be
8033reported for a uniform array.
8034
8035Uniform variables that are declared as structures or arrays of
8036structures will not be returned directly by this function. Instead, each
8037of these uniform variables will be reduced to its fundamental components
8038containing the \".\" and \"[]\" operators such that each of the names is
8039valid as an argument to `glGetUniformLocation'. Each of these reduced
8040uniform variables is counted as one active uniform variable and is
8041assigned an index. A valid name cannot be a structure, an array of
8042structures, or a subcomponent of a vector or matrix.
8043
8044The size of the uniform variable will be returned in SIZE. Uniform
8045variables other than arrays will have a size of 1. Structures and arrays
8046of structures will be reduced as described earlier, such that each of
8047the names returned will be a data type in the earlier list. If this
8048reduction results in an array, the size returned will be as described
8049for uniform arrays; otherwise, the size returned will be 1.
8050
8051The list of active uniform variables may include both built-in uniform
8052variables (which begin with the prefix \"gl_\") as well as user-defined
8053uniform variable names.
8054
8055This function will return as much information as it can about the
8056specified active uniform variable. If no information is available,
8057LENGTH will be 0, and NAME will be an empty string. This situation could
8058occur if this function is called after a link operation that failed. If
8059an error occurs, the return values LENGTH, SIZE, TYPE, and NAME will be
8060unmodified.
8061
8062`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8063OpenGL.
8064
8065`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8066
8067`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to the
8068number of active uniform variables in PROGRAM.
8069
8070`GL_INVALID_OPERATION' is generated if `glGetActiveUniform' is executed
8071between the execution of `glBegin' and the corresponding execution of
8072`glEnd'.
8073
8074`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.")
8075
25072f02 8076(define-gl-procedures
bb894c9d
AW
8077 ((glGetAttachedShaders
8078 (program GLuint)
8079 (maxCount GLsizei)
00239761
AW
8080 (count GLsizei-*)
8081 (shaders GLuint-*)
bb894c9d
AW
8082 ->
8083 void))
3c9b6116
AW
8084 "Returns the handles of the shader objects attached to a program object.
8085
8086PROGRAM
8087 Specifies the program object to be queried.
8088
8089MAXCOUNT
8090 Specifies the size of the array for storing the returned object
8091 names.
8092
8093COUNT
8094 Returns the number of names actually returned in OBJECTS.
8095
8096SHADERS
8097 Specifies an array that is used to return the names of attached
8098 shader objects.
8099
8100`glGetAttachedShaders' returns the names of the shader objects attached
8101to PROGRAM. The names of shader objects that are attached to PROGRAM
8102will be returned in SHADERS. The actual number of shader names written
8103into SHADERS is returned in COUNT. If no shader objects are attached to
8104PROGRAM, COUNT is set to 0. The maximum number of shader names that may
8105be returned in SHADERS is specified by MAXCOUNT.
8106
8107If the number of names actually returned is not required (for instance,
8108if it has just been obtained by calling `glGetProgram'), a value of
8109`NULL' may be passed for count. If no shader objects are attached to
8110PROGRAM, a value of 0 will be returned in COUNT. The actual number of
8111attached shaders can be obtained by calling `glGetProgram' with the
8112value `GL_ATTACHED_SHADERS'.
8113
8114`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
8115OpenGL.
8116
8117`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8118
8119`GL_INVALID_VALUE' is generated if MAXCOUNT is less than 0.
8120
8121`GL_INVALID_OPERATION' is generated if `glGetAttachedShaders' is
8122executed between the execution of `glBegin' and the corresponding
8123execution of `glEnd'.")
8124
25072f02 8125(define-gl-procedures
bb894c9d
AW
8126 ((glGetAttribLocation
8127 (program GLuint)
00239761 8128 (name const-GLchar-*)
bb894c9d
AW
8129 ->
8130 GLint))
3c9b6116
AW
8131 "Returns the location of an attribute variable.
8132
8133PROGRAM
8134 Specifies the program object to be queried.
8135
8136NAME
8137 Points to a null terminated string containing the name of the
8138 attribute variable whose location is to be queried.
8139
8140`glGetAttribLocation' queries the previously linked program object
8141specified by PROGRAM for the attribute variable specified by NAME and
8142returns the index of the generic vertex attribute that is bound to that
8143attribute variable. If NAME is a matrix attribute variable, the index of
8144the first column of the matrix is returned. If the named attribute
8145variable is not an active attribute in the specified program object or
8146if NAME starts with the reserved prefix \"gl_\", a value of -1 is
8147returned.
8148
8149The association between an attribute variable name and a generic
8150attribute index can be specified at any time by calling
8151`glBindAttribLocation'. Attribute bindings do not go into effect until
8152`glLinkProgram' is called. After a program object has been linked
8153successfully, the index values for attribute variables remain fixed
8154until the next link command occurs. The attribute values can only be
8155queried after a link if the link was successful. `glGetAttribLocation'
8156returns the binding that actually went into effect the last time
8157`glLinkProgram' was called for the specified program object. Attribute
8158bindings that have been specified since the last link operation are not
8159returned by `glGetAttribLocation'.
8160
8161`GL_INVALID_OPERATION' is generated if PROGRAM is not a value generated
8162by OpenGL.
8163
8164`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
8165
8166`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
8167linked.
8168
8169`GL_INVALID_OPERATION' is generated if `glGetAttribLocation' is executed
8170between the execution of `glBegin' and the corresponding execution of
8171`glEnd'.")
8172
b002944d
AW
8173(define-gl-procedures
8174 ((glGetBufferParameteriv
8175 (target GLenum)
8176 (value GLenum)
8177 (data GLint-*)
8178 ->
8179 void))
8180 "Return parameters of a buffer object.
8181
8182TARGET
8183 Specifies the target buffer object. The symbolic constant must be
8184 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8185 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8186
8187VALUE
8188 Specifies the symbolic name of a buffer object parameter. Accepted
8189 values are `GL_BUFFER_ACCESS', `GL_BUFFER_MAPPED',
8190 `GL_BUFFER_SIZE', or `GL_BUFFER_USAGE'.
8191
8192DATA
8193 Returns the requested parameter.
8194
8195`glGetBufferParameteriv' returns in DATA a selected parameter of the
8196buffer object specified by TARGET.
8197
8198VALUE names a specific buffer object parameter, as follows:
8199
8200`GL_BUFFER_ACCESS'
8201 PARAMS returns the access policy set while mapping the buffer
8202 object. The initial value is `GL_READ_WRITE'.
8203
8204`GL_BUFFER_MAPPED'
8205 PARAMS returns a flag indicating whether the buffer object is
8206 currently mapped. The initial value is `GL_FALSE'.
8207
8208`GL_BUFFER_SIZE'
8209 PARAMS returns the size of the buffer object, measured in bytes.
8210 The initial value is 0.
8211
8212`GL_BUFFER_USAGE'
8213 PARAMS returns the buffer object's usage pattern. The initial value
8214 is `GL_STATIC_DRAW'.
8215
8216`GL_INVALID_ENUM' is generated if TARGET or VALUE is not an accepted
8217value.
8218
8219`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8220is bound to TARGET.
8221
8222`GL_INVALID_OPERATION' is generated if `glGetBufferParameteriv' is
8223executed between the execution of `glBegin' and the corresponding
8224execution of `glEnd'.")
8225
8226(define-gl-procedures
8227 ((glGetBufferPointerv
8228 (target GLenum)
8229 (pname GLenum)
8230 (params GLvoid-**)
8231 ->
8232 void))
8233 "Return the pointer to a mapped buffer object's data store.
8234
8235TARGET
8236 Specifies the target buffer object. The symbolic constant must be
8237 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8238 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8239
8240PNAME
8241 Specifies the pointer to be returned. The symbolic constant must be
8242 `GL_BUFFER_MAP_POINTER'.
8243
8244PARAMS
8245 Returns the pointer value specified by PNAME.
8246
8247`glGetBufferPointerv' returns pointer information. PNAME is a symbolic
8248constant indicating the pointer to be returned, which must be
8249`GL_BUFFER_MAP_POINTER', the pointer to which the buffer object's data
8250store is mapped. If the data store is not currently mapped, `NULL' is
8251returned. PARAMS is a pointer to a location in which to place the
8252returned pointer value.
8253
8254`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
8255value.
8256
8257`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8258is bound to TARGET.
8259
8260`GL_INVALID_OPERATION' is generated if `glGetBufferPointerv' is executed
8261between the execution of `glBegin' and the corresponding execution of
8262`glEnd'.")
8263
25072f02 8264(define-gl-procedures
bb894c9d
AW
8265 ((glGetBufferSubData
8266 (target GLenum)
8267 (offset GLintptr)
8268 (size GLsizeiptr)
00239761 8269 (data GLvoid-*)
bb894c9d
AW
8270 ->
8271 void))
3c9b6116
AW
8272 "Returns a subset of a buffer object's data store.
8273
8274TARGET
8275 Specifies the target buffer object. The symbolic constant must be
8276 `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
8277 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
8278
8279OFFSET
8280 Specifies the offset into the buffer object's data store from which
8281 data will be returned, measured in bytes.
8282
8283SIZE
8284 Specifies the size in bytes of the data store region being
8285 returned.
8286
8287DATA
8288 Specifies a pointer to the location where buffer object data is
8289 returned.
8290
8291`glGetBufferSubData' returns some or all of the data from the buffer
8292object currently bound to TARGET. Data starting at byte offset OFFSET
8293and extending for SIZE bytes is copied from the data store to the memory
8294pointed to by DATA. An error is thrown if the buffer object is currently
8295mapped, or if OFFSET and SIZE together define a range beyond the bounds
8296of the buffer object's data store.
8297
8298`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
8299`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
8300`GL_PIXEL_UNPACK_BUFFER'.
8301
8302`GL_INVALID_VALUE' is generated if OFFSET or SIZE is negative, or if
8303together they define a region of memory that extends beyond the buffer
8304object's allocated data store.
8305
8306`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
8307is bound to TARGET.
8308
8309`GL_INVALID_OPERATION' is generated if the buffer object being queried
8310is mapped.
8311
8312`GL_INVALID_OPERATION' is generated if `glGetBufferSubData' is executed
8313between the execution of `glBegin' and the corresponding execution of
8314`glEnd'.")
8315
25072f02 8316(define-gl-procedures
bb894c9d
AW
8317 ((glGetClipPlane
8318 (plane GLenum)
00239761 8319 (equation GLdouble-*)
bb894c9d
AW
8320 ->
8321 void))
3c9b6116
AW
8322 "Return the coefficients of the specified clipping plane.
8323
8324PLANE
8325 Specifies a clipping plane. The number of clipping planes depends
8326 on the implementation, but at least six clipping planes are
8327 supported. They are identified by symbolic names of the form
8328 `GL_CLIP_PLANE' I where i ranges from 0 to the value of
8329 `GL_MAX_CLIP_PLANES' - 1.
8330
8331EQUATION
8332 Returns four double-precision values that are the coefficients of
8333 the plane equation of PLANE in eye coordinates. The initial value
8334 is (0, 0, 0, 0).
8335
8336`glGetClipPlane' returns in EQUATION the four coefficients of the plane
8337equation for PLANE.
8338
8339`GL_INVALID_ENUM' is generated if PLANE is not an accepted value.
8340
8341`GL_INVALID_OPERATION' is generated if `glGetClipPlane' is executed
8342between the execution of `glBegin' and the corresponding execution of
8343`glEnd'.")
8344
b002944d
AW
8345(define-gl-procedures
8346 ((glGetColorTableParameterfv
8347 (target GLenum)
8348 (pname GLenum)
8349 (params GLfloat-*)
8350 ->
8351 void)
8352 (glGetColorTableParameteriv
8353 (target GLenum)
8354 (pname GLenum)
8355 (params GLint-*)
8356 ->
8357 void))
8358 "Get color lookup table parameters.
8359
8360TARGET
8361 The target color table. Must be `GL_COLOR_TABLE',
8362 `GL_POST_CONVOLUTION_COLOR_TABLE',
8363 `GL_POST_COLOR_MATRIX_COLOR_TABLE', `GL_PROXY_COLOR_TABLE',
8364 `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
8365 `GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
8366
8367PNAME
8368 The symbolic name of a color lookup table parameter. Must be one of
8369 `GL_COLOR_TABLE_BIAS', `GL_COLOR_TABLE_SCALE',
8370 `GL_COLOR_TABLE_FORMAT', `GL_COLOR_TABLE_WIDTH',
8371 `GL_COLOR_TABLE_RED_SIZE', `GL_COLOR_TABLE_GREEN_SIZE',
8372 `GL_COLOR_TABLE_BLUE_SIZE', `GL_COLOR_TABLE_ALPHA_SIZE',
8373 `GL_COLOR_TABLE_LUMINANCE_SIZE', or
8374 `GL_COLOR_TABLE_INTENSITY_SIZE'.
8375
8376PARAMS
8377 A pointer to an array where the values of the parameter will be
8378 stored.
8379
8380Returns parameters specific to color table TARGET.
8381
8382When PNAME is set to `GL_COLOR_TABLE_SCALE' or `GL_COLOR_TABLE_BIAS',
8383`glGetColorTableParameter' returns the color table scale or bias
8384parameters for the table specified by TARGET. For these queries, TARGET
8385must be set to `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8386`GL_POST_COLOR_MATRIX_COLOR_TABLE' and PARAMS points to an array of four
8387elements, which receive the scale or bias factors for red, green, blue,
8388and alpha, in that order.
8389
8390`glGetColorTableParameter' can also be used to retrieve the format and
8391size parameters for a color table. For these queries, set TARGET to
8392either the color table target or the proxy color table target. The
8393format and size parameters are set by `glColorTable'.
8394
8395The following table lists the format and size parameters that may be
8396queried. For each symbolic constant listed below for PNAME, PARAMS must
8397point to an array of the given length and receive the values indicated.
8398
8399
8400
8401*Parameter*
8402 *N*, *Meaning*
8403
8404`GL_COLOR_TABLE_FORMAT'
8405 1 , Internal format (e.g., `GL_RGBA')
8406
8407`GL_COLOR_TABLE_WIDTH'
8408 1 , Number of elements in table
8409
8410`GL_COLOR_TABLE_RED_SIZE'
8411 1 , Size of red component, in bits
8412
8413`GL_COLOR_TABLE_GREEN_SIZE'
8414 1 , Size of green component
8415
8416`GL_COLOR_TABLE_BLUE_SIZE'
8417 1 , Size of blue component
8418
8419`GL_COLOR_TABLE_ALPHA_SIZE'
8420 1 , Size of alpha component
8421
8422`GL_COLOR_TABLE_LUMINANCE_SIZE'
8423 1 , Size of luminance component
8424
8425`GL_COLOR_TABLE_INTENSITY_SIZE'
8426 1 , Size of intensity component
8427
8428
8429
8430`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an acceptable
8431value.
8432
8433`GL_INVALID_OPERATION' is generated if `glGetColorTableParameter' is
8434executed between the execution of `glBegin' and the corresponding
8435execution of `glEnd'.")
8436
25072f02 8437(define-gl-procedures
bb894c9d
AW
8438 ((glGetColorTable
8439 (target GLenum)
8440 (format GLenum)
8441 (type GLenum)
00239761 8442 (table GLvoid-*)
bb894c9d
AW
8443 ->
8444 void))
3c9b6116
AW
8445 "Retrieve contents of a color lookup table.
8446
8447TARGET
8448 Must be `GL_COLOR_TABLE', `GL_POST_CONVOLUTION_COLOR_TABLE', or
8449 `GL_POST_COLOR_MATRIX_COLOR_TABLE'.
8450
8451FORMAT
8452 The format of the pixel data in TABLE. The possible values are
8453 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_LUMINANCE',
8454 `GL_LUMINANCE_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', and `GL_BGRA'.
8455
8456TYPE
8457 The type of the pixel data in TABLE. Symbolic constants
8458 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8459 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8460 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8461 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8462 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8463 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8464 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8465 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8466 are accepted.
8467
8468TABLE
8469 Pointer to a one-dimensional array of pixel data containing the
8470 contents of the color table.
8471
8472`glGetColorTable' returns in TABLE the contents of the color table
8473specified by TARGET. No pixel transfer operations are performed, but
8474pixel storage modes that are applicable to `glReadPixels' are performed.
8475
8476If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8477target (see `glBindBuffer') while a histogram table is requested, TABLE
8478is treated as a byte offset into the buffer object's data store.
8479
8480Color components that are requested in the specified FORMAT, but which
8481are not included in the internal format of the color lookup table, are
8482returned as zero. The assignments of internal color components to the
8483components requested by FORMAT are
8484
8485*Internal Component*
8486 *Resulting Component*
8487
8488Red
8489 Red
8490
8491Green
8492 Green
8493
8494Blue
8495 Blue
8496
8497Alpha
8498 Alpha
8499
8500Luminance
8501 Red
8502
8503Intensity
8504 Red
8505
8506
8507
8508`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8509values.
8510
8511`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8512values.
8513
8514`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8515values.
8516
8517`GL_INVALID_OPERATION' is generated if TYPE is one of
8518`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8519`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8520is not `GL_RGB'.
8521
8522`GL_INVALID_OPERATION' is generated if TYPE is one of
8523`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8524`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8525`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8526`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8527FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8528
8529`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8530bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8531store is currently mapped.
8532
8533`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8534bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8535to the buffer object such that the memory writes required would exceed
8536the data store size.
8537
8538`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8539bound to the `GL_PIXEL_PACK_BUFFER' target and TABLE is not evenly
8540divisible into the number of bytes needed to store in memory a datum
8541indicated by TYPE.
8542
8543`GL_INVALID_OPERATION' is generated if `glGetColorTable' is executed
8544between the execution of `glBegin' and the corresponding execution of
8545`glEnd'.")
8546
25072f02 8547(define-gl-procedures
bb894c9d
AW
8548 ((glGetCompressedTexImage
8549 (target GLenum)
8550 (lod GLint)
00239761 8551 (img GLvoid-*)
bb894c9d
AW
8552 ->
8553 void))
3c9b6116
AW
8554 "Return a compressed texture image.
8555
8556TARGET
8557 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
8558 `GL_TEXTURE_2D', and
8559 `GL_TEXTURE_3D'`GL_TEXTURE_CUBE_MAP_POSITIVE_X',
8560 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
8561 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
8562 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
8563
8564LOD
8565 Specifies the level-of-detail number of the desired image. Level 0
8566 is the base image level. Level N is the N th mipmap reduction
8567 image.
8568
8569IMG
8570 Returns the compressed texture image.
8571
8572`glGetCompressedTexImage' returns the compressed texture image
8573associated with TARGET and LOD into IMG. IMG should be an array of
8574`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' bytes. TARGET specifies whether the
8575desired texture image was one specified by `glTexImage1D'
8576(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
8577`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LOD
8578specifies the level-of-detail number of the desired image.
8579
8580If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8581target (see `glBindBuffer') while a texture image is requested, IMG is
8582treated as a byte offset into the buffer object's data store.
8583
8584To minimize errors, first verify that the texture is compressed by
8585calling `glGetTexLevelParameter' with argument `GL_TEXTURE_COMPRESSED'.
8586If the texture is compressed, then determine the amount of memory
8587required to store the compressed texture by calling
8588`glGetTexLevelParameter' with argument
8589`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'. Finally, retrieve the internal
8590format of the texture by calling `glGetTexLevelParameter' with argument
8591`GL_TEXTURE_INTERNAL_FORMAT'. To store the texture for later use,
8592associate the internal format and size with the retrieved texture image.
8593These data can be used by the respective texture or subtexture loading
8594routine used for loading TARGET textures.
8595
8596`GL_INVALID_VALUE' is generated if LOD is less than zero or greater than
8597the maximum number of LODs permitted by the implementation.
8598
8599`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is used
8600to retrieve a texture that is in an uncompressed internal format.
8601
8602`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8603bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8604store is currently mapped.
8605
8606`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8607bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8608to the buffer object such that the memory writes required would exceed
8609the data store size.
8610
8611`GL_INVALID_OPERATION' is generated if `glGetCompressedTexImage' is
8612executed between the execution of `glBegin' and the corresponding
8613execution of `glEnd'.")
8614
25072f02 8615(define-gl-procedures
bb894c9d
AW
8616 ((glGetConvolutionFilter
8617 (target GLenum)
8618 (format GLenum)
8619 (type GLenum)
00239761 8620 (image GLvoid-*)
bb894c9d
AW
8621 ->
8622 void))
3c9b6116
AW
8623 "Get current 1D or 2D convolution filter kernel.
8624
8625TARGET
8626 The filter to be retrieved. Must be one of `GL_CONVOLUTION_1D' or
8627 `GL_CONVOLUTION_2D'.
8628
8629FORMAT
8630 Format of the output image. Must be one of `GL_RED', `GL_GREEN',
8631 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
8632 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8633
8634TYPE
8635 Data type of components in the output image. Symbolic constants
8636 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8637 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
8638 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8639 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
8640 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8641 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8642 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8643 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
8644 are accepted.
8645
8646IMAGE
8647 Pointer to storage for the output image.
8648
8649`glGetConvolutionFilter' returns the current 1D or 2D convolution filter
8650kernel as an image. The one- or two-dimensional image is placed in IMAGE
8651according to the specifications in FORMAT and TYPE. No pixel transfer
8652operations are performed on this image, but the relevant pixel storage
8653modes are applied.
8654
8655If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
8656target (see `glBindBuffer') while a convolution filter is requested,
8657IMAGE is treated as a byte offset into the buffer object's data store.
8658
8659Color components that are present in FORMAT but not included in the
8660internal format of the filter are returned as zero. The assignments of
8661internal color components to the components of FORMAT are as follows.
8662
8663*Internal Component*
8664 *Resulting Component*
8665
8666Red
8667 Red
8668
8669Green
8670 Green
8671
8672Blue
8673 Blue
8674
8675Alpha
8676 Alpha
8677
8678Luminance
8679 Red
8680
8681Intensity
8682 Red
8683
8684
8685
8686`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8687values.
8688
8689`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
8690values.
8691
8692`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
8693values.
8694
8695`GL_INVALID_OPERATION' is generated if TYPE is one of
8696`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
8697`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
8698is not `GL_RGB'.
8699
8700`GL_INVALID_OPERATION' is generated if TYPE is one of
8701`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
8702`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
8703`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
8704`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
8705FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8706
8707`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8708bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
8709store is currently mapped.
8710
8711`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8712bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
8713to the buffer object such that the memory writes required would exceed
8714the data store size.
8715
8716`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
8717bound to the `GL_PIXEL_PACK_BUFFER' target and IMAGE is not evenly
8718divisible into the number of bytes needed to store in memory a datum
8719indicated by TYPE.
8720
8721`GL_INVALID_OPERATION' is generated if `glGetConvolutionFilter' is
8722executed between the execution of `glBegin' and the corresponding
8723execution of `glEnd'.")
8724
b002944d
AW
8725(define-gl-procedures
8726 ((glGetConvolutionParameterfv
8727 (target GLenum)
8728 (pname GLenum)
8729 (params GLfloat-*)
8730 ->
8731 void)
8732 (glGetConvolutionParameteriv
8733 (target GLenum)
8734 (pname GLenum)
8735 (params GLint-*)
8736 ->
8737 void))
8738 "Get convolution parameters.
8739
8740TARGET
8741 The filter whose parameters are to be retrieved. Must be one of
8742 `GL_CONVOLUTION_1D', `GL_CONVOLUTION_2D', or `GL_SEPARABLE_2D'.
8743
8744PNAME
8745 The parameter to be retrieved. Must be one of
8746 `GL_CONVOLUTION_BORDER_MODE', `GL_CONVOLUTION_BORDER_COLOR',
8747 `GL_CONVOLUTION_FILTER_SCALE', `GL_CONVOLUTION_FILTER_BIAS',
8748 `GL_CONVOLUTION_FORMAT', `GL_CONVOLUTION_WIDTH',
8749 `GL_CONVOLUTION_HEIGHT', `GL_MAX_CONVOLUTION_WIDTH', or
8750 `GL_MAX_CONVOLUTION_HEIGHT'.
8751
8752PARAMS
8753 Pointer to storage for the parameters to be retrieved.
8754
8755`glGetConvolutionParameter' retrieves convolution parameters. TARGET
8756determines which convolution filter is queried. PNAME determines which
8757parameter is returned:
8758
8759`GL_CONVOLUTION_BORDER_MODE'
8760
8761
8762 The convolution border mode. See `glConvolutionParameter' for a
8763 list of border modes.
8764
8765`GL_CONVOLUTION_BORDER_COLOR'
8766
8767
8768 The current convolution border color. PARAMS must be a pointer to
8769 an array of four elements, which will receive the red, green, blue,
8770 and alpha border colors.
8771
8772`GL_CONVOLUTION_FILTER_SCALE'
8773
8774
8775 The current filter scale factors. PARAMS must be a pointer to an
8776 array of four elements, which will receive the red, green, blue,
8777 and alpha filter scale factors in that order.
8778
8779`GL_CONVOLUTION_FILTER_BIAS'
8780
8781
8782 The current filter bias factors. PARAMS must be a pointer to an
8783 array of four elements, which will receive the red, green, blue,
8784 and alpha filter bias terms in that order.
8785
8786`GL_CONVOLUTION_FORMAT'
8787
8788
8789 The current internal format. See `glConvolutionFilter1D',
8790 `glConvolutionFilter2D', and `glSeparableFilter2D' for lists of
8791 allowable formats.
8792
8793`GL_CONVOLUTION_WIDTH'
8794
8795
8796 The current filter image width.
8797
8798`GL_CONVOLUTION_HEIGHT'
8799
8800
8801 The current filter image height.
8802
8803`GL_MAX_CONVOLUTION_WIDTH'
8804
8805
8806 The maximum acceptable filter image width.
8807
8808`GL_MAX_CONVOLUTION_HEIGHT'
8809
8810
8811 The maximum acceptable filter image height.
8812
8813`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8814values.
8815
8816`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8817values.
8818
8819`GL_INVALID_ENUM' is generated if TARGET is `GL_CONVOLUTION_1D' and
8820PNAME is `GL_CONVOLUTION_HEIGHT' or `GL_MAX_CONVOLUTION_HEIGHT'.
8821
8822`GL_INVALID_OPERATION' is generated if `glGetConvolutionParameter' is
8823executed between the execution of `glBegin' and the corresponding
8824execution of `glEnd'.")
8825
25072f02 8826(define-gl-procedures
bb894c9d 8827 ((glGetError -> GLenum))
3c9b6116
AW
8828 "Return error information.
8829
8830`glGetError' returns the value of the error flag. Each detectable error
8831is assigned a numeric code and symbolic name. When an error occurs, the
8832error flag is set to the appropriate error code value. No other errors
8833are recorded until `glGetError' is called, the error code is returned,
8834and the flag is reset to `GL_NO_ERROR'. If a call to `glGetError'
8835returns `GL_NO_ERROR', there has been no detectable error since the last
8836call to `glGetError', or since the GL was initialized.
8837
8838To allow for distributed implementations, there may be several error
8839flags. If any single error flag has recorded an error, the value of that
8840flag is returned and that flag is reset to `GL_NO_ERROR' when
8841`glGetError' is called. If more than one flag has recorded an error,
8842`glGetError' returns and clears an arbitrary error flag value. Thus,
8843`glGetError' should always be called in a loop, until it returns
8844`GL_NO_ERROR', if all error flags are to be reset.
8845
8846Initially, all error flags are set to `GL_NO_ERROR'.
8847
8848The following errors are currently defined:
8849
8850`GL_NO_ERROR'
8851 No error has been recorded. The value of this symbolic constant is
8852 guaranteed to be 0.
8853
8854`GL_INVALID_ENUM'
8855 An unacceptable value is specified for an enumerated argument. The
8856 offending command is ignored and has no other side effect than to
8857 set the error flag.
8858
8859`GL_INVALID_VALUE'
8860 A numeric argument is out of range. The offending command is
8861 ignored and has no other side effect than to set the error flag.
8862
8863`GL_INVALID_OPERATION'
8864 The specified operation is not allowed in the current state. The
8865 offending command is ignored and has no other side effect than to
8866 set the error flag.
8867
8868`GL_STACK_OVERFLOW'
8869 This command would cause a stack overflow. The offending command is
8870 ignored and has no other side effect than to set the error flag.
8871
8872`GL_STACK_UNDERFLOW'
8873 This command would cause a stack underflow. The offending command
8874 is ignored and has no other side effect than to set the error flag.
8875
8876`GL_OUT_OF_MEMORY'
8877 There is not enough memory left to execute the command. The state
8878 of the GL is undefined, except for the state of the error flags,
8879 after this error is recorded.
8880
8881`GL_TABLE_TOO_LARGE'
8882 The specified table exceeds the implementation's maximum supported
8883 table size. The offending command is ignored and has no other side
8884 effect than to set the error flag.
8885
8886When an error flag is set, results of a GL operation are undefined only
8887if `GL_OUT_OF_MEMORY' has occurred. In all other cases, the command
8888generating the error is ignored and has no effect on the GL state or
8889frame buffer contents. If the generating command returns a value, it
8890returns 0. If `glGetError' itself generates an error, it returns 0.
8891
8892`GL_INVALID_OPERATION' is generated if `glGetError' is executed between
8893the execution of `glBegin' and the corresponding execution of `glEnd'.
8894In this case, `glGetError' returns 0.")
8895
b002944d
AW
8896(define-gl-procedures
8897 ((glGetHistogramParameterfv
8898 (target GLenum)
8899 (pname GLenum)
8900 (params GLfloat-*)
8901 ->
8902 void)
8903 (glGetHistogramParameteriv
8904 (target GLenum)
8905 (pname GLenum)
8906 (params GLint-*)
8907 ->
8908 void))
8909 "Get histogram parameters.
8910
8911TARGET
8912 Must be one of `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
8913
8914PNAME
8915 The name of the parameter to be retrieved. Must be one of
8916 `GL_HISTOGRAM_WIDTH', `GL_HISTOGRAM_FORMAT',
8917 `GL_HISTOGRAM_RED_SIZE', `GL_HISTOGRAM_GREEN_SIZE',
8918 `GL_HISTOGRAM_BLUE_SIZE', `GL_HISTOGRAM_ALPHA_SIZE',
8919 `GL_HISTOGRAM_LUMINANCE_SIZE', or `GL_HISTOGRAM_SINK'.
8920
8921PARAMS
8922 Pointer to storage for the returned values.
8923
8924`glGetHistogramParameter' is used to query parameter values for the
8925current histogram or for a proxy. The histogram state information may be
8926queried by calling `glGetHistogramParameter' with a TARGET of
8927`GL_HISTOGRAM' (to obtain information for the current histogram table)
8928or `GL_PROXY_HISTOGRAM' (to obtain information from the most recent
8929proxy request) and one of the following values for the PNAME argument:
8930
8931
8932
8933*Parameter*
8934 *Description*
8935
8936`GL_HISTOGRAM_WIDTH'
8937 Histogram table width
8938
8939`GL_HISTOGRAM_FORMAT'
8940 Internal format
8941
8942`GL_HISTOGRAM_RED_SIZE'
8943 Red component counter size, in bits
8944
8945`GL_HISTOGRAM_GREEN_SIZE'
8946 Green component counter size, in bits
8947
8948`GL_HISTOGRAM_BLUE_SIZE'
8949 Blue component counter size, in bits
8950
8951`GL_HISTOGRAM_ALPHA_SIZE'
8952 Alpha component counter size, in bits
8953
8954`GL_HISTOGRAM_LUMINANCE_SIZE'
8955 Luminance component counter size, in bits
8956
8957`GL_HISTOGRAM_SINK'
8958 Value of the SINK parameter
8959
8960
8961
8962`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
8963values.
8964
8965`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
8966values.
8967
8968`GL_INVALID_OPERATION' is generated if `glGetHistogramParameter' is
8969executed between the execution of `glBegin' and the corresponding
8970execution of `glEnd'.")
8971
25072f02 8972(define-gl-procedures
bb894c9d
AW
8973 ((glGetHistogram
8974 (target GLenum)
8975 (reset GLboolean)
8976 (format GLenum)
8977 (type GLenum)
00239761 8978 (values GLvoid-*)
bb894c9d
AW
8979 ->
8980 void))
3c9b6116
AW
8981 "Get histogram table.
8982
8983TARGET
8984 Must be `GL_HISTOGRAM'.
8985
8986RESET
8987 If `GL_TRUE', each component counter that is actually returned is
8988 reset to zero. (Other counters are unaffected.) If `GL_FALSE', none
8989 of the counters in the histogram table is modified.
8990
8991FORMAT
8992 The format of values to be returned in VALUES. Must be one of
8993 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
8994 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
8995
8996TYPE
8997 The type of values to be returned in VALUES. Symbolic constants
8998 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
8999 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9000 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9001 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9002 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9003 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9004 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9005 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
9006 are accepted.
9007
9008VALUES
9009 A pointer to storage for the returned histogram table.
9010
9011`glGetHistogram' returns the current histogram table as a
9012one-dimensional image with the same width as the histogram. No pixel
9013transfer operations are performed on this image, but pixel storage modes
9014that are applicable to 1D images are honored.
9015
9016If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9017target (see `glBindBuffer') while a histogram table is requested, VALUES
9018is treated as a byte offset into the buffer object's data store.
9019
9020Color components that are requested in the specified FORMAT, but which
9021are not included in the internal format of the histogram, are returned
9022as zero. The assignments of internal color components to the components
9023requested by FORMAT are:
9024
9025*Internal Component*
9026 *Resulting Component*
9027
9028Red
9029 Red
9030
9031Green
9032 Green
9033
9034Blue
9035 Blue
9036
9037Alpha
9038 Alpha
9039
9040Luminance
9041 Red
9042
9043
9044
9045`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
9046
9047`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
9048values.
9049
9050`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
9051values.
9052
9053`GL_INVALID_OPERATION' is generated if TYPE is one of
9054`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9055`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9056is not `GL_RGB'.
9057
9058`GL_INVALID_OPERATION' is generated if TYPE is one of
9059`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9060`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9061`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9062`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9063FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
9064
9065`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9066bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9067store is currently mapped.
9068
9069`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9070bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9071to the buffer object such that the memory writes required would exceed
9072the data store size.
9073
9074`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9075bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
9076divisible into the number of bytes needed to store in memory a datum
9077indicated by TYPE.
9078
9079`GL_INVALID_OPERATION' is generated if `glGetHistogram' is executed
9080between the execution of `glBegin' and the corresponding execution of
9081`glEnd'.")
9082
25072f02 9083(define-gl-procedures
b002944d
AW
9084 ((glGetLightfv
9085 (light GLenum)
9086 (pname GLenum)
9087 (params GLfloat-*)
9088 ->
9089 void)
9090 (glGetLightiv
9091 (light GLenum)
9092 (pname GLenum)
9093 (params GLint-*)
bb894c9d
AW
9094 ->
9095 void))
b002944d 9096 "Return light source parameter values.
3c9b6116 9097
b002944d
AW
9098LIGHT
9099 Specifies a light source. The number of possible lights depends on
9100 the implementation, but at least eight lights are supported. They
9101 are identified by symbolic names of the form `GL_LIGHT' I where I
9102 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
3c9b6116 9103
b002944d
AW
9104PNAME
9105 Specifies a light source parameter for LIGHT. Accepted symbolic
9106 names are `GL_AMBIENT', `GL_DIFFUSE', `GL_SPECULAR', `GL_POSITION',
9107 `GL_SPOT_DIRECTION', `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF',
9108 `GL_CONSTANT_ATTENUATION', `GL_LINEAR_ATTENUATION', and
9109 `GL_QUADRATIC_ATTENUATION'.
3c9b6116 9110
b002944d
AW
9111PARAMS
9112 Returns the requested data.
3c9b6116 9113
b002944d
AW
9114`glGetLight' returns in PARAMS the value or values of a light source
9115parameter. LIGHT names the light and is a symbolic name of the form
9116`GL_LIGHT'I where i ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
9117`GL_MAX_LIGHTS' is an implementation dependent constant that is greater
9118than or equal to eight. PNAME specifies one of ten light source
9119parameters, again by symbolic name.
9120
9121The following parameters are defined:
9122
9123`GL_AMBIENT'
9124 PARAMS returns four integer or floating-point values representing
9125 the ambient intensity of the light source. Integer values, when
9126 requested, are linearly mapped from the internal floating-point
9127 representation such that 1.0 maps to the most positive
9128 representable integer value, and -1.0 maps to the most negative
9129 representable integer value. If the internal value is outside the
9130 range [-1,1] , the corresponding integer return value is undefined.
9131 The initial value is (0, 0, 0, 1).
9132
9133`GL_DIFFUSE'
9134 PARAMS returns four integer or floating-point values representing
9135 the diffuse intensity of the light source. Integer values, when
9136 requested, are linearly mapped from the internal floating-point
9137 representation such that 1.0 maps to the most positive
9138 representable integer value, and -1.0 maps to the most negative
9139 representable integer value. If the internal value is outside the
9140 range [-1,1] , the corresponding integer return value is undefined.
9141 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
9142 lights, the initial value is (0, 0, 0, 0).
9143
9144`GL_SPECULAR'
9145 PARAMS returns four integer or floating-point values representing
9146 the specular intensity of the light source. Integer values, when
9147 requested, are linearly mapped from the internal floating-point
9148 representation such that 1.0 maps to the most positive
9149 representable integer value, and -1.0 maps to the most negative
9150 representable integer value. If the internal value is outside the
9151 range [-1,1] , the corresponding integer return value is undefined.
9152 The initial value for `GL_LIGHT0' is (1, 1, 1, 1); for other
9153 lights, the initial value is (0, 0, 0, 0).
9154
9155`GL_POSITION'
9156 PARAMS returns four integer or floating-point values representing
9157 the position of the light source. Integer values, when requested,
9158 are computed by rounding the internal floating-point values to the
9159 nearest integer value. The returned values are those maintained in
9160 eye coordinates. They will not be equal to the values specified
9161 using `glLight', unless the modelview matrix was identity at the
9162 time `glLight' was called. The initial value is (0, 0, 1, 0).
9163
9164`GL_SPOT_DIRECTION'
9165 PARAMS returns three integer or floating-point values representing
9166 the direction of the light source. Integer values, when requested,
9167 are computed by rounding the internal floating-point values to the
9168 nearest integer value. The returned values are those maintained in
9169 eye coordinates. They will not be equal to the values specified
9170 using `glLight', unless the modelview matrix was identity at the
9171 time `glLight' was called. Although spot direction is normalized
9172 before being used in the lighting equation, the returned values are
9173 the transformed versions of the specified values prior to
9174 normalization. The initial value is (0,0-1) .
9175
9176`GL_SPOT_EXPONENT'
9177 PARAMS returns a single integer or floating-point value
9178 representing the spot exponent of the light. An integer value, when
9179 requested, is computed by rounding the internal floating-point
9180 representation to the nearest integer. The initial value is 0.
9181
9182`GL_SPOT_CUTOFF'
9183 PARAMS returns a single integer or floating-point value
9184 representing the spot cutoff angle of the light. An integer value,
9185 when requested, is computed by rounding the internal floating-point
9186 representation to the nearest integer. The initial value is 180.
9187
9188`GL_CONSTANT_ATTENUATION'
9189 PARAMS returns a single integer or floating-point value
9190 representing the constant (not distance-related) attenuation of the
9191 light. An integer value, when requested, is computed by rounding
9192 the internal floating-point representation to the nearest integer.
9193 The initial value is 1.
9194
9195`GL_LINEAR_ATTENUATION'
9196 PARAMS returns a single integer or floating-point value
9197 representing the linear attenuation of the light. An integer value,
9198 when requested, is computed by rounding the internal floating-point
9199 representation to the nearest integer. The initial value is 0.
9200
9201`GL_QUADRATIC_ATTENUATION'
9202 PARAMS returns a single integer or floating-point value
9203 representing the quadratic attenuation of the light. An integer
9204 value, when requested, is computed by rounding the internal
9205 floating-point representation to the nearest integer. The initial
9206 value is 0.
9207
9208`GL_INVALID_ENUM' is generated if LIGHT or PNAME is not an accepted
9209value.
9210
9211`GL_INVALID_OPERATION' is generated if `glGetLight' is executed between
9212the execution of `glBegin' and the corresponding execution of `glEnd'.")
9213
9214(define-gl-procedures
78aa45b9
DH
9215 ((glGetMapdv
9216 (target GLenum)
9217 (query GLenum)
9218 (v GLdouble-*)
9219 ->
9220 void)
9221 (glGetMapfv
b002944d
AW
9222 (target GLenum)
9223 (query GLenum)
9224 (v GLfloat-*)
9225 ->
9226 void)
9227 (glGetMapiv
9228 (target GLenum)
9229 (query GLenum)
9230 (v GLint-*)
9231 ->
9232 void))
9233 "Return evaluator parameters.
9234
9235TARGET
9236 Specifies the symbolic name of a map. Accepted values are
9237 `GL_MAP1_COLOR_4', `GL_MAP1_INDEX', `GL_MAP1_NORMAL',
9238 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
9239 `GL_MAP1_TEXTURE_COORD_3', `GL_MAP1_TEXTURE_COORD_4',
9240 `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4', `GL_MAP2_COLOR_4',
9241 `GL_MAP2_INDEX', `GL_MAP2_NORMAL', `GL_MAP2_TEXTURE_COORD_1',
9242 `GL_MAP2_TEXTURE_COORD_2', `GL_MAP2_TEXTURE_COORD_3',
9243 `GL_MAP2_TEXTURE_COORD_4', `GL_MAP2_VERTEX_3', and
9244 `GL_MAP2_VERTEX_4'.
9245
9246QUERY
9247 Specifies which parameter to return. Symbolic names `GL_COEFF',
9248 `GL_ORDER', and `GL_DOMAIN' are accepted.
9249
9250V
9251 Returns the requested data.
9252
9253`glMap1' and `glMap2' define evaluators. `glGetMap' returns evaluator
9254parameters. TARGET chooses a map, QUERY selects a specific parameter,
9255and V points to storage where the values will be returned.
9256
9257The acceptable values for the TARGET parameter are described in the
9258`glMap1' and `glMap2' reference pages.
9259
9260QUERY can assume the following values:
9261
9262`GL_COEFF'
9263 V returns the control points for the evaluator function.
9264 One-dimensional evaluators return ORDER control points, and
9265 two-dimensional evaluators return UORDER×VORDER control points.
9266 Each control point consists of one, two, three, or four integer,
9267 single-precision floating-point, or double-precision floating-point
9268 values, depending on the type of the evaluator. The GL returns
9269 two-dimensional control points in row-major order, incrementing the
9270 UORDER index quickly and the VORDER index after each row. Integer
9271 values, when requested, are computed by rounding the internal
9272 floating-point values to the nearest integer values.
9273
9274`GL_ORDER'
9275 V returns the order of the evaluator function. One-dimensional
9276 evaluators return a single value, ORDER . The initial value is 1.
9277 Two-dimensional evaluators return two values, UORDER and VORDER .
9278 The initial value is 1,1.
9279
9280`GL_DOMAIN'
9281 V returns the linear U and V mapping parameters. One-dimensional
9282 evaluators return two values, U1 and U2 , as specified by `glMap1'.
9283 Two-dimensional evaluators return four values ( U1 , U2 , V1 , and
9284 V2 ) as specified by `glMap2'. Integer values, when requested, are
9285 computed by rounding the internal floating-point values to the
9286 nearest integer values.
9287
9288`GL_INVALID_ENUM' is generated if either TARGET or QUERY is not an
9289accepted value.
9290
9291`GL_INVALID_OPERATION' is generated if `glGetMap' is executed between
9292the execution of `glBegin' and the corresponding execution of `glEnd'.")
9293
9294(define-gl-procedures
9295 ((glGetMaterialfv
9296 (face GLenum)
9297 (pname GLenum)
9298 (params GLfloat-*)
9299 ->
9300 void)
9301 (glGetMaterialiv
9302 (face GLenum)
9303 (pname GLenum)
9304 (params GLint-*)
9305 ->
9306 void))
9307 "Return material parameters.
9308
9309FACE
9310 Specifies which of the two materials is being queried. `GL_FRONT'
9311 or `GL_BACK' are accepted, representing the front and back
9312 materials, respectively.
9313
9314PNAME
9315 Specifies the material parameter to return. `GL_AMBIENT',
9316 `GL_DIFFUSE', `GL_SPECULAR', `GL_EMISSION', `GL_SHININESS', and
9317 `GL_COLOR_INDEXES' are accepted.
9318
9319PARAMS
9320 Returns the requested data.
9321
9322`glGetMaterial' returns in PARAMS the value or values of parameter PNAME
9323of material FACE. Six parameters are defined:
9324
9325`GL_AMBIENT'
9326 PARAMS returns four integer or floating-point values representing
9327 the ambient reflectance of the material. Integer values, when
9328 requested, are linearly mapped from the internal floating-point
9329 representation such that 1.0 maps to the most positive
9330 representable integer value, and -1.0 maps to the most negative
9331 representable integer value. If the internal value is outside the
9332 range [-1,1] , the corresponding integer return value is undefined.
9333 The initial value is (0.2, 0.2, 0.2, 1.0)
9334
9335`GL_DIFFUSE'
9336 PARAMS returns four integer or floating-point values representing
9337 the diffuse reflectance of the material. Integer values, when
9338 requested, are linearly mapped from the internal floating-point
9339 representation such that 1.0 maps to the most positive
9340 representable integer value, and -1.0 maps to the most negative
9341 representable integer value. If the internal value is outside the
9342 range [-1,1] , the corresponding integer return value is undefined.
9343 The initial value is (0.8, 0.8, 0.8, 1.0).
9344
9345`GL_SPECULAR'
9346 PARAMS returns four integer or floating-point values representing
9347 the specular reflectance of the material. Integer values, when
9348 requested, are linearly mapped from the internal floating-point
9349 representation such that 1.0 maps to the most positive
9350 representable integer value, and -1.0 maps to the most negative
9351 representable integer value. If the internal value is outside the
9352 range [-1,1] , the corresponding integer return value is undefined.
9353 The initial value is (0, 0, 0, 1).
9354
9355`GL_EMISSION'
9356 PARAMS returns four integer or floating-point values representing
9357 the emitted light intensity of the material. Integer values, when
9358 requested, are linearly mapped from the internal floating-point
9359 representation such that 1.0 maps to the most positive
9360 representable integer value, and -1.0 maps to the most negative
9361 representable integer value. If the internal value is outside the
9362 range [-1,1] , the corresponding integer return value is undefined.
9363 The initial value is (0, 0, 0, 1).
9364
9365`GL_SHININESS'
9366 PARAMS returns one integer or floating-point value representing the
9367 specular exponent of the material. Integer values, when requested,
9368 are computed by rounding the internal floating-point value to the
9369 nearest integer value. The initial value is 0.
9370
9371`GL_COLOR_INDEXES'
9372 PARAMS returns three integer or floating-point values representing
9373 the ambient, diffuse, and specular indices of the material. These
9374 indices are used only for color index lighting. (All the other
9375 parameters are used only for RGBA lighting.) Integer values, when
9376 requested, are computed by rounding the internal floating-point
9377 values to the nearest integer values.
9378
9379`GL_INVALID_ENUM' is generated if FACE or PNAME is not an accepted
9380value.
9381
9382`GL_INVALID_OPERATION' is generated if `glGetMaterial' is executed
9383between the execution of `glBegin' and the corresponding execution of
9384`glEnd'.")
9385
9386(define-gl-procedures
9387 ((glGetMinmaxParameterfv
9388 (target GLenum)
9389 (pname GLenum)
9390 (params GLfloat-*)
9391 ->
9392 void)
9393 (glGetMinmaxParameteriv
9394 (target GLenum)
9395 (pname GLenum)
9396 (params GLint-*)
9397 ->
9398 void))
9399 "Get minmax parameters.
9400
9401TARGET
9402 Must be `GL_MINMAX'.
9403
9404PNAME
9405 The parameter to be retrieved. Must be one of `GL_MINMAX_FORMAT' or
9406 `GL_MINMAX_SINK'.
9407
9408PARAMS
9409 A pointer to storage for the retrieved parameters.
9410
9411`glGetMinmaxParameter' retrieves parameters for the current minmax table
9412by setting PNAME to one of the following values:
9413
9414
9415
9416*Parameter*
9417 *Description*
9418
9419`GL_MINMAX_FORMAT'
9420 Internal format of minmax table
9421
9422`GL_MINMAX_SINK'
9423 Value of the SINK parameter
9424
9425
9426
9427`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
9428
9429`GL_INVALID_ENUM' is generated if PNAME is not one of the allowable
9430values.
9431
9432`GL_INVALID_OPERATION' is generated if `glGetMinmaxParameter' is
9433executed between the execution of `glBegin' and the corresponding
9434execution of `glEnd'.")
9435
9436(define-gl-procedures
9437 ((glGetMinmax
9438 (target GLenum)
9439 (reset GLboolean)
9440 (format GLenum)
9441 (types GLenum)
9442 (values GLvoid-*)
9443 ->
9444 void))
9445 "Get minimum and maximum pixel values.
9446
9447TARGET
9448 Must be `GL_MINMAX'.
9449
9450RESET
9451 If `GL_TRUE', all entries in the minmax table that are actually
9452 returned are reset to their initial values. (Other entries are
9453 unaltered.) If `GL_FALSE', the minmax table is unaltered.
9454
9455FORMAT
9456 The format of the data to be returned in VALUES. Must be one of
9457 `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR',
9458 `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9459
9460TYPES
9461 The type of the data to be returned in VALUES. Symbolic constants
9462 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9463 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9464 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9465 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9466 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9467 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9468 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9469 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
bb894c9d 9470 are accepted.
3c9b6116 9471
bb894c9d
AW
9472VALUES
9473 A pointer to storage for the returned values.
3c9b6116 9474
bb894c9d
AW
9475`glGetMinmax' returns the accumulated minimum and maximum pixel values
9476(computed on a per-component basis) in a one-dimensional image of width
94772. The first set of return values are the minima, and the second set of
9478return values are the maxima. The format of the return values is
9479determined by FORMAT, and their type is determined by TYPES.
3c9b6116 9480
bb894c9d
AW
9481If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9482target (see `glBindBuffer') while minimum and maximum pixel values are
9483requested, VALUES is treated as a byte offset into the buffer object's
9484data store.
3c9b6116 9485
bb894c9d
AW
9486No pixel transfer operations are performed on the return values, but
9487pixel storage modes that are applicable to one-dimensional images are
9488performed. Color components that are requested in the specified FORMAT,
9489but that are not included in the internal format of the minmax table,
9490are returned as zero. The assignment of internal color components to the
9491components requested by FORMAT are as follows:
3c9b6116 9492
3c9b6116 9493
3c9b6116 9494
bb894c9d
AW
9495*Internal Component*
9496 *Resulting Component*
3c9b6116 9497
bb894c9d
AW
9498Red
9499 Red
3c9b6116 9500
bb894c9d
AW
9501Green
9502 Green
3c9b6116 9503
bb894c9d
AW
9504Blue
9505 Blue
3c9b6116 9506
bb894c9d
AW
9507Alpha
9508 Alpha
3c9b6116 9509
bb894c9d
AW
9510Luminance
9511 Red
3c9b6116 9512
bb894c9d
AW
9513If RESET is `GL_TRUE', the minmax table entries corresponding to the
9514return values are reset to their initial values. Minimum and maximum
9515values that are not returned are not modified, even if RESET is
9516`GL_TRUE'.
3c9b6116 9517
bb894c9d 9518`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
3c9b6116
AW
9519
9520`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
9521values.
9522
9523`GL_INVALID_ENUM' is generated if TYPES is not one of the allowable
9524values.
9525
9526`GL_INVALID_OPERATION' is generated if TYPES is one of
9527`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9528`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
9529is not `GL_RGB'.
9530
9531`GL_INVALID_OPERATION' is generated if TYPES is one of
9532`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9533`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9534`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9535`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
9536FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
9537
9538`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9539bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9540store is currently mapped.
9541
9542`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9543bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9544to the buffer object such that the memory writes required would exceed
9545the data store size.
9546
9547`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9548bound to the `GL_PIXEL_PACK_BUFFER' target and VALUES is not evenly
9549divisible into the number of bytes needed to store in memory a datum
9550indicated by TYPE.
9551
9552`GL_INVALID_OPERATION' is generated if `glGetMinmax' is executed between
9553the execution of `glBegin' and the corresponding execution of `glEnd'.")
9554
b002944d
AW
9555(define-gl-procedures
9556 ((glGetPixelMapfv
9557 (map GLenum)
9558 (data GLfloat-*)
9559 ->
9560 void)
9561 (glGetPixelMapuiv
9562 (map GLenum)
9563 (data GLuint-*)
9564 ->
78aa45b9
DH
9565 void)
9566 (glGetPixelMapusv
9567 (map GLenum)
9568 (data GLushort-*)
9569 ->
b002944d
AW
9570 void))
9571 "Return the specified pixel map.
9572
9573MAP
9574 Specifies the name of the pixel map to return. Accepted values are
9575 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
9576 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
9577 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
9578 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
9579 `GL_PIXEL_MAP_B_TO_B', and `GL_PIXEL_MAP_A_TO_A'.
9580
9581DATA
9582 Returns the pixel map contents.
9583
9584See the `glPixelMap' reference page for a description of the acceptable
9585values for the MAP parameter. `glGetPixelMap' returns in DATA the
9586contents of the pixel map specified in MAP. Pixel maps are used during
9587the execution of `glReadPixels', `glDrawPixels', `glCopyPixels',
9588`glTexImage1D', `glTexImage2D', `glTexImage3D', `glTexSubImage1D',
9589`glTexSubImage2D', `glTexSubImage3D', `glCopyTexImage1D',
9590`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D', and
9591`glCopyTexSubImage3D'. to map color indices, stencil indices, color
9592components, and depth components to other values.
9593
9594If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9595target (see `glBindBuffer') while a pixel map is requested, DATA is
9596treated as a byte offset into the buffer object's data store.
9597
9598Unsigned integer values, if requested, are linearly mapped from the
9599internal fixed or floating-point representation such that 1.0 maps to
9600the largest representable integer value, and 0.0 maps to 0. Return
9601unsigned integer values are undefined if the map value was not in the
9602range [0,1].
9603
9604To determine the required size of MAP, call `glGet' with the appropriate
9605symbolic constant.
9606
9607`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
9608
9609`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9610bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9611store is currently mapped.
9612
9613`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9614bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9615to the buffer object such that the memory writes required would exceed
9616the data store size.
9617
9618`GL_INVALID_OPERATION' is generated by `glGetPixelMapfv' if a non-zero
9619buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9620DATA is not evenly divisible into the number of bytes needed to store in
9621memory a GLfloat datum.
9622
9623`GL_INVALID_OPERATION' is generated by `glGetPixelMapuiv' if a non-zero
9624buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9625DATA is not evenly divisible into the number of bytes needed to store in
9626memory a GLuint datum.
9627
9628`GL_INVALID_OPERATION' is generated by `glGetPixelMapusv' if a non-zero
9629buffer object name is bound to the `GL_PIXEL_PACK_BUFFER' target and
9630DATA is not evenly divisible into the number of bytes needed to store in
9631memory a GLushort datum.
9632
9633`GL_INVALID_OPERATION' is generated if `glGetPixelMap' is executed
9634between the execution of `glBegin' and the corresponding execution of
9635`glEnd'.")
9636
9637(define-gl-procedures
9638 ((glGetPointerv
9639 (pname GLenum)
9640 (params GLvoid-**)
9641 ->
9642 void))
9643 "Return the address of the specified pointer.
9644
9645PNAME
9646 Specifies the array or buffer pointer to be returned. Symbolic
9647 constants `GL_COLOR_ARRAY_POINTER', `GL_EDGE_FLAG_ARRAY_POINTER',
9648 `GL_FOG_COORD_ARRAY_POINTER', `GL_FEEDBACK_BUFFER_POINTER',
9649 `GL_INDEX_ARRAY_POINTER', `GL_NORMAL_ARRAY_POINTER',
9650 `GL_SECONDARY_COLOR_ARRAY_POINTER', `GL_SELECTION_BUFFER_POINTER',
9651 `GL_TEXTURE_COORD_ARRAY_POINTER', or `GL_VERTEX_ARRAY_POINTER' are
9652 accepted.
9653
9654PARAMS
9655 Returns the pointer value specified by PNAME.
9656
9657`glGetPointerv' returns pointer information. PNAME is a symbolic
9658constant indicating the pointer to be returned, and PARAMS is a pointer
9659to a location in which to place the returned data.
9660
9661For all PNAME arguments except `GL_FEEDBACK_BUFFER_POINTER' and
9662`GL_SELECTION_BUFFER_POINTER', if a non-zero named buffer object was
9663bound to the `GL_ARRAY_BUFFER' target (see `glBindBuffer') when the
9664desired pointer was previously specified, the pointer returned is a byte
9665offset into the buffer object's data store. Buffer objects are only
9666available in OpenGL versions 1.5 and greater.
9667
9668`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
9669
25072f02 9670(define-gl-procedures
00239761 9671 ((glGetPolygonStipple (pattern GLubyte-*) -> void))
3c9b6116
AW
9672 "Return the polygon stipple pattern.
9673
9674PATTERN
9675 Returns the stipple pattern. The initial value is all 1's.
9676
9677`glGetPolygonStipple' returns to PATTERN a 32×32 polygon stipple
9678pattern. The pattern is packed into memory as if `glReadPixels' with
9679both HEIGHT and WIDTH of 32, TYPE of `GL_BITMAP', and FORMAT of
9680`GL_COLOR_INDEX' were called, and the stipple pattern were stored in an
9681internal 32×32 color index buffer. Unlike `glReadPixels', however, pixel
9682transfer operations (shift, offset, pixel map) are not applied to the
9683returned stipple image.
9684
9685If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
9686target (see `glBindBuffer') while a polygon stipple pattern is
9687requested, PATTERN is treated as a byte offset into the buffer object's
9688data store.
9689
9690`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9691bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
9692store is currently mapped.
9693
9694`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
9695bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
9696to the buffer object such that the memory writes required would exceed
9697the data store size.
9698
9699`GL_INVALID_OPERATION' is generated if `glGetPolygonStipple' is executed
9700between the execution of `glBegin' and the corresponding execution of
9701`glEnd'.")
9702
25072f02 9703(define-gl-procedures
bb894c9d
AW
9704 ((glGetProgramInfoLog
9705 (program GLuint)
9706 (maxLength GLsizei)
00239761
AW
9707 (length GLsizei-*)
9708 (infoLog GLchar-*)
bb894c9d
AW
9709 ->
9710 void))
3c9b6116
AW
9711 "Returns the information log for a program object.
9712
9713PROGRAM
9714 Specifies the program object whose information log is to be
9715 queried.
9716
9717MAXLENGTH
9718 Specifies the size of the character buffer for storing the returned
9719 information log.
9720
9721LENGTH
9722 Returns the length of the string returned in INFOLOG (excluding the
9723 null terminator).
9724
9725INFOLOG
9726 Specifies an array of characters that is used to return the
9727 information log.
9728
9729`glGetProgramInfoLog' returns the information log for the specified
9730program object. The information log for a program object is modified
9731when the program object is linked or validated. The string that is
9732returned will be null terminated.
9733
9734`glGetProgramInfoLog' returns in INFOLOG as much of the information log
9735as it can, up to a maximum of MAXLENGTH characters. The number of
9736characters actually returned, excluding the null termination character,
9737is specified by LENGTH. If the length of the returned string is not
9738required, a value of `NULL' can be passed in the LENGTH argument. The
9739size of the buffer required to store the returned information log can be
9740obtained by calling `glGetProgram' with the value `GL_INFO_LOG_LENGTH'.
9741
9742The information log for a program object is either an empty string, or a
9743string containing information about the last link operation, or a string
9744containing information about the last validation operation. It may
9745contain diagnostic messages, warning messages, and other information.
9746When a program object is created, its information log will be a string
9747of length 0.
9748
9749`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9750OpenGL.
9751
9752`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
9753
9754`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
9755
9756`GL_INVALID_OPERATION' is generated if `glGetProgramInfoLog' is executed
9757between the execution of `glBegin' and the corresponding execution of
9758`glEnd'.")
9759
25072f02 9760(define-gl-procedures
b002944d
AW
9761 ((glGetProgramiv
9762 (program GLuint)
9763 (pname GLenum)
9764 (params GLint-*)
bb894c9d
AW
9765 ->
9766 void))
b002944d 9767 "Returns a parameter from a program object.
3c9b6116 9768
b002944d
AW
9769PROGRAM
9770 Specifies the program object to be queried.
3c9b6116 9771
b002944d
AW
9772PNAME
9773 Specifies the object parameter. Accepted symbolic names are
9774 `GL_DELETE_STATUS', `GL_LINK_STATUS', `GL_VALIDATE_STATUS',
9775 `GL_INFO_LOG_LENGTH', `GL_ATTACHED_SHADERS',
9776 `GL_ACTIVE_ATTRIBUTES', `GL_ACTIVE_ATTRIBUTE_MAX_LENGTH',
9777 `GL_ACTIVE_UNIFORMS', `GL_ACTIVE_UNIFORM_MAX_LENGTH'.
3c9b6116 9778
b002944d
AW
9779PARAMS
9780 Returns the requested object parameter.
3c9b6116 9781
b002944d
AW
9782`glGetProgram' returns in PARAMS the value of a parameter for a specific
9783program object. The following parameters are defined:
3c9b6116 9784
b002944d 9785`GL_DELETE_STATUS'
3c9b6116
AW
9786
9787
b002944d
AW
9788 PARAMS returns `GL_TRUE' if PROGRAM is currently flagged for
9789 deletion, and `GL_FALSE' otherwise.
3c9b6116 9790
b002944d 9791`GL_LINK_STATUS'
3c9b6116
AW
9792
9793
b002944d
AW
9794 PARAMS returns `GL_TRUE' if the last link operation on PROGRAM was
9795 successful, and `GL_FALSE' otherwise.
3c9b6116 9796
b002944d 9797`GL_VALIDATE_STATUS'
3c9b6116
AW
9798
9799
b002944d
AW
9800 PARAMS returns `GL_TRUE' or if the last validation operation on
9801 PROGRAM was successful, and `GL_FALSE' otherwise.
3c9b6116 9802
b002944d 9803`GL_INFO_LOG_LENGTH'
3c9b6116
AW
9804
9805
b002944d
AW
9806 PARAMS returns the number of characters in the information log for
9807 PROGRAM including the null termination character (i.e., the size of
9808 the character buffer required to store the information log). If
9809 PROGRAM has no information log, a value of 0 is returned.
3c9b6116 9810
b002944d 9811`GL_ATTACHED_SHADERS'
3c9b6116
AW
9812
9813
b002944d 9814 PARAMS returns the number of shader objects attached to PROGRAM.
3c9b6116 9815
b002944d 9816`GL_ACTIVE_ATTRIBUTES'
3c9b6116
AW
9817
9818
b002944d
AW
9819 PARAMS returns the number of active attribute variables for
9820 PROGRAM.
9821
9822`GL_ACTIVE_ATTRIBUTE_MAX_LENGTH'
9823
9824
9825 PARAMS returns the length of the longest active attribute name for
9826 PROGRAM, including the null termination character (i.e., the size
9827 of the character buffer required to store the longest attribute
9828 name). If no active attributes exist, 0 is returned.
9829
9830`GL_ACTIVE_UNIFORMS'
9831
9832
9833 PARAMS returns the number of active uniform variables for PROGRAM.
9834
9835`GL_ACTIVE_UNIFORM_MAX_LENGTH'
9836
9837
9838 PARAMS returns the length of the longest active uniform variable
9839 name for PROGRAM, including the null termination character (i.e.,
9840 the size of the character buffer required to store the longest
9841 uniform variable name). If no active uniform variables exist, 0 is
9842 returned.
9843
9844`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
9845OpenGL.
9846
9847`GL_INVALID_OPERATION' is generated if PROGRAM does not refer to a
9848program object.
9849
9850`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9851
9852`GL_INVALID_OPERATION' is generated if `glGetProgram' is executed
9853between the execution of `glBegin' and the corresponding execution of
9854`glEnd'.")
9855
9856(define-gl-procedures
9857 ((glGetQueryiv
9858 (target GLenum)
9859 (pname GLenum)
9860 (params GLint-*)
9861 ->
9862 void))
9863 "Return parameters of a query object target.
9864
9865TARGET
9866 Specifies a query object target. Must be `GL_SAMPLES_PASSED'.
9867
9868PNAME
9869 Specifies the symbolic name of a query object target parameter.
9870 Accepted values are `GL_CURRENT_QUERY' or `GL_QUERY_COUNTER_BITS'.
9871
9872PARAMS
9873 Returns the requested data.
9874
9875`glGetQueryiv' returns in PARAMS a selected parameter of the query
9876object target specified by TARGET.
9877
9878PNAME names a specific query object target parameter. When TARGET is
9879`GL_SAMPLES_PASSED', PNAME can be as follows:
9880
9881`GL_CURRENT_QUERY'
9882 PARAMS returns the name of the currently active occlusion query
9883 object. If no occlusion query is active, 0 is returned. The initial
9884 value is 0.
9885
9886`GL_QUERY_COUNTER_BITS'
9887 PARAMS returns the number of bits in the query counter used to
9888 accumulate passing samples. If the number of bits returned is 0,
9889 the implementation does not support a query counter, and the
9890 results obtained from `glGetQueryObject' are useless.
9891
9892`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
9893value.
9894
9895`GL_INVALID_OPERATION' is generated if `glGetQueryiv' is executed
9896between the execution of `glBegin' and the corresponding execution of
9897`glEnd'.")
9898
9899(define-gl-procedures
9900 ((glGetQueryObjectiv
9901 (id GLuint)
9902 (pname GLenum)
9903 (params GLint-*)
9904 ->
9905 void)
9906 (glGetQueryObjectuiv
9907 (id GLuint)
9908 (pname GLenum)
9909 (params GLuint-*)
9910 ->
9911 void))
9912 "Return parameters of a query object.
9913
9914ID
9915 Specifies the name of a query object.
9916
9917PNAME
9918 Specifies the symbolic name of a query object parameter. Accepted
9919 values are `GL_QUERY_RESULT' or `GL_QUERY_RESULT_AVAILABLE'.
9920
9921PARAMS
9922 Returns the requested data.
9923
9924`glGetQueryObject' returns in PARAMS a selected parameter of the query
9925object specified by ID.
9926
9927PNAME names a specific query object parameter. PNAME can be as follows:
9928
9929`GL_QUERY_RESULT'
9930 PARAMS returns the value of the query object's passed samples
9931 counter. The initial value is 0.
9932
9933`GL_QUERY_RESULT_AVAILABLE'
9934 PARAMS returns whether the passed samples counter is immediately
9935 available. If a delay would occur waiting for the query result,
9936 `GL_FALSE' is returned. Otherwise, `GL_TRUE' is returned, which
9937 also indicates that the results of all previous queries are
9938 available as well.
9939
9940`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
9941
9942`GL_INVALID_OPERATION' is generated if ID is not the name of a query
9943object.
9944
9945`GL_INVALID_OPERATION' is generated if ID is the name of a currently
9946active query object.
9947
9948`GL_INVALID_OPERATION' is generated if `glGetQueryObject' is executed
9949between the execution of `glBegin' and the corresponding execution of
9950`glEnd'.")
9951
9952(define-gl-procedures
9953 ((glGetSeparableFilter
9954 (target GLenum)
9955 (format GLenum)
9956 (type GLenum)
9957 (row GLvoid-*)
9958 (column GLvoid-*)
9959 (span GLvoid-*)
9960 ->
9961 void))
9962 "Get separable convolution filter kernel images.
9963
9964TARGET
9965 The separable filter to be retrieved. Must be `GL_SEPARABLE_2D'.
9966
9967FORMAT
9968 Format of the output images. Must be one of `GL_RED', `GL_GREEN',
9969 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR'`GL_RGBA', `GL_BGRA',
9970 `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'.
9971
9972TYPE
9973 Data type of components in the output images. Symbolic constants
9974 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
9975 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
9976 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
9977 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
9978 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
9979 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
9980 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
9981 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
9982 are accepted.
9983
9984ROW
9985 Pointer to storage for the row filter image.
9986
9987COLUMN
9988 Pointer to storage for the column filter image.
9989
9990SPAN
9991 Pointer to storage for the span filter image (currently unused).
9992
9993`glGetSeparableFilter' returns the two one-dimensional filter kernel
9994images for the current separable 2D convolution filter. The row image is
9995placed in ROW and the column image is placed in COLUMN according to the
9996specifications in FORMAT and TYPE. (In the current implementation, SPAN
9997is not affected in any way.) No pixel transfer operations are performed
9998on the images, but the relevant pixel storage modes are applied.
9999
10000If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
10001target (see `glBindBuffer') while a separable convolution filter is
10002requested, ROW, COLUMN, and SPAN are treated as a byte offset into the
10003buffer object's data store.
10004
10005Color components that are present in FORMAT but not included in the
10006internal format of the filters are returned as zero. The assignments of
10007internal color components to the components of FORMAT are as follows:
10008
10009
10010
10011*Internal Component*
10012 *Resulting Component*
10013
10014Red
10015 Red
10016
10017Green
10018 Green
10019
10020Blue
10021 Blue
10022
10023Alpha
10024 Alpha
10025
10026Luminance
10027 Red
10028
10029Intensity
10030 Red
10031
10032
10033
10034`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
10035
10036`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
bb894c9d 10037values.
3c9b6116 10038
bb894c9d
AW
10039`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
10040values.
3c9b6116 10041
bb894c9d
AW
10042`GL_INVALID_OPERATION' is generated if TYPE is one of
10043`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
10044`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
10045is not `GL_RGB'.
3c9b6116 10046
bb894c9d
AW
10047`GL_INVALID_OPERATION' is generated if TYPE is one of
10048`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
10049`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
10050`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
10051`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
10052FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
3c9b6116 10053
bb894c9d
AW
10054`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10055bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
10056store is currently mapped.
3c9b6116 10057
bb894c9d
AW
10058`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10059bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
10060to the buffer object such that the memory writes required would exceed
10061the data store size.
3c9b6116 10062
bb894c9d
AW
10063`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10064bound to the `GL_PIXEL_PACK_BUFFER' target and ROW or COLUMN is not
10065evenly divisible into the number of bytes needed to store in memory a
10066datum indicated by TYPE.
3c9b6116 10067
bb894c9d
AW
10068`GL_INVALID_OPERATION' is generated if `glGetSeparableFilter' is
10069executed between the execution of `glBegin' and the corresponding
10070execution of `glEnd'.")
3c9b6116 10071
25072f02 10072(define-gl-procedures
bb894c9d
AW
10073 ((glGetShaderInfoLog
10074 (shader GLuint)
10075 (maxLength GLsizei)
00239761
AW
10076 (length GLsizei-*)
10077 (infoLog GLchar-*)
bb894c9d
AW
10078 ->
10079 void))
3c9b6116
AW
10080 "Returns the information log for a shader object.
10081
10082SHADER
10083 Specifies the shader object whose information log is to be queried.
10084
10085MAXLENGTH
10086 Specifies the size of the character buffer for storing the returned
10087 information log.
10088
10089LENGTH
10090 Returns the length of the string returned in INFOLOG (excluding the
10091 null terminator).
10092
10093INFOLOG
10094 Specifies an array of characters that is used to return the
10095 information log.
10096
10097`glGetShaderInfoLog' returns the information log for the specified
10098shader object. The information log for a shader object is modified when
10099the shader is compiled. The string that is returned will be null
10100terminated.
10101
10102`glGetShaderInfoLog' returns in INFOLOG as much of the information log
10103as it can, up to a maximum of MAXLENGTH characters. The number of
10104characters actually returned, excluding the null termination character,
10105is specified by LENGTH. If the length of the returned string is not
10106required, a value of `NULL' can be passed in the LENGTH argument. The
10107size of the buffer required to store the returned information log can be
10108obtained by calling `glGetShader' with the value `GL_INFO_LOG_LENGTH'.
10109
10110The information log for a shader object is a string that may contain
10111diagnostic messages, warning messages, and other information about the
10112last compile operation. When a shader object is created, its information
10113log will be a string of length 0.
10114
10115`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
10116OpenGL.
10117
10118`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
10119
10120`GL_INVALID_VALUE' is generated if MAXLENGTH is less than 0.
10121
10122`GL_INVALID_OPERATION' is generated if `glGetShaderInfoLog' is executed
10123between the execution of `glBegin' and the corresponding execution of
10124`glEnd'.")
10125
25072f02 10126(define-gl-procedures
bb894c9d
AW
10127 ((glGetShaderSource
10128 (shader GLuint)
10129 (bufSize GLsizei)
00239761
AW
10130 (length GLsizei-*)
10131 (source GLchar-*)
bb894c9d
AW
10132 ->
10133 void))
3c9b6116
AW
10134 "Returns the source code string from a shader object.
10135
10136SHADER
10137 Specifies the shader object to be queried.
10138
10139BUFSIZE
10140 Specifies the size of the character buffer for storing the returned
10141 source code string.
10142
10143LENGTH
10144 Returns the length of the string returned in SOURCE (excluding the
10145 null terminator).
10146
10147SOURCE
10148 Specifies an array of characters that is used to return the source
10149 code string.
10150
10151`glGetShaderSource' returns the concatenation of the source code strings
10152from the shader object specified by SHADER. The source code strings for
10153a shader object are the result of a previous call to `glShaderSource'.
10154The string returned by the function will be null terminated.
10155
10156`glGetShaderSource' returns in SOURCE as much of the source code string
10157as it can, up to a maximum of BUFSIZE characters. The number of
10158characters actually returned, excluding the null termination character,
10159is specified by LENGTH. If the length of the returned string is not
10160required, a value of `NULL' can be passed in the LENGTH argument. The
10161size of the buffer required to store the returned source code string can
10162be obtained by calling `glGetShader' with the value
10163`GL_SHADER_SOURCE_LENGTH'.
10164
10165`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
10166OpenGL.
10167
bb894c9d 10168`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
3c9b6116 10169
bb894c9d 10170`GL_INVALID_VALUE' is generated if BUFSIZE is less than 0.
3c9b6116 10171
bb894c9d
AW
10172`GL_INVALID_OPERATION' is generated if `glGetShaderSource' is executed
10173between the execution of `glBegin' and the corresponding execution of
10174`glEnd'.")
3c9b6116 10175
b002944d
AW
10176(define-gl-procedures
10177 ((glGetShaderiv
10178 (shader GLuint)
10179 (pname GLenum)
10180 (params GLint-*)
10181 ->
10182 void))
10183 "Returns a parameter from a shader object.
10184
10185SHADER
10186 Specifies the shader object to be queried.
10187
10188PNAME
10189 Specifies the object parameter. Accepted symbolic names are
10190 `GL_SHADER_TYPE', `GL_DELETE_STATUS', `GL_COMPILE_STATUS',
10191 `GL_INFO_LOG_LENGTH', `GL_SHADER_SOURCE_LENGTH'.
10192
10193PARAMS
10194 Returns the requested object parameter.
10195
10196`glGetShader' returns in PARAMS the value of a parameter for a specific
10197shader object. The following parameters are defined:
10198
10199`GL_SHADER_TYPE'
10200 PARAMS returns `GL_VERTEX_SHADER' if SHADER is a vertex shader
10201 object, and `GL_FRAGMENT_SHADER' if SHADER is a fragment shader
10202 object.
10203
10204`GL_DELETE_STATUS'
10205 PARAMS returns `GL_TRUE' if SHADER is currently flagged for
10206 deletion, and `GL_FALSE' otherwise.
10207
10208`GL_COMPILE_STATUS'
10209 PARAMS returns `GL_TRUE' if the last compile operation on SHADER
10210 was successful, and `GL_FALSE' otherwise.
10211
10212`GL_INFO_LOG_LENGTH'
10213 PARAMS returns the number of characters in the information log for
10214 SHADER including the null termination character (i.e., the size of
10215 the character buffer required to store the information log). If
10216 SHADER has no information log, a value of 0 is returned.
10217
10218`GL_SHADER_SOURCE_LENGTH'
10219 PARAMS returns the length of the concatenation of the source
10220 strings that make up the shader source for the SHADER, including
10221 the null termination character. (i.e., the size of the character
10222 buffer required to store the shader source). If no source code
10223 exists, 0 is returned.
10224
10225`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
10226OpenGL.
10227
10228`GL_INVALID_OPERATION' is generated if SHADER does not refer to a shader
10229object.
10230
10231`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
10232
10233`GL_INVALID_OPERATION' is generated if `glGetShader' is executed between
10234the execution of `glBegin' and the corresponding execution of `glEnd'.")
10235
25072f02 10236(define-gl-procedures
00239761 10237 ((glGetString (name GLenum) -> const-GLubyte*))
bb894c9d 10238 "Return a string describing the current GL connection.
3c9b6116 10239
bb894c9d
AW
10240NAME
10241 Specifies a symbolic constant, one of `GL_VENDOR', `GL_RENDERER',
10242 `GL_VERSION', `GL_SHADING_LANGUAGE_VERSION', or `GL_EXTENSIONS'.
3c9b6116 10243
bb894c9d
AW
10244`glGetString' returns a pointer to a static string describing some
10245aspect of the current GL connection. NAME can be one of the following:
3c9b6116 10246
bb894c9d 10247`GL_VENDOR'
3c9b6116 10248
3c9b6116 10249
bb894c9d
AW
10250 Returns the company responsible for this GL implementation. This
10251 name does not change from release to release.
3c9b6116 10252
bb894c9d 10253`GL_RENDERER'
3c9b6116 10254
3c9b6116 10255
bb894c9d
AW
10256 Returns the name of the renderer. This name is typically specific
10257 to a particular configuration of a hardware platform. It does not
10258 change from release to release.
3c9b6116 10259
bb894c9d 10260`GL_VERSION'
3c9b6116 10261
3c9b6116 10262
bb894c9d 10263 Returns a version or release number.
3c9b6116 10264
bb894c9d 10265`GL_SHADING_LANGUAGE_VERSION'
3c9b6116 10266
3c9b6116 10267
bb894c9d 10268 Returns a version or release number for the shading language.
3c9b6116 10269
bb894c9d 10270`GL_EXTENSIONS'
3c9b6116 10271
3c9b6116 10272
bb894c9d 10273 Returns a space-separated list of supported extensions to GL.
3c9b6116 10274
bb894c9d
AW
10275Because the GL does not include queries for the performance
10276characteristics of an implementation, some applications are written to
10277recognize known platforms and modify their GL usage based on known
10278performance characteristics of these platforms. Strings `GL_VENDOR' and
10279`GL_RENDERER' together uniquely specify a platform. They do not change
10280from release to release and should be used by platform-recognition
10281algorithms.
3c9b6116 10282
bb894c9d
AW
10283Some applications want to make use of features that are not part of the
10284standard GL. These features may be implemented as extensions to the
10285standard GL. The `GL_EXTENSIONS' string is a space-separated list of
10286supported GL extensions. (Extension names never contain a space
10287character.)
3c9b6116 10288
bb894c9d
AW
10289The `GL_VERSION' and `GL_SHADING_LANGUAGE_VERSION' strings begin with a
10290version number. The version number uses one of these forms:
3c9b6116 10291
bb894c9d 10292MAJOR_NUMBER.MINOR_NUMBERMAJOR_NUMBER.MINOR_NUMBER.RELEASE_NUMBER
3c9b6116 10293
bb894c9d
AW
10294Vendor-specific information may follow the version number. Its format
10295depends on the implementation, but a space always separates the version
10296number and the vendor-specific information.
3c9b6116 10297
bb894c9d 10298All strings are null-terminated.
3c9b6116 10299
bb894c9d 10300`GL_INVALID_ENUM' is generated if NAME is not an accepted value.
3c9b6116 10301
bb894c9d
AW
10302`GL_INVALID_OPERATION' is generated if `glGetString' is executed between
10303the execution of `glBegin' and the corresponding execution of `glEnd'.")
3c9b6116 10304
b002944d
AW
10305(define-gl-procedures
10306 ((glGetTexEnvfv
10307 (target GLenum)
10308 (pname GLenum)
10309 (params GLfloat-*)
10310 ->
10311 void)
10312 (glGetTexEnviv
10313 (target GLenum)
10314 (pname GLenum)
10315 (params GLint-*)
10316 ->
10317 void))
10318 "Return texture environment parameters.
10319
10320TARGET
10321 Specifies a texture environment. May be `GL_TEXTURE_ENV',
10322 `GL_TEXTURE_FILTER_CONTROL', or `GL_POINT_SPRITE'.
10323
10324PNAME
10325 Specifies the symbolic name of a texture environment parameter.
10326 Accepted values are `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
10327 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
10328 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
10329 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
10330 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
10331 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
10332 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
10333
10334PARAMS
10335 Returns the requested data.
10336
10337`glGetTexEnv' returns in PARAMS selected values of a texture environment
10338that was specified with `glTexEnv'. TARGET specifies a texture
10339environment.
10340
10341When TARGET is `GL_TEXTURE_FILTER_CONTROL', PNAME must be
10342`GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_POINT_SPRITE', PNAME must be
10343`GL_COORD_REPLACE'. When TARGET is `GL_TEXTURE_ENV', PNAME can be
10344`GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR', `GL_COMBINE_RGB',
10345`GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE', `GL_SRC0_RGB',
10346`GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA', `GL_SRC1_ALPHA', or
10347`GL_SRC2_ALPHA'.
10348
10349PNAME names a specific texture environment parameter, as follows:
10350
10351`GL_TEXTURE_ENV_MODE'
10352 PARAMS returns the single-valued texture environment mode, a
10353 symbolic constant. The initial value is `GL_MODULATE'.
10354
10355`GL_TEXTURE_ENV_COLOR'
10356 PARAMS returns four integer or floating-point values that are the
10357 texture environment color. Integer values, when requested, are
10358 linearly mapped from the internal floating-point representation
10359 such that 1.0 maps to the most positive representable integer, and
10360 -1.0 maps to the most negative representable integer. The initial
10361 value is (0, 0, 0, 0).
10362
10363`GL_TEXTURE_LOD_BIAS'
10364 PARAMS returns a single floating-point value that is the texture
10365 level-of-detail bias. The initial value is 0.
10366
10367`GL_COMBINE_RGB'
10368 PARAMS returns a single symbolic constant value representing the
10369 current RGB combine mode. The initial value is `GL_MODULATE'.
10370
10371`GL_COMBINE_ALPHA'
10372 PARAMS returns a single symbolic constant value representing the
10373 current alpha combine mode. The initial value is `GL_MODULATE'.
10374
10375`GL_SRC0_RGB'
10376 PARAMS returns a single symbolic constant value representing the
10377 texture combiner zero's RGB source. The initial value is
10378 `GL_TEXTURE'.
10379
10380`GL_SRC1_RGB'
10381 PARAMS returns a single symbolic constant value representing the
10382 texture combiner one's RGB source. The initial value is
10383 `GL_PREVIOUS'.
10384
10385`GL_SRC2_RGB'
10386 PARAMS returns a single symbolic constant value representing the
10387 texture combiner two's RGB source. The initial value is
10388 `GL_CONSTANT'.
10389
10390`GL_SRC0_ALPHA'
10391 PARAMS returns a single symbolic constant value representing the
10392 texture combiner zero's alpha source. The initial value is
10393 `GL_TEXTURE'.
10394
10395`GL_SRC1_ALPHA'
10396 PARAMS returns a single symbolic constant value representing the
10397 texture combiner one's alpha source. The initial value is
10398 `GL_PREVIOUS'.
10399
10400`GL_SRC2_ALPHA'
10401 PARAMS returns a single symbolic constant value representing the
10402 texture combiner two's alpha source. The initial value is
10403 `GL_CONSTANT'.
10404
10405`GL_OPERAND0_RGB'
10406 PARAMS returns a single symbolic constant value representing the
10407 texture combiner zero's RGB operand. The initial value is
10408 `GL_SRC_COLOR'.
10409
10410`GL_OPERAND1_RGB'
10411 PARAMS returns a single symbolic constant value representing the
10412 texture combiner one's RGB operand. The initial value is
10413 `GL_SRC_COLOR'.
10414
10415`GL_OPERAND2_RGB'
10416 PARAMS returns a single symbolic constant value representing the
10417 texture combiner two's RGB operand. The initial value is
10418 `GL_SRC_ALPHA'.
10419
10420`GL_OPERAND0_ALPHA'
10421 PARAMS returns a single symbolic constant value representing the
10422 texture combiner zero's alpha operand. The initial value is
10423 `GL_SRC_ALPHA'.
10424
10425`GL_OPERAND1_ALPHA'
10426 PARAMS returns a single symbolic constant value representing the
10427 texture combiner one's alpha operand. The initial value is
10428 `GL_SRC_ALPHA'.
10429
10430`GL_OPERAND2_ALPHA'
10431 PARAMS returns a single symbolic constant value representing the
10432 texture combiner two's alpha operand. The initial value is
10433 `GL_SRC_ALPHA'.
10434
10435`GL_RGB_SCALE'
10436 PARAMS returns a single floating-point value representing the
10437 current RGB texture combiner scaling factor. The initial value is
10438 1.0.
10439
10440`GL_ALPHA_SCALE'
10441 PARAMS returns a single floating-point value representing the
10442 current alpha texture combiner scaling factor. The initial value is
10443 1.0.
10444
10445`GL_COORD_REPLACE'
10446 PARAMS returns a single boolean value representing the current
10447 point sprite texture coordinate replacement enable state. The
10448 initial value is `GL_FALSE'.
10449
10450`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10451value.
10452
10453`GL_INVALID_OPERATION' is generated if `glGetTexEnv' is executed between
10454the execution of `glBegin' and the corresponding execution of `glEnd'.")
10455
10456(define-gl-procedures
78aa45b9
DH
10457 ((glGetTexGendv
10458 (coord GLenum)
10459 (pname GLenum)
10460 (params GLdouble-*)
10461 ->
10462 void)
10463 (glGetTexGenfv
b002944d
AW
10464 (coord GLenum)
10465 (pname GLenum)
10466 (params GLfloat-*)
10467 ->
10468 void)
10469 (glGetTexGeniv
10470 (coord GLenum)
10471 (pname GLenum)
10472 (params GLint-*)
10473 ->
10474 void))
10475 "Return texture coordinate generation parameters.
10476
10477COORD
10478 Specifies a texture coordinate. Must be `GL_S', `GL_T', `GL_R', or
10479 `GL_Q'.
10480
10481PNAME
10482 Specifies the symbolic name of the value(s) to be returned. Must be
10483 either `GL_TEXTURE_GEN_MODE' or the name of one of the texture
10484 generation plane equations: `GL_OBJECT_PLANE' or `GL_EYE_PLANE'.
10485
10486PARAMS
10487 Returns the requested data.
10488
10489`glGetTexGen' returns in PARAMS selected parameters of a texture
10490coordinate generation function that was specified using `glTexGen'.
10491COORD names one of the (S, T, R, Q) texture coordinates, using the
10492symbolic constant `GL_S', `GL_T', `GL_R', or `GL_Q'.
10493
10494PNAME specifies one of three symbolic names:
10495
10496`GL_TEXTURE_GEN_MODE'
10497 PARAMS returns the single-valued texture generation function, a
10498 symbolic constant. The initial value is `GL_EYE_LINEAR'.
10499
10500`GL_OBJECT_PLANE'
10501 PARAMS returns the four plane equation coefficients that specify
10502 object linear-coordinate generation. Integer values, when
10503 requested, are mapped directly from the internal floating-point
10504 representation.
10505
10506`GL_EYE_PLANE'
10507 PARAMS returns the four plane equation coefficients that specify
10508 eye linear-coordinate generation. Integer values, when requested,
10509 are mapped directly from the internal floating-point
10510 representation. The returned values are those maintained in eye
10511 coordinates. They are not equal to the values specified using
10512 `glTexGen', unless the modelview matrix was identity when
10513 `glTexGen' was called.
10514
10515`GL_INVALID_ENUM' is generated if COORD or PNAME is not an accepted
10516value.
10517
10518`GL_INVALID_OPERATION' is generated if `glGetTexGen' is executed between
10519the execution of `glBegin' and the corresponding execution of `glEnd'.")
10520
25072f02 10521(define-gl-procedures
bb894c9d
AW
10522 ((glGetTexImage
10523 (target GLenum)
10524 (level GLint)
10525 (format GLenum)
10526 (type GLenum)
00239761 10527 (img GLvoid-*)
bb894c9d
AW
10528 ->
10529 void))
10530 "Return a texture image.
3c9b6116 10531
b002944d
AW
10532TARGET
10533 Specifies which texture is to be obtained. `GL_TEXTURE_1D',
10534 `GL_TEXTURE_2D', `GL_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10535 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10536 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10537 and `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z' are accepted.
10538
10539LEVEL
10540 Specifies the level-of-detail number of the desired image. Level 0
10541 is the base image level. Level N is the N th mipmap reduction
10542 image.
10543
10544FORMAT
10545 Specifies a pixel format for the returned data. The supported
10546 formats are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
10547 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
10548 `GL_LUMINANCE_ALPHA'.
10549
10550TYPE
10551 Specifies a pixel type for the returned data. The supported types
10552 are `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_UNSIGNED_SHORT', `GL_SHORT',
10553 `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2',
10554 `GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
10555 `GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
10556 `GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
10557 `GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
10558 `GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
10559 `GL_UNSIGNED_INT_2_10_10_10_REV'.
10560
10561IMG
10562 Returns the texture image. Should be a pointer to an array of the
10563 type specified by TYPE.
10564
10565`glGetTexImage' returns a texture image into IMG. TARGET specifies
10566whether the desired texture image is one specified by `glTexImage1D'
10567(`GL_TEXTURE_1D'), `glTexImage2D' (`GL_TEXTURE_2D' or any of
10568`GL_TEXTURE_CUBE_MAP_*'), or `glTexImage3D' (`GL_TEXTURE_3D'). LEVEL
10569specifies the level-of-detail number of the desired image. FORMAT and
10570TYPE specify the format and type of the desired image array. See the
10571reference pages `glTexImage1D' and `glDrawPixels' for a description of
10572the acceptable values for the FORMAT and TYPE parameters, respectively.
10573
10574If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
10575target (see `glBindBuffer') while a texture image is requested, IMG is
10576treated as a byte offset into the buffer object's data store.
10577
10578To understand the operation of `glGetTexImage', consider the selected
10579internal four-component texture image to be an RGBA color buffer the
10580size of the image. The semantics of `glGetTexImage' are then identical
10581to those of `glReadPixels', with the exception that no pixel transfer
10582operations are performed, when called with the same FORMAT and TYPE,
10583with X and Y set to 0, WIDTH set to the width of the texture image
10584(including border if one was specified), and HEIGHT set to 1 for 1D
10585images, or to the height of the texture image (including border if one
10586was specified) for 2D images. Because the internal texture image is an
10587RGBA image, pixel formats `GL_COLOR_INDEX', `GL_STENCIL_INDEX', and
10588`GL_DEPTH_COMPONENT' are not accepted, and pixel type `GL_BITMAP' is not
10589accepted.
10590
10591If the selected texture image does not contain four components, the
10592following mappings are applied. Single-component textures are treated as
10593RGBA buffers with red set to the single-component value, green set to 0,
10594blue set to 0, and alpha set to 1. Two-component textures are treated as
10595RGBA buffers with red set to the value of component zero, alpha set to
10596the value of component one, and green and blue set to 0. Finally,
10597three-component textures are treated as RGBA buffers with red set to
10598component zero, green set to component one, blue set to component two,
10599and alpha set to 1.
10600
10601To determine the required size of IMG, use `glGetTexLevelParameter' to
10602determine the dimensions of the internal texture image, then scale the
10603required number of pixels by the storage required for each pixel, based
10604on FORMAT and TYPE. Be sure to take the pixel storage parameters into
10605account, especially `GL_PACK_ALIGNMENT'.
10606
10607`GL_INVALID_ENUM' is generated if TARGET, FORMAT, or TYPE is not an
10608accepted value.
10609
10610`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10611
10612`GL_INVALID_VALUE' may be generated if LEVEL is greater than
10613LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10614
10615`GL_INVALID_OPERATION' is returned if TYPE is one of
10616`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
10617`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
10618is not `GL_RGB'.
10619
10620`GL_INVALID_OPERATION' is returned if TYPE is one of
10621`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
10622`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
10623`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
10624`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV', and
10625FORMAT is neither `GL_RGBA' or `GL_BGRA'.
10626
10627`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10628bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
10629store is currently mapped.
10630
10631`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10632bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
10633to the buffer object such that the memory writes required would exceed
10634the data store size.
10635
10636`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
10637bound to the `GL_PIXEL_PACK_BUFFER' target and IMG is not evenly
10638divisible into the number of bytes needed to store in memory a datum
10639indicated by TYPE.
10640
10641`GL_INVALID_OPERATION' is generated if `glGetTexImage' is executed
10642between the execution of `glBegin' and the corresponding execution of
10643`glEnd'.")
10644
10645(define-gl-procedures
10646 ((glGetTexLevelParameterfv
10647 (target GLenum)
10648 (level GLint)
10649 (pname GLenum)
10650 (params GLfloat-*)
10651 ->
10652 void)
10653 (glGetTexLevelParameteriv
10654 (target GLenum)
10655 (level GLint)
10656 (pname GLenum)
10657 (params GLint-*)
10658 ->
10659 void))
10660 "Return texture parameter values for a specific level of detail.
10661
10662TARGET
10663 Specifies the symbolic name of the target texture, either
10664 `GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D',
10665 `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10666 `GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10667 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10668 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10669 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10670
10671LEVEL
10672 Specifies the level-of-detail number of the desired image. Level 0
10673 is the base image level. Level N is the N th mipmap reduction
10674 image.
10675
10676PNAME
10677 Specifies the symbolic name of a texture parameter.
10678 `GL_TEXTURE_WIDTH', `GL_TEXTURE_HEIGHT', `GL_TEXTURE_DEPTH',
10679 `GL_TEXTURE_INTERNAL_FORMAT', `GL_TEXTURE_BORDER',
10680 `GL_TEXTURE_RED_SIZE', `GL_TEXTURE_GREEN_SIZE',
10681 `GL_TEXTURE_BLUE_SIZE', `GL_TEXTURE_ALPHA_SIZE',
10682 `GL_TEXTURE_LUMINANCE_SIZE', `GL_TEXTURE_INTENSITY_SIZE',
10683 `GL_TEXTURE_DEPTH_SIZE', `GL_TEXTURE_COMPRESSED', and
10684 `GL_TEXTURE_COMPRESSED_IMAGE_SIZE' are accepted.
10685
10686PARAMS
10687 Returns the requested data.
10688
10689`glGetTexLevelParameter' returns in PARAMS texture parameter values for
10690a specific level-of-detail value, specified as LEVEL. TARGET defines the
10691target texture, either `GL_TEXTURE_1D', `GL_TEXTURE_2D',
10692`GL_TEXTURE_3D', `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_2D',
10693`GL_PROXY_TEXTURE_3D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
10694`GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
10695`GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
10696`GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
10697
10698`GL_MAX_TEXTURE_SIZE', and `GL_MAX_3D_TEXTURE_SIZE' are not really
10699descriptive enough. It has to report the largest square texture image
10700that can be accommodated with mipmaps and borders, but a long skinny
10701texture, or a texture without mipmaps and borders, may easily fit in
10702texture memory. The proxy targets allow the user to more accurately
10703query whether the GL can accommodate a texture of a given configuration.
10704If the texture cannot be accommodated, the texture state variables,
10705which may be queried with `glGetTexLevelParameter', are set to 0. If the
10706texture can be accommodated, the texture state values will be set as
10707they would be set for a non-proxy target.
10708
10709PNAME specifies the texture parameter whose value or values will be
10710returned.
10711
10712The accepted parameter names are as follows:
10713
10714`GL_TEXTURE_WIDTH'
10715
10716
10717 PARAMS returns a single value, the width of the texture image. This
10718 value includes the border of the texture image. The initial value
10719 is 0.
10720
10721`GL_TEXTURE_HEIGHT'
10722
10723
10724 PARAMS returns a single value, the height of the texture image.
10725 This value includes the border of the texture image. The initial
10726 value is 0.
10727
10728`GL_TEXTURE_DEPTH'
10729
10730
10731 PARAMS returns a single value, the depth of the texture image. This
10732 value includes the border of the texture image. The initial value
10733 is 0.
10734
10735`GL_TEXTURE_INTERNAL_FORMAT'
10736
10737
10738 PARAMS returns a single value, the internal format of the texture
10739 image.
10740
10741`GL_TEXTURE_BORDER'
10742
10743
10744 PARAMS returns a single value, the width in pixels of the border of
10745 the texture image. The initial value is 0.
10746
10747`GL_TEXTURE_RED_SIZE',
10748`GL_TEXTURE_GREEN_SIZE',
10749`GL_TEXTURE_BLUE_SIZE',
10750`GL_TEXTURE_ALPHA_SIZE',
10751`GL_TEXTURE_LUMINANCE_SIZE',
10752`GL_TEXTURE_INTENSITY_SIZE',
10753`GL_TEXTURE_DEPTH_SIZE'
10754
10755
10756 The internal storage resolution of an individual component. The
10757 resolution chosen by the GL will be a close match for the
10758 resolution requested by the user with the component argument of
10759 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
10760 and `glCopyTexImage2D'. The initial value is 0.
10761
10762`GL_TEXTURE_COMPRESSED'
10763
10764
10765 PARAMS returns a single boolean value indicating if the texture
10766 image is stored in a compressed internal format. The initiali value
10767 is `GL_FALSE'.
10768
10769`GL_TEXTURE_COMPRESSED_IMAGE_SIZE'
10770
10771
10772 PARAMS returns a single integer value, the number of unsigned bytes
10773 of the compressed texture image that would be returned from
10774 `glGetCompressedTexImage'.
10775
10776`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10777value.
10778
10779`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
10780
10781`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
10782where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
10783
10784`GL_INVALID_OPERATION' is generated if `glGetTexLevelParameter' is
10785executed between the execution of `glBegin' and the corresponding
10786execution of `glEnd'.
10787
10788`GL_INVALID_OPERATION' is generated if
10789`GL_TEXTURE_COMPRESSED_IMAGE_SIZE' is queried on texture images with an
10790uncompressed internal format or on proxy targets.")
10791
10792(define-gl-procedures
10793 ((glGetTexParameterfv
10794 (target GLenum)
10795 (pname GLenum)
10796 (params GLfloat-*)
10797 ->
10798 void)
10799 (glGetTexParameteriv
10800 (target GLenum)
10801 (pname GLenum)
10802 (params GLint-*)
10803 ->
10804 void))
10805 "Return texture parameter values.
10806
10807TARGET
10808 Specifies the symbolic name of the target texture. `GL_TEXTURE_1D',
10809 `GL_TEXTURE_2D', `GL_TEXTURE_3D', and `GL_TEXTURE_CUBE_MAP' are
10810 accepted.
10811
10812PNAME
10813 Specifies the symbolic name of a texture parameter.
10814 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_FILTER',
10815 `GL_TEXTURE_MIN_LOD', `GL_TEXTURE_MAX_LOD',
10816 `GL_TEXTURE_BASE_LEVEL', `GL_TEXTURE_MAX_LEVEL',
10817 `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T', `GL_TEXTURE_WRAP_R',
10818 `GL_TEXTURE_BORDER_COLOR', `GL_TEXTURE_PRIORITY',
10819 `GL_TEXTURE_RESIDENT', `GL_TEXTURE_COMPARE_MODE',
10820 `GL_TEXTURE_COMPARE_FUNC', `GL_DEPTH_TEXTURE_MODE', and
10821 `GL_GENERATE_MIPMAP' are accepted.
10822
10823PARAMS
10824 Returns the texture parameters.
10825
10826`glGetTexParameter' returns in PARAMS the value or values of the texture
10827parameter specified as PNAME. TARGET defines the target texture, either
10828`GL_TEXTURE_1D', `GL_TEXTURE_2D', `GL_TEXTURE_3D', or
10829`GL_TEXTURE_CUBE_MAP', to specify one-, two-, or three-dimensional or
10830cube-mapped texturing. PNAME accepts the same symbols as
10831`glTexParameter', with the same interpretations:
10832
10833`GL_TEXTURE_MAG_FILTER'
10834 Returns the single-valued texture magnification filter, a symbolic
10835 constant. The initial value is `GL_LINEAR'.
10836
10837`GL_TEXTURE_MIN_FILTER'
10838 Returns the single-valued texture minification filter, a symbolic
10839 constant. The initial value is `GL_NEAREST_MIPMAP_LINEAR'.
10840
10841`GL_TEXTURE_MIN_LOD'
10842 Returns the single-valued texture minimum level-of-detail value.
10843 The initial value is -1000 .
10844
10845`GL_TEXTURE_MAX_LOD'
10846 Returns the single-valued texture maximum level-of-detail value.
10847 The initial value is 1000.
10848
10849`GL_TEXTURE_BASE_LEVEL'
10850 Returns the single-valued base texture mipmap level. The initial
10851 value is 0.
10852
10853`GL_TEXTURE_MAX_LEVEL'
10854 Returns the single-valued maximum texture mipmap array level. The
10855 initial value is 1000.
10856
10857`GL_TEXTURE_WRAP_S'
10858 Returns the single-valued wrapping function for texture coordinate
10859 S , a symbolic constant. The initial value is `GL_REPEAT'.
10860
10861`GL_TEXTURE_WRAP_T'
10862 Returns the single-valued wrapping function for texture coordinate
10863 T , a symbolic constant. The initial value is `GL_REPEAT'.
10864
10865`GL_TEXTURE_WRAP_R'
10866 Returns the single-valued wrapping function for texture coordinate
10867 R , a symbolic constant. The initial value is `GL_REPEAT'.
10868
10869`GL_TEXTURE_BORDER_COLOR'
10870 Returns four integer or floating-point numbers that comprise the
10871 RGBA color of the texture border. Floating-point values are
10872 returned in the range [0,1] . Integer values are returned as a
10873 linear mapping of the internal floating-point representation such
10874 that 1.0 maps to the most positive representable integer and -1.0
10875 maps to the most negative representable integer. The initial value
10876 is (0, 0, 0, 0).
10877
10878`GL_TEXTURE_PRIORITY'
10879 Returns the residence priority of the target texture (or the named
10880 texture bound to it). The initial value is 1. See
10881 `glPrioritizeTextures'.
10882
10883`GL_TEXTURE_RESIDENT'
10884 Returns the residence status of the target texture. If the value
10885 returned in PARAMS is `GL_TRUE', the texture is resident in texture
10886 memory. See `glAreTexturesResident'.
10887
10888`GL_TEXTURE_COMPARE_MODE'
10889 Returns a single-valued texture comparison mode, a symbolic
10890 constant. The initial value is `GL_NONE'. See `glTexParameter'.
10891
10892`GL_TEXTURE_COMPARE_FUNC'
10893 Returns a single-valued texture comparison function, a symbolic
10894 constant. The initial value is `GL_LEQUAL'. See `glTexParameter'.
10895
10896`GL_DEPTH_TEXTURE_MODE'
10897 Returns a single-valued texture format indicating how the depth
10898 values should be converted into color components. The initial value
10899 is `GL_LUMINANCE'. See `glTexParameter'.
10900
10901`GL_GENERATE_MIPMAP'
10902 Returns a single boolean value indicating if automatic mipmap level
10903 updates are enabled. See `glTexParameter'.
10904
10905`GL_INVALID_ENUM' is generated if TARGET or PNAME is not an accepted
10906value.
10907
10908`GL_INVALID_OPERATION' is generated if `glGetTexParameter' is executed
10909between the execution of `glBegin' and the corresponding execution of
10910`glEnd'.")
10911
10912(define-gl-procedures
10913 ((glGetUniformLocation
10914 (program GLuint)
10915 (name const-GLchar-*)
10916 ->
10917 GLint))
10918 "Returns the location of a uniform variable.
10919
10920PROGRAM
10921 Specifies the program object to be queried.
10922
10923NAME
10924 Points to a null terminated string containing the name of the
10925 uniform variable whose location is to be queried.
10926
10927`glGetUniformLocation ' returns an integer that represents the location
10928of a specific uniform variable within a program object. NAME must be a
10929null terminated string that contains no white space. NAME must be an
10930active uniform variable name in PROGRAM that is not a structure, an
10931array of structures, or a subcomponent of a vector or a matrix. This
10932function returns -1 if NAME does not correspond to an active uniform
10933variable in PROGRAM or if NAME starts with the reserved prefix \"gl_\".
10934
10935Uniform variables that are structures or arrays of structures may be
10936queried by calling `glGetUniformLocation' for each field within the
10937structure. The array element operator \"[]\" and the structure field
10938operator \".\" may be used in NAME in order to select elements within an
10939array or fields within a structure. The result of using these operators
10940is not allowed to be another structure, an array of structures, or a
10941subcomponent of a vector or a matrix. Except if the last part of NAME
10942indicates a uniform variable array, the location of the first element of
10943an array can be retrieved by using the name of the array, or by using
10944the name appended by \"[0]\".
10945
10946The actual locations assigned to uniform variables are not known until
10947the program object is linked successfully. After linking has occurred,
10948the command `glGetUniformLocation' can be used to obtain the location of
10949a uniform variable. This location value can then be passed to
10950`glUniform' to set the value of the uniform variable or to
10951`glGetUniform' in order to query the current value of the uniform
10952variable. After a program object has been linked successfully, the index
10953values for uniform variables remain fixed until the next link command
10954occurs. Uniform variable locations and values can only be queried after
10955a link if the link was successful.
10956
10957`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
10958OpenGL.
10959
10960`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
10961
10962`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
10963linked.
10964
10965`GL_INVALID_OPERATION' is generated if `glGetUniformLocation' is
10966executed between the execution of `glBegin' and the corresponding
10967execution of `glEnd'.")
10968
10969(define-gl-procedures
10970 ((glGetUniformfv
10971 (program GLuint)
10972 (location GLint)
10973 (params GLfloat-*)
10974 ->
10975 void)
10976 (glGetUniformiv
10977 (program GLuint)
10978 (location GLint)
10979 (params GLint-*)
10980 ->
10981 void))
10982 "Returns the value of a uniform variable.
10983
10984PROGRAM
10985 Specifies the program object to be queried.
10986
10987LOCATION
10988 Specifies the location of the uniform variable to be queried.
10989
10990PARAMS
10991 Returns the value of the specified uniform variable.
10992
10993`glGetUniform' returns in PARAMS the value(s) of the specified uniform
10994variable. The type of the uniform variable specified by LOCATION
10995determines the number of values returned. If the uniform variable is
10996defined in the shader as a boolean, int, or float, a single value will
10997be returned. If it is defined as a vec2, ivec2, or bvec2, two values
10998will be returned. If it is defined as a vec3, ivec3, or bvec3, three
10999values will be returned, and so on. To query values stored in uniform
11000variables declared as arrays, call `glGetUniform' for each element of
11001the array. To query values stored in uniform variables declared as
11002structures, call `glGetUniform' for each field in the structure. The
11003values for uniform variables declared as a matrix will be returned in
11004column major order.
11005
11006The locations assigned to uniform variables are not known until the
11007program object is linked. After linking has occurred, the command
11008`glGetUniformLocation' can be used to obtain the location of a uniform
11009variable. This location value can then be passed to `glGetUniform' in
11010order to query the current value of the uniform variable. After a
11011program object has been linked successfully, the index values for
11012uniform variables remain fixed until the next link command occurs. The
11013uniform variable values can only be queried after a link if the link was
11014successful.
11015
11016`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
11017OpenGL.
11018
11019`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
11020
11021`GL_INVALID_OPERATION' is generated if PROGRAM has not been successfully
11022linked.
11023
11024`GL_INVALID_OPERATION' is generated if LOCATION does not correspond to a
11025valid uniform variable location for the specified program object.
11026
11027`GL_INVALID_OPERATION' is generated if `glGetUniform' is executed
11028between the execution of `glBegin' and the corresponding execution of
11029`glEnd'.")
11030
11031(define-gl-procedures
11032 ((glGetVertexAttribPointerv
11033 (index GLuint)
11034 (pname GLenum)
11035 (pointer GLvoid-**)
11036 ->
11037 void))
11038 "Return the address of the specified generic vertex attribute pointer.
11039
11040INDEX
11041 Specifies the generic vertex attribute parameter to be returned.
11042
11043PNAME
11044 Specifies the symbolic name of the generic vertex attribute
11045 parameter to be returned. Must be `GL_VERTEX_ATTRIB_ARRAY_POINTER'.
11046
11047POINTER
11048 Returns the pointer value.
11049
11050`glGetVertexAttribPointerv' returns pointer information. INDEX is the
11051generic vertex attribute to be queried, PNAME is a symbolic constant
11052indicating the pointer to be returned, and PARAMS is a pointer to a
11053location in which to place the returned data.
11054
11055If a non-zero named buffer object was bound to the `GL_ARRAY_BUFFER'
11056target (see `glBindBuffer') when the desired pointer was previously
11057specified, the POINTER returned is a byte offset into the buffer
11058object's data store.
11059
11060`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
11061`GL_MAX_VERTEX_ATTRIBS'.
11062
11063`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.")
11064
11065(define-gl-procedures
78aa45b9
DH
11066 ((glGetVertexAttribdv
11067 (index GLuint)
11068 (pname GLenum)
11069 (params GLdouble-*)
11070 ->
11071 void)
11072 (glGetVertexAttribfv
b002944d
AW
11073 (index GLuint)
11074 (pname GLenum)
11075 (params GLfloat-*)
11076 ->
11077 void)
11078 (glGetVertexAttribiv
11079 (index GLuint)
11080 (pname GLenum)
11081 (params GLint-*)
11082 ->
11083 void))
11084 "Return a generic vertex attribute parameter.
11085
11086INDEX
11087 Specifies the generic vertex attribute parameter to be queried.
11088
11089PNAME
11090 Specifies the symbolic name of the vertex attribute parameter to be
11091 queried. Accepted values are
11092 `GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING',
11093 `GL_VERTEX_ATTRIB_ARRAY_ENABLED', `GL_VERTEX_ATTRIB_ARRAY_SIZE',
11094 `GL_VERTEX_ATTRIB_ARRAY_STRIDE', `GL_VERTEX_ATTRIB_ARRAY_TYPE',
11095 `GL_VERTEX_ATTRIB_ARRAY_NORMALIZED', or `GL_CURRENT_VERTEX_ATTRIB'.
11096
11097PARAMS
11098 Returns the requested data.
11099
11100`glGetVertexAttrib' returns in PARAMS the value of a generic vertex
11101attribute parameter. The generic vertex attribute to be queried is
11102specified by INDEX, and the parameter to be queried is specified by
11103PNAME.
11104
11105The accepted parameter names are as follows:
11106
11107`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING'
11108
11109
11110 PARAMS returns a single value, the name of the buffer object
11111 currently bound to the binding point corresponding to generic
11112 vertex attribute array INDEX. If no buffer object is bound, 0 is
11113 returned. The initial value is 0.
11114
11115`GL_VERTEX_ATTRIB_ARRAY_ENABLED'
11116
11117
11118 PARAMS returns a single value that is non-zero (true) if the vertex
11119 attribute array for INDEX is enabled and 0 (false) if it is
11120 disabled. The initial value is `GL_FALSE'.
11121
11122`GL_VERTEX_ATTRIB_ARRAY_SIZE'
11123
11124
11125 PARAMS returns a single value, the size of the vertex attribute
11126 array for INDEX. The size is the number of values for each element
11127 of the vertex attribute array, and it will be 1, 2, 3, or 4. The
11128 initial value is 4.
11129
11130`GL_VERTEX_ATTRIB_ARRAY_STRIDE'
11131
11132
11133 PARAMS returns a single value, the array stride for (number of
11134 bytes between successive elements in) the vertex attribute array
11135 for INDEX. A value of 0 indicates that the array elements are
11136 stored sequentially in memory. The initial value is 0.
11137
11138`GL_VERTEX_ATTRIB_ARRAY_TYPE'
11139
11140
11141 PARAMS returns a single value, a symbolic constant indicating the
11142 array type for the vertex attribute array for INDEX. Possible
11143 values are `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
11144 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', and
11145 `GL_DOUBLE'. The initial value is `GL_FLOAT'.
11146
11147`GL_VERTEX_ATTRIB_ARRAY_NORMALIZED'
11148
11149
11150 PARAMS returns a single value that is non-zero (true) if
11151 fixed-point data types for the vertex attribute array indicated by
11152 INDEX are normalized when they are converted to floating point, and
11153 0 (false) otherwise. The initial value is `GL_FALSE'.
11154
11155`GL_CURRENT_VERTEX_ATTRIB'
11156
11157
11158 PARAMS returns four values that represent the current value for the
11159 generic vertex attribute specified by index. Generic vertex
11160 attribute 0 is unique in that it has no current state, so an error
11161 will be generated if INDEX is 0. The initial value for all other
11162 generic vertex attributes is (0,0,0,1).
11163
11164All of the parameters except `GL_CURRENT_VERTEX_ATTRIB' represent
11165client-side state.
11166
11167`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
11168`GL_MAX_VERTEX_ATTRIBS'.
11169
11170`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
11171
11172`GL_INVALID_OPERATION' is generated if INDEX is 0 and PNAME is
11173`GL_CURRENT_VERTEX_ATTRIB'.")
11174
11175(define-gl-procedures
11176 ((glGetBooleanv
11177 (pname GLenum)
11178 (params GLboolean-*)
11179 ->
11180 void)
11181 (glGetDoublev
11182 (pname GLenum)
11183 (params GLdouble-*)
11184 ->
11185 void)
11186 (glGetFloatv
11187 (pname GLenum)
11188 (params GLfloat-*)
11189 ->
11190 void)
11191 (glGetIntegerv
11192 (pname GLenum)
11193 (params GLint-*)
11194 ->
11195 void))
11196 "Return the value or values of a selected parameter.
11197
11198PNAME
11199 Specifies the parameter value to be returned. The symbolic
11200 constants in the list below are accepted.
11201
11202PARAMS
11203 Returns the value or values of the specified parameter.
11204
11205These four commands return values for simple state variables in GL.
11206PNAME is a symbolic constant indicating the state variable to be
11207returned, and PARAMS is a pointer to an array of the indicated type in
11208which to place the returned data.
11209
11210Type conversion is performed if PARAMS has a different type than the
11211state variable value being requested. If `glGetBooleanv' is called, a
11212floating-point (or integer) value is converted to `GL_FALSE' if and only
11213if it is 0.0 (or 0). Otherwise, it is converted to `GL_TRUE'. If
11214`glGetIntegerv' is called, boolean values are returned as `GL_TRUE' or
11215`GL_FALSE', and most floating-point values are rounded to the nearest
11216integer value. Floating-point colors and normals, however, are returned
11217with a linear mapping that maps 1.0 to the most positive representable
11218integer value and -1.0 to the most negative representable integer value.
11219If `glGetFloatv' or `glGetDoublev' is called, boolean values are
11220returned as `GL_TRUE' or `GL_FALSE', and integer values are converted to
11221floating-point values.
11222
11223The following symbolic constants are accepted by PNAME:
11224
11225`GL_ACCUM_ALPHA_BITS'
11226
11227
11228 PARAMS returns one value, the number of alpha bitplanes in the
11229 accumulation buffer.
11230
11231`GL_ACCUM_BLUE_BITS'
11232
11233
11234 PARAMS returns one value, the number of blue bitplanes in the
11235 accumulation buffer.
11236
11237`GL_ACCUM_CLEAR_VALUE'
11238
11239
11240 PARAMS returns four values: the red, green, blue, and alpha values
11241 used to clear the accumulation buffer. Integer values, if
11242 requested, are linearly mapped from the internal floating-point
11243 representation such that 1.0 returns the most positive
11244 representable integer value, and -1.0 returns the most negative
11245 representable integer value. The initial value is (0, 0, 0, 0). See
11246 `glClearAccum'.
11247
11248`GL_ACCUM_GREEN_BITS'
11249
11250
11251 PARAMS returns one value, the number of green bitplanes in the
11252 accumulation buffer.
11253
11254`GL_ACCUM_RED_BITS'
11255
11256
11257 PARAMS returns one value, the number of red bitplanes in the
11258 accumulation buffer.
11259
11260`GL_ACTIVE_TEXTURE'
11261
11262
11263 PARAMS returns a single value indicating the active multitexture
11264 unit. The initial value is `GL_TEXTURE0'. See `glActiveTexture'.
11265
11266`GL_ALIASED_POINT_SIZE_RANGE'
11267
11268
11269 PARAMS returns two values, the smallest and largest supported sizes
11270 for aliased points.
11271
11272`GL_ALIASED_LINE_WIDTH_RANGE'
11273
11274
11275 PARAMS returns two values, the smallest and largest supported
11276 widths for aliased lines.
11277
11278`GL_ALPHA_BIAS'
11279
11280
11281 PARAMS returns one value, the alpha bias factor used during pixel
11282 transfers. The initial value is 0. See `glPixelTransfer'.
11283
11284`GL_ALPHA_BITS'
11285
11286
11287 PARAMS returns one value, the number of alpha bitplanes in each
11288 color buffer.
11289
11290`GL_ALPHA_SCALE'
11291
11292
11293 PARAMS returns one value, the alpha scale factor used during pixel
11294 transfers. The initial value is 1. See `glPixelTransfer'.
11295
11296`GL_ALPHA_TEST'
11297
11298
11299 PARAMS returns a single boolean value indicating whether alpha
11300 testing of fragments is enabled. The initial value is `GL_FALSE'.
11301 See `glAlphaFunc'.
11302
11303`GL_ALPHA_TEST_FUNC'PARAMS returns one value,
11304
11305
11306 the symbolic name of the alpha test function. The initial value is
11307 `GL_ALWAYS'. See `glAlphaFunc'.
11308
11309`GL_ALPHA_TEST_REF'
11310
11311
11312 PARAMS returns one value, the reference value for the alpha test.
11313 The initial value is 0. See `glAlphaFunc'. An integer value, if
11314 requested, is linearly mapped from the internal floating-point
11315 representation such that 1.0 returns the most positive
11316 representable integer value, and -1.0 returns the most negative
11317 representable integer value.
11318
11319`GL_ARRAY_BUFFER_BINDING'
11320
11321
11322 PARAMS returns a single value, the name of the buffer object
11323 currently bound to the target `GL_ARRAY_BUFFER'. If no buffer
11324 object is bound to this target, 0 is returned. The initial value is
11325 0. See `glBindBuffer'.
11326
11327`GL_ATTRIB_STACK_DEPTH'
11328
11329
11330 PARAMS returns one value, the depth of the attribute stack. If the
11331 stack is empty, 0 is returned. The initial value is 0. See
11332 `glPushAttrib'.
11333
11334`GL_AUTO_NORMAL'
11335
11336
11337 PARAMS returns a single boolean value indicating whether 2D map
11338 evaluation automatically generates surface normals. The initial
11339 value is `GL_FALSE'. See `glMap2'.
11340
11341`GL_AUX_BUFFERS'
11342
11343
11344 PARAMS returns one value, the number of auxiliary color buffers
11345 available.
11346
11347`GL_BLEND'
11348
11349
11350 PARAMS returns a single boolean value indicating whether blending
11351 is enabled. The initial value is `GL_FALSE'. See `glBlendFunc'.
11352
11353`GL_BLEND_COLOR'
11354
11355
11356 PARAMS returns four values, the red, green, blue, and alpha values
11357 which are the components of the blend color. See `glBlendColor'.
11358
11359`GL_BLEND_DST_ALPHA'
11360
11361
11362 PARAMS returns one value, the symbolic constant identifying the
11363 alpha destination blend function. The initial value is `GL_ZERO'.
11364 See `glBlendFunc' and `glBlendFuncSeparate'.
11365
11366`GL_BLEND_DST_RGB'
11367
11368
11369 PARAMS returns one value, the symbolic constant identifying the RGB
11370 destination blend function. The initial value is `GL_ZERO'. See
11371 `glBlendFunc' and `glBlendFuncSeparate'.
11372
11373`GL_BLEND_EQUATION_RGB'
11374
11375
11376 PARAMS returns one value, a symbolic constant indicating whether
11377 the RGB blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11378 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11379 `glBlendEquationSeparate'.
11380
11381`GL_BLEND_EQUATION_ALPHA'
11382
11383
11384 PARAMS returns one value, a symbolic constant indicating whether
11385 the Alpha blend equation is `GL_FUNC_ADD', `GL_FUNC_SUBTRACT',
11386 `GL_FUNC_REVERSE_SUBTRACT', `GL_MIN' or `GL_MAX'. See
11387 `glBlendEquationSeparate'.
11388
11389`GL_BLEND_SRC_ALPHA'
11390
11391
11392 PARAMS returns one value, the symbolic constant identifying the
11393 alpha source blend function. The initial value is `GL_ONE'. See
11394 `glBlendFunc' and `glBlendFuncSeparate'.
11395
11396`GL_BLEND_SRC_RGB'
11397
11398
11399 PARAMS returns one value, the symbolic constant identifying the RGB
11400 source blend function. The initial value is `GL_ONE'. See
11401 `glBlendFunc' and `glBlendFuncSeparate'.
11402
11403`GL_BLUE_BIAS'
11404
11405
11406 PARAMS returns one value, the blue bias factor used during pixel
11407 transfers. The initial value is 0. See `glPixelTransfer'.
11408
11409`GL_BLUE_BITS'
11410
11411
11412 PARAMS returns one value, the number of blue bitplanes in each
11413 color buffer.
11414
11415`GL_BLUE_SCALE'
11416
11417
11418 PARAMS returns one value, the blue scale factor used during pixel
11419 transfers. The initial value is 1. See `glPixelTransfer'.
11420
11421`GL_CLIENT_ACTIVE_TEXTURE'
11422
11423
11424 PARAMS returns a single integer value indicating the current client
11425 active multitexture unit. The initial value is `GL_TEXTURE0'. See
11426 `glClientActiveTexture'.
11427
11428`GL_CLIENT_ATTRIB_STACK_DEPTH'
11429
11430
11431 PARAMS returns one value indicating the depth of the attribute
11432 stack. The initial value is 0. See `glPushClientAttrib'.
11433
11434`GL_CLIP_PLANE'I
11435
11436
11437 PARAMS returns a single boolean value indicating whether the
11438 specified clipping plane is enabled. The initial value is
11439 `GL_FALSE'. See `glClipPlane'.
11440
11441`GL_COLOR_ARRAY'
11442
11443
11444 PARAMS returns a single boolean value indicating whether the color
11445 array is enabled. The initial value is `GL_FALSE'. See
11446 `glColorPointer'.
11447
11448`GL_COLOR_ARRAY_BUFFER_BINDING'
11449
11450
11451 PARAMS returns a single value, the name of the buffer object
11452 associated with the color array. This buffer object would have been
11453 bound to the target `GL_ARRAY_BUFFER' at the time of the most
11454 recent call to `glColorPointer'. If no buffer object was bound to
11455 this target, 0 is returned. The initial value is 0. See
11456 `glBindBuffer'.
11457
11458`GL_COLOR_ARRAY_SIZE'
11459
11460
11461 PARAMS returns one value, the number of components per color in the
11462 color array. The initial value is 4. See `glColorPointer'.
11463
11464`GL_COLOR_ARRAY_STRIDE'
11465
11466
11467 PARAMS returns one value, the byte offset between consecutive
11468 colors in the color array. The initial value is 0. See
11469 `glColorPointer'.
11470
11471`GL_COLOR_ARRAY_TYPE'
11472
11473
11474 PARAMS returns one value, the data type of each component in the
11475 color array. The initial value is `GL_FLOAT'. See `glColorPointer'.
11476
11477`GL_COLOR_CLEAR_VALUE'
11478
11479
11480 PARAMS returns four values: the red, green, blue, and alpha values
11481 used to clear the color buffers. Integer values, if requested, are
11482 linearly mapped from the internal floating-point representation
11483 such that 1.0 returns the most positive representable integer
11484 value, and -1.0 returns the most negative representable integer
11485 value. The initial value is (0, 0, 0, 0). See `glClearColor'.
11486
11487`GL_COLOR_LOGIC_OP'
11488
11489
11490 PARAMS returns a single boolean value indicating whether a
11491 fragment's RGBA color values are merged into the framebuffer using
11492 a logical operation. The initial value is `GL_FALSE'. See
11493 `glLogicOp'.
11494
11495`GL_COLOR_MATERIAL'
11496
11497
11498 PARAMS returns a single boolean value indicating whether one or
11499 more material parameters are tracking the current color. The
11500 initial value is `GL_FALSE'. See `glColorMaterial'.
11501
11502`GL_COLOR_MATERIAL_FACE'
11503
11504
11505 PARAMS returns one value, a symbolic constant indicating which
11506 materials have a parameter that is tracking the current color. The
11507 initial value is `GL_FRONT_AND_BACK'. See `glColorMaterial'.
11508
11509`GL_COLOR_MATERIAL_PARAMETER'
11510
11511
11512 PARAMS returns one value, a symbolic constant indicating which
11513 material parameters are tracking the current color. The initial
11514 value is `GL_AMBIENT_AND_DIFFUSE'. See `glColorMaterial'.
11515
11516`GL_COLOR_MATRIX'
11517
11518
11519 PARAMS returns sixteen values: the color matrix on the top of the
11520 color matrix stack. Initially this matrix is the identity matrix.
11521 See `glPushMatrix'.
11522
11523`GL_COLOR_MATRIX_STACK_DEPTH'
11524
11525
11526 PARAMS returns one value, the maximum supported depth of the
11527 projection matrix stack. The value must be at least 2. See
11528 `glPushMatrix'.
11529
11530`GL_COLOR_SUM'
11531
11532
11533 PARAMS returns a single boolean value indicating whether primary
11534 and secondary color sum is enabled. See `glSecondaryColor'.
11535
11536`GL_COLOR_TABLE'
11537
11538
11539 PARAMS returns a single boolean value indicating whether the color
11540 table lookup is enabled. See `glColorTable'.
11541
11542`GL_COLOR_WRITEMASK'
11543
11544
11545 PARAMS returns four boolean values: the red, green, blue, and alpha
11546 write enables for the color buffers. The initial value is
11547 (`GL_TRUE', `GL_TRUE', `GL_TRUE', `GL_TRUE'). See `glColorMask'.
11548
11549`GL_COMPRESSED_TEXTURE_FORMATS'
11550
11551
11552 PARAMS returns a list of symbolic constants of length
11553 `GL_NUM_COMPRESSED_TEXTURE_FORMATS' indicating which compressed
11554 texture formats are available. See `glCompressedTexImage2D'.
11555
11556`GL_CONVOLUTION_1D'
11557
11558
11559 PARAMS returns a single boolean value indicating whether 1D
11560 convolution is enabled. The initial value is `GL_FALSE'. See
11561 `glConvolutionFilter1D'.
11562
11563`GL_CONVOLUTION_2D'
11564
11565
11566 PARAMS returns a single boolean value indicating whether 2D
11567 convolution is enabled. The initial value is `GL_FALSE'. See
11568 `glConvolutionFilter2D'.
11569
11570`GL_CULL_FACE'
11571
11572
11573 PARAMS returns a single boolean value indicating whether polygon
11574 culling is enabled. The initial value is `GL_FALSE'. See
11575 `glCullFace'.
11576
11577`GL_CULL_FACE_MODE'
11578
11579
11580 PARAMS returns one value, a symbolic constant indicating which
11581 polygon faces are to be culled. The initial value is `GL_BACK'. See
11582 `glCullFace'.
11583
11584`GL_CURRENT_COLOR'
11585
11586
11587 PARAMS returns four values: the red, green, blue, and alpha values
11588 of the current color. Integer values, if requested, are linearly
11589 mapped from the internal floating-point representation such that
11590 1.0 returns the most positive representable integer value, and -1.0
11591 returns the most negative representable integer value. The initial
11592 value is (1, 1, 1, 1). See `glColor'.
11593
11594`GL_CURRENT_FOG_COORD'
11595
11596
11597 PARAMS returns one value, the current fog coordinate. The initial
11598 value is 0. See `glFogCoord'.
11599
11600`GL_CURRENT_INDEX'
11601
11602
11603 PARAMS returns one value, the current color index. The initial
11604 value is 1. See `glIndex'.
11605
11606`GL_CURRENT_NORMAL'
11607
11608
11609 PARAMS returns three values: the X, Y, and Z values of the current
11610 normal. Integer values, if requested, are linearly mapped from the
11611 internal floating-point representation such that 1.0 returns the
11612 most positive representable integer value, and -1.0 returns the
11613 most negative representable integer value. The initial value is (0,
11614 0, 1). See `glNormal'.
11615
11616`GL_CURRENT_PROGRAM'
11617
11618
11619 PARAMS returns one value, the name of the program object that is
11620 currently active, or 0 if no program object is active. See
11621 `glUseProgram'.
11622
11623`GL_CURRENT_RASTER_COLOR'
11624
11625
11626 PARAMS returns four values: the red, green, blue, and alpha color
11627 values of the current raster position. Integer values, if
11628 requested, are linearly mapped from the internal floating-point
11629 representation such that 1.0 returns the most positive
11630 representable integer value, and -1.0 returns the most negative
11631 representable integer value. The initial value is (1, 1, 1, 1). See
11632 `glRasterPos'.
11633
11634`GL_CURRENT_RASTER_DISTANCE'
11635
11636
11637 PARAMS returns one value, the distance from the eye to the current
11638 raster position. The initial value is 0. See `glRasterPos'.
11639
11640`GL_CURRENT_RASTER_INDEX'
11641
11642
11643 PARAMS returns one value, the color index of the current raster
11644 position. The initial value is 1. See `glRasterPos'.
11645
11646`GL_CURRENT_RASTER_POSITION'
11647
11648
11649 PARAMS returns four values: the X, Y, Z, and W components of the
11650 current raster position. X, Y, and Z are in window coordinates, and
11651 W is in clip coordinates. The initial value is (0, 0, 0, 1). See
11652 `glRasterPos'.
11653
11654`GL_CURRENT_RASTER_POSITION_VALID'
11655
11656
11657 PARAMS returns a single boolean value indicating whether the
11658 current raster position is valid. The initial value is `GL_TRUE'.
11659 See `glRasterPos'.
11660
11661`GL_CURRENT_RASTER_SECONDARY_COLOR'
11662
11663
11664 PARAMS returns four values: the red, green, blue, and alpha
11665 secondary color values of the current raster position. Integer
11666 values, if requested, are linearly mapped from the internal
11667 floating-point representation such that 1.0 returns the most
11668 positive representable integer value, and -1.0 returns the most
11669 negative representable integer value. The initial value is (1, 1,
11670 1, 1). See `glRasterPos'.
11671
11672`GL_CURRENT_RASTER_TEXTURE_COORDS'
11673
11674
11675 PARAMS returns four values: the S, T, R, and Q texture coordinates
11676 of the current raster position. The initial value is (0, 0, 0, 1).
11677 See `glRasterPos' and `glMultiTexCoord'.
11678
11679`GL_CURRENT_SECONDARY_COLOR'
11680
11681
11682 PARAMS returns four values: the red, green, blue, and alpha values
11683 of the current secondary color. Integer values, if requested, are
11684 linearly mapped from the internal floating-point representation
11685 such that 1.0 returns the most positive representable integer
11686 value, and -1.0 returns the most negative representable integer
11687 value. The initial value is (0, 0, 0, 0). See `glSecondaryColor'.
11688
11689`GL_CURRENT_TEXTURE_COORDS'
11690
11691
11692 PARAMS returns four values: the S, T, R, and Q current texture
11693 coordinates. The initial value is (0, 0, 0, 1). See
11694 `glMultiTexCoord'.
11695
11696`GL_DEPTH_BIAS'
11697
11698
11699 PARAMS returns one value, the depth bias factor used during pixel
11700 transfers. The initial value is 0. See `glPixelTransfer'.
11701
11702`GL_DEPTH_BITS'
11703
11704
11705 PARAMS returns one value, the number of bitplanes in the depth
11706 buffer.
11707
11708`GL_DEPTH_CLEAR_VALUE'
11709
11710
11711 PARAMS returns one value, the value that is used to clear the depth
11712 buffer. Integer values, if requested, are linearly mapped from the
11713 internal floating-point representation such that 1.0 returns the
11714 most positive representable integer value, and -1.0 returns the
11715 most negative representable integer value. The initial value is 1.
11716 See `glClearDepth'.
11717
11718`GL_DEPTH_FUNC'
11719
11720
11721 PARAMS returns one value, the symbolic constant that indicates the
11722 depth comparison function. The initial value is `GL_LESS'. See
11723 `glDepthFunc'.
11724
11725`GL_DEPTH_RANGE'
11726
11727
11728 PARAMS returns two values: the near and far mapping limits for the
11729 depth buffer. Integer values, if requested, are linearly mapped
11730 from the internal floating-point representation such that 1.0
11731 returns the most positive representable integer value, and -1.0
11732 returns the most negative representable integer value. The initial
11733 value is (0, 1). See `glDepthRange'.
11734
11735`GL_DEPTH_SCALE'
11736
11737
11738 PARAMS returns one value, the depth scale factor used during pixel
11739 transfers. The initial value is 1. See `glPixelTransfer'.
11740
11741`GL_DEPTH_TEST'
11742
11743
11744 PARAMS returns a single boolean value indicating whether depth
11745 testing of fragments is enabled. The initial value is `GL_FALSE'.
11746 See `glDepthFunc' and `glDepthRange'.
11747
11748`GL_DEPTH_WRITEMASK'
11749
11750
11751 PARAMS returns a single boolean value indicating if the depth
11752 buffer is enabled for writing. The initial value is `GL_TRUE'. See
11753 `glDepthMask'.
11754
11755`GL_DITHER'
11756
11757
11758 PARAMS returns a single boolean value indicating whether dithering
11759 of fragment colors and indices is enabled. The initial value is
11760 `GL_TRUE'.
11761
11762`GL_DOUBLEBUFFER'
11763
11764
11765 PARAMS returns a single boolean value indicating whether double
11766 buffering is supported.
11767
11768`GL_DRAW_BUFFER'
11769
11770
11771 PARAMS returns one value, a symbolic constant indicating which
11772 buffers are being drawn to. See `glDrawBuffer'. The initial value
11773 is `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11774
11775`GL_DRAW_BUFFER'I
11776
11777
11778 PARAMS returns one value, a symbolic constant indicating which
11779 buffers are being drawn to by the corresponding output color. See
11780 `glDrawBuffers'. The initial value of `GL_DRAW_BUFFER0' is
11781 `GL_BACK' if there are back buffers, otherwise it is `GL_FRONT'.
11782 The initial values of draw buffers for all other output colors is
11783 `GL_NONE'.
11784
11785`GL_EDGE_FLAG'
11786
11787
11788 PARAMS returns a single boolean value indicating whether the
11789 current edge flag is `GL_TRUE' or `GL_FALSE'. The initial value is
11790 `GL_TRUE'. See `glEdgeFlag'.
11791
11792`GL_EDGE_FLAG_ARRAY'
11793
11794
11795 PARAMS returns a single boolean value indicating whether the edge
11796 flag array is enabled. The initial value is `GL_FALSE'. See
11797 `glEdgeFlagPointer'.
11798
11799`GL_EDGE_FLAG_ARRAY_BUFFER_BINDING'
11800
11801
11802 PARAMS returns a single value, the name of the buffer object
11803 associated with the edge flag array. This buffer object would have
11804 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
11805 recent call to `glEdgeFlagPointer'. If no buffer object was bound
11806 to this target, 0 is returned. The initial value is 0. See
11807 `glBindBuffer'.
11808
11809`GL_EDGE_FLAG_ARRAY_STRIDE'
11810
11811
11812 PARAMS returns one value, the byte offset between consecutive edge
11813 flags in the edge flag array. The initial value is 0. See
11814 `glEdgeFlagPointer'.
11815
11816`GL_ELEMENT_ARRAY_BUFFER_BINDING'
11817
11818
11819 PARAMS returns a single value, the name of the buffer object
11820 currently bound to the target `GL_ELEMENT_ARRAY_BUFFER'. If no
11821 buffer object is bound to this target, 0 is returned. The initial
11822 value is 0. See `glBindBuffer'.
11823
11824`GL_FEEDBACK_BUFFER_SIZE'
11825
11826
11827 PARAMS returns one value, the size of the feedback buffer. See
11828 `glFeedbackBuffer'.
11829
11830`GL_FEEDBACK_BUFFER_TYPE'
11831
11832
11833 PARAMS returns one value, the type of the feedback buffer. See
11834 `glFeedbackBuffer'.
11835
11836`GL_FOG'
11837
11838
11839 PARAMS returns a single boolean value indicating whether fogging is
11840 enabled. The initial value is `GL_FALSE'. See `glFog'.
11841
11842`GL_FOG_COORD_ARRAY'
11843
11844
11845 PARAMS returns a single boolean value indicating whether the fog
11846 coordinate array is enabled. The initial value is `GL_FALSE'. See
11847 `glFogCoordPointer'.
11848
11849`GL_FOG_COORD_ARRAY_BUFFER_BINDING'
11850
11851
11852 PARAMS returns a single value, the name of the buffer object
11853 associated with the fog coordinate array. This buffer object would
11854 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11855 most recent call to `glFogCoordPointer'. If no buffer object was
11856 bound to this target, 0 is returned. The initial value is 0. See
11857 `glBindBuffer'.
11858
11859`GL_FOG_COORD_ARRAY_STRIDE'
11860
11861
11862 PARAMS returns one value, the byte offset between consecutive fog
11863 coordinates in the fog coordinate array. The initial value is 0.
11864 See `glFogCoordPointer'.
11865
11866`GL_FOG_COORD_ARRAY_TYPE'
11867
11868
11869 PARAMS returns one value, the type of the fog coordinate array. The
11870 initial value is `GL_FLOAT'. See `glFogCoordPointer'.
11871
11872`GL_FOG_COORD_SRC'
11873
11874
11875 PARAMS returns one value, a symbolic constant indicating the source
11876 of the fog coordinate. The initial value is `GL_FRAGMENT_DEPTH'.
11877 See `glFog'.
11878
11879`GL_FOG_COLOR'
11880
11881
11882 PARAMS returns four values: the red, green, blue, and alpha
11883 components of the fog color. Integer values, if requested, are
11884 linearly mapped from the internal floating-point representation
11885 such that 1.0 returns the most positive representable integer
11886 value, and -1.0 returns the most negative representable integer
11887 value. The initial value is (0, 0, 0, 0). See `glFog'.
11888
11889`GL_FOG_DENSITY'
11890
11891
11892 PARAMS returns one value, the fog density parameter. The initial
11893 value is 1. See `glFog'.
11894
11895`GL_FOG_END'
11896
11897
11898 PARAMS returns one value, the end factor for the linear fog
11899 equation. The initial value is 1. See `glFog'.
11900
11901`GL_FOG_HINT'
11902
11903
11904 PARAMS returns one value, a symbolic constant indicating the mode
11905 of the fog hint. The initial value is `GL_DONT_CARE'. See `glHint'.
11906
11907`GL_FOG_INDEX'
11908
11909
11910 PARAMS returns one value, the fog color index. The initial value is
11911 0. See `glFog'.
11912
11913`GL_FOG_MODE'
11914
11915
11916 PARAMS returns one value, a symbolic constant indicating which fog
11917 equation is selected. The initial value is `GL_EXP'. See `glFog'.
11918
11919`GL_FOG_START'
11920
11921
11922 PARAMS returns one value, the start factor for the linear fog
11923 equation. The initial value is 0. See `glFog'.
11924
11925`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
11926
11927
11928 PARAMS returns one value, a symbolic constant indicating the mode
11929 of the derivative accuracy hint for fragment shaders. The initial
11930 value is `GL_DONT_CARE'. See `glHint'.
11931
11932`GL_FRONT_FACE'
11933
11934
11935 PARAMS returns one value, a symbolic constant indicating whether
11936 clockwise or counterclockwise polygon winding is treated as
11937 front-facing. The initial value is `GL_CCW'. See `glFrontFace'.
11938
11939`GL_GENERATE_MIPMAP_HINT'
11940
11941
11942 PARAMS returns one value, a symbolic constant indicating the mode
11943 of the mipmap generation filtering hint. The initial value is
11944 `GL_DONT_CARE'. See `glHint'.
11945
11946`GL_GREEN_BIAS'
11947
11948
11949 PARAMS returns one value, the green bias factor used during pixel
11950 transfers. The initial value is 0.
11951
11952`GL_GREEN_BITS'
11953
11954
11955 PARAMS returns one value, the number of green bitplanes in each
11956 color buffer.
11957
11958`GL_GREEN_SCALE'
11959
11960
11961 PARAMS returns one value, the green scale factor used during pixel
11962 transfers. The initial value is 1. See `glPixelTransfer'.
11963
11964`GL_HISTOGRAM'
11965
11966
11967 PARAMS returns a single boolean value indicating whether histogram
11968 is enabled. The initial value is `GL_FALSE'. See `glHistogram'.
11969
11970`GL_INDEX_ARRAY'
11971
11972
11973 PARAMS returns a single boolean value indicating whether the color
11974 index array is enabled. The initial value is `GL_FALSE'. See
11975 `glIndexPointer'.
11976
11977`GL_INDEX_ARRAY_BUFFER_BINDING'
11978
11979
11980 PARAMS returns a single value, the name of the buffer object
11981 associated with the color index array. This buffer object would
11982 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
11983 most recent call to `glIndexPointer'. If no buffer object was bound
11984 to this target, 0 is returned. The initial value is 0. See
11985 `glBindBuffer'.
11986
11987`GL_INDEX_ARRAY_STRIDE'
11988
11989
11990 PARAMS returns one value, the byte offset between consecutive color
11991 indexes in the color index array. The initial value is 0. See
11992 `glIndexPointer'.
11993
11994`GL_INDEX_ARRAY_TYPE'
11995
11996
11997 PARAMS returns one value, the data type of indexes in the color
11998 index array. The initial value is `GL_FLOAT'. See `glIndexPointer'.
11999
12000`GL_INDEX_BITS'
12001
12002
12003 PARAMS returns one value, the number of bitplanes in each color
12004 index buffer.
12005
12006`GL_INDEX_CLEAR_VALUE'
12007
12008
12009 PARAMS returns one value, the color index used to clear the color
12010 index buffers. The initial value is 0. See `glClearIndex'.
12011
12012`GL_INDEX_LOGIC_OP'
12013
12014
12015 PARAMS returns a single boolean value indicating whether a
12016 fragment's index values are merged into the framebuffer using a
12017 logical operation. The initial value is `GL_FALSE'. See
12018 `glLogicOp'.
12019
12020`GL_INDEX_MODE'
12021
12022
12023 PARAMS returns a single boolean value indicating whether the GL is
12024 in color index mode (`GL_TRUE') or RGBA mode (`GL_FALSE').
12025
12026`GL_INDEX_OFFSET'
12027
12028
12029 PARAMS returns one value, the offset added to color and stencil
12030 indices during pixel transfers. The initial value is 0. See
12031 `glPixelTransfer'.
12032
12033`GL_INDEX_SHIFT'
12034
12035
12036 PARAMS returns one value, the amount that color and stencil indices
12037 are shifted during pixel transfers. The initial value is 0. See
12038 `glPixelTransfer'.
12039
12040`GL_INDEX_WRITEMASK'
12041
12042
12043 PARAMS returns one value, a mask indicating which bitplanes of each
12044 color index buffer can be written. The initial value is all 1's.
12045 See `glIndexMask'.
12046
12047`GL_LIGHT'I
12048
12049
12050 PARAMS returns a single boolean value indicating whether the
12051 specified light is enabled. The initial value is `GL_FALSE'. See
12052 `glLight' and `glLightModel'.
12053
12054`GL_LIGHTING'
12055
12056
12057 PARAMS returns a single boolean value indicating whether lighting
12058 is enabled. The initial value is `GL_FALSE'. See `glLightModel'.
12059
12060`GL_LIGHT_MODEL_AMBIENT'
12061
12062
12063 PARAMS returns four values: the red, green, blue, and alpha
12064 components of the ambient intensity of the entire scene. Integer
12065 values, if requested, are linearly mapped from the internal
12066 floating-point representation such that 1.0 returns the most
12067 positive representable integer value, and -1.0 returns the most
12068 negative representable integer value. The initial value is (0.2,
12069 0.2, 0.2, 1.0). See `glLightModel'.
12070
12071`GL_LIGHT_MODEL_COLOR_CONTROL'
12072
12073
12074 PARAMS returns single enumerated value indicating whether specular
12075 reflection calculations are separated from normal lighting
12076 computations. The initial value is `GL_SINGLE_COLOR'.
12077
12078`GL_LIGHT_MODEL_LOCAL_VIEWER'
12079
12080
12081 PARAMS returns a single boolean value indicating whether specular
12082 reflection calculations treat the viewer as being local to the
12083 scene. The initial value is `GL_FALSE'. See `glLightModel'.
12084
12085`GL_LIGHT_MODEL_TWO_SIDE'
12086
12087
12088 PARAMS returns a single boolean value indicating whether separate
12089 materials are used to compute lighting for front- and back-facing
12090 polygons. The initial value is `GL_FALSE'. See `glLightModel'.
12091
12092`GL_LINE_SMOOTH'
12093
12094
12095 PARAMS returns a single boolean value indicating whether
12096 antialiasing of lines is enabled. The initial value is `GL_FALSE'.
12097 See `glLineWidth'.
12098
12099`GL_LINE_SMOOTH_HINT'
12100
12101
12102 PARAMS returns one value, a symbolic constant indicating the mode
12103 of the line antialiasing hint. The initial value is `GL_DONT_CARE'.
12104 See `glHint'.
12105
12106`GL_LINE_STIPPLE'
12107
12108
12109 PARAMS returns a single boolean value indicating whether stippling
12110 of lines is enabled. The initial value is `GL_FALSE'. See
12111 `glLineStipple'.
12112
12113`GL_LINE_STIPPLE_PATTERN'
12114
12115
12116 PARAMS returns one value, the 16-bit line stipple pattern. The
12117 initial value is all 1's. See `glLineStipple'.
12118
12119`GL_LINE_STIPPLE_REPEAT'
12120
12121
12122 PARAMS returns one value, the line stipple repeat factor. The
12123 initial value is 1. See `glLineStipple'.
12124
12125`GL_LINE_WIDTH'
12126
12127
12128 PARAMS returns one value, the line width as specified with
12129 `glLineWidth'. The initial value is 1.
12130
12131`GL_LINE_WIDTH_GRANULARITY'
12132
12133
12134 PARAMS returns one value, the width difference between adjacent
12135 supported widths for antialiased lines. See `glLineWidth'.
12136
12137`GL_LINE_WIDTH_RANGE'
12138
12139
12140 PARAMS returns two values: the smallest and largest supported
12141 widths for antialiased lines. See `glLineWidth'.
12142
12143`GL_LIST_BASE'
12144
12145
12146 PARAMS returns one value, the base offset added to all names in
12147 arrays presented to `glCallLists'. The initial value is 0. See
12148 `glListBase'.
12149
12150`GL_LIST_INDEX'
12151
12152
12153 PARAMS returns one value, the name of the display list currently
12154 under construction. 0 is returned if no display list is currently
12155 under construction. The initial value is 0. See `glNewList'.
12156
12157`GL_LIST_MODE'
12158
12159
12160 PARAMS returns one value, a symbolic constant indicating the
12161 construction mode of the display list currently under construction.
12162 The initial value is 0. See `glNewList'.
12163
12164`GL_LOGIC_OP_MODE'
12165
12166
12167 PARAMS returns one value, a symbolic constant indicating the
12168 selected logic operation mode. The initial value is `GL_COPY'. See
12169 `glLogicOp'.
12170
12171`GL_MAP1_COLOR_4'
12172
12173
12174 PARAMS returns a single boolean value indicating whether 1D
12175 evaluation generates colors. The initial value is `GL_FALSE'. See
12176 `glMap1'.
12177
12178`GL_MAP1_GRID_DOMAIN'
12179
12180
12181 PARAMS returns two values: the endpoints of the 1D map's grid
12182 domain. The initial value is (0, 1). See `glMapGrid'.
12183
12184`GL_MAP1_GRID_SEGMENTS'
12185
12186
12187 PARAMS returns one value, the number of partitions in the 1D map's
12188 grid domain. The initial value is 1. See `glMapGrid'.
12189
12190`GL_MAP1_INDEX'
12191
12192
12193 PARAMS returns a single boolean value indicating whether 1D
12194 evaluation generates color indices. The initial value is
12195 `GL_FALSE'. See `glMap1'.
12196
12197`GL_MAP1_NORMAL'
12198
12199
12200 PARAMS returns a single boolean value indicating whether 1D
12201 evaluation generates normals. The initial value is `GL_FALSE'. See
12202 `glMap1'.
12203
12204`GL_MAP1_TEXTURE_COORD_1'
12205
12206
12207 PARAMS returns a single boolean value indicating whether 1D
12208 evaluation generates 1D texture coordinates. The initial value is
12209 `GL_FALSE'. See `glMap1'.
12210
12211`GL_MAP1_TEXTURE_COORD_2'
12212
12213
12214 PARAMS returns a single boolean value indicating whether 1D
12215 evaluation generates 2D texture coordinates. The initial value is
12216 `GL_FALSE'. See `glMap1'.
12217
12218`GL_MAP1_TEXTURE_COORD_3'
12219
12220
12221 PARAMS returns a single boolean value indicating whether 1D
12222 evaluation generates 3D texture coordinates. The initial value is
12223 `GL_FALSE'. See `glMap1'.
12224
12225`GL_MAP1_TEXTURE_COORD_4'
12226
12227
12228 PARAMS returns a single boolean value indicating whether 1D
12229 evaluation generates 4D texture coordinates. The initial value is
12230 `GL_FALSE'. See `glMap1'.
12231
12232`GL_MAP1_VERTEX_3'
12233
12234
12235 PARAMS returns a single boolean value indicating whether 1D
12236 evaluation generates 3D vertex coordinates. The initial value is
12237 `GL_FALSE'. See `glMap1'.
12238
12239`GL_MAP1_VERTEX_4'
12240
12241
12242 PARAMS returns a single boolean value indicating whether 1D
12243 evaluation generates 4D vertex coordinates. The initial value is
12244 `GL_FALSE'. See `glMap1'.
12245
12246`GL_MAP2_COLOR_4'
12247
12248
12249 PARAMS returns a single boolean value indicating whether 2D
12250 evaluation generates colors. The initial value is `GL_FALSE'. See
12251 `glMap2'.
12252
12253`GL_MAP2_GRID_DOMAIN'
12254
12255
12256 PARAMS returns four values: the endpoints of the 2D map's I and J
12257 grid domains. The initial value is (0,1; 0,1). See `glMapGrid'.
12258
12259`GL_MAP2_GRID_SEGMENTS'
12260
12261
12262 PARAMS returns two values: the number of partitions in the 2D map's
12263 I and J grid domains. The initial value is (1,1). See `glMapGrid'.
12264
12265`GL_MAP2_INDEX'
12266
12267
12268 PARAMS returns a single boolean value indicating whether 2D
12269 evaluation generates color indices. The initial value is
12270 `GL_FALSE'. See `glMap2'.
12271
12272`GL_MAP2_NORMAL'
12273
12274
12275 PARAMS returns a single boolean value indicating whether 2D
12276 evaluation generates normals. The initial value is `GL_FALSE'. See
12277 `glMap2'.
12278
12279`GL_MAP2_TEXTURE_COORD_1'
12280
12281
12282 PARAMS returns a single boolean value indicating whether 2D
12283 evaluation generates 1D texture coordinates. The initial value is
12284 `GL_FALSE'. See `glMap2'.
12285
12286`GL_MAP2_TEXTURE_COORD_2'
12287
12288
12289 PARAMS returns a single boolean value indicating whether 2D
12290 evaluation generates 2D texture coordinates. The initial value is
12291 `GL_FALSE'. See `glMap2'.
12292
12293`GL_MAP2_TEXTURE_COORD_3'
12294
12295
12296 PARAMS returns a single boolean value indicating whether 2D
12297 evaluation generates 3D texture coordinates. The initial value is
12298 `GL_FALSE'. See `glMap2'.
12299
12300`GL_MAP2_TEXTURE_COORD_4'
12301
12302
12303 PARAMS returns a single boolean value indicating whether 2D
12304 evaluation generates 4D texture coordinates. The initial value is
12305 `GL_FALSE'. See `glMap2'.
12306
12307`GL_MAP2_VERTEX_3'
12308
12309
12310 PARAMS returns a single boolean value indicating whether 2D
12311 evaluation generates 3D vertex coordinates. The initial value is
12312 `GL_FALSE'. See `glMap2'.
12313
12314`GL_MAP2_VERTEX_4'
12315
12316
12317 PARAMS returns a single boolean value indicating whether 2D
12318 evaluation generates 4D vertex coordinates. The initial value is
12319 `GL_FALSE'. See `glMap2'.
12320
12321`GL_MAP_COLOR'
12322
12323
12324 PARAMS returns a single boolean value indicating if colors and
12325 color indices are to be replaced by table lookup during pixel
12326 transfers. The initial value is `GL_FALSE'. See `glPixelTransfer'.
12327
12328`GL_MAP_STENCIL'
12329
12330
12331 PARAMS returns a single boolean value indicating if stencil indices
12332 are to be replaced by table lookup during pixel transfers. The
12333 initial value is `GL_FALSE'. See `glPixelTransfer'.
12334
12335`GL_MATRIX_MODE'
12336
12337
12338 PARAMS returns one value, a symbolic constant indicating which
12339 matrix stack is currently the target of all matrix operations. The
12340 initial value is `GL_MODELVIEW'. See `glMatrixMode'.
12341
12342`GL_MAX_3D_TEXTURE_SIZE'
12343
12344
12345 PARAMS returns one value, a rough estimate of the largest 3D
12346 texture that the GL can handle. The value must be at least 16. If
12347 the GL version is 1.2 or greater, use `GL_PROXY_TEXTURE_3D' to
12348 determine if a texture is too large. See `glTexImage3D'.
12349
12350`GL_MAX_CLIENT_ATTRIB_STACK_DEPTH'
12351
12352
12353 PARAMS returns one value indicating the maximum supported depth of
12354 the client attribute stack. See `glPushClientAttrib'.
12355
12356`GL_MAX_ATTRIB_STACK_DEPTH'
12357
12358
12359 PARAMS returns one value, the maximum supported depth of the
12360 attribute stack. The value must be at least 16. See `glPushAttrib'.
12361
12362`GL_MAX_CLIP_PLANES'
12363
12364
12365 PARAMS returns one value, the maximum number of application-defined
12366 clipping planes. The value must be at least 6. See `glClipPlane'.
12367
12368`GL_MAX_COLOR_MATRIX_STACK_DEPTH'
12369
12370
12371 PARAMS returns one value, the maximum supported depth of the color
12372 matrix stack. The value must be at least 2. See `glPushMatrix'.
12373
12374`GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS'
12375
12376
12377 PARAMS returns one value, the maximum supported texture image units
12378 that can be used to access texture maps from the vertex shader and
12379 the fragment processor combined. If both the vertex shader and the
12380 fragment processing stage access the same texture image unit, then
12381 that counts as using two texture image units against this limit.
12382 The value must be at least 2. See `glActiveTexture'.
12383
12384`GL_MAX_CUBE_MAP_TEXTURE_SIZE'
12385
12386
12387 PARAMS returns one value. The value gives a rough estimate of the
12388 largest cube-map texture that the GL can handle. The value must be
12389 at least 16. If the GL version is 1.3 or greater, use
12390 `GL_PROXY_TEXTURE_CUBE_MAP' to determine if a texture is too large.
12391 See `glTexImage2D'.
12392
12393`GL_MAX_DRAW_BUFFERS'
12394
12395
12396 PARAMS returns one value, the maximum number of simultaneous output
12397 colors allowed from a fragment shader using the `gl_FragData'
12398 built-in array. The value must be at least 1. See `glDrawBuffers'.
12399
12400`GL_MAX_ELEMENTS_INDICES'
12401
12402
12403 PARAMS returns one value, the recommended maximum number of vertex
12404 array indices. See `glDrawRangeElements'.
12405
12406`GL_MAX_ELEMENTS_VERTICES'
12407
12408
12409 PARAMS returns one value, the recommended maximum number of vertex
12410 array vertices. See `glDrawRangeElements'.
12411
12412`GL_MAX_EVAL_ORDER'
12413
12414
12415 PARAMS returns one value, the maximum equation order supported by
12416 1D and 2D evaluators. The value must be at least 8. See `glMap1'
12417 and `glMap2'.
12418
12419`GL_MAX_FRAGMENT_UNIFORM_COMPONENTS'
12420
12421
12422 PARAMS returns one value, the maximum number of individual
12423 floating-point, integer, or boolean values that can be held in
12424 uniform variable storage for a fragment shader. The value must be
12425 at least 64. See `glUniform'.
12426
12427`GL_MAX_LIGHTS'
12428
12429
12430 PARAMS returns one value, the maximum number of lights. The value
12431 must be at least 8. See `glLight'.
12432
12433`GL_MAX_LIST_NESTING'
12434
12435
12436 PARAMS returns one value, the maximum recursion depth allowed
12437 during display-list traversal. The value must be at least 64. See
12438 `glCallList'.
12439
12440`GL_MAX_MODELVIEW_STACK_DEPTH'
12441
12442
12443 PARAMS returns one value, the maximum supported depth of the
12444 modelview matrix stack. The value must be at least 32. See
12445 `glPushMatrix'.
12446
12447`GL_MAX_NAME_STACK_DEPTH'
12448
12449
12450 PARAMS returns one value, the maximum supported depth of the
12451 selection name stack. The value must be at least 64. See
12452 `glPushName'.
12453
12454`GL_MAX_PIXEL_MAP_TABLE'
12455
12456
12457 PARAMS returns one value, the maximum supported size of a
12458 `glPixelMap' lookup table. The value must be at least 32. See
12459 `glPixelMap'.
12460
12461`GL_MAX_PROJECTION_STACK_DEPTH'
12462
12463
12464 PARAMS returns one value, the maximum supported depth of the
12465 projection matrix stack. The value must be at least 2. See
12466 `glPushMatrix'.
12467
12468`GL_MAX_TEXTURE_COORDS'
12469
12470
12471 PARAMS returns one value, the maximum number of texture coordinate
12472 sets available to vertex and fragment shaders. The value must be at
12473 least 2. See `glActiveTexture' and `glClientActiveTexture'.
12474
12475`GL_MAX_TEXTURE_IMAGE_UNITS'
12476
12477
12478 PARAMS returns one value, the maximum supported texture image units
12479 that can be used to access texture maps from the fragment shader.
12480 The value must be at least 2. See `glActiveTexture'.
12481
12482`GL_MAX_TEXTURE_LOD_BIAS'
12483
12484
12485 PARAMS returns one value, the maximum, absolute value of the
12486 texture level-of-detail bias. The value must be at least 4.
12487
12488`GL_MAX_TEXTURE_SIZE'
12489
12490
12491 PARAMS returns one value. The value gives a rough estimate of the
12492 largest texture that the GL can handle. The value must be at least
12493 64. If the GL version is 1.1 or greater, use `GL_PROXY_TEXTURE_1D'
12494 or `GL_PROXY_TEXTURE_2D' to determine if a texture is too large.
12495 See `glTexImage1D' and `glTexImage2D'.
12496
12497`GL_MAX_TEXTURE_STACK_DEPTH'
12498
12499
12500 PARAMS returns one value, the maximum supported depth of the
12501 texture matrix stack. The value must be at least 2. See
12502 `glPushMatrix'.
12503
12504`GL_MAX_TEXTURE_UNITS'
12505
12506
12507 PARAMS returns a single value indicating the number of conventional
12508 texture units supported. Each conventional texture unit includes
12509 both a texture coordinate set and a texture image unit.
12510 Conventional texture units may be used for fixed-function
12511 (non-shader) rendering. The value must be at least 2. Additional
12512 texture coordinate sets and texture image units may be accessed
12513 from vertex and fragment shaders. See `glActiveTexture' and
12514 `glClientActiveTexture'.
12515
12516`GL_MAX_VARYING_FLOATS'
12517
12518
12519 PARAMS returns one value, the maximum number of interpolators
12520 available for processing varying variables used by vertex and
12521 fragment shaders. This value represents the number of individual
12522 floating-point values that can be interpolated; varying variables
12523 declared as vectors, matrices, and arrays will all consume multiple
12524 interpolators. The value must be at least 32.
12525
12526`GL_MAX_VERTEX_ATTRIBS'
12527
12528
12529 PARAMS returns one value, the maximum number of 4-component generic
12530 vertex attributes accessible to a vertex shader. The value must be
12531 at least 16. See `glVertexAttrib'.
12532
12533`GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS'
12534
12535
12536 PARAMS returns one value, the maximum supported texture image units
12537 that can be used to access texture maps from the vertex shader. The
12538 value may be 0. See `glActiveTexture'.
12539
12540`GL_MAX_VERTEX_UNIFORM_COMPONENTS'
12541
12542
12543 PARAMS returns one value, the maximum number of individual
12544 floating-point, integer, or boolean values that can be held in
12545 uniform variable storage for a vertex shader. The value must be at
12546 least 512. See `glUniform'.
12547
12548`GL_MAX_VIEWPORT_DIMS'
12549
12550
12551 PARAMS returns two values: the maximum supported width and height
12552 of the viewport. These must be at least as large as the visible
12553 dimensions of the display being rendered to. See `glViewport'.
12554
12555`GL_MINMAX'
12556
12557
12558 PARAMS returns a single boolean value indicating whether pixel
12559 minmax values are computed. The initial value is `GL_FALSE'. See
12560 `glMinmax'.
12561
12562`GL_MODELVIEW_MATRIX'
12563
12564
12565 PARAMS returns sixteen values: the modelview matrix on the top of
12566 the modelview matrix stack. Initially this matrix is the identity
12567 matrix. See `glPushMatrix'.
12568
12569`GL_MODELVIEW_STACK_DEPTH'
12570
12571
12572 PARAMS returns one value, the number of matrices on the modelview
12573 matrix stack. The initial value is 1. See `glPushMatrix'.
12574
12575`GL_NAME_STACK_DEPTH'
12576
12577
12578 PARAMS returns one value, the number of names on the selection name
12579 stack. The initial value is 0. See `glPushName'.
12580
12581`GL_NORMAL_ARRAY'
12582
12583
12584 PARAMS returns a single boolean value, indicating whether the
12585 normal array is enabled. The initial value is `GL_FALSE'. See
12586 `glNormalPointer'.
12587
12588`GL_NORMAL_ARRAY_BUFFER_BINDING'
12589
12590
12591 PARAMS returns a single value, the name of the buffer object
12592 associated with the normal array. This buffer object would have
12593 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
12594 recent call to `glNormalPointer'. If no buffer object was bound to
12595 this target, 0 is returned. The initial value is 0. See
12596 `glBindBuffer'.
12597
12598`GL_NORMAL_ARRAY_STRIDE'
12599
12600
12601 PARAMS returns one value, the byte offset between consecutive
12602 normals in the normal array. The initial value is 0. See
12603 `glNormalPointer'.
12604
12605`GL_NORMAL_ARRAY_TYPE'
12606
12607
12608 PARAMS returns one value, the data type of each coordinate in the
12609 normal array. The initial value is `GL_FLOAT'. See
12610 `glNormalPointer'.
12611
12612`GL_NORMALIZE'
12613
12614
12615 PARAMS returns a single boolean value indicating whether normals
12616 are automatically scaled to unit length after they have been
12617 transformed to eye coordinates. The initial value is `GL_FALSE'.
12618 See `glNormal'.
12619
12620`GL_NUM_COMPRESSED_TEXTURE_FORMATS'
12621
12622
12623 PARAMS returns a single integer value indicating the number of
12624 available compressed texture formats. The minimum value is 0. See
12625 `glCompressedTexImage2D'.
12626
12627`GL_PACK_ALIGNMENT'
12628
12629
12630 PARAMS returns one value, the byte alignment used for writing pixel
12631 data to memory. The initial value is 4. See `glPixelStore'.
12632
12633`GL_PACK_IMAGE_HEIGHT'
12634
12635
12636 PARAMS returns one value, the image height used for writing pixel
12637 data to memory. The initial value is 0. See `glPixelStore'.
12638
12639`GL_PACK_LSB_FIRST'
12640
12641
12642 PARAMS returns a single boolean value indicating whether single-bit
12643 pixels being written to memory are written first to the least
12644 significant bit of each unsigned byte. The initial value is
12645 `GL_FALSE'. See `glPixelStore'.
12646
12647`GL_PACK_ROW_LENGTH'
12648
12649
12650 PARAMS returns one value, the row length used for writing pixel
12651 data to memory. The initial value is 0. See `glPixelStore'.
12652
12653`GL_PACK_SKIP_IMAGES'
12654
12655
12656 PARAMS returns one value, the number of pixel images skipped before
12657 the first pixel is written into memory. The initial value is 0. See
12658 `glPixelStore'.
12659
12660`GL_PACK_SKIP_PIXELS'
12661
12662
12663 PARAMS returns one value, the number of pixel locations skipped
12664 before the first pixel is written into memory. The initial value is
12665 0. See `glPixelStore'.
12666
12667`GL_PACK_SKIP_ROWS'
12668
12669
12670 PARAMS returns one value, the number of rows of pixel locations
12671 skipped before the first pixel is written into memory. The initial
12672 value is 0. See `glPixelStore'.
12673
12674`GL_PACK_SWAP_BYTES'
12675
12676
12677 PARAMS returns a single boolean value indicating whether the bytes
12678 of two-byte and four-byte pixel indices and components are swapped
12679 before being written to memory. The initial value is `GL_FALSE'.
12680 See `glPixelStore'.
12681
12682`GL_PERSPECTIVE_CORRECTION_HINT'
12683
12684
12685 PARAMS returns one value, a symbolic constant indicating the mode
12686 of the perspective correction hint. The initial value is
12687 `GL_DONT_CARE'. See `glHint'.
12688
12689`GL_PIXEL_MAP_A_TO_A_SIZE'
12690
12691
12692 PARAMS returns one value, the size of the alpha-to-alpha pixel
12693 translation table. The initial value is 1. See `glPixelMap'.
12694
12695`GL_PIXEL_MAP_B_TO_B_SIZE'
12696
12697
12698 PARAMS returns one value, the size of the blue-to-blue pixel
12699 translation table. The initial value is 1. See `glPixelMap'.
12700
12701`GL_PIXEL_MAP_G_TO_G_SIZE'
12702
12703
12704 PARAMS returns one value, the size of the green-to-green pixel
12705 translation table. The initial value is 1. See `glPixelMap'.
12706
12707`GL_PIXEL_MAP_I_TO_A_SIZE'
12708
12709
12710 PARAMS returns one value, the size of the index-to-alpha pixel
12711 translation table. The initial value is 1. See `glPixelMap'.
12712
12713`GL_PIXEL_MAP_I_TO_B_SIZE'
12714
12715
12716 PARAMS returns one value, the size of the index-to-blue pixel
12717 translation table. The initial value is 1. See `glPixelMap'.
12718
12719`GL_PIXEL_MAP_I_TO_G_SIZE'
12720
12721
12722 PARAMS returns one value, the size of the index-to-green pixel
12723 translation table. The initial value is 1. See `glPixelMap'.
12724
12725`GL_PIXEL_MAP_I_TO_I_SIZE'
12726
12727
12728 PARAMS returns one value, the size of the index-to-index pixel
12729 translation table. The initial value is 1. See `glPixelMap'.
12730
12731`GL_PIXEL_MAP_I_TO_R_SIZE'
12732
12733
12734 PARAMS returns one value, the size of the index-to-red pixel
12735 translation table. The initial value is 1. See `glPixelMap'.
12736
12737`GL_PIXEL_MAP_R_TO_R_SIZE'
12738
12739
12740 PARAMS returns one value, the size of the red-to-red pixel
12741 translation table. The initial value is 1. See `glPixelMap'.
12742
12743`GL_PIXEL_MAP_S_TO_S_SIZE'
12744
12745
12746 PARAMS returns one value, the size of the stencil-to-stencil pixel
12747 translation table. The initial value is 1. See `glPixelMap'.
12748
12749`GL_PIXEL_PACK_BUFFER_BINDING'
12750
12751
12752 PARAMS returns a single value, the name of the buffer object
12753 currently bound to the target `GL_PIXEL_PACK_BUFFER'. If no buffer
12754 object is bound to this target, 0 is returned. The initial value is
12755 0. See `glBindBuffer'.
12756
12757`GL_PIXEL_UNPACK_BUFFER_BINDING'
12758
12759
12760 PARAMS returns a single value, the name of the buffer object
12761 currently bound to the target `GL_PIXEL_UNPACK_BUFFER'. If no
12762 buffer object is bound to this target, 0 is returned. The initial
12763 value is 0. See `glBindBuffer'.
12764
12765`GL_POINT_DISTANCE_ATTENUATION'
12766
12767
12768 PARAMS returns three values, the coefficients for computing the
12769 attenuation value for points. See `glPointParameter'.
12770
12771`GL_POINT_FADE_THRESHOLD_SIZE'
12772
12773
12774 PARAMS returns one value, the point size threshold for determining
12775 the point size. See `glPointParameter'.
12776
12777`GL_POINT_SIZE'
12778
12779
12780 PARAMS returns one value, the point size as specified by
12781 `glPointSize'. The initial value is 1.
12782
12783`GL_POINT_SIZE_GRANULARITY'
12784
12785
12786 PARAMS returns one value, the size difference between adjacent
12787 supported sizes for antialiased points. See `glPointSize'.
12788
12789`GL_POINT_SIZE_MAX'
12790
12791
12792 PARAMS returns one value, the upper bound for the attenuated point
12793 sizes. The initial value is 0.0. See `glPointParameter'.
12794
12795`GL_POINT_SIZE_MIN'
12796
12797
12798 PARAMS returns one value, the lower bound for the attenuated point
12799 sizes. The initial value is 1.0. See `glPointParameter'.
12800
12801`GL_POINT_SIZE_RANGE'
12802
12803
12804 PARAMS returns two values: the smallest and largest supported sizes
12805 for antialiased points. The smallest size must be at most 1, and
12806 the largest size must be at least 1. See `glPointSize'.
12807
12808`GL_POINT_SMOOTH'
12809
12810
12811 PARAMS returns a single boolean value indicating whether
12812 antialiasing of points is enabled. The initial value is `GL_FALSE'.
12813 See `glPointSize'.
12814
12815`GL_POINT_SMOOTH_HINT'
12816
12817
12818 PARAMS returns one value, a symbolic constant indicating the mode
12819 of the point antialiasing hint. The initial value is
12820 `GL_DONT_CARE'. See `glHint'.
12821
12822`GL_POINT_SPRITE'
12823
12824
12825 PARAMS returns a single boolean value indicating whether point
12826 sprite is enabled. The initial value is `GL_FALSE'.
12827
12828`GL_POLYGON_MODE'
12829
12830
12831 PARAMS returns two values: symbolic constants indicating whether
12832 front-facing and back-facing polygons are rasterized as points,
12833 lines, or filled polygons. The initial value is `GL_FILL'. See
12834 `glPolygonMode'.
12835
12836`GL_POLYGON_OFFSET_FACTOR'
12837
12838
12839 PARAMS returns one value, the scaling factor used to determine the
12840 variable offset that is added to the depth value of each fragment
12841 generated when a polygon is rasterized. The initial value is 0. See
12842 `glPolygonOffset'.
12843
12844`GL_POLYGON_OFFSET_UNITS'
12845
12846
12847 PARAMS returns one value. This value is multiplied by an
12848 implementation-specific value and then added to the depth value of
12849 each fragment generated when a polygon is rasterized. The initial
12850 value is 0. See `glPolygonOffset'.
12851
12852`GL_POLYGON_OFFSET_FILL'
12853
12854
12855 PARAMS returns a single boolean value indicating whether polygon
12856 offset is enabled for polygons in fill mode. The initial value is
12857 `GL_FALSE'. See `glPolygonOffset'.
12858
12859`GL_POLYGON_OFFSET_LINE'
12860
12861
12862 PARAMS returns a single boolean value indicating whether polygon
12863 offset is enabled for polygons in line mode. The initial value is
12864 `GL_FALSE'. See `glPolygonOffset'.
12865
12866`GL_POLYGON_OFFSET_POINT'
12867
12868
12869 PARAMS returns a single boolean value indicating whether polygon
12870 offset is enabled for polygons in point mode. The initial value is
12871 `GL_FALSE'. See `glPolygonOffset'.
12872
12873`GL_POLYGON_SMOOTH'
12874
12875
12876 PARAMS returns a single boolean value indicating whether
12877 antialiasing of polygons is enabled. The initial value is
12878 `GL_FALSE'. See `glPolygonMode'.
12879
12880`GL_POLYGON_SMOOTH_HINT'
12881
12882
12883 PARAMS returns one value, a symbolic constant indicating the mode
12884 of the polygon antialiasing hint. The initial value is
12885 `GL_DONT_CARE'. See `glHint'.
12886
12887`GL_POLYGON_STIPPLE'
12888
12889
12890 PARAMS returns a single boolean value indicating whether polygon
12891 stippling is enabled. The initial value is `GL_FALSE'. See
12892 `glPolygonStipple'.
12893
12894`GL_POST_COLOR_MATRIX_COLOR_TABLE'
12895
12896
12897 PARAMS returns a single boolean value indicating whether post color
12898 matrix transformation lookup is enabled. The initial value is
12899 `GL_FALSE'. See `glColorTable'.
12900
12901`GL_POST_COLOR_MATRIX_RED_BIAS'
12902
12903
12904 PARAMS returns one value, the red bias factor applied to RGBA
12905 fragments after color matrix transformations. The initial value is
12906 0. See `glPixelTransfer'.
12907
12908`GL_POST_COLOR_MATRIX_GREEN_BIAS'
12909
12910
12911 PARAMS returns one value, the green bias factor applied to RGBA
12912 fragments after color matrix transformations. The initial value is
12913 0. See `glPixelTransfer'
12914
12915`GL_POST_COLOR_MATRIX_BLUE_BIAS'
12916
12917
12918 PARAMS returns one value, the blue bias factor applied to RGBA
12919 fragments after color matrix transformations. The initial value is
12920 0. See `glPixelTransfer'.
12921
12922`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
12923
12924
12925 PARAMS returns one value, the alpha bias factor applied to RGBA
12926 fragments after color matrix transformations. The initial value is
12927 0. See `glPixelTransfer'.
12928
12929`GL_POST_COLOR_MATRIX_RED_SCALE'
12930
12931
12932 PARAMS returns one value, the red scale factor applied to RGBA
12933 fragments after color matrix transformations. The initial value is
12934 1. See `glPixelTransfer'.
12935
12936`GL_POST_COLOR_MATRIX_GREEN_SCALE'
12937
12938
12939 PARAMS returns one value, the green scale factor applied to RGBA
12940 fragments after color matrix transformations. The initial value is
12941 1. See `glPixelTransfer'.
12942
12943`GL_POST_COLOR_MATRIX_BLUE_SCALE'
12944
12945
12946 PARAMS returns one value, the blue scale factor applied to RGBA
12947 fragments after color matrix transformations. The initial value is
12948 1. See `glPixelTransfer'.
12949
12950`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
12951
12952
12953 PARAMS returns one value, the alpha scale factor applied to RGBA
12954 fragments after color matrix transformations. The initial value is
12955 1. See `glPixelTransfer'.
12956
12957`GL_POST_CONVOLUTION_COLOR_TABLE'
12958
12959
12960 PARAMS returns a single boolean value indicating whether post
12961 convolution lookup is enabled. The initial value is `GL_FALSE'. See
12962 `glColorTable'.
12963
12964`GL_POST_CONVOLUTION_RED_BIAS'
12965
12966
12967 PARAMS returns one value, the red bias factor applied to RGBA
12968 fragments after convolution. The initial value is 0. See
12969 `glPixelTransfer'.
12970
12971`GL_POST_CONVOLUTION_GREEN_BIAS'
12972
12973
12974 PARAMS returns one value, the green bias factor applied to RGBA
12975 fragments after convolution. The initial value is 0. See
12976 `glPixelTransfer'.
12977
12978`GL_POST_CONVOLUTION_BLUE_BIAS'
12979
12980
12981 PARAMS returns one value, the blue bias factor applied to RGBA
12982 fragments after convolution. The initial value is 0. See
12983 `glPixelTransfer'.
12984
12985`GL_POST_CONVOLUTION_ALPHA_BIAS'
12986
12987
12988 PARAMS returns one value, the alpha bias factor applied to RGBA
12989 fragments after convolution. The initial value is 0. See
12990 `glPixelTransfer'.
12991
12992`GL_POST_CONVOLUTION_RED_SCALE'
12993
12994
12995 PARAMS returns one value, the red scale factor applied to RGBA
12996 fragments after convolution. The initial value is 1. See
12997 `glPixelTransfer'.
12998
12999`GL_POST_CONVOLUTION_GREEN_SCALE'
13000
13001
13002 PARAMS returns one value, the green scale factor applied to RGBA
13003 fragments after convolution. The initial value is 1. See
13004 `glPixelTransfer'.
13005
13006`GL_POST_CONVOLUTION_BLUE_SCALE'
13007
13008
13009 PARAMS returns one value, the blue scale factor applied to RGBA
13010 fragments after convolution. The initial value is 1. See
13011 `glPixelTransfer'.
13012
13013`GL_POST_CONVOLUTION_ALPHA_SCALE'
13014
13015
13016 PARAMS returns one value, the alpha scale factor applied to RGBA
13017 fragments after convolution. The initial value is 1. See
13018 `glPixelTransfer'.
13019
13020`GL_PROJECTION_MATRIX'
13021
13022
13023 PARAMS returns sixteen values: the projection matrix on the top of
13024 the projection matrix stack. Initially this matrix is the identity
13025 matrix. See `glPushMatrix'.
13026
13027`GL_PROJECTION_STACK_DEPTH'
13028
13029
13030 PARAMS returns one value, the number of matrices on the projection
13031 matrix stack. The initial value is 1. See `glPushMatrix'.
13032
13033`GL_READ_BUFFER'
13034
13035
13036 PARAMS returns one value, a symbolic constant indicating which
13037 color buffer is selected for reading. The initial value is
13038 `GL_BACK' if there is a back buffer, otherwise it is `GL_FRONT'.
13039 See `glReadPixels' and `glAccum'.
13040
13041`GL_RED_BIAS'
13042
13043
13044 PARAMS returns one value, the red bias factor used during pixel
13045 transfers. The initial value is 0.
13046
13047`GL_RED_BITS'
13048
13049
13050 PARAMS returns one value, the number of red bitplanes in each color
13051 buffer.
13052
13053`GL_RED_SCALE'
13054
13055
13056 PARAMS returns one value, the red scale factor used during pixel
13057 transfers. The initial value is 1. See `glPixelTransfer'.
13058
13059`GL_RENDER_MODE'
13060
13061
13062 PARAMS returns one value, a symbolic constant indicating whether
13063 the GL is in render, select, or feedback mode. The initial value is
13064 `GL_RENDER'. See `glRenderMode'.
13065
13066`GL_RESCALE_NORMAL'
13067
13068
13069 PARAMS returns single boolean value indicating whether normal
13070 rescaling is enabled. See `glEnable'.
13071
13072`GL_RGBA_MODE'
13073
13074
13075 PARAMS returns a single boolean value indicating whether the GL is
13076 in RGBA mode (true) or color index mode (false). See `glColor'.
13077
13078`GL_SAMPLE_BUFFERS'
13079
13080
13081 PARAMS returns a single integer value indicating the number of
13082 sample buffers associated with the framebuffer. See
13083 `glSampleCoverage'.
13084
13085`GL_SAMPLE_COVERAGE_VALUE'
13086
13087
13088 PARAMS returns a single positive floating-point value indicating
13089 the current sample coverage value. See `glSampleCoverage'.
13090
13091`GL_SAMPLE_COVERAGE_INVERT'
13092
13093
13094 PARAMS returns a single boolean value indicating if the temporary
13095 coverage value should be inverted. See `glSampleCoverage'.
13096
13097`GL_SAMPLES'
13098
13099
13100 PARAMS returns a single integer value indicating the coverage mask
13101 size. See `glSampleCoverage'.
13102
13103`GL_SCISSOR_BOX'
13104
13105
13106 PARAMS returns four values: the X and Y window coordinates of the
13107 scissor box, followed by its width and height. Initially the X and
13108 Y window coordinates are both 0 and the width and height are set to
13109 the size of the window. See `glScissor'.
13110
13111`GL_SCISSOR_TEST'
13112
13113
13114 PARAMS returns a single boolean value indicating whether scissoring
13115 is enabled. The initial value is `GL_FALSE'. See `glScissor'.
13116
13117`GL_SECONDARY_COLOR_ARRAY'
13118
13119
13120 PARAMS returns a single boolean value indicating whether the
13121 secondary color array is enabled. The initial value is `GL_FALSE'.
13122 See `glSecondaryColorPointer'.
13123
13124`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING'
13125
13126
13127 PARAMS returns a single value, the name of the buffer object
13128 associated with the secondary color array. This buffer object would
13129 have been bound to the target `GL_ARRAY_BUFFER' at the time of the
13130 most recent call to `glSecondaryColorPointer'. If no buffer object
13131 was bound to this target, 0 is returned. The initial value is 0.
13132 See `glBindBuffer'.
13133
13134`GL_SECONDARY_COLOR_ARRAY_SIZE'
13135
13136
13137 PARAMS returns one value, the number of components per color in the
13138 secondary color array. The initial value is 3. See
13139 `glSecondaryColorPointer'.
13140
13141`GL_SECONDARY_COLOR_ARRAY_STRIDE'
13142
13143
13144 PARAMS returns one value, the byte offset between consecutive
13145 colors in the secondary color array. The initial value is 0. See
13146 `glSecondaryColorPointer'.
13147
13148`GL_SECONDARY_COLOR_ARRAY_TYPE'
13149
13150
13151 PARAMS returns one value, the data type of each component in the
13152 secondary color array. The initial value is `GL_FLOAT'. See
13153 `glSecondaryColorPointer'.
13154
13155`GL_SELECTION_BUFFER_SIZE'
13156
13157
13158 PARAMS return one value, the size of the selection buffer. See
13159 `glSelectBuffer'.
13160
13161`GL_SEPARABLE_2D'
13162
13163
13164 PARAMS returns a single boolean value indicating whether 2D
13165 separable convolution is enabled. The initial value is `GL_FALSE'.
13166 See `glSeparableFilter2D'.
13167
13168`GL_SHADE_MODEL'
13169
13170
13171 PARAMS returns one value, a symbolic constant indicating whether
13172 the shading mode is flat or smooth. The initial value is
13173 `GL_SMOOTH'. See `glShadeModel'.
13174
13175`GL_SMOOTH_LINE_WIDTH_RANGE'
13176
13177
13178 PARAMS returns two values, the smallest and largest supported
13179 widths for antialiased lines. See `glLineWidth'.
13180
13181`GL_SMOOTH_LINE_WIDTH_GRANULARITY'
13182
13183
13184 PARAMS returns one value, the granularity of widths for antialiased
13185 lines. See `glLineWidth'.
13186
13187`GL_SMOOTH_POINT_SIZE_RANGE'
13188
13189
13190 PARAMS returns two values, the smallest and largest supported
13191 widths for antialiased points. See `glPointSize'.
13192
13193`GL_SMOOTH_POINT_SIZE_GRANULARITY'
13194
13195
13196 PARAMS returns one value, the granularity of sizes for antialiased
13197 points. See `glPointSize'.
13198
13199`GL_STENCIL_BACK_FAIL'
13200
13201
13202 PARAMS returns one value, a symbolic constant indicating what
13203 action is taken for back-facing polygons when the stencil test
13204 fails. The initial value is `GL_KEEP'. See `glStencilOpSeparate'.
13205
13206`GL_STENCIL_BACK_FUNC'
13207
13208
13209 PARAMS returns one value, a symbolic constant indicating what
13210 function is used for back-facing polygons to compare the stencil
13211 reference value with the stencil buffer value. The initial value is
13212 `GL_ALWAYS'. See `glStencilFuncSeparate'.
13213
13214`GL_STENCIL_BACK_PASS_DEPTH_FAIL'
13215
13216
13217 PARAMS returns one value, a symbolic constant indicating what
13218 action is taken for back-facing polygons when the stencil test
13219 passes, but the depth test fails. The initial value is `GL_KEEP'.
13220 See `glStencilOpSeparate'.
13221
13222`GL_STENCIL_BACK_PASS_DEPTH_PASS'
13223
13224
13225 PARAMS returns one value, a symbolic constant indicating what
13226 action is taken for back-facing polygons when the stencil test
13227 passes and the depth test passes. The initial value is `GL_KEEP'.
13228 See `glStencilOpSeparate'.
13229
13230`GL_STENCIL_BACK_REF'
13231
13232
13233 PARAMS returns one value, the reference value that is compared with
13234 the contents of the stencil buffer for back-facing polygons. The
13235 initial value is 0. See `glStencilFuncSeparate'.
13236
13237`GL_STENCIL_BACK_VALUE_MASK'
13238
13239
13240 PARAMS returns one value, the mask that is used for back-facing
13241 polygons to mask both the stencil reference value and the stencil
13242 buffer value before they are compared. The initial value is all
13243 1's. See `glStencilFuncSeparate'.
13244
13245`GL_STENCIL_BACK_WRITEMASK'
13246
13247
13248 PARAMS returns one value, the mask that controls writing of the
13249 stencil bitplanes for back-facing polygons. The initial value is
13250 all 1's. See `glStencilMaskSeparate'.
13251
13252`GL_STENCIL_BITS'
13253
13254
13255 PARAMS returns one value, the number of bitplanes in the stencil
13256 buffer.
13257
13258`GL_STENCIL_CLEAR_VALUE'
13259
13260
13261 PARAMS returns one value, the index to which the stencil bitplanes
13262 are cleared. The initial value is 0. See `glClearStencil'.
13263
13264`GL_STENCIL_FAIL'
13265
13266
13267 PARAMS returns one value, a symbolic constant indicating what
13268 action is taken when the stencil test fails. The initial value is
13269 `GL_KEEP'. See `glStencilOp'. If the GL version is 2.0 or greater,
13270 this stencil state only affects non-polygons and front-facing
13271 polygons. Back-facing polygons use separate stencil state. See
13272 `glStencilOpSeparate'.
13273
13274`GL_STENCIL_FUNC'
13275
13276
13277 PARAMS returns one value, a symbolic constant indicating what
13278 function is used to compare the stencil reference value with the
13279 stencil buffer value. The initial value is `GL_ALWAYS'. See
13280 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
13281 state only affects non-polygons and front-facing polygons.
13282 Back-facing polygons use separate stencil state. See
13283 `glStencilFuncSeparate'.
13284
13285`GL_STENCIL_PASS_DEPTH_FAIL'
13286
13287
13288 PARAMS returns one value, a symbolic constant indicating what
13289 action is taken when the stencil test passes, but the depth test
13290 fails. The initial value is `GL_KEEP'. See `glStencilOp'. If the GL
13291 version is 2.0 or greater, this stencil state only affects
13292 non-polygons and front-facing polygons. Back-facing polygons use
13293 separate stencil state. See `glStencilOpSeparate'.
13294
13295`GL_STENCIL_PASS_DEPTH_PASS'
13296
13297
13298 PARAMS returns one value, a symbolic constant indicating what
13299 action is taken when the stencil test passes and the depth test
13300 passes. The initial value is `GL_KEEP'. See `glStencilOp'. If the
13301 GL version is 2.0 or greater, this stencil state only affects
13302 non-polygons and front-facing polygons. Back-facing polygons use
13303 separate stencil state. See `glStencilOpSeparate'.
13304
13305`GL_STENCIL_REF'
13306
13307
13308 PARAMS returns one value, the reference value that is compared with
13309 the contents of the stencil buffer. The initial value is 0. See
13310 `glStencilFunc'. If the GL version is 2.0 or greater, this stencil
13311 state only affects non-polygons and front-facing polygons.
13312 Back-facing polygons use separate stencil state. See
13313 `glStencilFuncSeparate'.
13314
13315`GL_STENCIL_TEST'
13316
13317
13318 PARAMS returns a single boolean value indicating whether stencil
13319 testing of fragments is enabled. The initial value is `GL_FALSE'.
13320 See `glStencilFunc' and `glStencilOp'.
13321
13322`GL_STENCIL_VALUE_MASK'
13323
13324
13325 PARAMS returns one value, the mask that is used to mask both the
13326 stencil reference value and the stencil buffer value before they
13327 are compared. The initial value is all 1's. See `glStencilFunc'. If
13328 the GL version is 2.0 or greater, this stencil state only affects
13329 non-polygons and front-facing polygons. Back-facing polygons use
13330 separate stencil state. See `glStencilFuncSeparate'.
13331
13332`GL_STENCIL_WRITEMASK'
13333
13334
13335 PARAMS returns one value, the mask that controls writing of the
13336 stencil bitplanes. The initial value is all 1's. See
13337 `glStencilMask'. If the GL version is 2.0 or greater, this stencil
13338 state only affects non-polygons and front-facing polygons.
13339 Back-facing polygons use separate stencil state. See
13340 `glStencilMaskSeparate'.
13341
13342`GL_STEREO'
13343
13344
13345 PARAMS returns a single boolean value indicating whether stereo
13346 buffers (left and right) are supported.
13347
13348`GL_SUBPIXEL_BITS'
13349
13350
13351 PARAMS returns one value, an estimate of the number of bits of
13352 subpixel resolution that are used to position rasterized geometry
13353 in window coordinates. The value must be at least 4.
13354
13355`GL_TEXTURE_1D'
13356
13357
13358 PARAMS returns a single boolean value indicating whether 1D texture
13359 mapping is enabled. The initial value is `GL_FALSE'. See
13360 `glTexImage1D'.
13361
13362`GL_TEXTURE_BINDING_1D'
13363
13364
13365 PARAMS returns a single value, the name of the texture currently
13366 bound to the target `GL_TEXTURE_1D'. The initial value is 0. See
13367 `glBindTexture'.
13368
13369`GL_TEXTURE_2D'
13370
13371
13372 PARAMS returns a single boolean value indicating whether 2D texture
13373 mapping is enabled. The initial value is `GL_FALSE'. See
13374 `glTexImage2D'.
13375
13376`GL_TEXTURE_BINDING_2D'
13377
13378
13379 PARAMS returns a single value, the name of the texture currently
13380 bound to the target `GL_TEXTURE_2D'. The initial value is 0. See
13381 `glBindTexture'.
13382
13383`GL_TEXTURE_3D'
13384
13385
13386 PARAMS returns a single boolean value indicating whether 3D texture
13387 mapping is enabled. The initial value is `GL_FALSE'. See
13388 `glTexImage3D'.
13389
13390`GL_TEXTURE_BINDING_3D'
13391
13392
13393 PARAMS returns a single value, the name of the texture currently
13394 bound to the target `GL_TEXTURE_3D'. The initial value is 0. See
13395 `glBindTexture'.
13396
13397`GL_TEXTURE_BINDING_CUBE_MAP'
13398
13399
13400 PARAMS returns a single value, the name of the texture currently
13401 bound to the target `GL_TEXTURE_CUBE_MAP'. The initial value is 0.
13402 See `glBindTexture'.
13403
13404`GL_TEXTURE_COMPRESSION_HINT'
13405
13406
13407 PARAMS returns a single value indicating the mode of the texture
13408 compression hint. The initial value is `GL_DONT_CARE'.
13409
13410`GL_TEXTURE_COORD_ARRAY'
13411
13412
13413 PARAMS returns a single boolean value indicating whether the
13414 texture coordinate array is enabled. The initial value is
13415 `GL_FALSE'. See `glTexCoordPointer'.
13416
13417`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING'
13418
13419
13420 PARAMS returns a single value, the name of the buffer object
13421 associated with the texture coordinate array. This buffer object
13422 would have been bound to the target `GL_ARRAY_BUFFER' at the time
13423 of the most recent call to `glTexCoordPointer'. If no buffer object
13424 was bound to this target, 0 is returned. The initial value is 0.
13425 See `glBindBuffer'.
13426
13427`GL_TEXTURE_COORD_ARRAY_SIZE'
13428
13429
13430 PARAMS returns one value, the number of coordinates per element in
13431 the texture coordinate array. The initial value is 4. See
13432 `glTexCoordPointer'.
13433
13434`GL_TEXTURE_COORD_ARRAY_STRIDE'
13435
13436
13437 PARAMS returns one value, the byte offset between consecutive
13438 elements in the texture coordinate array. The initial value is 0.
13439 See `glTexCoordPointer'.
13440
13441`GL_TEXTURE_COORD_ARRAY_TYPE'
13442
13443
13444 PARAMS returns one value, the data type of the coordinates in the
13445 texture coordinate array. The initial value is `GL_FLOAT'. See
13446 `glTexCoordPointer'.
13447
13448`GL_TEXTURE_CUBE_MAP'
13449
13450
13451 PARAMS returns a single boolean value indicating whether
13452 cube-mapped texture mapping is enabled. The initial value is
13453 `GL_FALSE'. See `glTexImage2D'.
13454
13455`GL_TEXTURE_GEN_Q'
13456
13457
13458 PARAMS returns a single boolean value indicating whether automatic
13459 generation of the Q texture coordinate is enabled. The initial
13460 value is `GL_FALSE'. See `glTexGen'.
13461
13462`GL_TEXTURE_GEN_R'
13463
13464
13465 PARAMS returns a single boolean value indicating whether automatic
13466 generation of the R texture coordinate is enabled. The initial
13467 value is `GL_FALSE'. See `glTexGen'.
13468
13469`GL_TEXTURE_GEN_S'
13470
13471
13472 PARAMS returns a single boolean value indicating whether automatic
13473 generation of the S texture coordinate is enabled. The initial
13474 value is `GL_FALSE'. See `glTexGen'.
13475
13476`GL_TEXTURE_GEN_T'
13477
13478
13479 PARAMS returns a single boolean value indicating whether automatic
13480 generation of the T texture coordinate is enabled. The initial
13481 value is `GL_FALSE'. See `glTexGen'.
13482
13483`GL_TEXTURE_MATRIX'
13484
13485
13486 PARAMS returns sixteen values: the texture matrix on the top of the
13487 texture matrix stack. Initially this matrix is the identity matrix.
13488 See `glPushMatrix'.
13489
13490`GL_TEXTURE_STACK_DEPTH'
13491
13492
13493 PARAMS returns one value, the number of matrices on the texture
13494 matrix stack. The initial value is 1. See `glPushMatrix'.
13495
13496`GL_TRANSPOSE_COLOR_MATRIX'
13497
13498
13499 PARAMS returns 16 values, the elements of the color matrix in
13500 row-major order. See `glLoadTransposeMatrix'.
13501
13502`GL_TRANSPOSE_MODELVIEW_MATRIX'
13503
13504
13505 PARAMS returns 16 values, the elements of the modelview matrix in
13506 row-major order. See `glLoadTransposeMatrix'.
13507
13508`GL_TRANSPOSE_PROJECTION_MATRIX'
13509
13510
13511 PARAMS returns 16 values, the elements of the projection matrix in
13512 row-major order. See `glLoadTransposeMatrix'.
13513
13514`GL_TRANSPOSE_TEXTURE_MATRIX'
13515
13516
13517 PARAMS returns 16 values, the elements of the texture matrix in
13518 row-major order. See `glLoadTransposeMatrix'.
13519
13520`GL_UNPACK_ALIGNMENT'
13521
13522
13523 PARAMS returns one value, the byte alignment used for reading pixel
13524 data from memory. The initial value is 4. See `glPixelStore'.
13525
13526`GL_UNPACK_IMAGE_HEIGHT'
13527
13528
13529 PARAMS returns one value, the image height used for reading pixel
13530 data from memory. The initial is 0. See `glPixelStore'.
13531
13532`GL_UNPACK_LSB_FIRST'
13533
13534
13535 PARAMS returns a single boolean value indicating whether single-bit
13536 pixels being read from memory are read first from the least
13537 significant bit of each unsigned byte. The initial value is
13538 `GL_FALSE'. See `glPixelStore'.
13539
13540`GL_UNPACK_ROW_LENGTH'
13541
13542
13543 PARAMS returns one value, the row length used for reading pixel
13544 data from memory. The initial value is 0. See `glPixelStore'.
13545
13546`GL_UNPACK_SKIP_IMAGES'
13547
13548
13549 PARAMS returns one value, the number of pixel images skipped before
13550 the first pixel is read from memory. The initial value is 0. See
13551 `glPixelStore'.
13552
13553`GL_UNPACK_SKIP_PIXELS'
13554
13555
13556 PARAMS returns one value, the number of pixel locations skipped
13557 before the first pixel is read from memory. The initial value is 0.
13558 See `glPixelStore'.
13559
13560`GL_UNPACK_SKIP_ROWS'
13561
13562
13563 PARAMS returns one value, the number of rows of pixel locations
13564 skipped before the first pixel is read from memory. The initial
13565 value is 0. See `glPixelStore'.
13566
13567`GL_UNPACK_SWAP_BYTES'
13568
13569
13570 PARAMS returns a single boolean value indicating whether the bytes
13571 of two-byte and four-byte pixel indices and components are swapped
13572 after being read from memory. The initial value is `GL_FALSE'. See
13573 `glPixelStore'.
13574
13575`GL_VERTEX_ARRAY'
13576
13577
13578 PARAMS returns a single boolean value indicating whether the vertex
13579 array is enabled. The initial value is `GL_FALSE'. See
13580 `glVertexPointer'.
13581
13582`GL_VERTEX_ARRAY_BUFFER_BINDING'
13583
3c9b6116 13584
b002944d
AW
13585 PARAMS returns a single value, the name of the buffer object
13586 associated with the vertex array. This buffer object would have
13587 been bound to the target `GL_ARRAY_BUFFER' at the time of the most
13588 recent call to `glVertexPointer'. If no buffer object was bound to
13589 this target, 0 is returned. The initial value is 0. See
13590 `glBindBuffer'.
3c9b6116 13591
b002944d 13592`GL_VERTEX_ARRAY_SIZE'
3c9b6116
AW
13593
13594
b002944d
AW
13595 PARAMS returns one value, the number of coordinates per vertex in
13596 the vertex array. The initial value is 4. See `glVertexPointer'.
3c9b6116 13597
b002944d 13598`GL_VERTEX_ARRAY_STRIDE'
3c9b6116
AW
13599
13600
b002944d
AW
13601 PARAMS returns one value, the byte offset between consecutive
13602 vertices in the vertex array. The initial value is 0. See
13603 `glVertexPointer'.
3c9b6116 13604
b002944d 13605`GL_VERTEX_ARRAY_TYPE'
3c9b6116
AW
13606
13607
b002944d
AW
13608 PARAMS returns one value, the data type of each coordinate in the
13609 vertex array. The initial value is `GL_FLOAT'. See
13610 `glVertexPointer'.
3c9b6116 13611
b002944d 13612`GL_VERTEX_PROGRAM_POINT_SIZE'
3c9b6116
AW
13613
13614
b002944d
AW
13615 PARAMS returns a single boolean value indicating whether vertex
13616 program point size mode is enabled. If enabled, and a vertex shader
13617 is active, then the point size is taken from the shader built-in
13618 `gl_PointSize'. If disabled, and a vertex shader is active, then
13619 the point size is taken from the point state as specified by
13620 `glPointSize'. The initial value is `GL_FALSE'.
3c9b6116 13621
b002944d 13622`GL_VERTEX_PROGRAM_TWO_SIDE'
3c9b6116
AW
13623
13624
b002944d
AW
13625 PARAMS returns a single boolean value indicating whether vertex
13626 program two-sided color mode is enabled. If enabled, and a vertex
13627 shader is active, then the GL chooses the back color output for
13628 back-facing polygons, and the front color output for non-polygons
13629 and front-facing polygons. If disabled, and a vertex shader is
13630 active, then the front color output is always selected. The initial
13631 value is `GL_FALSE'.
3c9b6116 13632
b002944d 13633`GL_VIEWPORT'
3c9b6116
AW
13634
13635
b002944d
AW
13636 PARAMS returns four values: the X and Y window coordinates of the
13637 viewport, followed by its width and height. Initially the X and Y
13638 window coordinates are both set to 0, and the width and height are
13639 set to the width and height of the window into which the GL will do
13640 its rendering. See `glViewport'.
3c9b6116 13641
b002944d 13642`GL_ZOOM_X'
3c9b6116
AW
13643
13644
b002944d
AW
13645 PARAMS returns one value, the X pixel zoom factor. The initial
13646 value is 1. See `glPixelZoom'.
3c9b6116 13647
b002944d 13648`GL_ZOOM_Y'
3c9b6116
AW
13649
13650
b002944d
AW
13651 PARAMS returns one value, the Y pixel zoom factor. The initial
13652 value is 1. See `glPixelZoom'.
3c9b6116 13653
b002944d
AW
13654Many of the boolean parameters can also be queried more easily using
13655`glIsEnabled'.
3c9b6116 13656
b002944d 13657`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
3c9b6116 13658
b002944d
AW
13659`GL_INVALID_OPERATION' is generated if `glGet' is executed between the
13660execution of `glBegin' and the corresponding execution of `glEnd'.")
3c9b6116 13661
25072f02 13662(define-gl-procedures
bb894c9d 13663 ((glHint (target GLenum) (mode GLenum) -> void))
3c9b6116
AW
13664 "Specify implementation-specific hints.
13665
13666TARGET
13667 Specifies a symbolic constant indicating the behavior to be
13668 controlled. `GL_FOG_HINT', `GL_GENERATE_MIPMAP_HINT',
13669 `GL_LINE_SMOOTH_HINT', `GL_PERSPECTIVE_CORRECTION_HINT',
13670 `GL_POINT_SMOOTH_HINT', `GL_POLYGON_SMOOTH_HINT',
13671 `GL_TEXTURE_COMPRESSION_HINT', and
13672 `GL_FRAGMENT_SHADER_DERIVATIVE_HINT' are accepted.
13673
13674MODE
13675 Specifies a symbolic constant indicating the desired behavior.
13676 `GL_FASTEST', `GL_NICEST', and `GL_DONT_CARE' are accepted.
13677
13678Certain aspects of GL behavior, when there is room for interpretation,
13679can be controlled with hints. A hint is specified with two arguments.
13680TARGET is a symbolic constant indicating the behavior to be controlled,
13681and MODE is another symbolic constant indicating the desired behavior.
13682The initial value for each TARGET is `GL_DONT_CARE'. MODE can be one of
13683the following:
13684
13685`GL_FASTEST'
13686
13687
13688 The most efficient option should be chosen.
13689
13690`GL_NICEST'
13691
13692
13693 The most correct, or highest quality, option should be chosen.
13694
13695`GL_DONT_CARE'
13696
13697
13698 No preference.
13699
13700Though the implementation aspects that can be hinted are well defined,
13701the interpretation of the hints depends on the implementation. The hint
13702aspects that can be specified with TARGET, along with suggested
13703semantics, are as follows:
13704
13705`GL_FOG_HINT'
13706
13707
13708 Indicates the accuracy of fog calculation. If per-pixel fog
13709 calculation is not efficiently supported by the GL implementation,
13710 hinting `GL_DONT_CARE' or `GL_FASTEST' can result in per-vertex
13711 calculation of fog effects.
13712
13713`GL_FRAGMENT_SHADER_DERIVATIVE_HINT'
13714
13715
13716 Indicates the accuracy of the derivative calculation for the GL
13717 shading language fragment processing built-in functions: `dFdx',
13718 `dFdy', and `fwidth'.
13719
13720`GL_GENERATE_MIPMAP_HINT'
13721
13722
13723 Indicates the quality of filtering when generating mipmap images.
13724
13725`GL_LINE_SMOOTH_HINT'
13726
13727
13728 Indicates the sampling quality of antialiased lines. If a larger
13729 filter function is applied, hinting `GL_NICEST' can result in more
13730 pixel fragments being generated during rasterization.
13731
13732`GL_PERSPECTIVE_CORRECTION_HINT'
13733
13734
13735 Indicates the quality of color, texture coordinate, and fog
13736 coordinate interpolation. If perspective-corrected parameter
13737 interpolation is not efficiently supported by the GL
13738 implementation, hinting `GL_DONT_CARE' or `GL_FASTEST' can result
13739 in simple linear interpolation of colors and/or texture
13740 coordinates.
13741
13742`GL_POINT_SMOOTH_HINT'
13743
13744
13745 Indicates the sampling quality of antialiased points. If a larger
13746 filter function is applied, hinting `GL_NICEST' can result in more
13747 pixel fragments being generated during rasterization.
13748
13749`GL_POLYGON_SMOOTH_HINT'
13750
13751
13752 Indicates the sampling quality of antialiased polygons. Hinting
13753 `GL_NICEST' can result in more pixel fragments being generated
13754 during rasterization, if a larger filter function is applied.
13755
13756`GL_TEXTURE_COMPRESSION_HINT'
13757
13758
13759 Indicates the quality and performance of the compressing texture
13760 images. Hinting `GL_FASTEST' indicates that texture images should
13761 be compressed as quickly as possible, while `GL_NICEST' indicates
13762 that texture images should be compressed with as little image
13763 quality loss as possible. `GL_NICEST' should be selected if the
13764 texture is to be retrieved by `glGetCompressedTexImage' for reuse.
13765
13766`GL_INVALID_ENUM' is generated if either TARGET or MODE is not an
13767accepted value.
13768
13769`GL_INVALID_OPERATION' is generated if `glHint' is executed between the
13770execution of `glBegin' and the corresponding execution of `glEnd'.")
13771
25072f02 13772(define-gl-procedures
bb894c9d
AW
13773 ((glHistogram
13774 (target GLenum)
13775 (width GLsizei)
13776 (internalformat GLenum)
13777 (sink GLboolean)
13778 ->
13779 void))
3c9b6116
AW
13780 "Define histogram table.
13781
13782TARGET
13783 The histogram whose parameters are to be set. Must be one of
13784 `GL_HISTOGRAM' or `GL_PROXY_HISTOGRAM'.
13785
13786WIDTH
13787 The number of entries in the histogram table. Must be a power of 2.
13788
13789INTERNALFORMAT
13790 The format of entries in the histogram table. Must be one of
13791 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
13792 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
13793 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
13794 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
13795 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
13796 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
13797 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
13798 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
13799 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
13800
13801SINK
13802 If `GL_TRUE', pixels will be consumed by the histogramming process
13803 and no drawing or texture loading will take place. If `GL_FALSE',
13804 pixels will proceed to the minmax process after histogramming.
13805
13806When `GL_HISTOGRAM' is enabled, RGBA color components are converted to
13807histogram table indices by clamping to the range [0,1], multiplying by
13808the width of the histogram table, and rounding to the nearest integer.
13809The table entries selected by the RGBA indices are then incremented. (If
13810the internal format of the histogram table includes luminance, then the
13811index derived from the R color component determines the luminance table
13812entry to be incremented.) If a histogram table entry is incremented
13813beyond its maximum value, then its value becomes undefined. (This is not
13814an error.)
13815
13816Histogramming is performed only for RGBA pixels (though these may be
13817specified originally as color indices and converted to RGBA by index
13818table lookup). Histogramming is enabled with `glEnable' and disabled
13819with `glDisable'.
13820
13821When TARGET is `GL_HISTOGRAM', `glHistogram' redefines the current
13822histogram table to have WIDTH entries of the format specified by
13823INTERNALFORMAT. The entries are indexed 0 through WIDTH-1 , and all
13824entries are initialized to zero. The values in the previous histogram
13825table, if any, are lost. If SINK is `GL_TRUE', then pixels are discarded
13826after histogramming; no further processing of the pixels takes place,
13827and no drawing, texture loading, or pixel readback will result.
13828
13829When TARGET is `GL_PROXY_HISTOGRAM', `glHistogram' computes all state
13830information as if the histogram table were to be redefined, but does not
13831actually define the new table. If the requested histogram table is too
13832large to be supported, then the state information will be set to zero.
13833This provides a way to determine if a histogram table with the given
13834parameters can be supported.
13835
13836
13837
13838`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
13839values.
13840
13841`GL_INVALID_VALUE' is generated if WIDTH is less than zero or is not a
13842power of 2.
13843
13844`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
13845allowable values.
13846
13847`GL_TABLE_TOO_LARGE' is generated if TARGET is `GL_HISTOGRAM' and the
13848histogram table specified is too large for the implementation.
13849
13850`GL_INVALID_OPERATION' is generated if `glHistogram' is executed between
13851the execution of `glBegin' and the corresponding execution of `glEnd'.")
13852
25072f02 13853(define-gl-procedures
bb894c9d 13854 ((glIndexMask (mask GLuint) -> void))
3c9b6116
AW
13855 "Control the writing of individual bits in the color index buffers.
13856
13857MASK
13858 Specifies a bit mask to enable and disable the writing of
13859 individual bits in the color index buffers. Initially, the mask is
13860 all 1's.
13861
13862`glIndexMask' controls the writing of individual bits in the color index
13863buffers. The least significant N bits of MASK, where N is the number of
13864bits in a color index buffer, specify a mask. Where a 1 (one) appears in
13865the mask, it's possible to write to the corresponding bit in the color
13866index buffer (or buffers). Where a 0 (zero) appears, the corresponding
13867bit is write-protected.
13868
13869This mask is used only in color index mode, and it affects only the
13870buffers currently selected for writing (see `glDrawBuffer'). Initially,
13871all bits are enabled for writing.
13872
13873`GL_INVALID_OPERATION' is generated if `glIndexMask' is executed between
13874the execution of `glBegin' and the corresponding execution of `glEnd'.")
13875
25072f02 13876(define-gl-procedures
bb894c9d
AW
13877 ((glIndexPointer
13878 (type GLenum)
13879 (stride GLsizei)
00239761 13880 (pointer const-GLvoid-*)
bb894c9d
AW
13881 ->
13882 void))
3c9b6116
AW
13883 "Define an array of color indexes.
13884
13885TYPE
13886 Specifies the data type of each color index in the array. Symbolic
13887 constants `GL_UNSIGNED_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
13888 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
13889
13890STRIDE
13891 Specifies the byte offset between consecutive color indexes. If
13892 STRIDE is 0, the color indexes are understood to be tightly packed
13893 in the array. The initial value is 0.
13894
13895POINTER
13896 Specifies a pointer to the first index in the array. The initial
13897 value is 0.
13898
13899`glIndexPointer' specifies the location and data format of an array of
13900color indexes to use when rendering. TYPE specifies the data type of
13901each color index and STRIDE specifies the byte stride from one color
13902index to the next, allowing vertices and attributes to be packed into a
13903single array or stored in separate arrays.
13904
13905If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
13906target (see `glBindBuffer') while a color index array is specified,
13907POINTER is treated as a byte offset into the buffer object's data store.
13908Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
13909color index vertex array client-side state
13910(`GL_INDEX_ARRAY_BUFFER_BINDING').
13911
13912When a color index array is specified, TYPE, STRIDE, and POINTER are
13913saved as client-side state, in addition to the current vertex array
13914buffer object binding.
13915
13916To enable and disable the color index array, call `glEnableClientState'
13917and `glDisableClientState' with the argument `GL_INDEX_ARRAY'. If
13918enabled, the color index array is used when `glDrawArrays',
13919`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements',
13920`glDrawRangeElements', or `glArrayElement' is called.
13921
13922`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
13923
13924`GL_INVALID_VALUE' is generated if STRIDE is negative.")
13925
25072f02 13926(define-gl-procedures
78aa45b9
DH
13927 ((glIndexs (c GLshort) -> void)
13928 (glIndexi (c GLint) -> void)
ca09631c 13929 (glIndexf (c GLfloat) -> void)
78aa45b9
DH
13930 (glIndexd (c GLdouble) -> void)
13931 (glIndexub (c GLubyte) -> void)
13932 (glIndexsv (c const-GLshort-*) -> void)
13933 (glIndexiv (c const-GLint-*) -> void)
13934 (glIndexfv (c const-GLfloat-*) -> void)
13935 (glIndexdv (c const-GLdouble-*) -> void)
13936 (glIndexubv (c const-GLubyte-*) -> void))
3c9b6116
AW
13937 "Set the current color index.
13938
13939C
13940 Specifies the new value for the current color index.
13941
13942
13943
13944`glIndex' updates the current (single-valued) color index. It takes one
13945argument, the new value for the current color index.
13946
13947The current index is stored as a floating-point value. Integer values
13948are converted directly to floating-point values, with no special
13949mapping. The initial value is 1.
13950
13951Index values outside the representable range of the color index buffer
13952are not clamped. However, before an index is dithered (if enabled) and
13953written to the frame buffer, it is converted to fixed-point format. Any
13954bits in the integer portion of the resulting fixed-point value that do
13955not correspond to bits in the frame buffer are masked out.")
13956
25072f02 13957(define-gl-procedures
bb894c9d 13958 ((glInitNames -> void))
3c9b6116
AW
13959 "Initialize the name stack.
13960
13961The name stack is used during selection mode to allow sets of rendering
13962commands to be uniquely identified. It consists of an ordered set of
13963unsigned integers. `glInitNames' causes the name stack to be initialized
13964to its default empty state.
13965
13966The name stack is always empty while the render mode is not `GL_SELECT'.
13967Calls to `glInitNames' while the render mode is not `GL_SELECT' are
13968ignored.
13969
13970`GL_INVALID_OPERATION' is generated if `glInitNames' is executed between
13971the execution of `glBegin' and the corresponding execution of `glEnd'.")
13972
25072f02 13973(define-gl-procedures
bb894c9d
AW
13974 ((glInterleavedArrays
13975 (format GLenum)
13976 (stride GLsizei)
00239761 13977 (pointer const-GLvoid-*)
bb894c9d
AW
13978 ->
13979 void))
3c9b6116
AW
13980 "Simultaneously specify and enable several interleaved arrays.
13981
13982FORMAT
13983 Specifies the type of array to enable. Symbolic constants `GL_V2F',
13984 `GL_V3F', `GL_C4UB_V2F', `GL_C4UB_V3F', `GL_C3F_V3F', `GL_N3F_V3F',
13985 `GL_C4F_N3F_V3F', `GL_T2F_V3F', `GL_T4F_V4F', `GL_T2F_C4UB_V3F',
13986 `GL_T2F_C3F_V3F', `GL_T2F_N3F_V3F', `GL_T2F_C4F_N3F_V3F', and
13987 `GL_T4F_C4F_N3F_V4F' are accepted.
13988
13989STRIDE
13990 Specifies the offset in bytes between each aggregate array element.
13991
13992`glInterleavedArrays' lets you specify and enable individual color,
13993normal, texture and vertex arrays whose elements are part of a larger
13994aggregate array element. For some implementations, this is more
13995efficient than specifying the arrays separately.
13996
13997If STRIDE is 0, the aggregate elements are stored consecutively.
13998Otherwise, STRIDE bytes occur between the beginning of one aggregate
13999array element and the beginning of the next aggregate array element.
14000
14001FORMAT serves as a ``key'' describing the extraction of individual
14002arrays from the aggregate array. If FORMAT contains a T, then texture
14003coordinates are extracted from the interleaved array. If C is present,
14004color values are extracted. If N is present, normal coordinates are
14005extracted. Vertex coordinates are always extracted.
14006
14007The digits 2, 3, and 4 denote how many values are extracted. F indicates
14008that values are extracted as floating-point values. Colors may also be
14009extracted as 4 unsigned bytes if 4UB follows the C. If a color is
14010extracted as 4 unsigned bytes, the vertex array element which follows is
14011located at the first possible floating-point aligned address.
14012
14013`GL_INVALID_ENUM' is generated if FORMAT is not an accepted value.
14014
14015`GL_INVALID_VALUE' is generated if STRIDE is negative.")
14016
25072f02 14017(define-gl-procedures
bb894c9d 14018 ((glIsBuffer (buffer GLuint) -> GLboolean))
3c9b6116
AW
14019 "Determine if a name corresponds to a buffer object.
14020
14021BUFFER
14022 Specifies a value that may be the name of a buffer object.
14023
14024`glIsBuffer' returns `GL_TRUE' if BUFFER is currently the name of a
14025buffer object. If BUFFER is zero, or is a non-zero value that is not
14026currently the name of a buffer object, or if an error occurs,
14027`glIsBuffer' returns `GL_FALSE'.
14028
14029A name returned by `glGenBuffers', but not yet associated with a buffer
14030object by calling `glBindBuffer', is not the name of a buffer object.
14031
14032`GL_INVALID_OPERATION' is generated if `glIsBuffer' is executed between
14033the execution of `glBegin' and the corresponding execution of `glEnd'.")
14034
25072f02 14035(define-gl-procedures
bb894c9d 14036 ((glIsEnabled (cap GLenum) -> GLboolean))
3c9b6116
AW
14037 "Test whether a capability is enabled.
14038
14039CAP
14040 Specifies a symbolic constant indicating a GL capability.
14041
14042`glIsEnabled' returns `GL_TRUE' if CAP is an enabled capability and
14043returns `GL_FALSE' otherwise. Initially all capabilities except
14044`GL_DITHER' are disabled; `GL_DITHER' is initially enabled.
14045
14046The following capabilities are accepted for CAP:
14047
14048
14049
14050*Constant*
14051 *See*
14052
14053`GL_ALPHA_TEST'
14054 `glAlphaFunc'
14055
14056`GL_AUTO_NORMAL'
14057 `glEvalCoord'
14058
14059`GL_BLEND'
14060 `glBlendFunc', `glLogicOp'
14061
14062`GL_CLIP_PLANE'I
14063 `glClipPlane'
14064
14065`GL_COLOR_ARRAY'
14066 `glColorPointer'
14067
14068`GL_COLOR_LOGIC_OP'
14069 `glLogicOp'
14070
14071`GL_COLOR_MATERIAL'
14072 `glColorMaterial'
14073
14074`GL_COLOR_SUM'
14075 `glSecondaryColor'
14076
14077`GL_COLOR_TABLE'
14078 `glColorTable'
14079
14080`GL_CONVOLUTION_1D'
14081 `glConvolutionFilter1D'
14082
14083`GL_CONVOLUTION_2D'
14084 `glConvolutionFilter2D'
14085
14086`GL_CULL_FACE'
14087 `glCullFace'
14088
14089`GL_DEPTH_TEST'
14090 `glDepthFunc', `glDepthRange'
14091
14092`GL_DITHER'
14093 `glEnable'
14094
14095`GL_EDGE_FLAG_ARRAY'
14096 `glEdgeFlagPointer'
14097
14098`GL_FOG'
14099 `glFog'
14100
14101`GL_FOG_COORD_ARRAY'
14102 `glFogCoordPointer'
14103
14104`GL_HISTOGRAM'
14105 `glHistogram'
14106
14107`GL_INDEX_ARRAY'
14108 `glIndexPointer'
14109
14110`GL_INDEX_LOGIC_OP'
14111 `glLogicOp'
14112
14113`GL_LIGHT'I
14114 `glLightModel', `glLight'
14115
14116`GL_LIGHTING'
14117 `glMaterial', `glLightModel', `glLight'
14118
14119`GL_LINE_SMOOTH'
14120 `glLineWidth'
14121
14122`GL_LINE_STIPPLE'
14123 `glLineStipple'
14124
14125`GL_MAP1_COLOR_4'
14126 `glMap1'
14127
14128`GL_MAP1_INDEX'
14129 `glMap1'
14130
14131`GL_MAP1_NORMAL'
14132 `glMap1'
14133
14134`GL_MAP1_TEXTURE_COORD_1'
14135 `glMap1'
14136
14137`GL_MAP1_TEXTURE_COORD_2'
14138 `glMap1'
14139
14140`GL_MAP1_TEXTURE_COORD_3'
14141 `glMap1'
14142
14143`GL_MAP1_TEXTURE_COORD_4'
14144 `glMap1'
14145
14146`GL_MAP2_COLOR_4'
14147 `glMap2'
14148
14149`GL_MAP2_INDEX'
14150 `glMap2'
14151
14152`GL_MAP2_NORMAL'
14153 `glMap2'
14154
14155`GL_MAP2_TEXTURE_COORD_1'
14156 `glMap2'
14157
14158`GL_MAP2_TEXTURE_COORD_2'
14159 `glMap2'
14160
14161`GL_MAP2_TEXTURE_COORD_3'
14162 `glMap2'
14163
14164`GL_MAP2_TEXTURE_COORD_4'
14165 `glMap2'
14166
14167`GL_MAP2_VERTEX_3'
14168 `glMap2'
14169
14170`GL_MAP2_VERTEX_4'
14171 `glMap2'
14172
14173`GL_MINMAX'
14174 `glMinmax'
14175
14176`GL_MULTISAMPLE'
14177 `glSampleCoverage'
14178
14179`GL_NORMAL_ARRAY'
14180 `glNormalPointer'
14181
14182`GL_NORMALIZE'
14183 `glNormal'
14184
14185`GL_POINT_SMOOTH'
14186 `glPointSize'
14187
14188`GL_POINT_SPRITE'
14189 `glEnable'
14190
14191`GL_POLYGON_SMOOTH'
14192 `glPolygonMode'
14193
14194`GL_POLYGON_OFFSET_FILL'
14195 `glPolygonOffset'
14196
14197`GL_POLYGON_OFFSET_LINE'
14198 `glPolygonOffset'
14199
14200`GL_POLYGON_OFFSET_POINT'
14201 `glPolygonOffset'
14202
14203`GL_POLYGON_STIPPLE'
14204 `glPolygonStipple'
14205
14206`GL_POST_COLOR_MATRIX_COLOR_TABLE'
14207 `glColorTable'
14208
14209`GL_POST_CONVOLUTION_COLOR_TABLE'
14210 `glColorTable'
14211
14212`GL_RESCALE_NORMAL'
14213 `glNormal'
14214
14215`GL_SAMPLE_ALPHA_TO_COVERAGE'
14216 `glSampleCoverage'
14217
14218`GL_SAMPLE_ALPHA_TO_ONE'
14219 `glSampleCoverage'
14220
14221`GL_SAMPLE_COVERAGE'
14222 `glSampleCoverage'
14223
14224`GL_SCISSOR_TEST'
14225 `glScissor'
14226
14227`GL_SECONDARY_COLOR_ARRAY'
14228 `glSecondaryColorPointer'
14229
14230`GL_SEPARABLE_2D'
14231 `glSeparableFilter2D'
14232
14233`GL_STENCIL_TEST'
14234 `glStencilFunc', `glStencilOp'
14235
14236`GL_TEXTURE_1D'
14237 `glTexImage1D'
14238
14239`GL_TEXTURE_2D'
14240 `glTexImage2D'
14241
14242`GL_TEXTURE_3D'
14243 `glTexImage3D'
14244
14245`GL_TEXTURE_COORD_ARRAY'
14246 `glTexCoordPointer'
14247
14248`GL_TEXTURE_CUBE_MAP'
14249 `glTexImage2D'
14250
14251`GL_TEXTURE_GEN_Q'
14252 `glTexGen'
14253
14254`GL_TEXTURE_GEN_R'
14255 `glTexGen'
14256
14257`GL_TEXTURE_GEN_S'
14258 `glTexGen'
14259
14260`GL_TEXTURE_GEN_T'
14261 `glTexGen'
14262
14263`GL_VERTEX_ARRAY'
14264 `glVertexPointer'
14265
14266`GL_VERTEX_PROGRAM_POINT_SIZE'
14267 `glEnable'
14268
14269`GL_VERTEX_PROGRAM_TWO_SIDE'
14270 `glEnable'
14271
14272
14273
14274`GL_INVALID_ENUM' is generated if CAP is not an accepted value.
14275
14276`GL_INVALID_OPERATION' is generated if `glIsEnabled' is executed between
14277the execution of `glBegin' and the corresponding execution of `glEnd'.")
14278
25072f02 14279(define-gl-procedures
bb894c9d 14280 ((glIsList (list GLuint) -> GLboolean))
3c9b6116
AW
14281 "Determine if a name corresponds to a display list.
14282
14283LIST
14284 Specifies a potential display list name.
14285
14286`glIsList' returns `GL_TRUE' if LIST is the name of a display list and
14287returns `GL_FALSE' if it is not, or if an error occurs.
14288
14289A name returned by `glGenLists', but not yet associated with a display
14290list by calling `glNewList', is not the name of a display list.
14291
14292`GL_INVALID_OPERATION' is generated if `glIsList' is executed between
14293the execution of `glBegin' and the corresponding execution of `glEnd'.")
14294
25072f02 14295(define-gl-procedures
bb894c9d 14296 ((glIsProgram (program GLuint) -> GLboolean))
3c9b6116
AW
14297 "Determines if a name corresponds to a program object.
14298
14299PROGRAM
14300 Specifies a potential program object.
14301
14302`glIsProgram' returns `GL_TRUE' if PROGRAM is the name of a program
14303object previously created with `glCreateProgram' and not yet deleted
14304with `glDeleteProgram'. If PROGRAM is zero or a non-zero value that is
14305not the name of a program object, or if an error occurs, `glIsProgram'
14306returns `GL_FALSE'.
14307
14308`GL_INVALID_OPERATION' is generated if `glIsProgram' is executed between
14309the execution of `glBegin' and the corresponding execution of `glEnd'.")
14310
25072f02 14311(define-gl-procedures
bb894c9d 14312 ((glIsQuery (id GLuint) -> GLboolean))
3c9b6116
AW
14313 "Determine if a name corresponds to a query object.
14314
14315ID
14316 Specifies a value that may be the name of a query object.
14317
14318`glIsQuery' returns `GL_TRUE' if ID is currently the name of a query
14319object. If ID is zero, or is a non-zero value that is not currently the
14320name of a query object, or if an error occurs, `glIsQuery' returns
14321`GL_FALSE'.
14322
14323A name returned by `glGenQueries', but not yet associated with a query
14324object by calling `glBeginQuery', is not the name of a query object.
14325
14326`GL_INVALID_OPERATION' is generated if `glIsQuery' is executed between
14327the execution of `glBegin' and the corresponding execution of `glEnd'.")
14328
25072f02 14329(define-gl-procedures
bb894c9d 14330 ((glIsShader (shader GLuint) -> GLboolean))
3c9b6116
AW
14331 "Determines if a name corresponds to a shader object.
14332
14333SHADER
14334 Specifies a potential shader object.
14335
14336`glIsShader' returns `GL_TRUE' if SHADER is the name of a shader object
14337previously created with `glCreateShader' and not yet deleted with
14338`glDeleteShader'. If SHADER is zero or a non-zero value that is not the
14339name of a shader object, or if an error occurs, `glIsShader ' returns
14340`GL_FALSE'.
14341
14342`GL_INVALID_OPERATION' is generated if `glIsShader' is executed between
14343the execution of `glBegin' and the corresponding execution of `glEnd'.")
14344
25072f02 14345(define-gl-procedures
bb894c9d 14346 ((glIsTexture (texture GLuint) -> GLboolean))
3c9b6116
AW
14347 "Determine if a name corresponds to a texture.
14348
14349TEXTURE
14350 Specifies a value that may be the name of a texture.
14351
14352`glIsTexture' returns `GL_TRUE' if TEXTURE is currently the name of a
14353texture. If TEXTURE is zero, or is a non-zero value that is not
14354currently the name of a texture, or if an error occurs, `glIsTexture'
14355returns `GL_FALSE'.
14356
14357A name returned by `glGenTextures', but not yet associated with a
14358texture by calling `glBindTexture', is not the name of a texture.
14359
14360`GL_INVALID_OPERATION' is generated if `glIsTexture' is executed between
14361the execution of `glBegin' and the corresponding execution of `glEnd'.")
14362
25072f02 14363(define-gl-procedures
bb894c9d
AW
14364 ((glLightModelf
14365 (pname GLenum)
14366 (param GLfloat)
14367 ->
14368 void)
14369 (glLightModeli
14370 (pname GLenum)
14371 (param GLint)
14372 ->
78aa45b9
DH
14373 void)
14374 (glLightModelfv
14375 (pname GLenum)
14376 (params const-GLfloat-*)
14377 ->
14378 void)
14379 (glLightModeliv
14380 (pname GLenum)
14381 (params const-GLint-*)
14382 ->
bb894c9d 14383 void))
3c9b6116
AW
14384 "Set the lighting model parameters.
14385
14386PNAME
14387 Specifies a single-valued lighting model parameter.
14388 `GL_LIGHT_MODEL_LOCAL_VIEWER', `GL_LIGHT_MODEL_COLOR_CONTROL', and
14389 `GL_LIGHT_MODEL_TWO_SIDE' are accepted.
14390
14391PARAM
14392 Specifies the value that PARAM will be set to.
14393
14394`glLightModel' sets the lighting model parameter. PNAME names a
14395parameter and PARAMS gives the new value. There are three lighting model
14396parameters:
14397
14398`GL_LIGHT_MODEL_AMBIENT'
14399
14400
14401 PARAMS contains four integer or floating-point values that specify
14402 the ambient RGBA intensity of the entire scene. Integer values are
14403 mapped linearly such that the most positive representable value
14404 maps to 1.0, and the most negative representable value maps to -1.0
14405 . Floating-point values are mapped directly. Neither integer nor
14406 floating-point values are clamped. The initial ambient scene
14407 intensity is (0.2, 0.2, 0.2, 1.0).
14408
14409`GL_LIGHT_MODEL_COLOR_CONTROL'
14410
14411
14412 PARAMS must be either `GL_SEPARATE_SPECULAR_COLOR' or
14413 `GL_SINGLE_COLOR'. `GL_SINGLE_COLOR' specifies that a single color
14414 is generated from the lighting computation for a vertex.
14415 `GL_SEPARATE_SPECULAR_COLOR' specifies that the specular color
14416 computation of lighting be stored separately from the remainder of
14417 the lighting computation. The specular color is summed into the
14418 generated fragment's color after the application of texture mapping
14419 (if enabled). The initial value is `GL_SINGLE_COLOR'.
14420
14421`GL_LIGHT_MODEL_LOCAL_VIEWER'
14422
14423
14424 PARAMS is a single integer or floating-point value that specifies
14425 how specular reflection angles are computed. If PARAMS is 0 (or
14426 0.0), specular reflection angles take the view direction to be
14427 parallel to and in the direction of the -Z axis, regardless of the
14428 location of the vertex in eye coordinates. Otherwise, specular
14429 reflections are computed from the origin of the eye coordinate
14430 system. The initial value is 0.
14431
14432`GL_LIGHT_MODEL_TWO_SIDE'
14433
14434
14435 PARAMS is a single integer or floating-point value that specifies
14436 whether one- or two-sided lighting calculations are done for
14437 polygons. It has no effect on the lighting calculations for points,
14438 lines, or bitmaps. If PARAMS is 0 (or 0.0), one-sided lighting is
14439 specified, and only the FRONT material parameters are used in the
14440 lighting equation. Otherwise, two-sided lighting is specified. In
14441 this case, vertices of back-facing polygons are lighted using the
14442 BACK material parameters and have their normals reversed before the
14443 lighting equation is evaluated. Vertices of front-facing polygons
14444 are always lighted using the FRONT material parameters, with no
14445 change to their normals. The initial value is 0.
14446
14447In RGBA mode, the lighted color of a vertex is the sum of the material
14448emission intensity, the product of the material ambient reflectance and
14449the lighting model full-scene ambient intensity, and the contribution of
14450each enabled light source. Each light source contributes the sum of
14451three terms: ambient, diffuse, and specular. The ambient light source
14452contribution is the product of the material ambient reflectance and the
14453light's ambient intensity. The diffuse light source contribution is the
14454product of the material diffuse reflectance, the light's diffuse
14455intensity, and the dot product of the vertex's normal with the
14456normalized vector from the vertex to the light source. The specular
14457light source contribution is the product of the material specular
14458reflectance, the light's specular intensity, and the dot product of the
14459normalized vertex-to-eye and vertex-to-light vectors, raised to the
14460power of the shininess of the material. All three light source
14461contributions are attenuated equally based on the distance from the
14462vertex to the light source and on light source direction, spread
14463exponent, and spread cutoff angle. All dot products are replaced with 0
14464if they evaluate to a negative value.
14465
14466The alpha component of the resulting lighted color is set to the alpha
14467value of the material diffuse reflectance.
14468
14469In color index mode, the value of the lighted index of a vertex ranges
14470from the ambient to the specular values passed to `glMaterial' using
14471`GL_COLOR_INDEXES'. Diffuse and specular coefficients, computed with a
14472(.30, .59, .11) weighting of the lights' colors, the shininess of the
14473material, and the same reflection and attenuation equations as in the
14474RGBA case, determine how much above ambient the resulting index is.
14475
14476`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
14477
14478`GL_INVALID_ENUM' is generated if PNAME is
14479`GL_LIGHT_MODEL_COLOR_CONTROL' and PARAMS is not one of
14480`GL_SINGLE_COLOR' or `GL_SEPARATE_SPECULAR_COLOR'.
14481
14482`GL_INVALID_OPERATION' is generated if `glLightModel' is executed
14483between the execution of `glBegin' and the corresponding execution of
14484`glEnd'.")
14485
25072f02 14486(define-gl-procedures
bb894c9d
AW
14487 ((glLightf
14488 (light GLenum)
14489 (pname GLenum)
14490 (param GLfloat)
14491 ->
14492 void)
14493 (glLighti
14494 (light GLenum)
14495 (pname GLenum)
14496 (param GLint)
14497 ->
78aa45b9
DH
14498 void)
14499 (glLightfv
14500 (light GLenum)
14501 (pname GLenum)
14502 (params const-GLfloat-*)
14503 ->
14504 void)
14505 (glLightiv
14506 (light GLenum)
14507 (pname GLenum)
14508 (params const-GLint-*)
14509 ->
bb894c9d 14510 void))
3c9b6116
AW
14511 "Set light source parameters.
14512
14513LIGHT
14514 Specifies a light. The number of lights depends on the
14515 implementation, but at least eight lights are supported. They are
14516 identified by symbolic names of the form `GL_LIGHT' I , where i
14517 ranges from 0 to the value of `GL_MAX_LIGHTS' - 1.
14518
14519PNAME
14520 Specifies a single-valued light source parameter for LIGHT.
14521 `GL_SPOT_EXPONENT', `GL_SPOT_CUTOFF', `GL_CONSTANT_ATTENUATION',
14522 `GL_LINEAR_ATTENUATION', and `GL_QUADRATIC_ATTENUATION' are
14523 accepted.
14524
14525PARAM
14526 Specifies the value that parameter PNAME of light source LIGHT will
14527 be set to.
14528
14529`glLight' sets the values of individual light source parameters. LIGHT
14530names the light and is a symbolic name of the form `GL_LIGHT'I , where i
14531ranges from 0 to the value of `GL_MAX_LIGHTS' - 1. PNAME specifies one
14532of ten light source parameters, again by symbolic name. PARAMS is either
14533a single value or a pointer to an array that contains the new values.
14534
14535To enable and disable lighting calculation, call `glEnable' and
14536`glDisable' with argument `GL_LIGHTING'. Lighting is initially disabled.
14537When it is enabled, light sources that are enabled contribute to the
14538lighting calculation. Light source I is enabled and disabled using
14539`glEnable' and `glDisable' with argument `GL_LIGHT'I .
14540
14541The ten light parameters are as follows:
14542
14543`GL_AMBIENT'
14544 PARAMS contains four integer or floating-point values that specify
14545 the ambient RGBA intensity of the light. Integer values are mapped
14546 linearly such that the most positive representable value maps to
14547 1.0, and the most negative representable value maps to -1.0 .
14548 Floating-point values are mapped directly. Neither integer nor
14549 floating-point values are clamped. The initial ambient light
14550 intensity is (0, 0, 0, 1).
14551
14552`GL_DIFFUSE'
14553 PARAMS contains four integer or floating-point values that specify
14554 the diffuse RGBA intensity of the light. Integer values are mapped
14555 linearly such that the most positive representable value maps to
14556 1.0, and the most negative representable value maps to -1.0 .
14557 Floating-point values are mapped directly. Neither integer nor
14558 floating-point values are clamped. The initial value for
14559 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14560 (0, 0, 0, 1).
14561
14562`GL_SPECULAR'
14563 PARAMS contains four integer or floating-point values that specify
14564 the specular RGBA intensity of the light. Integer values are mapped
14565 linearly such that the most positive representable value maps to
14566 1.0, and the most negative representable value maps to -1.0 .
14567 Floating-point values are mapped directly. Neither integer nor
14568 floating-point values are clamped. The initial value for
14569 `GL_LIGHT0' is (1, 1, 1, 1); for other lights, the initial value is
14570 (0, 0, 0, 1).
14571
14572`GL_POSITION'
14573 PARAMS contains four integer or floating-point values that specify
14574 the position of the light in homogeneous object coordinates. Both
14575 integer and floating-point values are mapped directly. Neither
14576 integer nor floating-point values are clamped.
14577
14578 The position is transformed by the modelview matrix when `glLight'
14579 is called (just as if it were a point), and it is stored in eye
14580 coordinates. If the W component of the position is 0, the light is
14581 treated as a directional source. Diffuse and specular lighting
14582 calculations take the light's direction, but not its actual
14583 position, into account, and attenuation is disabled. Otherwise,
14584 diffuse and specular lighting calculations are based on the actual
14585 location of the light in eye coordinates, and attenuation is
14586 enabled. The initial position is (0, 0, 1, 0); thus, the initial
14587 light source is directional, parallel to, and in the direction of
14588 the -Z axis.
14589
14590`GL_SPOT_DIRECTION'
14591 PARAMS contains three integer or floating-point values that specify
14592 the direction of the light in homogeneous object coordinates. Both
14593 integer and floating-point values are mapped directly. Neither
14594 integer nor floating-point values are clamped.
14595
14596 The spot direction is transformed by the upper 3x3 of the modelview
14597 matrix when `glLight' is called, and it is stored in eye
14598 coordinates. It is significant only when `GL_SPOT_CUTOFF' is not
14599 180, which it is initially. The initial direction is (0,0-1) .
14600
14601`GL_SPOT_EXPONENT'
14602 PARAMS is a single integer or floating-point value that specifies
14603 the intensity distribution of the light. Integer and floating-point
14604 values are mapped directly. Only values in the range [0,128] are
14605 accepted.
14606
14607 Effective light intensity is attenuated by the cosine of the angle
14608 between the direction of the light and the direction from the light
14609 to the vertex being lighted, raised to the power of the spot
14610 exponent. Thus, higher spot exponents result in a more focused
14611 light source, regardless of the spot cutoff angle (see
14612 `GL_SPOT_CUTOFF', next paragraph). The initial spot exponent is 0,
14613 resulting in uniform light distribution.
14614
14615`GL_SPOT_CUTOFF'
14616 PARAMS is a single integer or floating-point value that specifies
14617 the maximum spread angle of a light source. Integer and
14618 floating-point values are mapped directly. Only values in the range
14619 [0,90] and the special value 180 are accepted. If the angle between
14620 the direction of the light and the direction from the light to the
14621 vertex being lighted is greater than the spot cutoff angle, the
14622 light is completely masked. Otherwise, its intensity is controlled
14623 by the spot exponent and the attenuation factors. The initial spot
14624 cutoff is 180, resulting in uniform light distribution.
14625
14626`GL_CONSTANT_ATTENUATION'
14627`GL_LINEAR_ATTENUATION'
14628`GL_QUADRATIC_ATTENUATION'
14629 PARAMS is a single integer or floating-point value that specifies
14630 one of the three light attenuation factors. Integer and
14631 floating-point values are mapped directly. Only nonnegative values
14632 are accepted. If the light is positional, rather than directional,
14633 its intensity is attenuated by the reciprocal of the sum of the
14634 constant factor, the linear factor times the distance between the
14635 light and the vertex being lighted, and the quadratic factor times
14636 the square of the same distance. The initial attenuation factors
14637 are (1, 0, 0), resulting in no attenuation.
14638
14639`GL_INVALID_ENUM' is generated if either LIGHT or PNAME is not an
14640accepted value.
14641
14642`GL_INVALID_VALUE' is generated if a spot exponent value is specified
14643outside the range [0,128] , or if spot cutoff is specified outside the
14644range [0,90] (except for the special value 180), or if a negative
14645attenuation factor is specified.
14646
14647`GL_INVALID_OPERATION' is generated if `glLight' is executed between the
14648execution of `glBegin' and the corresponding execution of `glEnd'.")
14649
25072f02 14650(define-gl-procedures
bb894c9d
AW
14651 ((glLineStipple
14652 (factor GLint)
14653 (pattern GLushort)
14654 ->
14655 void))
3c9b6116
AW
14656 "Specify the line stipple pattern.
14657
14658FACTOR
14659 Specifies a multiplier for each bit in the line stipple pattern. If
14660 FACTOR is 3, for example, each bit in the pattern is used three
14661 times before the next bit in the pattern is used. FACTOR is clamped
14662 to the range [1, 256] and defaults to 1.
14663
14664PATTERN
14665 Specifies a 16-bit integer whose bit pattern determines which
14666 fragments of a line will be drawn when the line is rasterized. Bit
14667 zero is used first; the default pattern is all 1's.
14668
14669Line stippling masks out certain fragments produced by rasterization;
14670those fragments will not be drawn. The masking is achieved by using
14671three parameters: the 16-bit line stipple pattern PATTERN, the repeat
14672count FACTOR, and an integer stipple counter S .
14673
14674Counter S is reset to 0 whenever `glBegin' is called and before each
14675line segment of a `glBegin'(`GL_LINES')/`glEnd' sequence is generated.
14676It is incremented after each fragment of a unit width aliased line
14677segment is generated or after each I fragments of an I width line
14678segment are generated. The I fragments associated with count S are
14679masked out if
14680
14681PATTERN bit (S/FACTOR,)%16
14682
14683is 0, otherwise these fragments are sent to the frame buffer. Bit zero
14684of PATTERN is the least significant bit.
14685
14686Antialiased lines are treated as a sequence of 1×WIDTH rectangles for
14687purposes of stippling. Whether rectangle S is rasterized or not depends
14688on the fragment rule described for aliased lines, counting rectangles
14689rather than groups of fragments.
14690
14691To enable and disable line stippling, call `glEnable' and `glDisable'
14692with argument `GL_LINE_STIPPLE'. When enabled, the line stipple pattern
14693is applied as described above. When disabled, it is as if the pattern
14694were all 1's. Initially, line stippling is disabled.
14695
14696`GL_INVALID_OPERATION' is generated if `glLineStipple' is executed
14697between the execution of `glBegin' and the corresponding execution of
14698`glEnd'.")
14699
25072f02 14700(define-gl-procedures
bb894c9d 14701 ((glLineWidth (width GLfloat) -> void))
3c9b6116
AW
14702 "Specify the width of rasterized lines.
14703
14704WIDTH
14705 Specifies the width of rasterized lines. The initial value is 1.
14706
14707`glLineWidth' specifies the rasterized width of both aliased and
14708antialiased lines. Using a line width other than 1 has different
14709effects, depending on whether line antialiasing is enabled. To enable
14710and disable line antialiasing, call `glEnable' and `glDisable' with
14711argument `GL_LINE_SMOOTH'. Line antialiasing is initially disabled.
14712
14713If line antialiasing is disabled, the actual width is determined by
14714rounding the supplied width to the nearest integer. (If the rounding
14715results in the value 0, it is as if the line width were 1.) If
14716∣ΔX,∣>=∣ΔY,∣ , I pixels are filled in each column that is rasterized,
14717where I is the rounded value of WIDTH. Otherwise, I pixels are filled in
14718each row that is rasterized.
14719
14720If antialiasing is enabled, line rasterization produces a fragment for
14721each pixel square that intersects the region lying within the rectangle
14722having width equal to the current line width, length equal to the actual
14723length of the line, and centered on the mathematical line segment. The
14724coverage value for each fragment is the window coordinate area of the
14725intersection of the rectangular region with the corresponding pixel
14726square. This value is saved and used in the final rasterization step.
14727
14728Not all widths can be supported when line antialiasing is enabled. If an
14729unsupported width is requested, the nearest supported width is used.
14730Only width 1 is guaranteed to be supported; others depend on the
14731implementation. Likewise, there is a range for aliased line widths as
14732well. To query the range of supported widths and the size difference
14733between supported widths within the range, call `glGet' with arguments
14734`GL_ALIASED_LINE_WIDTH_RANGE', `GL_SMOOTH_LINE_WIDTH_RANGE', and
14735`GL_SMOOTH_LINE_WIDTH_GRANULARITY'.
14736
14737`GL_INVALID_VALUE' is generated if WIDTH is less than or equal to 0.
14738
14739`GL_INVALID_OPERATION' is generated if `glLineWidth' is executed between
14740the execution of `glBegin' and the corresponding execution of `glEnd'.")
14741
25072f02 14742(define-gl-procedures
bb894c9d 14743 ((glLinkProgram (program GLuint) -> void))
3c9b6116
AW
14744 "Links a program object.
14745
14746PROGRAM
14747 Specifies the handle of the program object to be linked.
14748
14749`glLinkProgram' links the program object specified by PROGRAM. If any
14750shader objects of type `GL_VERTEX_SHADER' are attached to PROGRAM, they
14751will be used to create an executable that will run on the programmable
14752vertex processor. If any shader objects of type `GL_FRAGMENT_SHADER' are
14753attached to PROGRAM, they will be used to create an executable that will
14754run on the programmable fragment processor.
14755
14756The status of the link operation will be stored as part of the program
14757object's state. This value will be set to `GL_TRUE' if the program
14758object was linked without errors and is ready for use, and `GL_FALSE'
14759otherwise. It can be queried by calling `glGetProgram' with arguments
14760PROGRAM and `GL_LINK_STATUS'.
14761
14762As a result of a successful link operation, all active user-defined
14763uniform variables belonging to PROGRAM will be initialized to 0, and
14764each of the program object's active uniform variables will be assigned a
14765location that can be queried by calling `glGetUniformLocation'. Also,
14766any active user-defined attribute variables that have not been bound to
14767a generic vertex attribute index will be bound to one at this time.
14768
14769Linking of a program object can fail for a number of reasons as
14770specified in the OPENGL SHADING LANGUAGE SPECIFICATION. The following
14771lists some of the conditions that will cause a link error.
14772
14773 * The storage limit for uniform variables has been exceeded.
14774
14775 * The number of active uniform variables supported by the
14776 implementation has been exceeded.
14777
14778 * The `main' function is missing for the vertex shader or the
14779 fragment shader.
14780
14781 * A varying variable actually used in the fragment shader is not
14782 declared in the same way (or is not declared at all) in the vertex
14783 shader.
14784
14785 * A reference to a function or variable name is unresolved.
14786
14787 * A shared global is declared with two different types or two
14788 different initial values.
14789
14790 * One or more of the attached shader objects has not been
14791 successfully compiled.
14792
14793 * Binding a generic attribute matrix caused some rows of the matrix
14794 to fall outside the allowed maximum of `GL_MAX_VERTEX_ATTRIBS'.
14795
14796 * Not enough contiguous vertex attribute slots could be found to bind
14797 attribute matrices.
14798
14799When a program object has been successfully linked, the program object
14800can be made part of current state by calling `glUseProgram'. Whether or
14801not the link operation was successful, the program object's information
14802log will be overwritten. The information log can be retrieved by calling
14803`glGetProgramInfoLog'.
14804
14805`glLinkProgram' will also install the generated executables as part of
14806the current rendering state if the link operation was successful and the
14807specified program object is already currently in use as a result of a
14808previous call to `glUseProgram'. If the program object currently in use
14809is relinked unsuccessfully, its link status will be set to `GL_FALSE' ,
14810but the executables and associated state will remain part of the current
14811state until a subsequent call to `glUseProgram' removes it from use.
14812After it is removed from use, it cannot be made part of current state
14813until it has been successfully relinked.
14814
14815If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but does
14816not contain shader objects of type `GL_FRAGMENT_SHADER', the vertex
14817shader will be linked against the implicit interface for fixed
14818functionality fragment processing. Similarly, if PROGRAM contains shader
14819objects of type `GL_FRAGMENT_SHADER' but it does not contain shader
14820objects of type `GL_VERTEX_SHADER', the fragment shader will be linked
14821against the implicit interface for fixed functionality vertex
14822processing.
14823
14824The program object's information log is updated and the program is
14825generated at the time of the link operation. After the link operation,
14826applications are free to modify attached shader objects, compile
14827attached shader objects, detach shader objects, delete shader objects,
14828and attach additional shader objects. None of these operations affects
14829the information log or the program that is part of the program object.
14830
14831`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
14832OpenGL.
14833
14834`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
14835
14836`GL_INVALID_OPERATION' is generated if `glLinkProgram' is executed
14837between the execution of `glBegin' and the corresponding execution of
14838`glEnd'.")
14839
25072f02 14840(define-gl-procedures
bb894c9d 14841 ((glListBase (base GLuint) -> void))
3c9b6116
AW
14842 "Set the display-list base for .
14843
14844BASE
14845 Specifies an integer offset that will be added to `glCallLists'
14846 offsets to generate display-list names. The initial value is 0.
14847
14848`glCallLists' specifies an array of offsets. Display-list names are
14849generated by adding BASE to each offset. Names that reference valid
14850display lists are executed; the others are ignored.
14851
14852`GL_INVALID_OPERATION' is generated if `glListBase' is executed between
14853the execution of `glBegin' and the corresponding execution of `glEnd'.")
14854
25072f02 14855(define-gl-procedures
bb894c9d 14856 ((glLoadIdentity -> void))
3c9b6116
AW
14857 "Replace the current matrix with the identity matrix.
14858
14859`glLoadIdentity' replaces the current matrix with the identity matrix.
14860It is semantically equivalent to calling `glLoadMatrix' with the
14861identity matrix
14862
14863
14864
14865((1 0 0 0), (0 1 0 0), (0 0 1 0), (0 0 0 1),,)
14866
14867
14868
14869but in some cases it is more efficient.
14870
14871`GL_INVALID_OPERATION' is generated if `glLoadIdentity' is executed
14872between the execution of `glBegin' and the corresponding execution of
14873`glEnd'.")
14874
25072f02 14875(define-gl-procedures
78aa45b9
DH
14876 ((glLoadMatrixd (m const-GLdouble-*) -> void)
14877 (glLoadMatrixf (m const-GLfloat-*) -> void))
3c9b6116
AW
14878 "Replace the current matrix with the specified matrix.
14879
14880M
14881 Specifies a pointer to 16 consecutive values, which are used as the
14882 elements of a 4×4 column-major matrix.
14883
14884`glLoadMatrix' replaces the current matrix with the one whose elements
14885are specified by M. The current matrix is the projection matrix,
14886modelview matrix, or texture matrix, depending on the current matrix
14887mode (see `glMatrixMode').
14888
14889The current matrix, M, defines a transformation of coordinates. For
14890instance, assume M refers to the modelview matrix. If
14891V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14892vertex, and M points to an array of 16 single- or double-precision
14893floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14894transformation M\u2061(V,) does the following:
14895
14896M\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,]),
14897(M\u2061[2,] M\u2061[6,] M\u2061[10,] M\u2061[14,]), (M\u2061[3,] M\u2061[7,] M\u2061[11,]
14898M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14899
14900
14901
14902Projection and texture transformations are similarly defined.
14903
14904`GL_INVALID_OPERATION' is generated if `glLoadMatrix' is executed
14905between the execution of `glBegin' and the corresponding execution of
14906`glEnd'.")
14907
25072f02 14908(define-gl-procedures
bb894c9d 14909 ((glLoadName (name GLuint) -> void))
3c9b6116
AW
14910 "Load a name onto the name stack.
14911
14912NAME
14913 Specifies a name that will replace the top value on the name stack.
14914
14915The name stack is used during selection mode to allow sets of rendering
14916commands to be uniquely identified. It consists of an ordered set of
14917unsigned integers and is initially empty.
14918
14919`glLoadName' causes NAME to replace the value on the top of the name
14920stack.
14921
14922The name stack is always empty while the render mode is not `GL_SELECT'.
14923Calls to `glLoadName' while the render mode is not `GL_SELECT' are
14924ignored.
14925
14926`GL_INVALID_OPERATION' is generated if `glLoadName' is called while the
14927name stack is empty.
14928
14929`GL_INVALID_OPERATION' is generated if `glLoadName' is executed between
14930the execution of `glBegin' and the corresponding execution of `glEnd'.")
14931
25072f02 14932(define-gl-procedures
78aa45b9
DH
14933 ((glLoadTransposeMatrixd
14934 (m const-GLdouble-*)
14935 ->
14936 void)
14937 (glLoadTransposeMatrixf
00239761
AW
14938 (m const-GLfloat-*)
14939 ->
14940 void))
3c9b6116
AW
14941 "Replace the current matrix with the specified row-major ordered matrix.
14942
14943M
14944 Specifies a pointer to 16 consecutive values, which are used as the
14945 elements of a 4×4 row-major matrix.
14946
14947`glLoadTransposeMatrix' replaces the current matrix with the one whose
14948elements are specified by M. The current matrix is the projection
14949matrix, modelview matrix, or texture matrix, depending on the current
14950matrix mode (see `glMatrixMode').
14951
14952The current matrix, M, defines a transformation of coordinates. For
14953instance, assume M refers to the modelview matrix. If
14954V=(V\u2061[0,],V\u2061[1,]V\u2061[2,]V\u2061[3,]) is the set of object coordinates of a
14955vertex, and M points to an array of 16 single- or double-precision
14956floating-point values M={M\u2061[0,],M\u2061[1,]...M\u2061[15,]} , then the modelview
14957transformation M\u2061(V,) does the following:
14958
14959M\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,]),
14960(M\u2061[8,] M\u2061[9,] M\u2061[10,] M\u2061[11,]), (M\u2061[12,] M\u2061[13,] M\u2061[14,]
14961M\u2061[15,]),)×((V\u2061[0,]), (V\u2061[1,]), (V\u2061[2,]), (V\u2061[3,]),)
14962
14963
14964
14965Projection and texture transformations are similarly defined.
14966
14967Calling `glLoadTransposeMatrix' with matrix M is identical in operation
14968to `glLoadMatrix' with M^T , where T represents the transpose.
14969
14970`GL_INVALID_OPERATION' is generated if `glLoadTransposeMatrix' is
14971executed between the execution of `glBegin' and the corresponding
14972execution of `glEnd'.")
14973
25072f02 14974(define-gl-procedures
bb894c9d 14975 ((glLogicOp (opcode GLenum) -> void))
3c9b6116
AW
14976 "Specify a logical pixel operation for color index rendering.
14977
14978OPCODE
14979 Specifies a symbolic constant that selects a logical operation. The
14980 following symbols are accepted: `GL_CLEAR', `GL_SET', `GL_COPY',
14981 `GL_COPY_INVERTED', `GL_NOOP', `GL_INVERT', `GL_AND', `GL_NAND',
14982 `GL_OR', `GL_NOR', `GL_XOR', `GL_EQUIV', `GL_AND_REVERSE',
14983 `GL_AND_INVERTED', `GL_OR_REVERSE', and `GL_OR_INVERTED'. The
14984 initial value is `GL_COPY'.
14985
14986`glLogicOp' specifies a logical operation that, when enabled, is applied
14987between the incoming color index or RGBA color and the color index or
14988RGBA color at the corresponding location in the frame buffer. To enable
14989or disable the logical operation, call `glEnable' and `glDisable' using
14990the symbolic constant `GL_COLOR_LOGIC_OP' for RGBA mode or
14991`GL_INDEX_LOGIC_OP' for color index mode. The initial value is disabled
14992for both operations.
14993
14994
14995
14996*Opcode*
14997 *Resulting Operation*
14998
14999`GL_CLEAR'
15000 0
15001
15002`GL_SET'
15003 1
15004
15005`GL_COPY'
15006 s
15007
15008`GL_COPY_INVERTED'
15009 ~s
15010
15011`GL_NOOP'
15012 d
15013
15014`GL_INVERT'
15015 ~d
15016
15017`GL_AND'
15018 s & d
15019
15020`GL_NAND'
15021 ~(s & d)
15022
15023`GL_OR'
15024 s | d
15025
15026`GL_NOR'
15027 ~(s | d)
15028
15029`GL_XOR'
15030 s ^ d
15031
15032`GL_EQUIV'
15033 ~(s ^ d)
15034
15035`GL_AND_REVERSE'
15036 s & ~d
15037
15038`GL_AND_INVERTED'
15039 ~s & d
15040
15041`GL_OR_REVERSE'
15042 s | ~d
15043
15044`GL_OR_INVERTED'
15045 ~s | d
15046
15047OPCODE is a symbolic constant chosen from the list above. In the
15048explanation of the logical operations, S represents the incoming color
15049index and D represents the index in the frame buffer. Standard
15050C-language operators are used. As these bitwise operators suggest, the
15051logical operation is applied independently to each bit pair of the
15052source and destination indices or colors.
15053
15054`GL_INVALID_ENUM' is generated if OPCODE is not an accepted value.
15055
15056`GL_INVALID_OPERATION' is generated if `glLogicOp' is executed between
15057the execution of `glBegin' and the corresponding execution of `glEnd'.")
15058
25072f02 15059(define-gl-procedures
ca09631c 15060 ((glMap1f
bb894c9d 15061 (target GLenum)
ca09631c
AW
15062 (u1 GLfloat)
15063 (u2 GLfloat)
bb894c9d
AW
15064 (stride GLint)
15065 (order GLint)
00239761 15066 (points const-GLfloat-*)
bb894c9d 15067 ->
78aa45b9
DH
15068 void)
15069 (glMap1d
15070 (target GLenum)
15071 (u1 GLdouble)
15072 (u2 GLdouble)
15073 (stride GLint)
15074 (order GLint)
15075 (points const-GLdouble-*)
15076 ->
bb894c9d 15077 void))
3c9b6116
AW
15078 "Define a one-dimensional evaluator.
15079
15080TARGET
15081 Specifies the kind of values that are generated by the evaluator.
15082 Symbolic constants `GL_MAP1_VERTEX_3', `GL_MAP1_VERTEX_4',
15083 `GL_MAP1_INDEX', `GL_MAP1_COLOR_4', `GL_MAP1_NORMAL',
15084 `GL_MAP1_TEXTURE_COORD_1', `GL_MAP1_TEXTURE_COORD_2',
15085 `GL_MAP1_TEXTURE_COORD_3', and `GL_MAP1_TEXTURE_COORD_4' are
15086 accepted.
15087
15088U1
15089 U2
15090
15091 Specify a linear mapping of U , as presented to `glEvalCoord1', to
15092 U^ , the variable that is evaluated by the equations specified by
15093 this command.
15094
15095STRIDE
15096 Specifies the number of floats or doubles between the beginning of
15097 one control point and the beginning of the next one in the data
15098 structure referenced in POINTS. This allows control points to be
15099 embedded in arbitrary data structures. The only constraint is that
15100 the values for a particular control point must occupy contiguous
15101 memory locations.
15102
15103ORDER
15104 Specifies the number of control points. Must be positive.
15105
15106POINTS
15107 Specifies a pointer to the array of control points.
15108
15109Evaluators provide a way to use polynomial or rational polynomial
15110mapping to produce vertices, normals, texture coordinates, and colors.
15111The values produced by an evaluator are sent to further stages of GL
15112processing just as if they had been presented using `glVertex',
15113`glNormal', `glTexCoord', and `glColor' commands, except that the
15114generated values do not update the current normal, texture coordinates,
15115or color.
15116
15117All polynomial or rational polynomial splines of any degree (up to the
15118maximum degree supported by the GL implementation) can be described
15119using evaluators. These include almost all splines used in computer
15120graphics: B-splines, Bezier curves, Hermite splines, and so on.
15121
15122Evaluators define curves based on Bernstein polynomials. Define P\u2061(U^,)
15123as
15124
15125P\u2061(U^,)=ΣI=0NB_I,^N\u2061(U^,)\u2062R_I
15126
15127
15128
15129where R_I is a control point and B_I,^N\u2061(U^,) is the I th Bernstein
15130polynomial of degree N (ORDER = N+1 ):
15131
15132B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
15133
15134Recall that
15135
151360^0==1 and ((N), (0),,)==1
15137
15138`glMap1' is used to define the basis and to specify what kind of values
15139are produced. Once defined, a map can be enabled and disabled by calling
15140`glEnable' and `glDisable' with the map name, one of the nine predefined
15141values for TARGET described below. `glEvalCoord1' evaluates the
15142one-dimensional maps that are enabled. When `glEvalCoord1' presents a
15143value U , the Bernstein functions are evaluated using U^ , where
15144U^=U-U1,/U2-U1,
15145
15146TARGET is a symbolic constant that indicates what kind of control points
15147are provided in POINTS, and what output is generated when the map is
15148evaluated. It can assume one of nine predefined values:
15149
15150`GL_MAP1_VERTEX_3'
15151 Each control point is three floating-point values representing X ,
15152 Y , and Z . Internal `glVertex3' commands are generated when the
15153 map is evaluated.
15154
15155`GL_MAP1_VERTEX_4'
15156 Each control point is four floating-point values representing X , Y
15157 , Z , and W . Internal `glVertex4' commands are generated when the
15158 map is evaluated.
15159
15160`GL_MAP1_INDEX'
15161 Each control point is a single floating-point value representing a
15162 color index. Internal `glIndex' commands are generated when the map
15163 is evaluated but the current index is not updated with the value of
15164 these `glIndex' commands.
15165
15166`GL_MAP1_COLOR_4'
15167 Each control point is four floating-point values representing red,
15168 green, blue, and alpha. Internal `glColor4' commands are generated
15169 when the map is evaluated but the current color is not updated with
15170 the value of these `glColor4' commands.
15171
15172`GL_MAP1_NORMAL'
15173 Each control point is three floating-point values representing the
15174 X , Y , and Z components of a normal vector. Internal `glNormal'
15175 commands are generated when the map is evaluated but the current
15176 normal is not updated with the value of these `glNormal' commands.
15177
15178`GL_MAP1_TEXTURE_COORD_1'
15179 Each control point is a single floating-point value representing
15180 the S texture coordinate. Internal `glTexCoord1' commands are
15181 generated when the map is evaluated but the current texture
15182 coordinates are not updated with the value of these `glTexCoord'
15183 commands.
15184
15185`GL_MAP1_TEXTURE_COORD_2'
15186 Each control point is two floating-point values representing the S
15187 and T texture coordinates. Internal `glTexCoord2' commands are
15188 generated when the map is evaluated but the current texture
15189 coordinates are not updated with the value of these `glTexCoord'
15190 commands.
15191
15192`GL_MAP1_TEXTURE_COORD_3'
15193 Each control point is three floating-point values representing the
15194 S , T , and R texture coordinates. Internal `glTexCoord3' commands
15195 are generated when the map is evaluated but the current texture
15196 coordinates are not updated with the value of these `glTexCoord'
15197 commands.
15198
15199`GL_MAP1_TEXTURE_COORD_4'
15200 Each control point is four floating-point values representing the S
15201 , T , R , and Q texture coordinates. Internal `glTexCoord4'
15202 commands are generated when the map is evaluated but the current
15203 texture coordinates are not updated with the value of these
15204 `glTexCoord' commands.
15205
15206STRIDE, ORDER, and POINTS define the array addressing for accessing the
15207control points. POINTS is the location of the first control point, which
15208occupies one, two, three, or four contiguous memory locations, depending
15209on which map is being defined. ORDER is the number of control points in
15210the array. STRIDE specifies how many float or double locations to
15211advance the internal memory pointer to reach the next control point.
15212
15213`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
15214
15215`GL_INVALID_VALUE' is generated if U1 is equal to U2.
15216
15217`GL_INVALID_VALUE' is generated if STRIDE is less than the number of
15218values in a control point.
15219
15220`GL_INVALID_VALUE' is generated if ORDER is less than 1 or greater than
15221the return value of `GL_MAX_EVAL_ORDER'.
15222
15223`GL_INVALID_OPERATION' is generated if `glMap1' is executed between the
15224execution of `glBegin' and the corresponding execution of `glEnd'.
15225
15226`GL_INVALID_OPERATION' is generated if `glMap1' is called and the value
15227of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
15228
25072f02 15229(define-gl-procedures
ca09631c 15230 ((glMap2f
bb894c9d 15231 (target GLenum)
ca09631c
AW
15232 (u1 GLfloat)
15233 (u2 GLfloat)
bb894c9d
AW
15234 (ustride GLint)
15235 (uorder GLint)
ca09631c
AW
15236 (v1 GLfloat)
15237 (v2 GLfloat)
bb894c9d
AW
15238 (vstride GLint)
15239 (vorder GLint)
00239761 15240 (points const-GLfloat-*)
bb894c9d 15241 ->
78aa45b9
DH
15242 void)
15243 (glMap2d
15244 (target GLenum)
15245 (u1 GLdouble)
15246 (u2 GLdouble)
15247 (ustride GLint)
15248 (uorder GLint)
15249 (v1 GLdouble)
15250 (v2 GLdouble)
15251 (vstride GLint)
15252 (vorder GLint)
15253 (points const-GLdouble-*)
15254 ->
bb894c9d 15255 void))
3c9b6116
AW
15256 "Define a two-dimensional evaluator.
15257
15258TARGET
15259 Specifies the kind of values that are generated by the evaluator.
15260 Symbolic constants `GL_MAP2_VERTEX_3', `GL_MAP2_VERTEX_4',
15261 `GL_MAP2_INDEX', `GL_MAP2_COLOR_4', `GL_MAP2_NORMAL',
15262 `GL_MAP2_TEXTURE_COORD_1', `GL_MAP2_TEXTURE_COORD_2',
15263 `GL_MAP2_TEXTURE_COORD_3', and `GL_MAP2_TEXTURE_COORD_4' are
15264 accepted.
15265
15266U1
15267 U2
15268
15269 Specify a linear mapping of U , as presented to `glEvalCoord2', to
15270 U^ , one of the two variables that are evaluated by the equations
15271 specified by this command. Initially, U1 is 0 and U2 is 1.
15272
15273USTRIDE
15274 Specifies the number of floats or doubles between the beginning of
15275 control point R_IJ and the beginning of control point R_(I+1,)\u2062J, ,
15276 where I and J are the U and V control point indices, respectively.
15277 This allows control points to be embedded in arbitrary data
15278 structures. The only constraint is that the values for a particular
15279 control point must occupy contiguous memory locations. The initial
15280 value of USTRIDE is 0.
15281
15282UORDER
15283 Specifies the dimension of the control point array in the U axis.
15284 Must be positive. The initial value is 1.
15285
15286V1
15287 V2
15288
15289 Specify a linear mapping of V , as presented to `glEvalCoord2', to
15290 V^ , one of the two variables that are evaluated by the equations
15291 specified by this command. Initially, V1 is 0 and V2 is 1.
15292
15293VSTRIDE
15294 Specifies the number of floats or doubles between the beginning of
15295 control point R_IJ and the beginning of control point R_I\u2061(J+1,), ,
15296 where I and J are the U and V control point indices, respectively.
15297 This allows control points to be embedded in arbitrary data
15298 structures. The only constraint is that the values for a particular
15299 control point must occupy contiguous memory locations. The initial
15300 value of VSTRIDE is 0.
15301
15302VORDER
15303 Specifies the dimension of the control point array in the V axis.
15304 Must be positive. The initial value is 1.
15305
15306POINTS
15307 Specifies a pointer to the array of control points.
15308
15309Evaluators provide a way to use polynomial or rational polynomial
15310mapping to produce vertices, normals, texture coordinates, and colors.
15311The values produced by an evaluator are sent on to further stages of GL
15312processing just as if they had been presented using `glVertex',
15313`glNormal', `glTexCoord', and `glColor' commands, except that the
15314generated values do not update the current normal, texture coordinates,
15315or color.
15316
15317All polynomial or rational polynomial splines of any degree (up to the
15318maximum degree supported by the GL implementation) can be described
15319using evaluators. These include almost all surfaces used in computer
15320graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
15321and so on.
15322
15323Evaluators define surfaces based on bivariate Bernstein polynomials.
15324Define P\u2061(U^,V^) as
15325
15326P\u2061(U^,V^)=ΣI=0NΣJ=0MB_I,^N\u2061(U^,)\u2062B_J,^M\u2061(V^,)\u2062R_IJ
15327
15328
15329
15330where R_IJ is a control point, B_I,^N\u2061(U^,) is the I th Bernstein
15331polynomial of degree N (UORDER = N+1 )
15332
15333B_I,^N\u2061(U^,)=((N), (I),,)\u2062U^,^I\u2062(1-U^,)^N-I,,
15334
15335and B_J,^M\u2061(V^,) is the J th Bernstein polynomial of degree M (VORDER =
15336M+1 )
15337
15338B_J,^M\u2061(V^,)=((M), (J),,)\u2062V^,^J\u2062(1-V^,)^M-J,,
15339
15340Recall that 0^0==1 and ((N), (0),,)==1
15341
15342`glMap2' is used to define the basis and to specify what kind of values
15343are produced. Once defined, a map can be enabled and disabled by calling
15344`glEnable' and `glDisable' with the map name, one of the nine predefined
15345values for TARGET, described below. When `glEvalCoord2' presents values
15346U and V , the bivariate Bernstein polynomials are evaluated using U^ and
15347V^ , where
15348
15349U^=U-U1,/U2-U1,
15350
15351V^=V-V1,/V2-V1,
15352
15353TARGET is a symbolic constant that indicates what kind of control points
15354are provided in POINTS, and what output is generated when the map is
15355evaluated. It can assume one of nine predefined values:
15356
15357`GL_MAP2_VERTEX_3'
15358 Each control point is three floating-point values representing X ,
15359 Y , and Z . Internal `glVertex3' commands are generated when the
15360 map is evaluated.
15361
15362`GL_MAP2_VERTEX_4'
15363 Each control point is four floating-point values representing X , Y
15364 , Z , and W . Internal `glVertex4' commands are generated when the
15365 map is evaluated.
15366
15367`GL_MAP2_INDEX'
15368 Each control point is a single floating-point value representing a
15369 color index. Internal `glIndex' commands are generated when the map
15370 is evaluated but the current index is not updated with the value of
15371 these `glIndex' commands.
15372
15373`GL_MAP2_COLOR_4'
15374 Each control point is four floating-point values representing red,
15375 green, blue, and alpha. Internal `glColor4' commands are generated
15376 when the map is evaluated but the current color is not updated with
15377 the value of these `glColor4' commands.
15378
15379`GL_MAP2_NORMAL'
15380 Each control point is three floating-point values representing the
15381 X , Y , and Z components of a normal vector. Internal `glNormal'
15382 commands are generated when the map is evaluated but the current
15383 normal is not updated with the value of these `glNormal' commands.
15384
15385`GL_MAP2_TEXTURE_COORD_1'
15386 Each control point is a single floating-point value representing
15387 the S texture coordinate. Internal `glTexCoord1' commands are
15388 generated when the map is evaluated but the current texture
15389 coordinates are not updated with the value of these `glTexCoord'
15390 commands.
15391
15392`GL_MAP2_TEXTURE_COORD_2'
15393 Each control point is two floating-point values representing the S
15394 and T texture coordinates. Internal `glTexCoord2' commands are
15395 generated when the map is evaluated but the current texture
15396 coordinates are not updated with the value of these `glTexCoord'
15397 commands.
15398
15399`GL_MAP2_TEXTURE_COORD_3'
15400 Each control point is three floating-point values representing the
15401 S , T , and R texture coordinates. Internal `glTexCoord3' commands
15402 are generated when the map is evaluated but the current texture
15403 coordinates are not updated with the value of these `glTexCoord'
15404 commands.
15405
15406`GL_MAP2_TEXTURE_COORD_4'
15407 Each control point is four floating-point values representing the S
15408 , T , R , and Q texture coordinates. Internal `glTexCoord4'
15409 commands are generated when the map is evaluated but the current
15410 texture coordinates are not updated with the value of these
15411 `glTexCoord' commands.
15412
15413USTRIDE, UORDER, VSTRIDE, VORDER, and POINTS define the array addressing
15414for accessing the control points. POINTS is the location of the first
15415control point, which occupies one, two, three, or four contiguous memory
15416locations, depending on which map is being defined. There are
15417UORDER×VORDER control points in the array. USTRIDE specifies how many
15418float or double locations are skipped to advance the internal memory
15419pointer from control point R_I\u2062J, to control point R_(I+1,)\u2062J, . VSTRIDE
15420specifies how many float or double locations are skipped to advance the
15421internal memory pointer from control point R_I\u2062J, to control point
15422R_I\u2061(J+1,), .
15423
15424`GL_INVALID_ENUM' is generated if TARGET is not an accepted value.
15425
15426`GL_INVALID_VALUE' is generated if U1 is equal to U2, or if V1 is equal
15427to V2.
15428
15429`GL_INVALID_VALUE' is generated if either USTRIDE or VSTRIDE is less
15430than the number of values in a control point.
15431
15432`GL_INVALID_VALUE' is generated if either UORDER or VORDER is less than
154331 or greater than the return value of `GL_MAX_EVAL_ORDER'.
15434
15435`GL_INVALID_OPERATION' is generated if `glMap2' is executed between the
15436execution of `glBegin' and the corresponding execution of `glEnd'.
15437
15438`GL_INVALID_OPERATION' is generated if `glMap2' is called and the value
15439of `GL_ACTIVE_TEXTURE' is not `GL_TEXTURE0'.")
15440
25072f02 15441(define-gl-procedures
bb894c9d
AW
15442 ((glMapBuffer
15443 (target GLenum)
15444 (access GLenum)
15445 ->
00239761 15446 void-*)
bb894c9d 15447 (glUnmapBuffer (target GLenum) -> GLboolean))
3c9b6116
AW
15448 "Map a buffer object's data store.
15449
15450TARGET
15451 Specifies the target buffer object being mapped. The symbolic
15452 constant must be `GL_ARRAY_BUFFER', `GL_ELEMENT_ARRAY_BUFFER',
15453 `GL_PIXEL_PACK_BUFFER', or `GL_PIXEL_UNPACK_BUFFER'.
15454
15455ACCESS
15456 Specifies the access policy, indicating whether it will be possible
15457 to read from, write to, or both read from and write to the buffer
15458 object's mapped data store. The symbolic constant must be
15459 `GL_READ_ONLY', `GL_WRITE_ONLY', or `GL_READ_WRITE'.
15460
15461`glMapBuffer' maps to the client's address space the entire data store
15462of the buffer object currently bound to TARGET. The data can then be
15463directly read and/or written relative to the returned pointer, depending
15464on the specified ACCESS policy. If the GL is unable to map the buffer
15465object's data store, `glMapBuffer' generates an error and returns
15466`NULL'. This may occur for system-specific reasons, such as low virtual
15467memory availability.
15468
15469If a mapped data store is accessed in a way inconsistent with the
15470specified ACCESS policy, no error is generated, but performance may be
15471negatively impacted and system errors, including program termination,
15472may result. Unlike the USAGE parameter of `glBufferData', ACCESS is not
15473a hint, and does in fact constrain the usage of the mapped data store on
15474some GL implementations. In order to achieve the highest performance
15475available, a buffer object's data store should be used in ways
15476consistent with both its specified USAGE and ACCESS parameters.
15477
15478A mapped data store must be unmapped with `glUnmapBuffer' before its
15479buffer object is used. Otherwise an error will be generated by any GL
15480command that attempts to dereference the buffer object's data store.
15481When a data store is unmapped, the pointer to its data store becomes
15482invalid. `glUnmapBuffer' returns `GL_TRUE' unless the data store
15483contents have become corrupt during the time the data store was mapped.
15484This can occur for system-specific reasons that affect the availability
15485of graphics memory, such as screen mode changes. In such situations,
15486`GL_FALSE' is returned and the data store contents are undefined. An
15487application must detect this rare condition and reinitialize the data
15488store.
15489
15490A buffer object's mapped data store is automatically unmapped when the
15491buffer object is deleted or its data store is recreated with
15492`glBufferData'.
15493
15494`GL_INVALID_ENUM' is generated if TARGET is not `GL_ARRAY_BUFFER',
15495`GL_ELEMENT_ARRAY_BUFFER', `GL_PIXEL_PACK_BUFFER', or
15496`GL_PIXEL_UNPACK_BUFFER'.
15497
15498`GL_INVALID_ENUM' is generated if ACCESS is not `GL_READ_ONLY',
15499`GL_WRITE_ONLY', or `GL_READ_WRITE'.
15500
15501`GL_OUT_OF_MEMORY' is generated when `glMapBuffer' is executed if the GL
15502is unable to map the buffer object's data store. This may occur for a
15503variety of system-specific reasons, such as the absence of sufficient
15504remaining virtual memory.
15505
15506`GL_INVALID_OPERATION' is generated if the reserved buffer object name 0
15507is bound to TARGET.
15508
15509`GL_INVALID_OPERATION' is generated if `glMapBuffer' is executed for a
15510buffer object whose data store is already mapped.
15511
15512`GL_INVALID_OPERATION' is generated if `glUnmapBuffer' is executed for a
15513buffer object whose data store is not currently mapped.
15514
15515`GL_INVALID_OPERATION' is generated if `glMapBuffer' or `glUnmapBuffer'
15516is executed between the execution of `glBegin' and the corresponding
15517execution of `glEnd'.")
15518
25072f02 15519(define-gl-procedures
78aa45b9
DH
15520 ((glMapGrid1d
15521 (un GLint)
15522 (u1 GLdouble)
15523 (u2 GLdouble)
15524 ->
15525 void)
15526 (glMapGrid1f
bb894c9d 15527 (un GLint)
ca09631c
AW
15528 (u1 GLfloat)
15529 (u2 GLfloat)
bb894c9d
AW
15530 ->
15531 void)
78aa45b9
DH
15532 (glMapGrid2d
15533 (un GLint)
15534 (u1 GLdouble)
15535 (u2 GLdouble)
15536 (vn GLint)
15537 (v1 GLdouble)
15538 (v2 GLdouble)
15539 ->
15540 void)
ca09631c 15541 (glMapGrid2f
bb894c9d 15542 (un GLint)
ca09631c
AW
15543 (u1 GLfloat)
15544 (u2 GLfloat)
bb894c9d 15545 (vn GLint)
ca09631c
AW
15546 (v1 GLfloat)
15547 (v2 GLfloat)
bb894c9d
AW
15548 ->
15549 void))
3c9b6116
AW
15550 "Define a one- or two-dimensional mesh.
15551
15552UN
15553 Specifies the number of partitions in the grid range interval [U1,
15554 U2]. Must be positive.
15555
15556U1
15557 U2
15558
15559 Specify the mappings for integer grid domain values I=0 and I=UN .
15560
15561VN
15562 Specifies the number of partitions in the grid range interval [V1,
15563 V2] (`glMapGrid2' only).
15564
15565V1
15566 V2
15567
15568 Specify the mappings for integer grid domain values J=0 and J=VN
15569 (`glMapGrid2' only).
15570
15571`glMapGrid' and `glEvalMesh' are used together to efficiently generate
15572and evaluate a series of evenly-spaced map domain values. `glEvalMesh'
15573steps through the integer domain of a one- or two-dimensional grid,
15574whose range is the domain of the evaluation maps specified by `glMap1'
15575and `glMap2'.
15576
15577`glMapGrid1' and `glMapGrid2' specify the linear grid mappings between
15578the I (or I and J ) integer grid coordinates, to the U (or U and V )
15579floating-point evaluation map coordinates. See `glMap1' and `glMap2' for
15580details of how U and V coordinates are evaluated.
15581
15582`glMapGrid1' specifies a single linear mapping such that integer grid
15583coordinate 0 maps exactly to U1, and integer grid coordinate UN maps
15584exactly to U2. All other integer grid coordinates I are mapped so that
15585
15586U=I\u2061(U2-U1,)/UN+U1
15587
15588`glMapGrid2' specifies two such linear mappings. One maps integer grid
15589coordinate I=0 exactly to U1, and integer grid coordinate I=UN exactly
15590to U2. The other maps integer grid coordinate J=0 exactly to V1, and
15591integer grid coordinate J=VN exactly to V2. Other integer grid
15592coordinates I and J are mapped such that
15593
15594U=I\u2061(U2-U1,)/UN+U1
15595
15596V=J\u2061(V2-V1,)/VN+V1
15597
15598The mappings specified by `glMapGrid' are used identically by
15599`glEvalMesh' and `glEvalPoint'.
15600
15601`GL_INVALID_VALUE' is generated if either UN or VN is not positive.
15602
15603`GL_INVALID_OPERATION' is generated if `glMapGrid' is executed between
15604the execution of `glBegin' and the corresponding execution of `glEnd'.")
15605
25072f02 15606(define-gl-procedures
bb894c9d
AW
15607 ((glMaterialf
15608 (face GLenum)
15609 (pname GLenum)
15610 (param GLfloat)
15611 ->
15612 void)
15613 (glMateriali
15614 (face GLenum)
15615 (pname GLenum)
15616 (param GLint)
15617 ->
78aa45b9
DH
15618 void)
15619 (glMaterialfv
15620 (face GLenum)
15621 (pname GLenum)
15622 (params const-GLfloat-*)
15623 ->
15624 void)
15625 (glMaterialiv
15626 (face GLenum)
15627 (pname GLenum)
15628 (params const-GLint-*)
15629 ->
bb894c9d 15630 void))
3c9b6116
AW
15631 "Specify material parameters for the lighting model.
15632
15633FACE
15634 Specifies which face or faces are being updated. Must be one of
15635 `GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
15636
15637PNAME
15638 Specifies the single-valued material parameter of the face or faces
15639 that is being updated. Must be `GL_SHININESS'.
15640
15641PARAM
15642 Specifies the value that parameter `GL_SHININESS' will be set to.
15643
15644`glMaterial' assigns values to material parameters. There are two
15645matched sets of material parameters. One, the FRONT-FACING set, is used
15646to shade points, lines, bitmaps, and all polygons (when two-sided
15647lighting is disabled), or just front-facing polygons (when two-sided
15648lighting is enabled). The other set, BACK-FACING, is used to shade
15649back-facing polygons only when two-sided lighting is enabled. Refer to
15650the `glLightModel' reference page for details concerning one- and
15651two-sided lighting calculations.
15652
15653`glMaterial' takes three arguments. The first, FACE, specifies whether
15654the `GL_FRONT' materials, the `GL_BACK' materials, or both
15655`GL_FRONT_AND_BACK' materials will be modified. The second, PNAME,
15656specifies which of several parameters in one or both sets will be
15657modified. The third, PARAMS, specifies what value or values will be
15658assigned to the specified parameter.
15659
15660Material parameters are used in the lighting equation that is optionally
15661applied to each vertex. The equation is discussed in the `glLightModel'
15662reference page. The parameters that can be specified using `glMaterial',
15663and their interpretations by the lighting equation, are as follows:
15664
15665`GL_AMBIENT'
15666 PARAMS contains four integer or floating-point values that specify
15667 the ambient RGBA reflectance of the material. Integer values are
15668 mapped linearly such that the most positive representable value
15669 maps to 1.0, and the most negative representable value maps to -1.0
15670 . Floating-point values are mapped directly. Neither integer nor
15671 floating-point values are clamped. The initial ambient reflectance
15672 for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
15673
15674`GL_DIFFUSE'
15675 PARAMS contains four integer or floating-point values that specify
15676 the diffuse RGBA reflectance of the material. Integer values are
15677 mapped linearly such that the most positive representable value
15678 maps to 1.0, and the most negative representable value maps to -1.0
15679 . Floating-point values are mapped directly. Neither integer nor
15680 floating-point values are clamped. The initial diffuse reflectance
15681 for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
15682
15683`GL_SPECULAR'
15684 PARAMS contains four integer or floating-point values that specify
15685 the specular RGBA reflectance of the material. Integer values are
15686 mapped linearly such that the most positive representable value
15687 maps to 1.0, and the most negative representable value maps to -1.0
15688 . Floating-point values are mapped directly. Neither integer nor
15689 floating-point values are clamped. The initial specular reflectance
15690 for both front- and back-facing materials is (0, 0, 0, 1).
15691
15692`GL_EMISSION'
15693 PARAMS contains four integer or floating-point values that specify
15694 the RGBA emitted light intensity of the material. Integer values
15695 are mapped linearly such that the most positive representable value
15696 maps to 1.0, and the most negative representable value maps to -1.0
15697 . Floating-point values are mapped directly. Neither integer nor
15698 floating-point values are clamped. The initial emission intensity
15699 for both front- and back-facing materials is (0, 0, 0, 1).
15700
15701`GL_SHININESS'
15702 PARAMS is a single integer or floating-point value that specifies
15703 the RGBA specular exponent of the material. Integer and
15704 floating-point values are mapped directly. Only values in the range
15705 [0,128] are accepted. The initial specular exponent for both front-
15706 and back-facing materials is 0.
15707
15708`GL_AMBIENT_AND_DIFFUSE'
15709 Equivalent to calling `glMaterial' twice with the same parameter
15710 values, once with `GL_AMBIENT' and once with `GL_DIFFUSE'.
15711
15712`GL_COLOR_INDEXES'
15713 PARAMS contains three integer or floating-point values specifying
15714 the color indices for ambient, diffuse, and specular lighting.
15715 These three values, and `GL_SHININESS', are the only material
15716 values used by the color index mode lighting equation. Refer to the
15717 `glLightModel' reference page for a discussion of color index
15718 lighting.
15719
15720`GL_INVALID_ENUM' is generated if either FACE or PNAME is not an
15721accepted value.
15722
15723`GL_INVALID_VALUE' is generated if a specular exponent outside the range
15724[0,128] is specified.")
15725
25072f02 15726(define-gl-procedures
bb894c9d 15727 ((glMatrixMode (mode GLenum) -> void))
3c9b6116
AW
15728 "Specify which matrix is the current matrix.
15729
15730MODE
15731 Specifies which matrix stack is the target for subsequent matrix
15732 operations. Three values are accepted: `GL_MODELVIEW',
15733 `GL_PROJECTION', and `GL_TEXTURE'. The initial value is
15734 `GL_MODELVIEW'. Additionally, if the `ARB_imaging' extension is
15735 supported, `GL_COLOR' is also accepted.
15736
15737`glMatrixMode' sets the current matrix mode. MODE can assume one of four
15738values:
15739
15740`GL_MODELVIEW'
15741 Applies subsequent matrix operations to the modelview matrix stack.
15742
15743`GL_PROJECTION'
15744 Applies subsequent matrix operations to the projection matrix
15745 stack.
15746
15747`GL_TEXTURE'
15748 Applies subsequent matrix operations to the texture matrix stack.
15749
15750`GL_COLOR'
15751 Applies subsequent matrix operations to the color matrix stack.
15752
15753To find out which matrix stack is currently the target of all matrix
15754operations, call `glGet' with argument `GL_MATRIX_MODE'. The initial
15755value is `GL_MODELVIEW'.
15756
15757`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15758
15759`GL_INVALID_OPERATION' is generated if `glMatrixMode' is executed
15760between the execution of `glBegin' and the corresponding execution of
15761`glEnd'.")
15762
25072f02 15763(define-gl-procedures
bb894c9d
AW
15764 ((glMinmax
15765 (target GLenum)
15766 (internalformat GLenum)
15767 (sink GLboolean)
15768 ->
15769 void))
3c9b6116
AW
15770 "Define minmax table.
15771
15772TARGET
15773 The minmax table whose parameters are to be set. Must be
15774 `GL_MINMAX'.
15775
15776INTERNALFORMAT
15777 The format of entries in the minmax table. Must be one of
15778 `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
15779 `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
15780 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
15781 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
15782 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
15783 `GL_LUMINANCE16_ALPHA16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4',
15784 `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16',
15785 `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8',
15786 `GL_RGB10_A2', `GL_RGBA12', or `GL_RGBA16'.
15787
15788SINK
15789 If `GL_TRUE', pixels will be consumed by the minmax process and no
15790 drawing or texture loading will take place. If `GL_FALSE', pixels
15791 will proceed to the final conversion process after minmax.
15792
15793When `GL_MINMAX' is enabled, the RGBA components of incoming pixels are
15794compared to the minimum and maximum values for each component, which are
15795stored in the two-element minmax table. (The first element stores the
15796minima, and the second element stores the maxima.) If a pixel component
15797is greater than the corresponding component in the maximum element, then
15798the maximum element is updated with the pixel component value. If a
15799pixel component is less than the corresponding component in the minimum
15800element, then the minimum element is updated with the pixel component
15801value. (In both cases, if the internal format of the minmax table
15802includes luminance, then the R color component of incoming pixels is
15803used for comparison.) The contents of the minmax table may be retrieved
15804at a later time by calling `glGetMinmax'. The minmax operation is
15805enabled or disabled by calling `glEnable' or `glDisable', respectively,
15806with an argument of `GL_MINMAX'.
15807
15808`glMinmax' redefines the current minmax table to have entries of the
15809format specified by INTERNALFORMAT. The maximum element is initialized
15810with the smallest possible component values, and the minimum element is
15811initialized with the largest possible component values. The values in
15812the previous minmax table, if any, are lost. If SINK is `GL_TRUE', then
15813pixels are discarded after minmax; no further processing of the pixels
15814takes place, and no drawing, texture loading, or pixel readback will
15815result.
15816
15817
15818
15819`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
15820values.
15821
15822`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
15823allowable values.
15824
15825`GL_INVALID_OPERATION' is generated if `glMinmax' is executed between
15826the execution of `glBegin' and the corresponding execution of `glEnd'.")
15827
25072f02 15828(define-gl-procedures
bb894c9d
AW
15829 ((glMultiDrawArrays
15830 (mode GLenum)
00239761
AW
15831 (first GLint-*)
15832 (count GLsizei-*)
bb894c9d
AW
15833 (primcount GLsizei)
15834 ->
15835 void))
3c9b6116
AW
15836 "Render multiple sets of primitives from array data.
15837
15838MODE
15839 Specifies what kind of primitives to render. Symbolic constants
15840 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15841 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15842 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15843
15844FIRST
15845 Points to an array of starting indices in the enabled arrays.
15846
15847COUNT
15848 Points to an array of the number of indices to be rendered.
15849
15850PRIMCOUNT
15851 Specifies the size of the first and count
15852
15853`glMultiDrawArrays' specifies multiple sets of geometric primitives with
15854very few subroutine calls. Instead of calling a GL procedure to pass
15855each individual vertex, normal, texture coordinate, edge flag, or color,
15856you can prespecify separate arrays of vertices, normals, and colors and
15857use them to construct a sequence of primitives with a single call to
15858`glMultiDrawArrays'.
15859
15860`glMultiDrawArrays' behaves identically to `glDrawArrays' except that
15861PRIMCOUNT separate ranges of elements are specified instead.
15862
15863When `glMultiDrawArrays' is called, it uses COUNT sequential elements
15864from each enabled array to construct a sequence of geometric primitives,
15865beginning with element FIRST. MODE specifies what kind of primitives are
15866constructed, and how the array elements construct those primitives. If
15867`GL_VERTEX_ARRAY' is not enabled, no geometric primitives are generated.
15868
15869Vertex attributes that are modified by `glMultiDrawArrays' have an
15870unspecified value after `glMultiDrawArrays' returns. For example, if
15871`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15872after `glMultiDrawArrays' executes. Attributes that aren't modified
15873remain well defined.
15874
15875`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15876
15877`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15878
15879`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15880bound to an enabled array and the buffer object's data store is
15881currently mapped.
15882
15883`GL_INVALID_OPERATION' is generated if `glMultiDrawArrays' is executed
15884between the execution of `glBegin' and the corresponding `glEnd'.")
15885
25072f02 15886(define-gl-procedures
bb894c9d
AW
15887 ((glMultiDrawElements
15888 (mode GLenum)
00239761 15889 (count const-GLsizei-*)
bb894c9d 15890 (type GLenum)
00239761 15891 (indices const-GLvoid-**)
bb894c9d
AW
15892 (primcount GLsizei)
15893 ->
15894 void))
3c9b6116
AW
15895 "Render multiple sets of primitives by specifying indices of array data
15896elements.
15897
15898MODE
15899 Specifies what kind of primitives to render. Symbolic constants
15900 `GL_POINTS', `GL_LINE_STRIP', `GL_LINE_LOOP', `GL_LINES',
15901 `GL_TRIANGLE_STRIP', `GL_TRIANGLE_FAN', `GL_TRIANGLES',
15902 `GL_QUAD_STRIP', `GL_QUADS', and `GL_POLYGON' are accepted.
15903
15904COUNT
15905 Points to an array of the elements counts.
15906
15907TYPE
15908 Specifies the type of the values in INDICES. Must be one of
15909 `GL_UNSIGNED_BYTE', `GL_UNSIGNED_SHORT', or `GL_UNSIGNED_INT'.
15910
15911INDICES
15912 Specifies a pointer to the location where the indices are stored.
15913
15914PRIMCOUNT
15915 Specifies the size of the COUNT array.
15916
15917`glMultiDrawElements' specifies multiple sets of geometric primitives
15918with very few subroutine calls. Instead of calling a GL function to pass
15919each individual vertex, normal, texture coordinate, edge flag, or color,
15920you can prespecify separate arrays of vertices, normals, and so on, and
15921use them to construct a sequence of primitives with a single call to
15922`glMultiDrawElements'.
15923
15924`glMultiDrawElements' is identical in operation to `glDrawElements'
15925except that PRIMCOUNT separate lists of elements are specified.
15926
15927Vertex attributes that are modified by `glMultiDrawElements' have an
15928unspecified value after `glMultiDrawElements' returns. For example, if
15929`GL_COLOR_ARRAY' is enabled, the value of the current color is undefined
15930after `glMultiDrawElements' executes. Attributes that aren't modified
15931maintain their previous values.
15932
15933`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
15934
15935`GL_INVALID_VALUE' is generated if PRIMCOUNT is negative.
15936
15937`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
15938bound to an enabled array or the element array and the buffer object's
15939data store is currently mapped.
15940
15941`GL_INVALID_OPERATION' is generated if `glMultiDrawElements' is executed
15942between the execution of `glBegin' and the corresponding `glEnd'.")
15943
25072f02 15944(define-gl-procedures
78aa45b9
DH
15945 ((glMultiTexCoord1s
15946 (target GLenum)
15947 (s GLshort)
15948 ->
15949 void)
15950 (glMultiTexCoord1i
bb894c9d
AW
15951 (target GLenum)
15952 (s GLint)
15953 ->
15954 void)
ca09631c 15955 (glMultiTexCoord1f
bb894c9d 15956 (target GLenum)
ca09631c 15957 (s GLfloat)
bb894c9d
AW
15958 ->
15959 void)
78aa45b9
DH
15960 (glMultiTexCoord1d
15961 (target GLenum)
15962 (s GLdouble)
15963 ->
15964 void)
15965 (glMultiTexCoord2s
15966 (target GLenum)
15967 (s GLshort)
15968 (t GLshort)
15969 ->
15970 void)
bb894c9d
AW
15971 (glMultiTexCoord2i
15972 (target GLenum)
15973 (s GLint)
15974 (t GLint)
15975 ->
15976 void)
ca09631c 15977 (glMultiTexCoord2f
bb894c9d 15978 (target GLenum)
ca09631c
AW
15979 (s GLfloat)
15980 (t GLfloat)
bb894c9d
AW
15981 ->
15982 void)
78aa45b9
DH
15983 (glMultiTexCoord2d
15984 (target GLenum)
15985 (s GLdouble)
15986 (t GLdouble)
15987 ->
15988 void)
15989 (glMultiTexCoord3s
15990 (target GLenum)
15991 (s GLshort)
15992 (t GLshort)
15993 (r GLshort)
15994 ->
15995 void)
bb894c9d
AW
15996 (glMultiTexCoord3i
15997 (target GLenum)
15998 (s GLint)
15999 (t GLint)
16000 (r GLint)
16001 ->
16002 void)
ca09631c 16003 (glMultiTexCoord3f
bb894c9d 16004 (target GLenum)
ca09631c
AW
16005 (s GLfloat)
16006 (t GLfloat)
16007 (r GLfloat)
bb894c9d
AW
16008 ->
16009 void)
78aa45b9
DH
16010 (glMultiTexCoord3d
16011 (target GLenum)
16012 (s GLdouble)
16013 (t GLdouble)
16014 (r GLdouble)
16015 ->
16016 void)
16017 (glMultiTexCoord4s
16018 (target GLenum)
16019 (s GLshort)
16020 (t GLshort)
16021 (r GLshort)
16022 (q GLshort)
16023 ->
16024 void)
bb894c9d
AW
16025 (glMultiTexCoord4i
16026 (target GLenum)
16027 (s GLint)
16028 (t GLint)
16029 (r GLint)
16030 (q GLint)
16031 ->
16032 void)
ca09631c 16033 (glMultiTexCoord4f
bb894c9d 16034 (target GLenum)
ca09631c
AW
16035 (s GLfloat)
16036 (t GLfloat)
16037 (r GLfloat)
16038 (q GLfloat)
bb894c9d 16039 ->
78aa45b9
DH
16040 void)
16041 (glMultiTexCoord4d
16042 (target GLenum)
16043 (s GLdouble)
16044 (t GLdouble)
16045 (r GLdouble)
16046 (q GLdouble)
16047 ->
16048 void)
16049 (glMultiTexCoord1sv
16050 (target GLenum)
16051 (v const-GLshort-*)
16052 ->
16053 void)
16054 (glMultiTexCoord1iv
16055 (target GLenum)
16056 (v const-GLint-*)
16057 ->
16058 void)
16059 (glMultiTexCoord1fv
16060 (target GLenum)
16061 (v const-GLfloat-*)
16062 ->
16063 void)
16064 (glMultiTexCoord1dv
16065 (target GLenum)
16066 (v const-GLdouble-*)
16067 ->
16068 void)
16069 (glMultiTexCoord2sv
16070 (target GLenum)
16071 (v const-GLshort-*)
16072 ->
16073 void)
16074 (glMultiTexCoord2iv
16075 (target GLenum)
16076 (v const-GLint-*)
16077 ->
16078 void)
16079 (glMultiTexCoord2fv
16080 (target GLenum)
16081 (v const-GLfloat-*)
16082 ->
16083 void)
16084 (glMultiTexCoord2dv
16085 (target GLenum)
16086 (v const-GLdouble-*)
16087 ->
16088 void)
16089 (glMultiTexCoord3sv
16090 (target GLenum)
16091 (v const-GLshort-*)
16092 ->
16093 void)
16094 (glMultiTexCoord3iv
16095 (target GLenum)
16096 (v const-GLint-*)
16097 ->
16098 void)
16099 (glMultiTexCoord3fv
16100 (target GLenum)
16101 (v const-GLfloat-*)
16102 ->
16103 void)
16104 (glMultiTexCoord3dv
16105 (target GLenum)
16106 (v const-GLdouble-*)
16107 ->
16108 void)
16109 (glMultiTexCoord4sv
16110 (target GLenum)
16111 (v const-GLshort-*)
16112 ->
16113 void)
16114 (glMultiTexCoord4iv
16115 (target GLenum)
16116 (v const-GLint-*)
16117 ->
16118 void)
16119 (glMultiTexCoord4fv
16120 (target GLenum)
16121 (v const-GLfloat-*)
16122 ->
16123 void)
16124 (glMultiTexCoord4dv
16125 (target GLenum)
16126 (v const-GLdouble-*)
16127 ->
bb894c9d 16128 void))
3c9b6116
AW
16129 "Set the current texture coordinates.
16130
16131TARGET
16132 Specifies the texture unit whose coordinates should be modified.
16133 The number of texture units is implementation dependent, but must
16134 be at least two. Symbolic constant must be one of `GL_TEXTURE' I ,
16135 where i ranges from 0 to `GL_MAX_TEXTURE_COORDS' - 1, which is an
16136 implementation-dependent value.
16137
16138S
16139 T
16140
16141 R
16142
16143 Q
16144
16145 Specify S, T, R, and Q texture coordinates for TARGET texture unit.
16146 Not all parameters are present in all forms of the command.
16147
16148`glMultiTexCoord' specifies texture coordinates in one, two, three, or
16149four dimensions. `glMultiTexCoord1' sets the current texture coordinates
16150to (S,001) ; a call to `glMultiTexCoord2' sets them to (S,T01) .
16151Similarly, `glMultiTexCoord3' specifies the texture coordinates as
16152(S,TR1) , and `glMultiTexCoord4' defines all four components explicitly
16153as (S,TRQ) .
16154
16155The current texture coordinates are part of the data that is associated
16156with each vertex and with the current raster position. Initially, the
16157values for (S,TRQ) are (0,001) .")
16158
25072f02 16159(define-gl-procedures
78aa45b9
DH
16160 ((glMultMatrixd (m const-GLdouble-*) -> void)
16161 (glMultMatrixf (m const-GLfloat-*) -> void))
3c9b6116
AW
16162 "Multiply the current matrix with the specified matrix.
16163
16164M
16165 Points to 16 consecutive values that are used as the elements of a
16166 4×4 column-major matrix.
16167
16168`glMultMatrix' multiplies the current matrix with the one specified
16169using M, and replaces the current matrix with the product.
16170
16171The current matrix is determined by the current matrix mode (see
16172`glMatrixMode'). It is either the projection matrix, modelview matrix,
16173or the texture matrix.
16174
16175`GL_INVALID_OPERATION' is generated if `glMultMatrix' is executed
16176between the execution of `glBegin' and the corresponding execution of
16177`glEnd'.")
16178
25072f02 16179(define-gl-procedures
78aa45b9
DH
16180 ((glMultTransposeMatrixd
16181 (m const-GLdouble-*)
16182 ->
16183 void)
16184 (glMultTransposeMatrixf
00239761
AW
16185 (m const-GLfloat-*)
16186 ->
16187 void))
3c9b6116
AW
16188 "Multiply the current matrix with the specified row-major ordered matrix.
16189
16190M
16191 Points to 16 consecutive values that are used as the elements of a
16192 4×4 row-major matrix.
16193
16194`glMultTransposeMatrix' multiplies the current matrix with the one
16195specified using M, and replaces the current matrix with the product.
16196
16197The current matrix is determined by the current matrix mode (see
16198`glMatrixMode'). It is either the projection matrix, modelview matrix,
16199or the texture matrix.
16200
16201`GL_INVALID_OPERATION' is generated if `glMultTransposeMatrix' is
16202executed between the execution of `glBegin' and the corresponding
16203execution of `glEnd'.")
16204
25072f02 16205(define-gl-procedures
bb894c9d
AW
16206 ((glNewList (list GLuint) (mode GLenum) -> void)
16207 (glEndList -> void))
3c9b6116
AW
16208 "Create or replace a display list.
16209
16210LIST
16211 Specifies the display-list name.
16212
16213MODE
16214 Specifies the compilation mode, which can be `GL_COMPILE' or
16215 `GL_COMPILE_AND_EXECUTE'.
16216
16217Display lists are groups of GL commands that have been stored for
16218subsequent execution. Display lists are created with `glNewList'. All
16219subsequent commands are placed in the display list, in the order issued,
16220until `glEndList' is called.
16221
16222`glNewList' has two arguments. The first argument, LIST, is a positive
16223integer that becomes the unique name for the display list. Names can be
16224created and reserved with `glGenLists' and tested for uniqueness with
16225`glIsList'. The second argument, MODE, is a symbolic constant that can
16226assume one of two values:
16227
16228`GL_COMPILE'
16229 Commands are merely compiled.
16230
16231`GL_COMPILE_AND_EXECUTE'
16232 Commands are executed as they are compiled into the display list.
16233
16234Certain commands are not compiled into the display list but are executed
16235immediately, regardless of the display-list mode. These commands are
16236`glAreTexturesResident', `glColorPointer', `glDeleteLists',
16237`glDeleteTextures', `glDisableClientState', `glEdgeFlagPointer',
16238`glEnableClientState', `glFeedbackBuffer', `glFinish', `glFlush',
16239`glGenLists', `glGenTextures', `glIndexPointer', `glInterleavedArrays',
16240`glIsEnabled', `glIsList', `glIsTexture', `glNormalPointer',
16241`glPopClientAttrib', `glPixelStore', `glPushClientAttrib',
16242`glReadPixels', `glRenderMode', `glSelectBuffer', `glTexCoordPointer',
16243`glVertexPointer', and all of the `glGet' commands.
16244
16245Similarly, `glTexImage1D', `glTexImage2D', and `glTexImage3D' are
16246executed immediately and not compiled into the display list when their
16247first argument is `GL_PROXY_TEXTURE_1D', `GL_PROXY_TEXTURE_1D', or
16248`GL_PROXY_TEXTURE_3D', respectively.
16249
16250When the `ARB_imaging' extension is supported, `glHistogram' executes
16251immediately when its argument is `GL_PROXY_HISTOGRAM'. Similarly,
16252`glColorTable' executes immediately when its first argument is
16253`GL_PROXY_COLOR_TABLE', `GL_PROXY_POST_CONVOLUTION_COLOR_TABLE', or
16254`GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE'.
16255
16256For OpenGL versions 1.3 and greater, or when the `ARB_multitexture'
16257extension is supported, `glClientActiveTexture' is not compiled into
16258display lists, but executed immediately.
16259
16260When `glEndList' is encountered, the display-list definition is
16261completed by associating the list with the unique name LIST (specified
16262in the `glNewList' command). If a display list with name LIST already
16263exists, it is replaced only when `glEndList' is called.
16264
16265`GL_INVALID_VALUE' is generated if LIST is 0.
16266
16267`GL_INVALID_ENUM' is generated if MODE is not an accepted value.
16268
16269`GL_INVALID_OPERATION' is generated if `glEndList' is called without a
16270preceding `glNewList', or if `glNewList' is called while a display list
16271is being defined.
16272
16273`GL_INVALID_OPERATION' is generated if `glNewList' or `glEndList' is
16274executed between the execution of `glBegin' and the corresponding
16275execution of `glEnd'.
16276
16277`GL_OUT_OF_MEMORY' is generated if there is insufficient memory to
16278compile the display list. If the GL version is 1.1 or greater, no change
16279is made to the previous contents of the display list, if any, and no
16280other change is made to the GL state. (It is as if no attempt had been
16281made to create the new display list.)")
16282
25072f02 16283(define-gl-procedures
bb894c9d
AW
16284 ((glNormalPointer
16285 (type GLenum)
16286 (stride GLsizei)
00239761 16287 (pointer const-GLvoid-*)
bb894c9d
AW
16288 ->
16289 void))
3c9b6116
AW
16290 "Define an array of normals.
16291
16292TYPE
16293 Specifies the data type of each coordinate in the array. Symbolic
16294 constants `GL_BYTE', `GL_SHORT', `GL_INT', `GL_FLOAT', and
16295 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
16296
16297STRIDE
16298 Specifies the byte offset between consecutive normals. If STRIDE is
16299 0, the normals are understood to be tightly packed in the array.
16300 The initial value is 0.
16301
16302POINTER
16303 Specifies a pointer to the first coordinate of the first normal in
16304 the array. The initial value is 0.
16305
16306`glNormalPointer' specifies the location and data format of an array of
16307normals to use when rendering. TYPE specifies the data type of each
16308normal coordinate, and STRIDE specifies the byte stride from one normal
16309to the next, allowing vertices and attributes to be packed into a single
16310array or stored in separate arrays. (Single-array storage may be more
16311efficient on some implementations; see `glInterleavedArrays'.)
16312
16313If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
16314target (see `glBindBuffer') while a normal array is specified, POINTER
16315is treated as a byte offset into the buffer object's data store. Also,
16316the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as normal
16317vertex array client-side state (`GL_NORMAL_ARRAY_BUFFER_BINDING').
16318
16319When a normal array is specified, TYPE, STRIDE, and POINTER are saved as
16320client-side state, in addition to the current vertex array buffer object
16321binding.
16322
16323To enable and disable the normal array, call `glEnableClientState' and
16324`glDisableClientState' with the argument `GL_NORMAL_ARRAY'. If enabled,
16325the normal array is used when `glDrawArrays', `glMultiDrawArrays',
16326`glDrawElements', `glMultiDrawElements', `glDrawRangeElements', or
16327`glArrayElement' is called.
16328
16329`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
16330
16331`GL_INVALID_VALUE' is generated if STRIDE is negative.")
16332
25072f02 16333(define-gl-procedures
78aa45b9
DH
16334 ((glNormal3b
16335 (nx GLbyte)
16336 (ny GLbyte)
16337 (nz GLbyte)
16338 ->
16339 void)
16340 (glNormal3d
16341 (nx GLdouble)
16342 (ny GLdouble)
16343 (nz GLdouble)
16344 ->
16345 void)
16346 (glNormal3f
ca09631c
AW
16347 (nx GLfloat)
16348 (ny GLfloat)
16349 (nz GLfloat)
bb894c9d
AW
16350 ->
16351 void)
16352 (glNormal3i
16353 (nx GLint)
16354 (ny GLint)
16355 (nz GLint)
16356 ->
78aa45b9
DH
16357 void)
16358 (glNormal3s
16359 (nx GLshort)
16360 (ny GLshort)
16361 (nz GLshort)
16362 ->
16363 void)
16364 (glNormal3bv (v const-GLbyte-*) -> void)
16365 (glNormal3dv (v const-GLdouble-*) -> void)
16366 (glNormal3fv (v const-GLfloat-*) -> void)
16367 (glNormal3iv (v const-GLint-*) -> void)
16368 (glNormal3sv (v const-GLshort-*) -> void))
3c9b6116
AW
16369 "Set the current normal vector.
16370
16371NX
16372 NY
16373
16374 NZ
16375
16376 Specify the X , Y , and Z coordinates of the new current normal.
16377 The initial value of the current normal is the unit vector, (0, 0,
16378 1).
16379
16380
16381
16382The current normal is set to the given coordinates whenever `glNormal'
16383is issued. Byte, short, or integer arguments are converted to
16384floating-point format with a linear mapping that maps the most positive
16385representable integer value to 1.0 and the most negative representable
16386integer value to -1.0 .
16387
16388Normals specified with `glNormal' need not have unit length. If
16389`GL_NORMALIZE' is enabled, then normals of any length specified with
16390`glNormal' are normalized after transformation. If `GL_RESCALE_NORMAL'
16391is enabled, normals are scaled by a scaling factor derived from the
16392modelview matrix. `GL_RESCALE_NORMAL' requires that the originally
16393specified normals were of unit length, and that the modelview matrix
16394contain only uniform scales for proper results. To enable and disable
16395normalization, call `glEnable' and `glDisable' with either
16396`GL_NORMALIZE' or `GL_RESCALE_NORMAL'. Normalization is initially
16397disabled.")
16398
25072f02 16399(define-gl-procedures
bb894c9d
AW
16400 ((glOrtho
16401 (left GLdouble)
16402 (right GLdouble)
16403 (bottom GLdouble)
16404 (top GLdouble)
16405 (nearVal GLdouble)
16406 (farVal GLdouble)
16407 ->
16408 void))
3c9b6116
AW
16409 "Multiply the current matrix with an orthographic matrix.
16410
16411LEFT
16412 RIGHT
16413
16414 Specify the coordinates for the left and right vertical clipping
16415 planes.
16416
16417BOTTOM
16418 TOP
16419
16420 Specify the coordinates for the bottom and top horizontal clipping
16421 planes.
16422
16423NEARVAL
16424 FARVAL
16425
16426 Specify the distances to the nearer and farther depth clipping
16427 planes. These values are negative if the plane is to be behind the
16428 viewer.
16429
16430`glOrtho' describes a transformation that produces a parallel
16431projection. The current matrix (see `glMatrixMode') is multiplied by
16432this matrix and the result replaces the current matrix, as if
16433`glMultMatrix' were called with the following matrix as its argument:
16434
16435((2/RIGHT-LEFT,, 0 0 T_X,), (0 2/TOP-BOTTOM,, 0 T_Y,), (0 0
16436-2/FARVAL-NEARVAL,, T_Z,), (0 0 0 1),)
16437
16438where T_X=-RIGHT+LEFT,/RIGHT-LEFT,, T_Y=-TOP+BOTTOM,/TOP-BOTTOM,,
16439T_Z=-FARVAL+NEARVAL,/FARVAL-NEARVAL,,
16440
16441Typically, the matrix mode is `GL_PROJECTION', and (LEFT,BOTTOM-NEARVAL)
16442and (RIGHT,TOP-NEARVAL) specify the points on the near clipping plane
16443that are mapped to the lower left and upper right corners of the window,
16444respectively, assuming that the eye is located at (0, 0, 0). -FARVAL
16445specifies the location of the far clipping plane. Both NEARVAL and
16446FARVAL can be either positive or negative.
16447
16448Use `glPushMatrix' and `glPopMatrix' to save and restore the current
16449matrix stack.
16450
16451`GL_INVALID_VALUE' is generated if LEFT = RIGHT, or BOTTOM = TOP, or
16452NEAR = FAR.
16453
16454`GL_INVALID_OPERATION' is generated if `glOrtho' is executed between the
16455execution of `glBegin' and the corresponding execution of `glEnd'.")
16456
25072f02 16457(define-gl-procedures
bb894c9d 16458 ((glPassThrough (token GLfloat) -> void))
3c9b6116
AW
16459 "Place a marker in the feedback buffer.
16460
16461TOKEN
16462 Specifies a marker value to be placed in the feedback buffer
16463 following a `GL_PASS_THROUGH_TOKEN'.
16464
16465
16466
16467Feedback is a GL render mode. The mode is selected by calling
16468`glRenderMode' with `GL_FEEDBACK'. When the GL is in feedback mode, no
16469pixels are produced by rasterization. Instead, information about
16470primitives that would have been rasterized is fed back to the
16471application using the GL. See the `glFeedbackBuffer' reference page for
16472a description of the feedback buffer and the values in it.
16473
16474`glPassThrough' inserts a user-defined marker in the feedback buffer
16475when it is executed in feedback mode. TOKEN is returned as if it were a
16476primitive; it is indicated with its own unique identifying value:
16477`GL_PASS_THROUGH_TOKEN'. The order of `glPassThrough' commands with
16478respect to the specification of graphics primitives is maintained.
16479
16480`GL_INVALID_OPERATION' is generated if `glPassThrough' is executed
16481between the execution of `glBegin' and the corresponding execution of
16482`glEnd'.")
16483
b002944d
AW
16484(define-gl-procedures
16485 ((glPixelMapfv
16486 (map GLenum)
16487 (mapsize GLsizei)
16488 (values const-GLfloat-*)
16489 ->
16490 void)
16491 (glPixelMapuiv
16492 (map GLenum)
16493 (mapsize GLsizei)
16494 (values const-GLuint-*)
16495 ->
78aa45b9
DH
16496 void)
16497 (glPixelMapusv
16498 (map GLenum)
16499 (mapsize GLsizei)
16500 (values const-GLushort-*)
16501 ->
b002944d
AW
16502 void))
16503 "Set up pixel transfer maps.
16504
16505MAP
16506 Specifies a symbolic map name. Must be one of the following:
16507 `GL_PIXEL_MAP_I_TO_I', `GL_PIXEL_MAP_S_TO_S',
16508 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
16509 `GL_PIXEL_MAP_I_TO_B', `GL_PIXEL_MAP_I_TO_A',
16510 `GL_PIXEL_MAP_R_TO_R', `GL_PIXEL_MAP_G_TO_G',
16511 `GL_PIXEL_MAP_B_TO_B', or `GL_PIXEL_MAP_A_TO_A'.
16512
16513MAPSIZE
16514 Specifies the size of the map being defined.
16515
16516VALUES
16517 Specifies an array of MAPSIZE values.
16518
16519`glPixelMap' sets up translation tables, or MAPS, used by
16520`glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
16521`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
16522`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
16523`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
16524`glTexSubImage3D'. Additionally, if the `ARB_imaging' subset is
16525supported, the routines `glColorTable', `glColorSubTable',
16526`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
16527`glMinmax', and `glSeparableFilter2D'. Use of these maps is described
16528completely in the `glPixelTransfer' reference page, and partly in the
16529reference pages for the pixel and texture image commands. Only the
16530specification of the maps is described in this reference page.
16531
16532MAP is a symbolic map name, indicating one of ten maps to set. MAPSIZE
16533specifies the number of entries in the map, and VALUES is a pointer to
16534an array of MAPSIZE map values.
16535
16536If a non-zero named buffer object is bound to the
16537`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a pixel
16538transfer map is specified, VALUES is treated as a byte offset into the
16539buffer object's data store.
16540
16541The ten maps are as follows:
16542
16543`GL_PIXEL_MAP_I_TO_I'
16544 Maps color indices to color indices.
16545
16546`GL_PIXEL_MAP_S_TO_S'
16547 Maps stencil indices to stencil indices.
16548
16549`GL_PIXEL_MAP_I_TO_R'
16550 Maps color indices to red components.
16551
16552`GL_PIXEL_MAP_I_TO_G'
16553 Maps color indices to green components.
16554
16555`GL_PIXEL_MAP_I_TO_B'
16556 Maps color indices to blue components.
16557
16558`GL_PIXEL_MAP_I_TO_A'
16559 Maps color indices to alpha components.
16560
16561`GL_PIXEL_MAP_R_TO_R'
16562 Maps red components to red components.
16563
16564`GL_PIXEL_MAP_G_TO_G'
16565 Maps green components to green components.
16566
16567`GL_PIXEL_MAP_B_TO_B'
16568 Maps blue components to blue components.
16569
16570`GL_PIXEL_MAP_A_TO_A'
16571 Maps alpha components to alpha components.
16572
16573The entries in a map can be specified as single-precision floating-point
16574numbers, unsigned short integers, or unsigned int integers. Maps that
16575store color component values (all but `GL_PIXEL_MAP_I_TO_I' and
16576`GL_PIXEL_MAP_S_TO_S') retain their values in floating-point format,
16577with unspecified mantissa and exponent sizes. Floating-point values
16578specified by `glPixelMapfv' are converted directly to the internal
16579floating-point format of these maps, then clamped to the range [0,1].
16580Unsigned integer values specified by `glPixelMapusv' and `glPixelMapuiv'
16581are converted linearly such that the largest representable integer maps
16582to 1.0, and 0 maps to 0.0.
16583
16584Maps that store indices, `GL_PIXEL_MAP_I_TO_I' and
16585`GL_PIXEL_MAP_S_TO_S', retain their values in fixed-point format, with
16586an unspecified number of bits to the right of the binary point.
16587Floating-point values specified by `glPixelMapfv' are converted directly
16588to the internal fixed-point format of these maps. Unsigned integer
16589values specified by `glPixelMapusv' and `glPixelMapuiv' specify integer
16590values, with all 0's to the right of the binary point.
16591
16592The following table shows the initial sizes and values for each of the
16593maps. Maps that are indexed by either color or stencil indices must have
16594MAPSIZE = 2^N for some N or the results are undefined. The maximum
16595allowable size for each map depends on the implementation and can be
16596determined by calling `glGet' with argument `GL_MAX_PIXEL_MAP_TABLE'.
16597The single maximum applies to all maps; it is at least 32.
16598
16599*MAP*
16600 *Lookup Index*, *Lookup Value*, *Initial Size*, *Initial Value*
16601
16602`GL_PIXEL_MAP_I_TO_I'
16603 color index , color index , 1 , 0
16604
16605`GL_PIXEL_MAP_S_TO_S'
16606 stencil index , stencil index , 1 , 0
16607
16608`GL_PIXEL_MAP_I_TO_R'
16609 color index , R , 1 , 0
16610
16611`GL_PIXEL_MAP_I_TO_G'
16612 color index , G , 1 , 0
16613
16614`GL_PIXEL_MAP_I_TO_B'
16615 color index , B , 1 , 0
16616
16617`GL_PIXEL_MAP_I_TO_A'
16618 color index , A , 1 , 0
16619
16620`GL_PIXEL_MAP_R_TO_R'
16621 R , R , 1 , 0
16622
16623`GL_PIXEL_MAP_G_TO_G'
16624 G , G , 1 , 0
16625
16626`GL_PIXEL_MAP_B_TO_B'
16627 B , B , 1 , 0
16628
16629`GL_PIXEL_MAP_A_TO_A'
16630 A , A , 1 , 0
16631
16632`GL_INVALID_ENUM' is generated if MAP is not an accepted value.
16633
16634`GL_INVALID_VALUE' is generated if MAPSIZE is less than one or larger
16635than `GL_MAX_PIXEL_MAP_TABLE'.
16636
16637`GL_INVALID_VALUE' is generated if MAP is `GL_PIXEL_MAP_I_TO_I',
16638`GL_PIXEL_MAP_S_TO_S', `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
16639`GL_PIXEL_MAP_I_TO_B', or `GL_PIXEL_MAP_I_TO_A', and MAPSIZE is not a
16640power of two.
16641
16642`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16643bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
16644data store is currently mapped.
16645
16646`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
16647bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
16648unpacked from the buffer object such that the memory reads required
16649would exceed the data store size.
16650
16651`GL_INVALID_OPERATION' is generated by `glPixelMapfv' if a non-zero
16652buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16653VALUES is not evenly divisible into the number of bytes needed to store
16654in memory a GLfloat datum.
16655
16656`GL_INVALID_OPERATION' is generated by `glPixelMapuiv' if a non-zero
16657buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16658VALUES is not evenly divisible into the number of bytes needed to store
16659in memory a GLuint datum.
16660
16661`GL_INVALID_OPERATION' is generated by `glPixelMapusv' if a non-zero
16662buffer object name is bound to the `GL_PIXEL_UNPACK_BUFFER' target and
16663VALUES is not evenly divisible into the number of bytes needed to store
16664in memory a GLushort datum.
16665
16666`GL_INVALID_OPERATION' is generated if `glPixelMap' is executed between
16667the execution of `glBegin' and the corresponding execution of `glEnd'.")
16668
25072f02 16669(define-gl-procedures
bb894c9d
AW
16670 ((glPixelStoref
16671 (pname GLenum)
16672 (param GLfloat)
16673 ->
16674 void)
16675 (glPixelStorei
16676 (pname GLenum)
16677 (param GLint)
16678 ->
16679 void))
3c9b6116
AW
16680 "Set pixel storage modes.
16681
16682PNAME
16683 Specifies the symbolic name of the parameter to be set. Six values
16684 affect the packing of pixel data into memory: `GL_PACK_SWAP_BYTES',
16685 `GL_PACK_LSB_FIRST', `GL_PACK_ROW_LENGTH', `GL_PACK_IMAGE_HEIGHT',
16686 `GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', `GL_PACK_SKIP_IMAGES',
16687 and `GL_PACK_ALIGNMENT'. Six more affect the unpacking of pixel
16688 data FROM memory: `GL_UNPACK_SWAP_BYTES', `GL_UNPACK_LSB_FIRST',
16689 `GL_UNPACK_ROW_LENGTH', `GL_UNPACK_IMAGE_HEIGHT',
16690 `GL_UNPACK_SKIP_PIXELS', `GL_UNPACK_SKIP_ROWS',
16691 `GL_UNPACK_SKIP_IMAGES', and `GL_UNPACK_ALIGNMENT'.
16692
16693PARAM
16694 Specifies the value that PNAME is set to.
16695
16696`glPixelStore' sets pixel storage modes that affect the operation of
16697subsequent `glDrawPixels' and `glReadPixels' as well as the unpacking of
16698polygon stipple patterns (see `glPolygonStipple'), bitmaps (see
16699`glBitmap'), texture patterns (see `glTexImage1D', `glTexImage2D',
16700`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D',
16701`glTexSubImage3D'). Additionally, if the `ARB_imaging' extension is
16702supported, pixel storage modes affect convolution filters (see
16703`glConvolutionFilter1D', `glConvolutionFilter2D', and
16704`glSeparableFilter2D', color table (see `glColorTable', and
16705`glColorSubTable', and unpacking histogram (See `glHistogram'), and
16706minmax (See `glMinmax') data.
16707
16708PNAME is a symbolic constant indicating the parameter to be set, and
16709PARAM is the new value. Six of the twelve storage parameters affect how
16710pixel data is returned to client memory. They are as follows:
16711
16712`GL_PACK_SWAP_BYTES'
16713 If true, byte ordering for multibyte color components, depth
16714 components, color indices, or stencil indices is reversed. That is,
16715 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16716 it is stored in memory as B_3 , B_2 , B_1 , B_0 if
16717 `GL_PACK_SWAP_BYTES' is true. `GL_PACK_SWAP_BYTES' has no effect on
16718 the memory order of components within a pixel, only on the order of
16719 bytes within components or indices. For example, the three
16720 components of a `GL_RGB' format pixel are always stored with red
16721 first, green second, and blue third, regardless of the value of
16722 `GL_PACK_SWAP_BYTES'.
16723
16724`GL_PACK_LSB_FIRST'
16725 If true, bits are ordered within a byte from least significant to
16726 most significant; otherwise, the first bit in each byte is the most
16727 significant one. This parameter is significant for bitmap data
16728 only.
16729
16730`GL_PACK_ROW_LENGTH'
16731 If greater than 0, `GL_PACK_ROW_LENGTH' defines the number of
16732 pixels in a row. If the first pixel of a row is placed at location
16733 P in memory, then the location of the first pixel of the next row
16734 is obtained by skipping
16735
16736 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16737
16738 components or indices, where N is the number of components or
16739 indices in a pixel, L is the number of pixels in a row
16740 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16741 to the pixel routine otherwise), A is the value of
16742 `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16743 component (if A<S , then it is as if A=S ). In the case of 1-bit
16744 values, the location of the next row is obtained by skipping
16745
16746 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16747
16748 components or indices.
16749
16750 The word COMPONENT in this description refers to the nonindex
16751 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16752 for example, has three components per pixel: first red, then green,
16753 and finally blue.
16754
16755`GL_PACK_IMAGE_HEIGHT'
16756 If greater than 0, `GL_PACK_IMAGE_HEIGHT' defines the number of
16757 pixels in an image three-dimensional texture volume, where
16758 ``image'' is defined by all pixels sharing the same third dimension
16759 index. If the first pixel of a row is placed at location P in
16760 memory, then the location of the first pixel of the next row is
16761 obtained by skipping
16762
16763 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16764
16765 components or indices, where N is the number of components or
16766 indices in a pixel, L is the number of pixels in a row
16767 (`GL_PACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16768 to `glTexImage3D' otherwise), H is the number of rows in a pixel
16769 image (`GL_PACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16770 argument to the `glTexImage3D' routine otherwise), A is the value
16771 of `GL_PACK_ALIGNMENT', and S is the size, in bytes, of a single
16772 component (if A<S , then it is as if A=S ).
16773
16774 The word COMPONENT in this description refers to the nonindex
16775 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16776 for example, has three components per pixel: first red, then green,
16777 and finally blue.
16778
16779`GL_PACK_SKIP_PIXELS', `GL_PACK_SKIP_ROWS', and `GL_PACK_SKIP_IMAGES'
16780 These values are provided as a convenience to the programmer; they
16781 provide no functionality that cannot be duplicated simply by
16782 incrementing the pointer passed to `glReadPixels'. Setting
16783 `GL_PACK_SKIP_PIXELS' to I is equivalent to incrementing the
16784 pointer by I\u2062N components or indices, where N is the number of
16785 components or indices in each pixel. Setting `GL_PACK_SKIP_ROWS' to
16786 J is equivalent to incrementing the pointer by J\u2062M components or
16787 indices, where M is the number of components or indices per row, as
16788 just computed in the `GL_PACK_ROW_LENGTH' section. Setting
16789 `GL_PACK_SKIP_IMAGES' to K is equivalent to incrementing the
16790 pointer by K\u2062P , where P is the number of components or indices per
16791 image, as computed in the `GL_PACK_IMAGE_HEIGHT' section.
16792
16793`GL_PACK_ALIGNMENT'
16794 Specifies the alignment requirements for the start of each pixel
16795 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16796 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16797 start on double-word boundaries).
16798
16799The other six of the twelve storage parameters affect how pixel data is
16800read from client memory. These values are significant for
16801`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
16802`glTexSubImage1D', `glTexSubImage2D', `glTexSubImage3D', `glBitmap', and
16803`glPolygonStipple'.
16804
16805Additionally, if the `ARB_imaging' extension is supported,
16806`glColorTable', `glColorSubTable', `glConvolutionFilter1D',
16807`glConvolutionFilter2D', and `glSeparableFilter2D'. They are as follows:
16808
16809`GL_UNPACK_SWAP_BYTES'
16810 If true, byte ordering for multibyte color components, depth
16811 components, color indices, or stencil indices is reversed. That is,
16812 if a four-byte component consists of bytes B_0 , B_1 , B_2 , B_3 ,
16813 it is taken from memory as B_3 , B_2 , B_1 , B_0 if
16814 `GL_UNPACK_SWAP_BYTES' is true. `GL_UNPACK_SWAP_BYTES' has no
16815 effect on the memory order of components within a pixel, only on
16816 the order of bytes within components or indices. For example, the
16817 three components of a `GL_RGB' format pixel are always stored with
16818 red first, green second, and blue third, regardless of the value of
16819 `GL_UNPACK_SWAP_BYTES'.
16820
16821`GL_UNPACK_LSB_FIRST'
16822 If true, bits are ordered within a byte from least significant to
16823 most significant; otherwise, the first bit in each byte is the most
16824 significant one. This is relevant only for bitmap data.
16825
16826`GL_UNPACK_ROW_LENGTH'
16827 If greater than 0, `GL_UNPACK_ROW_LENGTH' defines the number of
16828 pixels in a row. If the first pixel of a row is placed at location
16829 P in memory, then the location of the first pixel of the next row
16830 is obtained by skipping
16831
16832 K={(N\u2062L), (A/S,\u2062⌈S\u2062N\u2062L,/A,⌉)\u2062(S>=A), (S<A),
16833
16834 components or indices, where N is the number of components or
16835 indices in a pixel, L is the number of pixels in a row
16836 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16837 to the pixel routine otherwise), A is the value of
16838 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16839 component (if A<S , then it is as if A=S ). In the case of 1-bit
16840 values, the location of the next row is obtained by skipping
16841
16842 K=8\u2062A\u2062⌈N\u2062L,/8\u2062A,,⌉
16843
16844 components or indices.
16845
16846 The word COMPONENT in this description refers to the nonindex
16847 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16848 for example, has three components per pixel: first red, then green,
16849 and finally blue.
16850
16851`GL_UNPACK_IMAGE_HEIGHT'
16852 If greater than 0, `GL_UNPACK_IMAGE_HEIGHT' defines the number of
16853 pixels in an image of a three-dimensional texture volume. Where
16854 ``image'' is defined by all pixel sharing the same third dimension
16855 index. If the first pixel of a row is placed at location P in
16856 memory, then the location of the first pixel of the next row is
16857 obtained by skipping
16858
16859 K={(N\u2062L\u2062H), (A/S,\u2062⌈S\u2062N\u2062L\u2062H,/A,⌉)\u2062(S>=A), (S<A),
16860
16861 components or indices, where N is the number of components or
16862 indices in a pixel, L is the number of pixels in a row
16863 (`GL_UNPACK_ROW_LENGTH' if it is greater than 0, the WIDTH argument
16864 to `glTexImage3D' otherwise), H is the number of rows in an image
16865 (`GL_UNPACK_IMAGE_HEIGHT' if it is greater than 0, the HEIGHT
16866 argument to `glTexImage3D' otherwise), A is the value of
16867 `GL_UNPACK_ALIGNMENT', and S is the size, in bytes, of a single
16868 component (if A<S , then it is as if A=S ).
16869
16870 The word COMPONENT in this description refers to the nonindex
16871 values red, green, blue, alpha, and depth. Storage format `GL_RGB',
16872 for example, has three components per pixel: first red, then green,
16873 and finally blue.
16874
16875`GL_UNPACK_SKIP_PIXELS' and `GL_UNPACK_SKIP_ROWS'
16876 These values are provided as a convenience to the programmer; they
16877 provide no functionality that cannot be duplicated by incrementing
16878 the pointer passed to `glDrawPixels', `glTexImage1D',
16879 `glTexImage2D', `glTexSubImage1D', `glTexSubImage2D', `glBitmap',
16880 or `glPolygonStipple'. Setting `GL_UNPACK_SKIP_PIXELS' to I is
16881 equivalent to incrementing the pointer by I\u2062N components or
16882 indices, where N is the number of components or indices in each
16883 pixel. Setting `GL_UNPACK_SKIP_ROWS' to J is equivalent to
16884 incrementing the pointer by J\u2062K components or indices, where K is
16885 the number of components or indices per row, as just computed in
16886 the `GL_UNPACK_ROW_LENGTH' section.
16887
16888`GL_UNPACK_ALIGNMENT'
16889 Specifies the alignment requirements for the start of each pixel
16890 row in memory. The allowable values are 1 (byte-alignment), 2 (rows
16891 aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows
16892 start on double-word boundaries).
16893
16894The following table gives the type, initial value, and range of valid
16895values for each storage parameter that can be set with `glPixelStore'.
16896
16897
16898
16899*PNAME*
16900 *Type*, *Initial Value*, *Valid Range*
16901
16902`GL_PACK_SWAP_BYTES'
16903 boolean , false , true or false
16904
16905`GL_PACK_LSB_FIRST'
16906 boolean , false , true or false
16907
16908`GL_PACK_ROW_LENGTH'
16909 integer , 0 , [0,∞)
16910
16911`GL_PACK_IMAGE_HEIGHT'
16912 integer , 0 , [0,∞)
16913
16914`GL_PACK_SKIP_ROWS'
16915 integer , 0 , [0,∞)
16916
16917`GL_PACK_SKIP_PIXELS'
16918 integer , 0 , [0,∞)
16919
16920`GL_PACK_SKIP_IMAGES'
16921 integer , 0 , [0,∞)
16922
16923`GL_PACK_ALIGNMENT'
16924 integer , 4 , 1, 2, 4, or 8
16925
16926`GL_UNPACK_SWAP_BYTES'
16927 boolean , false , true or false
16928
16929`GL_UNPACK_LSB_FIRST'
16930 boolean , false , true or false
16931
16932`GL_UNPACK_ROW_LENGTH'
16933 integer , 0 , [0,∞)
16934
16935`GL_UNPACK_IMAGE_HEIGHT'
16936 integer , 0 , [0,∞)
16937
16938`GL_UNPACK_SKIP_ROWS'
16939 integer , 0 , [0,∞)
16940
16941`GL_UNPACK_SKIP_PIXELS'
16942 integer , 0 , [0,∞)
16943
16944`GL_UNPACK_SKIP_IMAGES'
16945 integer , 0 , [0,∞)
16946
16947`GL_UNPACK_ALIGNMENT'
16948 integer , 4 , 1, 2, 4, or 8
16949
16950`glPixelStoref' can be used to set any pixel store parameter. If the
16951parameter type is boolean, then if PARAM is 0, the parameter is false;
16952otherwise it is set to true. If PNAME is a integer type parameter, PARAM
16953is rounded to the nearest integer.
16954
16955Likewise, `glPixelStorei' can also be used to set any of the pixel store
16956parameters. Boolean parameters are set to false if PARAM is 0 and true
16957otherwise.
16958
16959`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
16960
16961`GL_INVALID_VALUE' is generated if a negative row length, pixel skip, or
16962row skip value is specified, or if alignment is specified as other than
169631, 2, 4, or 8.
16964
16965`GL_INVALID_OPERATION' is generated if `glPixelStore' is executed
16966between the execution of `glBegin' and the corresponding execution of
16967`glEnd'.")
16968
25072f02 16969(define-gl-procedures
bb894c9d
AW
16970 ((glPixelTransferf
16971 (pname GLenum)
16972 (param GLfloat)
16973 ->
16974 void)
16975 (glPixelTransferi
16976 (pname GLenum)
16977 (param GLint)
16978 ->
16979 void))
3c9b6116
AW
16980 "Set pixel transfer modes.
16981
16982PNAME
16983 Specifies the symbolic name of the pixel transfer parameter to be
16984 set. Must be one of the following: `GL_MAP_COLOR',
16985 `GL_MAP_STENCIL', `GL_INDEX_SHIFT', `GL_INDEX_OFFSET',
16986 `GL_RED_SCALE', `GL_RED_BIAS', `GL_GREEN_SCALE', `GL_GREEN_BIAS',
16987 `GL_BLUE_SCALE', `GL_BLUE_BIAS', `GL_ALPHA_SCALE', `GL_ALPHA_BIAS',
16988 `GL_DEPTH_SCALE', or `GL_DEPTH_BIAS'.
16989
16990 Additionally, if the `ARB_imaging' extension is supported, the
16991 following symbolic names are accepted:
16992 `GL_POST_COLOR_MATRIX_RED_SCALE',
16993 `GL_POST_COLOR_MATRIX_GREEN_SCALE',
16994 `GL_POST_COLOR_MATRIX_BLUE_SCALE',
16995 `GL_POST_COLOR_MATRIX_ALPHA_SCALE',
16996 `GL_POST_COLOR_MATRIX_RED_BIAS', `GL_POST_COLOR_MATRIX_GREEN_BIAS',
16997 `GL_POST_COLOR_MATRIX_BLUE_BIAS',
16998 `GL_POST_COLOR_MATRIX_ALPHA_BIAS', `GL_POST_CONVOLUTION_RED_SCALE',
16999 `GL_POST_CONVOLUTION_GREEN_SCALE',
17000 `GL_POST_CONVOLUTION_BLUE_SCALE',
17001 `GL_POST_CONVOLUTION_ALPHA_SCALE', `GL_POST_CONVOLUTION_RED_BIAS',
17002 `GL_POST_CONVOLUTION_GREEN_BIAS', `GL_POST_CONVOLUTION_BLUE_BIAS',
17003 and `GL_POST_CONVOLUTION_ALPHA_BIAS'.
17004
17005PARAM
17006 Specifies the value that PNAME is set to.
17007
17008`glPixelTransfer' sets pixel transfer modes that affect the operation of
17009subsequent `glCopyPixels', `glCopyTexImage1D', `glCopyTexImage2D',
17010`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D',
17011`glDrawPixels', `glReadPixels', `glTexImage1D', `glTexImage2D',
17012`glTexImage3D', `glTexSubImage1D', `glTexSubImage2D', and
17013`glTexSubImage3D' commands. Additionally, if the `ARB_imaging' subset is
17014supported, the routines `glColorTable', `glColorSubTable',
17015`glConvolutionFilter1D', `glConvolutionFilter2D', `glHistogram',
17016`glMinmax', and `glSeparableFilter2D' are also affected. The algorithms
17017that are specified by pixel transfer modes operate on pixels after they
17018are read from the frame buffer (`glCopyPixels'`glCopyTexImage1D',
17019`glCopyTexImage2D', `glCopyTexSubImage1D', `glCopyTexSubImage2D',
17020`glCopyTexSubImage3D', and `glReadPixels'), or unpacked from client
17021memory (`glDrawPixels', `glTexImage1D', `glTexImage2D', `glTexImage3D',
17022`glTexSubImage1D', `glTexSubImage2D', and `glTexSubImage3D'). Pixel
17023transfer operations happen in the same order, and in the same manner,
17024regardless of the command that resulted in the pixel operation. Pixel
17025storage modes (see `glPixelStore') control the unpacking of pixels being
17026read from client memory and the packing of pixels being written back
17027into client memory.
17028
17029Pixel transfer operations handle four fundamental pixel types: COLOR,
17030COLOR INDEX, DEPTH, and STENCIL. COLOR pixels consist of four
17031floating-point values with unspecified mantissa and exponent sizes,
17032scaled such that 0 represents zero intensity and 1 represents full
17033intensity. COLOR INDICES comprise a single fixed-point value, with
17034unspecified precision to the right of the binary point. DEPTH pixels
17035comprise a single floating-point value, with unspecified mantissa and
17036exponent sizes, scaled such that 0.0 represents the minimum depth buffer
17037value, and 1.0 represents the maximum depth buffer value. Finally,
17038STENCIL pixels comprise a single fixed-point value, with unspecified
17039precision to the right of the binary point.
17040
17041The pixel transfer operations performed on the four basic pixel types
17042are as follows:
17043
17044COLOR
17045 Each of the four color components is multiplied by a scale factor,
17046 then added to a bias factor. That is, the red component is
17047 multiplied by `GL_RED_SCALE', then added to `GL_RED_BIAS'; the
17048 green component is multiplied by `GL_GREEN_SCALE', then added to
17049 `GL_GREEN_BIAS'; the blue component is multiplied by
17050 `GL_BLUE_SCALE', then added to `GL_BLUE_BIAS'; and the alpha
17051 component is multiplied by `GL_ALPHA_SCALE', then added to
17052 `GL_ALPHA_BIAS'. After all four color components are scaled and
17053 biased, each is clamped to the range [0,1] . All color, scale, and
17054 bias values are specified with `glPixelTransfer'.
17055
17056 If `GL_MAP_COLOR' is true, each color component is scaled by the
17057 size of the corresponding color-to-color map, then replaced by the
17058 contents of that map indexed by the scaled component. That is, the
17059 red component is scaled by `GL_PIXEL_MAP_R_TO_R_SIZE', then
17060 replaced by the contents of `GL_PIXEL_MAP_R_TO_R' indexed by
17061 itself. The green component is scaled by
17062 `GL_PIXEL_MAP_G_TO_G_SIZE', then replaced by the contents of
17063 `GL_PIXEL_MAP_G_TO_G' indexed by itself. The blue component is
17064 scaled by `GL_PIXEL_MAP_B_TO_B_SIZE', then replaced by the contents
17065 of `GL_PIXEL_MAP_B_TO_B' indexed by itself. And the alpha component
17066 is scaled by `GL_PIXEL_MAP_A_TO_A_SIZE', then replaced by the
17067 contents of `GL_PIXEL_MAP_A_TO_A' indexed by itself. All components
17068 taken from the maps are then clamped to the range [0,1] .
17069 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
17070 the various maps are specified with `glPixelMap'.
17071
17072 If the `ARB_imaging' extension is supported, each of the four color
17073 components may be scaled and biased after transformation by the
17074 color matrix. That is, the red component is multiplied by
17075 `GL_POST_COLOR_MATRIX_RED_SCALE', then added to
17076 `GL_POST_COLOR_MATRIX_RED_BIAS'; the green component is multiplied
17077 by `GL_POST_COLOR_MATRIX_GREEN_SCALE', then added to
17078 `GL_POST_COLOR_MATRIX_GREEN_BIAS'; the blue component is multiplied
17079 by `GL_POST_COLOR_MATRIX_BLUE_SCALE', then added to
17080 `GL_POST_COLOR_MATRIX_BLUE_BIAS'; and the alpha component is
17081 multiplied by `GL_POST_COLOR_MATRIX_ALPHA_SCALE', then added to
17082 `GL_POST_COLOR_MATRIX_ALPHA_BIAS'. After all four color components
17083 are scaled and biased, each is clamped to the range [0,1] .
17084
17085 Similarly, if the `ARB_imaging' extension is supported, each of the
17086 four color components may be scaled and biased after processing by
17087 the enabled convolution filter. That is, the red component is
17088 multiplied by `GL_POST_CONVOLUTION_RED_SCALE', then added to
17089 `GL_POST_CONVOLUTION_RED_BIAS'; the green component is multiplied
17090 by `GL_POST_CONVOLUTION_GREEN_SCALE', then added to
17091 `GL_POST_CONVOLUTION_GREEN_BIAS'; the blue component is multiplied
17092 by `GL_POST_CONVOLUTION_BLUE_SCALE', then added to
17093 `GL_POST_CONVOLUTION_BLUE_BIAS'; and the alpha component is
17094 multiplied by `GL_POST_CONVOLUTION_ALPHA_SCALE', then added to
17095 `GL_POST_CONVOLUTION_ALPHA_BIAS'. After all four color components
17096 are scaled and biased, each is clamped to the range [0,1] .
17097
17098COLOR INDEX
17099 Each color index is shifted left by `GL_INDEX_SHIFT' bits; any bits
17100 beyond the number of fraction bits carried by the fixed-point index
17101 are filled with zeros. If `GL_INDEX_SHIFT' is negative, the shift
17102 is to the right, again zero filled. Then `GL_INDEX_OFFSET' is added
17103 to the index. `GL_INDEX_SHIFT' and `GL_INDEX_OFFSET' are specified
17104 with `glPixelTransfer'.
17105
17106 From this point, operation diverges depending on the required
17107 format of the resulting pixels. If the resulting pixels are to be
17108 written to a color index buffer, or if they are being read back to
17109 client memory in `GL_COLOR_INDEX' format, the pixels continue to be
17110 treated as indices. If `GL_MAP_COLOR' is true, each index is masked
17111 by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_I_SIZE', then replaced by
17112 the contents of `GL_PIXEL_MAP_I_TO_I' indexed by the masked value.
17113 `GL_MAP_COLOR' is specified with `glPixelTransfer'. The contents of
17114 the index map is specified with `glPixelMap'.
17115
17116 If the resulting pixels are to be written to an RGBA color buffer,
17117 or if they are read back to client memory in a format other than
17118 `GL_COLOR_INDEX', the pixels are converted from indices to colors
17119 by referencing the four maps `GL_PIXEL_MAP_I_TO_R',
17120 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
17121 `GL_PIXEL_MAP_I_TO_A'. Before being dereferenced, the index is
17122 masked by 2^N-1 , where N is `GL_PIXEL_MAP_I_TO_R_SIZE' for the red
17123 map, `GL_PIXEL_MAP_I_TO_G_SIZE' for the green map,
17124 `GL_PIXEL_MAP_I_TO_B_SIZE' for the blue map, and
17125 `GL_PIXEL_MAP_I_TO_A_SIZE' for the alpha map. All components taken
17126 from the maps are then clamped to the range [0,1] . The contents of
17127 the four maps is specified with `glPixelMap'.
17128
17129DEPTH
17130 Each depth value is multiplied by `GL_DEPTH_SCALE', added to
17131 `GL_DEPTH_BIAS', then clamped to the range [0,1] .
17132
17133STENCIL
17134 Each index is shifted `GL_INDEX_SHIFT' bits just as a color index
17135 is, then added to `GL_INDEX_OFFSET'. If `GL_MAP_STENCIL' is true,
17136 each index is masked by 2^N-1 , where N is
17137 `GL_PIXEL_MAP_S_TO_S_SIZE', then replaced by the contents of
17138 `GL_PIXEL_MAP_S_TO_S' indexed by the masked value.
17139
17140The following table gives the type, initial value, and range of valid
17141values for each of the pixel transfer parameters that are set with
17142`glPixelTransfer'.
17143
17144
17145
17146*PNAME*
17147 *Type*, *Initial Value*, *Valid Range*
17148
17149`GL_MAP_COLOR'
17150 boolean , false , true/false
17151
17152`GL_MAP_STENCIL'
17153 boolean , false , true/false
17154
17155`GL_INDEX_SHIFT'
17156 integer , 0 , (-∞,∞)
17157
17158`GL_INDEX_OFFSET'
17159 integer , 0 , (-∞,∞)
17160
17161`GL_RED_SCALE'
17162 float , 1 , (-∞,∞)
17163
17164`GL_GREEN_SCALE'
17165 float , 1 , (-∞,∞)
17166
17167`GL_BLUE_SCALE'
17168 float , 1 , (-∞,∞)
17169
17170`GL_ALPHA_SCALE'
17171 float , 1 , (-∞,∞)
17172
17173`GL_DEPTH_SCALE'
17174 float , 1 , (-∞,∞)
17175
17176`GL_RED_BIAS'
17177 float , 0 , (-∞,∞)
17178
17179`GL_GREEN_BIAS'
17180 float , 0 , (-∞,∞)
17181
17182`GL_BLUE_BIAS'
17183 float , 0 , (-∞,∞)
17184
17185`GL_ALPHA_BIAS'
17186 float , 0 , (-∞,∞)
17187
17188`GL_DEPTH_BIAS'
17189 float , 0 , (-∞,∞)
17190
17191`GL_POST_COLOR_MATRIX_RED_SCALE'
17192 float , 1 , (-∞,∞)
17193
17194`GL_POST_COLOR_MATRIX_GREEN_SCALE'
17195 float , 1 , (-∞,∞)
17196
17197`GL_POST_COLOR_MATRIX_BLUE_SCALE'
17198 float , 1 , (-∞,∞)
17199
17200`GL_POST_COLOR_MATRIX_ALPHA_SCALE'
17201 float , 1 , (-∞,∞)
17202
17203`GL_POST_COLOR_MATRIX_RED_BIAS'
17204 float , 0 , (-∞,∞)
17205
17206`GL_POST_COLOR_MATRIX_GREEN_BIAS'
17207 float , 0 , (-∞,∞)
17208
17209`GL_POST_COLOR_MATRIX_BLUE_BIAS'
17210 float , 0 , (-∞,∞)
17211
17212`GL_POST_COLOR_MATRIX_ALPHA_BIAS'
17213 float , 0 , (-∞,∞)
17214
17215`GL_POST_CONVOLUTION_RED_SCALE'
17216 float , 1 , (-∞,∞)
17217
17218`GL_POST_CONVOLUTION_GREEN_SCALE'
17219 float , 1 , (-∞,∞)
17220
17221`GL_POST_CONVOLUTION_BLUE_SCALE'
17222 float , 1 , (-∞,∞)
17223
17224`GL_POST_CONVOLUTION_ALPHA_SCALE'
17225 float , 1 , (-∞,∞)
17226
17227`GL_POST_CONVOLUTION_RED_BIAS'
17228 float , 0 , (-∞,∞)
17229
17230`GL_POST_CONVOLUTION_GREEN_BIAS'
17231 float , 0 , (-∞,∞)
17232
17233`GL_POST_CONVOLUTION_BLUE_BIAS'
17234 float , 0 , (-∞,∞)
17235
17236`GL_POST_CONVOLUTION_ALPHA_BIAS'
17237 float , 0 , (-∞,∞)
17238
17239`glPixelTransferf' can be used to set any pixel transfer parameter. If
17240the parameter type is boolean, 0 implies false and any other value
17241implies true. If PNAME is an integer parameter, PARAM is rounded to the
17242nearest integer.
17243
17244Likewise, `glPixelTransferi' can be used to set any of the pixel
17245transfer parameters. Boolean parameters are set to false if PARAM is 0
17246and to true otherwise. PARAM is converted to floating point before being
17247assigned to real-valued parameters.
17248
17249`GL_INVALID_ENUM' is generated if PNAME is not an accepted value.
17250
17251`GL_INVALID_OPERATION' is generated if `glPixelTransfer' is executed
17252between the execution of `glBegin' and the corresponding execution of
17253`glEnd'.")
17254
25072f02 17255(define-gl-procedures
bb894c9d
AW
17256 ((glPixelZoom
17257 (xfactor GLfloat)
17258 (yfactor GLfloat)
17259 ->
17260 void))
3c9b6116
AW
17261 "Specify the pixel zoom factors.
17262
17263XFACTOR
17264 YFACTOR
17265
17266 Specify the X and Y zoom factors for pixel write operations.
17267
17268`glPixelZoom' specifies values for the X and Y zoom factors. During the
17269execution of `glDrawPixels' or `glCopyPixels', if (XR , YR ) is the
17270current raster position, and a given element is in the M th row and N th
17271column of the pixel rectangle, then pixels whose centers are in the
17272rectangle with corners at
17273
17274(XR+N·XFACTOR , YR+M·YFACTOR )
17275
17276(XR+(N+1,)·XFACTOR , YR+(M+1,)·YFACTOR )
17277
17278are candidates for replacement. Any pixel whose center lies on the
17279bottom or left edge of this rectangular region is also modified.
17280
17281Pixel zoom factors are not limited to positive values. Negative zoom
17282factors reflect the resulting image about the current raster position.
17283
17284`GL_INVALID_OPERATION' is generated if `glPixelZoom' is executed between
17285the execution of `glBegin' and the corresponding execution of `glEnd'.")
17286
25072f02 17287(define-gl-procedures
bb894c9d
AW
17288 ((glPointParameterf
17289 (pname GLenum)
17290 (param GLfloat)
17291 ->
17292 void)
17293 (glPointParameteri
17294 (pname GLenum)
17295 (param GLint)
17296 ->
78aa45b9
DH
17297 void)
17298 (glPointParameterfv
17299 (pname GLenum)
17300 (params const-GLfloat-*)
17301 ->
17302 void)
17303 (glPointParameteriv
17304 (pname GLenum)
17305 (params const-GLint-*)
17306 ->
bb894c9d 17307 void))
3c9b6116
AW
17308 "Specify point parameters.
17309
17310PNAME
17311 Specifies a single-valued point parameter. `GL_POINT_SIZE_MIN',
17312 `GL_POINT_SIZE_MAX', `GL_POINT_FADE_THRESHOLD_SIZE', and
17313 `GL_POINT_SPRITE_COORD_ORIGIN' are accepted.
17314
17315PARAM
17316 Specifies the value that PNAME will be set to.
17317
17318The following values are accepted for PNAME:
17319
17320`GL_POINT_SIZE_MIN'
17321
17322
17323 PARAMS is a single floating-point value that specifies the minimum
17324 point size. The default value is 0.0.
17325
17326`GL_POINT_SIZE_MAX'
17327
17328
17329 PARAMS is a single floating-point value that specifies the maximum
17330 point size. The default value is 1.0.
17331
17332`GL_POINT_FADE_THRESHOLD_SIZE'
17333
17334
17335 PARAMS is a single floating-point value that specifies the
17336 threshold value to which point sizes are clamped if they exceed the
17337 specified value. The default value is 1.0.
17338
17339`GL_POINT_DISTANCE_ATTENUATION'
17340
17341
17342 PARAMS is an array of three floating-point values that specify the
17343 coefficients used for scaling the computed point size. The default
17344 values are (1,00) .
17345
17346`GL_POINT_SPRITE_COORD_ORIGIN'
17347
17348
17349 PARAMS is a single enum specifying the point sprite texture
17350 coordinate origin, either `GL_LOWER_LEFT' or `GL_UPPER_LEFT'. The
17351 default value is `GL_UPPER_LEFT'.
17352
17353`GL_INVALID_VALUE' is generated If the value specified for
17354`GL_POINT_SIZE_MIN', `GL_POINT_SIZE_MAX', or
17355`GL_POINT_FADE_THRESHOLD_SIZE' is less than zero.
17356
17357`GL_INVALID_ENUM' is generated If the value specified for
17358`GL_POINT_SPRITE_COORD_ORIGIN' is not `GL_LOWER_LEFT' or
17359`GL_UPPER_LEFT'.
17360
17361If the value for `GL_POINT_SIZE_MIN' is greater than
17362`GL_POINT_SIZE_MAX', the point size after clamping is undefined, but no
17363error is generated.")
17364
25072f02 17365(define-gl-procedures
bb894c9d 17366 ((glPointSize (size GLfloat) -> void))
3c9b6116
AW
17367 "Specify the diameter of rasterized points.
17368
17369SIZE
17370 Specifies the diameter of rasterized points. The initial value is
17371 1.
17372
17373`glPointSize' specifies the rasterized diameter of both aliased and
17374antialiased points. Using a point size other than 1 has different
17375effects, depending on whether point antialiasing is enabled. To enable
17376and disable point antialiasing, call `glEnable' and `glDisable' with
17377argument `GL_POINT_SMOOTH'. Point antialiasing is initially disabled.
17378
17379The specified point size is multiplied with a distance attenuation
17380factor and clamped to the specified point size range, and further
17381clamped to the implementation-dependent point size range to produce the
17382derived point size using
17383
17384POINTSIZE=CLAMP\u2062(SIZE×√(1/A+B×D+C×D^2,,,),,)
17385
17386where D is the eye-coordinate distance from the eye to the vertex, and A
17387, B , and C are the distance attenuation coefficients (see
17388`glPointParameter').
17389
17390If multisampling is disabled, the computed point size is used as the
17391point's width.
17392
17393If multisampling is enabled, the point may be faded by modifying the
17394point alpha value (see `glSampleCoverage') instead of allowing the point
17395width to go below a given threshold (see `glPointParameter'). In this
17396case, the width is further modified in the following manner:
17397
17398POINTWIDTH={(POINTSIZE), (THRESHOLD)\u2062(POINTSIZE>=THRESHOLD),
17399(OTHERWISE),
17400
17401The point alpha value is modified by computing:
17402
17403POINTALPHA={(1), ((POINTSIZE/THRESHOLD,)^2)\u2062(POINTSIZE>=THRESHOLD),
17404(OTHERWISE),
17405
17406If point antialiasing is disabled, the actual size is determined by
17407rounding the supplied size to the nearest integer. (If the rounding
17408results in the value 0, it is as if the point size were 1.) If the
17409rounded size is odd, then the center point (X , Y ) of the pixel
17410fragment that represents the point is computed as
17411
17412(⌊X_W,⌋+.5,⌊Y_W,⌋+.5)
17413
17414where W subscripts indicate window coordinates. All pixels that lie
17415within the square grid of the rounded size centered at (X , Y ) make up
17416the fragment. If the size is even, the center point is
17417
17418(⌊X_W+.5,⌋,⌊Y_W+.5,⌋)
17419
17420and the rasterized fragment's centers are the half-integer window
17421coordinates within the square of the rounded size centered at (X,Y) .
17422All pixel fragments produced in rasterizing a nonantialiased point are
17423assigned the same associated data, that of the vertex corresponding to
17424the point.
17425
17426If antialiasing is enabled, then point rasterization produces a fragment
17427for each pixel square that intersects the region lying within the circle
17428having diameter equal to the current point size and centered at the
17429point's (X_W,Y_W) . The coverage value for each fragment is the window
17430coordinate area of the intersection of the circular region with the
17431corresponding pixel square. This value is saved and used in the final
17432rasterization step. The data associated with each fragment is the data
17433associated with the point being rasterized.
17434
17435Not all sizes are supported when point antialiasing is enabled. If an
17436unsupported size is requested, the nearest supported size is used. Only
17437size 1 is guaranteed to be supported; others depend on the
17438implementation. To query the range of supported sizes and the size
17439difference between supported sizes within the range, call `glGet' with
17440arguments `GL_SMOOTH_POINT_SIZE_RANGE' and
17441`GL_SMOOTH_POINT_SIZE_GRANULARITY'. For aliased points, query the
17442supported ranges and granularity with `glGet' with arguments
17443`GL_ALIASED_POINT_SIZE_RANGE'.
17444
17445`GL_INVALID_VALUE' is generated if SIZE is less than or equal to 0.
17446
17447`GL_INVALID_OPERATION' is generated if `glPointSize' is executed between
17448the execution of `glBegin' and the corresponding execution of `glEnd'.")
17449
25072f02 17450(define-gl-procedures
bb894c9d
AW
17451 ((glPolygonMode
17452 (face GLenum)
17453 (mode GLenum)
17454 ->
17455 void))
3c9b6116
AW
17456 "Select a polygon rasterization mode.
17457
17458FACE
17459 Specifies the polygons that MODE applies to. Must be `GL_FRONT' for
17460 front-facing polygons, `GL_BACK' for back-facing polygons, or
17461 `GL_FRONT_AND_BACK' for front- and back-facing polygons.
17462
17463MODE
17464 Specifies how polygons will be rasterized. Accepted values are
17465 `GL_POINT', `GL_LINE', and `GL_FILL'. The initial value is
17466 `GL_FILL' for both front- and back-facing polygons.
17467
17468`glPolygonMode' controls the interpretation of polygons for
17469rasterization. FACE describes which polygons MODE applies to:
17470front-facing polygons (`GL_FRONT'), back-facing polygons (`GL_BACK'), or
17471both (`GL_FRONT_AND_BACK'). The polygon mode affects only the final
17472rasterization of polygons. In particular, a polygon's vertices are lit
17473and the polygon is clipped and possibly culled before these modes are
17474applied.
17475
17476Three modes are defined and can be specified in MODE:
17477
17478`GL_POINT'
17479 Polygon vertices that are marked as the start of a boundary edge
17480 are drawn as points. Point attributes such as `GL_POINT_SIZE' and
17481 `GL_POINT_SMOOTH' control the rasterization of the points. Polygon
17482 rasterization attributes other than `GL_POLYGON_MODE' have no
17483 effect.
17484
17485`GL_LINE'
17486 Boundary edges of the polygon are drawn as line segments. They are
17487 treated as connected line segments for line stippling; the line
17488 stipple counter and pattern are not reset between segments (see
17489 `glLineStipple'). Line attributes such as `GL_LINE_WIDTH' and
17490 `GL_LINE_SMOOTH' control the rasterization of the lines. Polygon
17491 rasterization attributes other than `GL_POLYGON_MODE' have no
17492 effect.
17493
17494`GL_FILL'
17495 The interior of the polygon is filled. Polygon attributes such as
17496 `GL_POLYGON_STIPPLE' and `GL_POLYGON_SMOOTH' control the
17497 rasterization of the polygon.
17498
17499`GL_INVALID_ENUM' is generated if either FACE or MODE is not an accepted
17500value.
17501
17502`GL_INVALID_OPERATION' is generated if `glPolygonMode' is executed
17503between the execution of `glBegin' and the corresponding execution of
17504`glEnd'.")
17505
25072f02 17506(define-gl-procedures
bb894c9d
AW
17507 ((glPolygonOffset
17508 (factor GLfloat)
17509 (units GLfloat)
17510 ->
17511 void))
3c9b6116
AW
17512 "Set the scale and units used to calculate depth values.
17513
17514FACTOR
17515 Specifies a scale factor that is used to create a variable depth
17516 offset for each polygon. The initial value is 0.
17517
17518UNITS
17519 Is multiplied by an implementation-specific value to create a
17520 constant depth offset. The initial value is 0.
17521
17522When `GL_POLYGON_OFFSET_FILL', `GL_POLYGON_OFFSET_LINE', or
17523`GL_POLYGON_OFFSET_POINT' is enabled, each fragment's DEPTH value will
17524be offset after it is interpolated from the DEPTH values of the
17525appropriate vertices. The value of the offset is FACTOR×DZ+R×UNITS ,
17526where DZ is a measurement of the change in depth relative to the screen
17527area of the polygon, and R is the smallest value that is guaranteed to
17528produce a resolvable offset for a given implementation. The offset is
17529added before the depth test is performed and before the value is written
17530into the depth buffer.
17531
17532`glPolygonOffset' is useful for rendering hidden-line images, for
17533applying decals to surfaces, and for rendering solids with highlighted
17534edges.
17535
17536`GL_INVALID_OPERATION' is generated if `glPolygonOffset' is executed
17537between the execution of `glBegin' and the corresponding execution of
17538`glEnd'.")
17539
25072f02 17540(define-gl-procedures
00239761
AW
17541 ((glPolygonStipple
17542 (pattern const-GLubyte-*)
17543 ->
17544 void))
3c9b6116
AW
17545 "Set the polygon stippling pattern.
17546
17547PATTERN
17548 Specifies a pointer to a 32×32 stipple pattern that will be
17549 unpacked from memory in the same way that `glDrawPixels' unpacks
17550 pixels.
17551
17552Polygon stippling, like line stippling (see `glLineStipple'), masks out
17553certain fragments produced by rasterization, creating a pattern.
17554Stippling is independent of polygon antialiasing.
17555
17556PATTERN is a pointer to a 32×32 stipple pattern that is stored in memory
17557just like the pixel data supplied to a `glDrawPixels' call with height
17558and WIDTH both equal to 32, a pixel format of `GL_COLOR_INDEX', and data
17559type of `GL_BITMAP'. That is, the stipple pattern is represented as a
1756032×32 array of 1-bit color indices packed in unsigned bytes.
17561`glPixelStore' parameters like `GL_UNPACK_SWAP_BYTES' and
17562`GL_UNPACK_LSB_FIRST' affect the assembling of the bits into a stipple
17563pattern. Pixel transfer operations (shift, offset, pixel map) are not
17564applied to the stipple image, however.
17565
17566If a non-zero named buffer object is bound to the
17567`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a stipple
17568pattern is specified, PATTERN is treated as a byte offset into the
17569buffer object's data store.
17570
17571To enable and disable polygon stippling, call `glEnable' and `glDisable'
17572with argument `GL_POLYGON_STIPPLE'. Polygon stippling is initially
17573disabled. If it's enabled, a rasterized polygon fragment with window
17574coordinates X_W and Y_W is sent to the next stage of the GL if and only
17575if the (X_W%32 )th bit in the (Y_W%32 )th row of the stipple pattern is
175761 (one). When polygon stippling is disabled, it is as if the stipple
17577pattern consists of all 1's.
17578
17579`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17580bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
17581data store is currently mapped.
17582
17583`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
17584bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
17585unpacked from the buffer object such that the memory reads required
17586would exceed the data store size.
17587
17588`GL_INVALID_OPERATION' is generated if `glPolygonStipple' is executed
17589between the execution of `glBegin' and the corresponding execution of
17590`glEnd'.")
17591
25072f02 17592(define-gl-procedures
bb894c9d
AW
17593 ((glPrioritizeTextures
17594 (n GLsizei)
00239761
AW
17595 (textures const-GLuint-*)
17596 (priorities const-GLclampf-*)
bb894c9d
AW
17597 ->
17598 void))
3c9b6116
AW
17599 "Set texture residence priority.
17600
17601N
17602 Specifies the number of textures to be prioritized.
17603
17604TEXTURES
17605 Specifies an array containing the names of the textures to be
17606 prioritized.
17607
17608PRIORITIES
17609 Specifies an array containing the texture priorities. A priority
17610 given in an element of PRIORITIES applies to the texture named by
17611 the corresponding element of TEXTURES.
17612
17613`glPrioritizeTextures' assigns the N texture priorities given in
17614PRIORITIES to the N textures named in TEXTURES.
17615
17616The GL establishes a ``working set'' of textures that are resident in
17617texture memory. These textures may be bound to a texture target much
17618more efficiently than textures that are not resident. By specifying a
17619priority for each texture, `glPrioritizeTextures' allows applications to
17620guide the GL implementation in determining which textures should be
17621resident.
17622
17623The priorities given in PRIORITIES are clamped to the range [0,1] before
17624they are assigned. 0 indicates the lowest priority; textures with
17625priority 0 are least likely to be resident. 1 indicates the highest
17626priority; textures with priority 1 are most likely to be resident.
17627However, textures are not guaranteed to be resident until they are used.
17628
17629`glPrioritizeTextures' silently ignores attempts to prioritize texture 0
17630or any texture name that does not correspond to an existing texture.
17631
17632`glPrioritizeTextures' does not require that any of the textures named
17633by TEXTURES be bound to a texture target. `glTexParameter' may also be
17634used to set a texture's priority, but only if the texture is currently
17635bound. This is the only way to set the priority of a default texture.
17636
17637`GL_INVALID_VALUE' is generated if N is negative.
17638
17639`GL_INVALID_OPERATION' is generated if `glPrioritizeTextures' is
17640executed between the execution of `glBegin' and the corresponding
17641execution of `glEnd'.")
17642
25072f02 17643(define-gl-procedures
bb894c9d
AW
17644 ((glPushAttrib (mask GLbitfield) -> void)
17645 (glPopAttrib -> void))
3c9b6116
AW
17646 "Push and pop the server attribute stack.
17647
17648MASK
17649 Specifies a mask that indicates which attributes to save. Values
17650 for MASK are listed below.
17651
17652`glPushAttrib' takes one argument, a mask that indicates which groups of
17653state variables to save on the attribute stack. Symbolic constants are
17654used to set bits in the mask. MASK is typically constructed by
17655specifying the bitwise-or of several of these constants together. The
17656special mask `GL_ALL_ATTRIB_BITS' can be used to save all stackable
17657states.
17658
17659The symbolic mask constants and their associated GL state are as follows
17660(the second column lists which attributes are saved):
17661
17662
17663
17664`GL_ACCUM_BUFFER_BIT'
17665 Accumulation buffer clear value
17666
17667`GL_COLOR_BUFFER_BIT'
17668 `GL_ALPHA_TEST' enable bit
17669
17670
17671 Alpha test function and reference value
17672
17673
17674 `GL_BLEND' enable bit
17675
17676
17677 Blending source and destination functions
17678
17679
17680 Constant blend color
17681
17682
17683 Blending equation
17684
17685
17686 `GL_DITHER' enable bit
17687
17688
17689 `GL_DRAW_BUFFER' setting
17690
17691
17692 `GL_COLOR_LOGIC_OP' enable bit
17693
17694
17695 `GL_INDEX_LOGIC_OP' enable bit
17696
17697
17698 Logic op function
17699
17700
17701 Color mode and index mode clear values
17702
17703
17704 Color mode and index mode writemasks
17705
17706`GL_CURRENT_BIT'
17707 Current RGBA color
17708
17709
17710 Current color index
17711
17712
17713 Current normal vector
17714
17715
17716 Current texture coordinates
17717
17718
17719 Current raster position
17720
17721
17722 `GL_CURRENT_RASTER_POSITION_VALID' flag
17723
17724
17725 RGBA color associated with current raster position
17726
17727
17728 Color index associated with current raster position
17729
17730
17731 Texture coordinates associated with current raster position
17732
17733
17734 `GL_EDGE_FLAG' flag
17735
17736`GL_DEPTH_BUFFER_BIT'
17737 `GL_DEPTH_TEST' enable bit
17738
17739
17740 Depth buffer test function
17741
17742
17743 Depth buffer clear value
17744
17745
17746 `GL_DEPTH_WRITEMASK' enable bit
17747
17748`GL_ENABLE_BIT'
17749 `GL_ALPHA_TEST' flag
17750
17751
17752 `GL_AUTO_NORMAL' flag
17753
17754
17755 `GL_BLEND' flag
17756
17757
17758 Enable bits for the user-definable clipping planes
17759
17760
17761 `GL_COLOR_MATERIAL'
17762
17763
17764 `GL_CULL_FACE' flag
17765
17766
17767 `GL_DEPTH_TEST' flag
17768
17769
17770 `GL_DITHER' flag
17771
17772
17773 `GL_FOG' flag
17774
17775
17776 `GL_LIGHT'I where `0' <= I < `GL_MAX_LIGHTS'
17777
17778
17779 `GL_LIGHTING' flag
17780
17781
17782 `GL_LINE_SMOOTH' flag
17783
17784
17785 `GL_LINE_STIPPLE' flag
17786
17787
17788 `GL_COLOR_LOGIC_OP' flag
17789
17790
17791 `GL_INDEX_LOGIC_OP' flag
17792
17793
17794 `GL_MAP1_'X where X is a map type
17795
17796
17797 `GL_MAP2_'X where X is a map type
17798
17799
17800 `GL_MULTISAMPLE' flag
17801
17802
17803 `GL_NORMALIZE' flag
17804
17805
17806 `GL_POINT_SMOOTH' flag
17807
17808
17809 `GL_POLYGON_OFFSET_LINE' flag
17810
17811
17812 `GL_POLYGON_OFFSET_FILL' flag
17813
17814
17815 `GL_POLYGON_OFFSET_POINT' flag
17816
17817
17818 `GL_POLYGON_SMOOTH' flag
17819
17820
17821 `GL_POLYGON_STIPPLE' flag
17822
17823
17824 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17825
17826
17827 `GL_SAMPLE_ALPHA_TO_ONE' flag
17828
17829
17830 `GL_SAMPLE_COVERAGE' flag
17831
17832
17833 `GL_SCISSOR_TEST' flag
17834
17835
17836 `GL_STENCIL_TEST' flag
17837
17838
17839 `GL_TEXTURE_1D' flag
17840
17841
17842 `GL_TEXTURE_2D' flag
17843
17844
17845 `GL_TEXTURE_3D' flag
17846
17847
17848 Flags `GL_TEXTURE_GEN_'X where X is S, T, R, or Q
17849
17850`GL_EVAL_BIT'
17851 `GL_MAP1_'X enable bits, where X is a map type
17852
17853
17854 `GL_MAP2_'X enable bits, where X is a map type
17855
17856
17857 1D grid endpoints and divisions
17858
17859
17860 2D grid endpoints and divisions
17861
17862
17863 `GL_AUTO_NORMAL' enable bit
17864
17865`GL_FOG_BIT'
17866 `GL_FOG' enable bit
17867
17868
17869 Fog color
17870
17871
17872 Fog density
17873
17874
17875 Linear fog start
17876
17877
17878 Linear fog end
17879
17880
17881 Fog index
17882
17883
17884 `GL_FOG_MODE' value
17885
17886`GL_HINT_BIT'
17887 `GL_PERSPECTIVE_CORRECTION_HINT' setting
17888
17889
17890 `GL_POINT_SMOOTH_HINT' setting
17891
17892
17893 `GL_LINE_SMOOTH_HINT' setting
17894
17895
17896 `GL_POLYGON_SMOOTH_HINT' setting
17897
17898
17899 `GL_FOG_HINT' setting
17900
17901
17902 `GL_GENERATE_MIPMAP_HINT' setting
17903
17904
17905 `GL_TEXTURE_COMPRESSION_HINT' setting
17906
17907`GL_LIGHTING_BIT'
17908 `GL_COLOR_MATERIAL' enable bit
17909
17910
17911 `GL_COLOR_MATERIAL_FACE' value
17912
17913
17914 Color material parameters that are tracking the current color
17915
17916
17917 Ambient scene color
17918
17919
17920 `GL_LIGHT_MODEL_LOCAL_VIEWER' value
17921
17922
17923 `GL_LIGHT_MODEL_TWO_SIDE' setting
17924
17925
17926 `GL_LIGHTING' enable bit
17927
17928
17929 Enable bit for each light
17930
17931
17932 Ambient, diffuse, and specular intensity for each light
17933
17934
17935 Direction, position, exponent, and cutoff angle for each light
17936
17937
17938 Constant, linear, and quadratic attenuation factors for each light
17939
17940
17941 Ambient, diffuse, specular, and emissive color for each material
17942
17943
17944 Ambient, diffuse, and specular color indices for each material
17945
17946
17947 Specular exponent for each material
17948
17949
17950 `GL_SHADE_MODEL' setting
17951
17952`GL_LINE_BIT'
17953 `GL_LINE_SMOOTH' flag
17954
17955
17956 `GL_LINE_STIPPLE' enable bit
17957
17958
17959 Line stipple pattern and repeat counter
17960
17961
17962 Line width
17963
17964`GL_LIST_BIT'
17965 `GL_LIST_BASE' setting
17966
17967`GL_MULTISAMPLE_BIT'
17968 `GL_MULTISAMPLE' flag
17969
17970
17971 `GL_SAMPLE_ALPHA_TO_COVERAGE' flag
17972
17973
17974 `GL_SAMPLE_ALPHA_TO_ONE' flag
17975
17976
17977 `GL_SAMPLE_COVERAGE' flag
17978
17979
17980 `GL_SAMPLE_COVERAGE_VALUE' value
17981
17982
17983 `GL_SAMPLE_COVERAGE_INVERT' value
17984
17985`GL_PIXEL_MODE_BIT'
17986 `GL_RED_BIAS' and `GL_RED_SCALE' settings
17987
17988
17989 `GL_GREEN_BIAS' and `GL_GREEN_SCALE' values
17990
17991
17992 `GL_BLUE_BIAS' and `GL_BLUE_SCALE'
17993
17994
17995 `GL_ALPHA_BIAS' and `GL_ALPHA_SCALE'
17996
17997
17998 `GL_DEPTH_BIAS' and `GL_DEPTH_SCALE'
17999
18000
18001 `GL_INDEX_OFFSET' and `GL_INDEX_SHIFT' values
18002
18003
18004 `GL_MAP_COLOR' and `GL_MAP_STENCIL' flags
18005
18006
18007 `GL_ZOOM_X' and `GL_ZOOM_Y' factors
18008
18009
18010 `GL_READ_BUFFER' setting
18011
18012`GL_POINT_BIT'
18013 `GL_POINT_SMOOTH' flag
18014
18015
18016 Point size
18017
18018`GL_POLYGON_BIT'
18019 `GL_CULL_FACE' enable bit
18020
18021
18022 `GL_CULL_FACE_MODE' value
18023
18024
18025 `GL_FRONT_FACE' indicator
18026
18027
18028 `GL_POLYGON_MODE' setting
18029
18030
18031 `GL_POLYGON_SMOOTH' flag
18032
18033
18034 `GL_POLYGON_STIPPLE' enable bit
18035
18036
18037 `GL_POLYGON_OFFSET_FILL' flag
18038
18039
18040 `GL_POLYGON_OFFSET_LINE' flag
18041
18042
18043 `GL_POLYGON_OFFSET_POINT' flag
18044
18045
18046 `GL_POLYGON_OFFSET_FACTOR'
18047
18048
18049 `GL_POLYGON_OFFSET_UNITS'
18050
18051`GL_POLYGON_STIPPLE_BIT'
18052 Polygon stipple image
18053
18054`GL_SCISSOR_BIT'
18055 `GL_SCISSOR_TEST' flag
18056
18057
18058 Scissor box
18059
18060`GL_STENCIL_BUFFER_BIT'
18061 `GL_STENCIL_TEST' enable bit
18062
18063
18064 Stencil function and reference value
18065
18066
18067 Stencil value mask
18068
18069
18070 Stencil fail, pass, and depth buffer pass actions
18071
18072
18073 Stencil buffer clear value
18074
18075
18076 Stencil buffer writemask
18077
18078`GL_TEXTURE_BIT'
18079 Enable bits for the four texture coordinates
18080
18081
18082 Border color for each texture image
18083
18084
18085 Minification function for each texture image
18086
18087
18088 Magnification function for each texture image
18089
18090
18091 Texture coordinates and wrap mode for each texture image
18092
18093
18094 Color and mode for each texture environment
18095
18096
18097 Enable bits `GL_TEXTURE_GEN_'X, X is S, T, R, and Q
18098
18099
18100 `GL_TEXTURE_GEN_MODE' setting for S, T, R, and Q
18101
18102
18103 `glTexGen' plane equations for S, T, R, and Q
18104
18105
18106 Current texture bindings (for example, `GL_TEXTURE_BINDING_2D')
18107
18108`GL_TRANSFORM_BIT'
18109 Coefficients of the six clipping planes
18110
18111
18112 Enable bits for the user-definable clipping planes
18113
18114
18115 `GL_MATRIX_MODE' value
18116
18117
18118 `GL_NORMALIZE' flag
18119
18120
18121 `GL_RESCALE_NORMAL' flag
18122
18123`GL_VIEWPORT_BIT'
18124 Depth range (near and far)
18125
18126
18127 Viewport origin and extent
18128
18129`glPopAttrib' restores the values of the state variables saved with the
18130last `glPushAttrib' command. Those not saved are left unchanged.
18131
18132It is an error to push attributes onto a full stack or to pop attributes
18133off an empty stack. In either case, the error flag is set and no other
18134change is made to GL state.
18135
18136Initially, the attribute stack is empty.
18137
18138`GL_STACK_OVERFLOW' is generated if `glPushAttrib' is called while the
18139attribute stack is full.
18140
18141`GL_STACK_UNDERFLOW' is generated if `glPopAttrib' is called while the
18142attribute stack is empty.
18143
18144`GL_INVALID_OPERATION' is generated if `glPushAttrib' or `glPopAttrib'
18145is executed between the execution of `glBegin' and the corresponding
18146execution of `glEnd'.")
8925f36f 18147
25072f02 18148(define-gl-procedures
bb894c9d
AW
18149 ((glPushClientAttrib (mask GLbitfield) -> void)
18150 (glPopClientAttrib -> void))
3c9b6116
AW
18151 "Push and pop the client attribute stack.
18152
18153MASK
18154 Specifies a mask that indicates which attributes to save. Values
18155 for MASK are listed below.
18156
18157`glPushClientAttrib' takes one argument, a mask that indicates which
18158groups of client-state variables to save on the client attribute stack.
18159Symbolic constants are used to set bits in the mask. MASK is typically
18160constructed by specifying the bitwise-or of several of these constants
18161together. The special mask `GL_CLIENT_ALL_ATTRIB_BITS' can be used to
18162save all stackable client state.
18163
18164The symbolic mask constants and their associated GL client state are as
18165follows (the second column lists which attributes are saved):
18166
18167`GL_CLIENT_PIXEL_STORE_BIT' Pixel storage modes
18168`GL_CLIENT_VERTEX_ARRAY_BIT' Vertex arrays (and enables)
18169
18170`glPopClientAttrib' restores the values of the client-state variables
18171saved with the last `glPushClientAttrib'. Those not saved are left
18172unchanged.
18173
18174It is an error to push attributes onto a full client attribute stack or
18175to pop attributes off an empty stack. In either case, the error flag is
18176set, and no other change is made to GL state.
18177
18178Initially, the client attribute stack is empty.
18179
18180`GL_STACK_OVERFLOW' is generated if `glPushClientAttrib' is called while
18181the attribute stack is full.
18182
18183`GL_STACK_UNDERFLOW' is generated if `glPopClientAttrib' is called while
18184the attribute stack is empty.")
8925f36f 18185
25072f02 18186(define-gl-procedures
bb894c9d 18187 ((glPushMatrix -> void) (glPopMatrix -> void))
3c9b6116
AW
18188 "Push and pop the current matrix stack.
18189
18190There is a stack of matrices for each of the matrix modes. In
18191`GL_MODELVIEW' mode, the stack depth is at least 32. In the other modes,
18192`GL_COLOR', `GL_PROJECTION', and `GL_TEXTURE', the depth is at least 2.
18193The current matrix in any mode is the matrix on the top of the stack for
18194that mode.
18195
18196`glPushMatrix' pushes the current matrix stack down by one, duplicating
18197the current matrix. That is, after a `glPushMatrix' call, the matrix on
18198top of the stack is identical to the one below it.
18199
18200`glPopMatrix' pops the current matrix stack, replacing the current
18201matrix with the one below it on the stack.
18202
18203Initially, each of the stacks contains one matrix, an identity matrix.
18204
18205It is an error to push a full matrix stack or to pop a matrix stack that
18206contains only a single matrix. In either case, the error flag is set and
18207no other change is made to GL state.
18208
18209`GL_STACK_OVERFLOW' is generated if `glPushMatrix' is called while the
18210current matrix stack is full.
18211
18212`GL_STACK_UNDERFLOW' is generated if `glPopMatrix' is called while the
18213current matrix stack contains only a single matrix.
18214
18215`GL_INVALID_OPERATION' is generated if `glPushMatrix' or `glPopMatrix'
18216is executed between the execution of `glBegin' and the corresponding
18217execution of `glEnd'.")
8925f36f 18218
25072f02 18219(define-gl-procedures
bb894c9d
AW
18220 ((glPushName (name GLuint) -> void)
18221 (glPopName -> void))
3c9b6116
AW
18222 "Push and pop the name stack.
18223
18224NAME
18225 Specifies a name that will be pushed onto the name stack.
18226
18227The name stack is used during selection mode to allow sets of rendering
18228commands to be uniquely identified. It consists of an ordered set of
18229unsigned integers and is initially empty.
18230
18231`glPushName' causes NAME to be pushed onto the name stack. `glPopName'
18232pops one name off the top of the stack.
18233
18234The maximum name stack depth is implementation-dependent; call
18235`GL_MAX_NAME_STACK_DEPTH' to find out the value for a particular
18236implementation. It is an error to push a name onto a full stack or to
18237pop a name off an empty stack. It is also an error to manipulate the
18238name stack between the execution of `glBegin' and the corresponding
18239execution of `glEnd'. In any of these cases, the error flag is set and
18240no other change is made to GL state.
18241
18242The name stack is always empty while the render mode is not `GL_SELECT'.
18243Calls to `glPushName' or `glPopName' while the render mode is not
18244`GL_SELECT' are ignored.
18245
18246`GL_STACK_OVERFLOW' is generated if `glPushName' is called while the
18247name stack is full.
18248
18249`GL_STACK_UNDERFLOW' is generated if `glPopName' is called while the
18250name stack is empty.
18251
18252`GL_INVALID_OPERATION' is generated if `glPushName' or `glPopName' is
18253executed between a call to `glBegin' and the corresponding call to
18254`glEnd'.")
8925f36f 18255
25072f02 18256(define-gl-procedures
78aa45b9
DH
18257 ((glRasterPos2s (x GLshort) (y GLshort) -> void)
18258 (glRasterPos2i (x GLint) (y GLint) -> void)
ca09631c 18259 (glRasterPos2f (x GLfloat) (y GLfloat) -> void)
78aa45b9
DH
18260 (glRasterPos2d (x GLdouble) (y GLdouble) -> void)
18261 (glRasterPos3s
18262 (x GLshort)
18263 (y GLshort)
18264 (z GLshort)
18265 ->
18266 void)
bb894c9d
AW
18267 (glRasterPos3i
18268 (x GLint)
18269 (y GLint)
18270 (z GLint)
18271 ->
18272 void)
ca09631c
AW
18273 (glRasterPos3f
18274 (x GLfloat)
18275 (y GLfloat)
18276 (z GLfloat)
bb894c9d
AW
18277 ->
18278 void)
78aa45b9
DH
18279 (glRasterPos3d
18280 (x GLdouble)
18281 (y GLdouble)
18282 (z GLdouble)
18283 ->
18284 void)
18285 (glRasterPos4s
18286 (x GLshort)
18287 (y GLshort)
18288 (z GLshort)
18289 (w GLshort)
18290 ->
18291 void)
bb894c9d
AW
18292 (glRasterPos4i
18293 (x GLint)
18294 (y GLint)
18295 (z GLint)
18296 (w GLint)
18297 ->
18298 void)
ca09631c
AW
18299 (glRasterPos4f
18300 (x GLfloat)
18301 (y GLfloat)
18302 (z GLfloat)
18303 (w GLfloat)
bb894c9d 18304 ->
78aa45b9
DH
18305 void)
18306 (glRasterPos4d
18307 (x GLdouble)
18308 (y GLdouble)
18309 (z GLdouble)
18310 (w GLdouble)
18311 ->
18312 void)
18313 (glRasterPos2sv (v const-GLshort-*) -> void)
18314 (glRasterPos2iv (v const-GLint-*) -> void)
18315 (glRasterPos2fv (v const-GLfloat-*) -> void)
18316 (glRasterPos2dv (v const-GLdouble-*) -> void)
18317 (glRasterPos3sv (v const-GLshort-*) -> void)
18318 (glRasterPos3iv (v const-GLint-*) -> void)
18319 (glRasterPos3fv (v const-GLfloat-*) -> void)
18320 (glRasterPos3dv (v const-GLdouble-*) -> void)
18321 (glRasterPos4sv (v const-GLshort-*) -> void)
18322 (glRasterPos4iv (v const-GLint-*) -> void)
18323 (glRasterPos4fv (v const-GLfloat-*) -> void)
18324 (glRasterPos4dv (v const-GLdouble-*) -> void))
3c9b6116
AW
18325 "Specify the raster position for pixel operations.
18326
18327X
18328 Y
18329
18330 Z
18331
18332 W
18333
18334 Specify the X , Y , Z , and W object coordinates (if present) for
18335 the raster position.
18336
18337The GL maintains a 3D position in window coordinates. This position,
18338called the raster position, is used to position pixel and bitmap write
18339operations. It is maintained with subpixel accuracy. See `glBitmap',
18340`glDrawPixels', and `glCopyPixels'.
18341
18342The current raster position consists of three window coordinates (X , Y
18343, Z ), a clip coordinate value (W ), an eye coordinate distance, a valid
18344bit, and associated color data and texture coordinates. The W coordinate
18345is a clip coordinate, because W is not projected to window coordinates.
18346`glRasterPos4' specifies object coordinates X , Y , Z , and W
18347explicitly. `glRasterPos3' specifies object coordinate X , Y , and Z
18348explicitly, while W is implicitly set to 1. `glRasterPos2' uses the
18349argument values for X and Y while implicitly setting Z and W to 0 and 1.
18350
18351The object coordinates presented by `glRasterPos' are treated just like
18352those of a `glVertex' command: They are transformed by the current
18353modelview and projection matrices and passed to the clipping stage. If
18354the vertex is not culled, then it is projected and scaled to window
18355coordinates, which become the new current raster position, and the
18356`GL_CURRENT_RASTER_POSITION_VALID' flag is set. If the vertex IS culled,
18357then the valid bit is cleared and the current raster position and
18358associated color and texture coordinates are undefined.
18359
18360The current raster position also includes some associated color data and
18361texture coordinates. If lighting is enabled, then
18362`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
18363(in color index mode) is set to the color produced by the lighting
18364calculation (see `glLight', `glLightModel', and `glShadeModel'). If
18365lighting is disabled, current color (in RGBA mode, state variable
18366`GL_CURRENT_COLOR') or color index (in color index mode, state variable
18367`GL_CURRENT_INDEX') is used to update the current raster color.
18368`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
18369
18370Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
18371`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
18372generation functions (see `glTexGen'). Finally, the distance from the
18373origin of the eye coordinate system to the vertex as transformed by only
18374the modelview matrix replaces `GL_CURRENT_RASTER_DISTANCE'.
18375
18376Initially, the current raster position is (0, 0, 0, 1), the current
18377raster distance is 0, the valid bit is set, the associated RGBA color is
18378(1, 1, 1, 1), the associated color index is 1, and the associated
18379texture coordinates are (0, 0, 0, 1). In RGBA mode,
18380`GL_CURRENT_RASTER_INDEX' is always 1; in color index mode, the current
18381raster RGBA color always maintains its initial value.
18382
18383`GL_INVALID_OPERATION' is generated if `glRasterPos' is executed between
18384the execution of `glBegin' and the corresponding execution of `glEnd'.")
18385
25072f02 18386(define-gl-procedures
bb894c9d 18387 ((glReadBuffer (mode GLenum) -> void))
3c9b6116
AW
18388 "Select a color buffer source for pixels.
18389
18390MODE
18391 Specifies a color buffer. Accepted values are `GL_FRONT_LEFT',
18392 `GL_FRONT_RIGHT', `GL_BACK_LEFT', `GL_BACK_RIGHT', `GL_FRONT',
18393 `GL_BACK', `GL_LEFT', `GL_RIGHT', and `GL_AUX'I, where I is between
18394 0 and the value of `GL_AUX_BUFFERS' minus 1.
18395
18396`glReadBuffer' specifies a color buffer as the source for subsequent
18397`glReadPixels', `glCopyTexImage1D', `glCopyTexImage2D',
18398`glCopyTexSubImage1D', `glCopyTexSubImage2D', `glCopyTexSubImage3D', and
18399`glCopyPixels' commands. MODE accepts one of twelve or more predefined
18400values. (`GL_AUX0' through `GL_AUX3' are always defined.) In a fully
18401configured system, `GL_FRONT', `GL_LEFT', and `GL_FRONT_LEFT' all name
18402the front left buffer, `GL_FRONT_RIGHT' and `GL_RIGHT' name the front
18403right buffer, and `GL_BACK_LEFT' and `GL_BACK' name the back left
18404buffer.
18405
18406Nonstereo double-buffered configurations have only a front left and a
18407back left buffer. Single-buffered configurations have a front left and a
18408front right buffer if stereo, and only a front left buffer if nonstereo.
18409It is an error to specify a nonexistent buffer to `glReadBuffer'.
18410
18411MODE is initially `GL_FRONT' in single-buffered configurations and
18412`GL_BACK' in double-buffered configurations.
18413
18414`GL_INVALID_ENUM' is generated if MODE is not one of the twelve (or
18415more) accepted values.
18416
18417`GL_INVALID_OPERATION' is generated if MODE specifies a buffer that does
18418not exist.
18419
18420`GL_INVALID_OPERATION' is generated if `glReadBuffer' is executed
18421between the execution of `glBegin' and the corresponding execution of
18422`glEnd'.")
18423
25072f02 18424(define-gl-procedures
bb894c9d
AW
18425 ((glReadPixels
18426 (x GLint)
18427 (y GLint)
18428 (width GLsizei)
18429 (height GLsizei)
18430 (format GLenum)
18431 (type GLenum)
00239761 18432 (data GLvoid-*)
bb894c9d
AW
18433 ->
18434 void))
3c9b6116
AW
18435 "Read a block of pixels from the frame buffer.
18436
18437X
18438 Y
18439
18440 Specify the window coordinates of the first pixel that is read from
18441 the frame buffer. This location is the lower left corner of a
18442 rectangular block of pixels.
18443
18444WIDTH
18445 HEIGHT
18446
18447 Specify the dimensions of the pixel rectangle. WIDTH and HEIGHT of
18448 one correspond to a single pixel.
18449
18450FORMAT
18451 Specifies the format of the pixel data. The following symbolic
18452 values are accepted: `GL_COLOR_INDEX', `GL_STENCIL_INDEX',
18453 `GL_DEPTH_COMPONENT', `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA',
18454 `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', and
18455 `GL_LUMINANCE_ALPHA'.
18456
18457TYPE
18458 Specifies the data type of the pixel data. Must be one of
18459 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
18460 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
18461 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18462 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
18463 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18464 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18465 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18466 `GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV'.
18467
18468DATA
18469 Returns the pixel data.
18470
18471`glReadPixels' returns pixel data from the frame buffer, starting with
18472the pixel whose lower left corner is at location (X, Y), into client
18473memory starting at location DATA. Several parameters control the
18474processing of the pixel data before it is placed into client memory.
18475These parameters are set with three commands: `glPixelStore',
18476`glPixelTransfer', and `glPixelMap'. This reference page describes the
18477effects on `glReadPixels' of most, but not all of the parameters
18478specified by these three commands.
18479
18480If a non-zero named buffer object is bound to the `GL_PIXEL_PACK_BUFFER'
18481target (see `glBindBuffer') while a block of pixels is requested, DATA
18482is treated as a byte offset into the buffer object's data store rather
18483than a pointer to client memory.
18484
18485When the `ARB_imaging' extension is supported, the pixel data may be
18486processed by additional operations including color table lookup, color
18487matrix transformations, convolutions, histograms, and minimum and
18488maximum pixel value computations.
18489
18490`glReadPixels' returns values from each pixel with lower left corner at
18491(X+I,Y+J) for 0<=I<WIDTH and 0<=J<HEIGHT . This pixel is said to be the
18492I th pixel in the J th row. Pixels are returned in row order from the
18493lowest to the highest row, left to right in each row.
18494
18495FORMAT specifies the format for the returned pixel values; accepted
18496values are:
18497
18498`GL_COLOR_INDEX'
18499 Color indices are read from the color buffer selected by
18500 `glReadBuffer'. Each index is converted to fixed point, shifted
18501 left or right depending on the value and sign of `GL_INDEX_SHIFT',
18502 and added to `GL_INDEX_OFFSET'. If `GL_MAP_COLOR' is `GL_TRUE',
18503 indices are replaced by their mappings in the table
18504 `GL_PIXEL_MAP_I_TO_I'.
18505
18506`GL_STENCIL_INDEX'
18507 Stencil values are read from the stencil buffer. Each index is
18508 converted to fixed point, shifted left or right depending on the
18509 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'.
18510 If `GL_MAP_STENCIL' is `GL_TRUE', indices are replaced by their
18511 mappings in the table `GL_PIXEL_MAP_S_TO_S'.
18512
18513`GL_DEPTH_COMPONENT'
18514 Depth values are read from the depth buffer. Each component is
18515 converted to floating point such that the minimum depth value maps
18516 to 0 and the maximum value maps to 1. Each component is then
18517 multiplied by `GL_DEPTH_SCALE', added to `GL_DEPTH_BIAS', and
18518 finally clamped to the range [0,1] .
18519
18520`GL_RED'
18521`GL_GREEN'
18522`GL_BLUE'
18523`GL_ALPHA'
18524`GL_RGB'
18525`GL_BGR'
18526`GL_RGBA'
18527`GL_BGRA'
18528`GL_LUMINANCE'
18529`GL_LUMINANCE_ALPHA'
18530 Processing differs depending on whether color buffers store color
18531 indices or RGBA color components. If color indices are stored, they
18532 are read from the color buffer selected by `glReadBuffer'. Each
18533 index is converted to fixed point, shifted left or right depending
18534 on the value and sign of `GL_INDEX_SHIFT', and added to
18535 `GL_INDEX_OFFSET'. Indices are then replaced by the red, green,
18536 blue, and alpha values obtained by indexing the tables
18537 `GL_PIXEL_MAP_I_TO_R', `GL_PIXEL_MAP_I_TO_G',
18538 `GL_PIXEL_MAP_I_TO_B', and `GL_PIXEL_MAP_I_TO_A'. Each table must
18539 be of size 2^N , but N may be different for different tables.
18540 Before an index is used to look up a value in a table of size 2^N ,
18541 it must be masked against 2^N-1 .
18542
18543 If RGBA color components are stored in the color buffers, they are
18544 read from the color buffer selected by `glReadBuffer'. Each color
18545 component is converted to floating point such that zero intensity
18546 maps to 0.0 and full intensity maps to 1.0. Each component is then
18547 multiplied by `GL_c_SCALE' and added to `GL_c_BIAS', where C is
18548 RED, GREEN, BLUE, or ALPHA. Finally, if `GL_MAP_COLOR' is
18549 `GL_TRUE', each component is clamped to the range [0,1] , scaled to
18550 the size of its corresponding table, and is then replaced by its
18551 mapping in the table `GL_PIXEL_MAP_c_TO_c', where C is R, G, B, or
18552 A.
18553
18554 Unneeded data is then discarded. For example, `GL_RED' discards the
18555 green, blue, and alpha components, while `GL_RGB' discards only the
18556 alpha component. `GL_LUMINANCE' computes a single-component value
18557 as the sum of the red, green, and blue components, and
18558 `GL_LUMINANCE_ALPHA' does the same, while keeping alpha as a second
18559 value. The final values are clamped to the range [0,1] .
18560
18561The shift, scale, bias, and lookup factors just described are all
18562specified by `glPixelTransfer'. The lookup table contents themselves are
18563specified by `glPixelMap'.
18564
18565Finally, the indices or components are converted to the proper format,
18566as specified by TYPE. If FORMAT is `GL_COLOR_INDEX' or
18567`GL_STENCIL_INDEX' and TYPE is not `GL_FLOAT', each index is masked with
18568the mask value given in the following table. If TYPE is `GL_FLOAT', then
18569each integer index is converted to single-precision floating-point
18570format.
18571
18572If FORMAT is `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
18573`GL_BGR', `GL_RGBA', `GL_BGRA', `GL_LUMINANCE', or `GL_LUMINANCE_ALPHA'
18574and TYPE is not `GL_FLOAT', each component is multiplied by the
18575multiplier shown in the following table. If type is `GL_FLOAT', then
18576each component is passed as is (or converted to the client's
18577single-precision floating-point format if it is different from the one
18578used by the GL).
18579
18580
18581
18582TYPE
18583 *Index Mask*, *Component Conversion*
18584
18585`GL_UNSIGNED_BYTE'
18586 2^8-1 , (2^8-1,)\u2062C
18587
18588`GL_BYTE'
18589 2^7-1 , (2^8-1,)\u2062C-1,/2
18590
18591`GL_BITMAP'
18592 1 , 1
18593
18594`GL_UNSIGNED_SHORT'
18595 2^16-1 , (2^16-1,)\u2062C
18596
18597`GL_SHORT'
18598 2^15-1 , (2^16-1,)\u2062C-1,/2
18599
18600`GL_UNSIGNED_INT'
18601 2^32-1 , (2^32-1,)\u2062C
18602
18603`GL_INT'
18604 2^31-1 , (2^32-1,)\u2062C-1,/2
18605
18606`GL_FLOAT'
18607 none , C
18608
18609Return values are placed in memory as follows. If FORMAT is
18610`GL_COLOR_INDEX', `GL_STENCIL_INDEX', `GL_DEPTH_COMPONENT', `GL_RED',
18611`GL_GREEN', `GL_BLUE', `GL_ALPHA', or `GL_LUMINANCE', a single value is
18612returned and the data for the I th pixel in the J th row is placed in
18613location (J,)\u2062WIDTH+I . `GL_RGB' and `GL_BGR' return three values,
18614`GL_RGBA' and `GL_BGRA' return four values, and `GL_LUMINANCE_ALPHA'
18615returns two values for each pixel, with all values corresponding to a
18616single pixel occupying contiguous space in DATA. Storage parameters set
18617by `glPixelStore', such as `GL_PACK_LSB_FIRST' and `GL_PACK_SWAP_BYTES',
18618affect the way that data is written into memory. See `glPixelStore' for
18619a description.
18620
18621`GL_INVALID_ENUM' is generated if FORMAT or TYPE is not an accepted
18622value.
18623
18624`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
18625`GL_COLOR_INDEX' or `GL_STENCIL_INDEX'.
18626
18627`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
18628
18629`GL_INVALID_OPERATION' is generated if FORMAT is `GL_COLOR_INDEX' and
18630the color buffers store RGBA color components.
18631
18632`GL_INVALID_OPERATION' is generated if FORMAT is `GL_STENCIL_INDEX' and
18633there is no stencil buffer.
18634
18635`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
18636and there is no depth buffer.
18637
18638`GL_INVALID_OPERATION' is generated if TYPE is one of
18639`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
18640`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
18641is not `GL_RGB'.
18642
18643`GL_INVALID_OPERATION' is generated if TYPE is one of
18644`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
18645`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
18646`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
18647`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
18648FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
18649
18650The formats `GL_BGR', and `GL_BGRA' and types `GL_UNSIGNED_BYTE_3_3_2',
18651`GL_UNSIGNED_BYTE_2_3_3_REV', `GL_UNSIGNED_SHORT_5_6_5',
18652`GL_UNSIGNED_SHORT_5_6_5_REV', `GL_UNSIGNED_SHORT_4_4_4_4',
18653`GL_UNSIGNED_SHORT_4_4_4_4_REV', `GL_UNSIGNED_SHORT_5_5_5_1',
18654`GL_UNSIGNED_SHORT_1_5_5_5_REV', `GL_UNSIGNED_INT_8_8_8_8',
18655`GL_UNSIGNED_INT_8_8_8_8_REV', `GL_UNSIGNED_INT_10_10_10_2', and
18656`GL_UNSIGNED_INT_2_10_10_10_REV' are available only if the GL version is
186571.2 or greater.
18658
18659`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18660bound to the `GL_PIXEL_PACK_BUFFER' target and the buffer object's data
18661store is currently mapped.
18662
18663`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18664bound to the `GL_PIXEL_PACK_BUFFER' target and the data would be packed
18665to the buffer object such that the memory writes required would exceed
18666the data store size.
18667
18668`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
18669bound to the `GL_PIXEL_PACK_BUFFER' target and DATA is not evenly
18670divisible into the number of bytes needed to store in memory a datum
18671indicated by TYPE.
8925f36f 18672
3c9b6116
AW
18673`GL_INVALID_OPERATION' is generated if `glReadPixels' is executed
18674between the execution of `glBegin' and the corresponding execution of
18675`glEnd'.")
8925f36f 18676
25072f02 18677(define-gl-procedures
78aa45b9
DH
18678 ((glRectd
18679 (x1 GLdouble)
18680 (y1 GLdouble)
18681 (x2 GLdouble)
18682 (y2 GLdouble)
18683 ->
18684 void)
18685 (glRectf
ca09631c
AW
18686 (x1 GLfloat)
18687 (y1 GLfloat)
18688 (x2 GLfloat)
18689 (y2 GLfloat)
bb894c9d
AW
18690 ->
18691 void)
18692 (glRecti
18693 (x1 GLint)
18694 (y1 GLint)
18695 (x2 GLint)
18696 (y2 GLint)
18697 ->
78aa45b9
DH
18698 void)
18699 (glRects
18700 (x1 GLshort)
18701 (y1 GLshort)
18702 (x2 GLshort)
18703 (y2 GLshort)
18704 ->
18705 void)
18706 (glRectdv
18707 (v1 const-GLdouble-*)
18708 (v2 const-GLdouble-*)
18709 ->
18710 void)
18711 (glRectfv
18712 (v1 const-GLfloat-*)
18713 (v2 const-GLfloat-*)
18714 ->
18715 void)
18716 (glRectiv
18717 (v1 const-GLint-*)
18718 (v2 const-GLint-*)
18719 ->
18720 void)
18721 (glRectsv
18722 (v1 const-GLshort-*)
18723 (v2 const-GLshort-*)
18724 ->
bb894c9d 18725 void))
3c9b6116 18726 "Draw a rectangle.
8925f36f 18727
3c9b6116
AW
18728X1
18729 Y1
8925f36f 18730
3c9b6116 18731 Specify one vertex of a rectangle.
8925f36f 18732
3c9b6116
AW
18733X2
18734 Y2
8925f36f 18735
3c9b6116 18736 Specify the opposite vertex of the rectangle.
8925f36f 18737
3c9b6116
AW
18738`glRect' supports efficient specification of rectangles as two corner
18739points. Each rectangle command takes four arguments, organized either as
18740two consecutive pairs of (X,Y) coordinates or as two pointers to arrays,
18741each containing an (X,Y) pair. The resulting rectangle is defined in the
18742Z=0 plane.
8925f36f 18743
3c9b6116
AW
18744`glRect'(X1, Y1, X2, Y2) is exactly equivalent to the following
18745sequence: Note that if the second vertex is above and to the right of
18746the first vertex, the rectangle is constructed with a counterclockwise
18747winding.
8925f36f 18748
3c9b6116
AW
18749
18750 glBegin(`GL_POLYGON');
18751 glVertex2(X1, Y1);
18752 glVertex2(X2, Y1);
18753 glVertex2(X2, Y2);
18754 glVertex2(X1, Y2);
18755 glEnd();
8925f36f 18756
3c9b6116
AW
18757`GL_INVALID_OPERATION' is generated if `glRect' is executed between the
18758execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18759
25072f02 18760(define-gl-procedures
bb894c9d 18761 ((glRenderMode (mode GLenum) -> GLint))
3c9b6116 18762 "Set rasterization mode.
8925f36f 18763
3c9b6116
AW
18764MODE
18765 Specifies the rasterization mode. Three values are accepted:
18766 `GL_RENDER', `GL_SELECT', and `GL_FEEDBACK'. The initial value is
18767 `GL_RENDER'.
18768
18769`glRenderMode' sets the rasterization mode. It takes one argument, MODE,
18770which can assume one of three predefined values:
18771
18772`GL_RENDER'
18773 Render mode. Primitives are rasterized, producing pixel fragments,
18774 which are written into the frame buffer. This is the normal mode
18775 and also the default mode.
18776
18777`GL_SELECT'
18778 Selection mode. No pixel fragments are produced, and no change to
18779 the frame buffer contents is made. Instead, a record of the names
18780 of primitives that would have been drawn if the render mode had
18781 been `GL_RENDER' is returned in a select buffer, which must be
18782 created (see `glSelectBuffer') before selection mode is entered.
18783
18784`GL_FEEDBACK'
18785 Feedback mode. No pixel fragments are produced, and no change to
18786 the frame buffer contents is made. Instead, the coordinates and
18787 attributes of vertices that would have been drawn if the render
18788 mode had been `GL_RENDER' is returned in a feedback buffer, which
18789 must be created (see `glFeedbackBuffer') before feedback mode is
18790 entered.
18791
18792The return value of `glRenderMode' is determined by the render mode at
18793the time `glRenderMode' is called, rather than by MODE. The values
18794returned for the three render modes are as follows:
18795
18796`GL_RENDER'
18797 0.
18798
18799`GL_SELECT'
18800 The number of hit records transferred to the select buffer.
18801
18802`GL_FEEDBACK'
18803 The number of values (not vertices) transferred to the feedback
18804 buffer.
18805
18806See the `glSelectBuffer' and `glFeedbackBuffer' reference pages for more
18807details concerning selection and feedback operation.
18808
18809`GL_INVALID_ENUM' is generated if MODE is not one of the three accepted
18810values.
18811
18812`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
18813the render mode is `GL_SELECT', or if `glRenderMode' is called with
18814argument `GL_SELECT' before `glSelectBuffer' is called at least once.
18815
18816`GL_INVALID_OPERATION' is generated if `glFeedbackBuffer' is called
18817while the render mode is `GL_FEEDBACK', or if `glRenderMode' is called
18818with argument `GL_FEEDBACK' before `glFeedbackBuffer' is called at least
18819once.
18820
18821`GL_INVALID_OPERATION' is generated if `glRenderMode' is executed
18822between the execution of `glBegin' and the corresponding execution of
18823`glEnd'.")
8925f36f 18824
25072f02 18825(define-gl-procedures
bb894c9d 18826 ((glResetHistogram (target GLenum) -> void))
3c9b6116
AW
18827 "Reset histogram table entries to zero.
18828
18829TARGET
18830 Must be `GL_HISTOGRAM'.
18831
18832`glResetHistogram' resets all the elements of the current histogram
18833table to zero.
18834
18835`GL_INVALID_ENUM' is generated if TARGET is not `GL_HISTOGRAM'.
18836
18837`GL_INVALID_OPERATION' is generated if `glResetHistogram' is executed
18838between the execution of `glBegin' and the corresponding execution of
18839`glEnd'.")
8925f36f 18840
25072f02 18841(define-gl-procedures
bb894c9d 18842 ((glResetMinmax (target GLenum) -> void))
3c9b6116
AW
18843 "Reset minmax table entries to initial values.
18844
18845TARGET
18846 Must be `GL_MINMAX'.
18847
18848`glResetMinmax' resets the elements of the current minmax table to their
18849initial values: the ``maximum'' element receives the minimum possible
18850component values, and the ``minimum'' element receives the maximum
18851possible component values.
18852
18853`GL_INVALID_ENUM' is generated if TARGET is not `GL_MINMAX'.
18854
18855`GL_INVALID_OPERATION' is generated if `glResetMinmax' is executed
18856between the execution of `glBegin' and the corresponding execution of
18857`glEnd'.")
8925f36f 18858
25072f02 18859(define-gl-procedures
78aa45b9
DH
18860 ((glRotated
18861 (angle GLdouble)
18862 (x GLdouble)
18863 (y GLdouble)
18864 (z GLdouble)
18865 ->
18866 void)
18867 (glRotatef
ca09631c
AW
18868 (angle GLfloat)
18869 (x GLfloat)
18870 (y GLfloat)
18871 (z GLfloat)
bb894c9d
AW
18872 ->
18873 void))
3c9b6116
AW
18874 "Multiply the current matrix by a rotation matrix.
18875
18876ANGLE
18877 Specifies the angle of rotation, in degrees.
18878
18879X
18880 Y
18881
18882 Z
18883
18884 Specify the X, Y, and Z coordinates of a vector, respectively.
18885
18886`glRotate' produces a rotation of ANGLE degrees around the vector (X,YZ)
18887. The current matrix (see `glMatrixMode') is multiplied by a rotation
18888matrix with the product replacing the current matrix, as if
18889`glMultMatrix' were called with the following matrix as its argument:
18890
18891((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
18892Y^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
18893Z^2\u2061(1-C,)+C 0), (0 0 0 1),)
18894
18895
18896
18897Where C=COS\u2061(ANGLE,) , S=SIN\u2061(ANGLE,) , and ∥(X,YZ),∥=1 (if not, the GL
18898will normalize this vector).
18899
18900
18901
18902
18903
18904If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18905objects drawn after `glRotate' is called are rotated. Use `glPushMatrix'
18906and `glPopMatrix' to save and restore the unrotated coordinate system.
18907
18908`GL_INVALID_OPERATION' is generated if `glRotate' is executed between
18909the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18910
25072f02 18911(define-gl-procedures
bb894c9d
AW
18912 ((glSampleCoverage
18913 (value GLclampf)
18914 (invert GLboolean)
18915 ->
18916 void))
3c9b6116
AW
18917 "Specify multisample coverage parameters.
18918
18919VALUE
18920 Specify a single floating-point sample coverage value. The value is
18921 clamped to the range [0,1] . The initial value is 1.0.
18922
18923INVERT
18924 Specify a single boolean value representing if the coverage masks
18925 should be inverted. `GL_TRUE' and `GL_FALSE' are accepted. The
18926 initial value is `GL_FALSE'.
18927
18928Multisampling samples a pixel multiple times at various
18929implementation-dependent subpixel locations to generate antialiasing
18930effects. Multisampling transparently antialiases points, lines,
18931polygons, bitmaps, and images if it is enabled.
18932
18933VALUE is used in constructing a temporary mask used in determining which
18934samples will be used in resolving the final fragment color. This mask is
18935bitwise-anded with the coverage mask generated from the multisampling
18936computation. If the INVERT flag is set, the temporary mask is inverted
18937(all bits flipped) and then the bitwise-and is computed.
18938
18939If an implementation does not have any multisample buffers available, or
18940multisampling is disabled, rasterization occurs with only a single
18941sample computing a pixel's final RGB color.
18942
18943Provided an implementation supports multisample buffers, and
18944multisampling is enabled, then a pixel's final color is generated by
18945combining several samples per pixel. Each sample contains color, depth,
18946and stencil information, allowing those operations to be performed on
18947each sample.
18948
18949`GL_INVALID_OPERATION' is generated if `glSampleCoverage' is executed
18950between the execution of `glBegin' and the corresponding execution of
18951`glEnd'.")
8925f36f 18952
25072f02 18953(define-gl-procedures
78aa45b9
DH
18954 ((glScaled
18955 (x GLdouble)
18956 (y GLdouble)
18957 (z GLdouble)
18958 ->
18959 void)
18960 (glScalef
ca09631c
AW
18961 (x GLfloat)
18962 (y GLfloat)
18963 (z GLfloat)
bb894c9d
AW
18964 ->
18965 void))
3c9b6116
AW
18966 "Multiply the current matrix by a general scaling matrix.
18967
18968X
18969 Y
18970
18971 Z
18972
18973 Specify scale factors along the X, Y, and Z axes, respectively.
18974
18975`glScale' produces a nonuniform scaling along the X, Y, and Z axes. The
18976three parameters indicate the desired scale factor along each of the
18977three axes.
18978
18979The current matrix (see `glMatrixMode') is multiplied by this scale
18980matrix, and the product replaces the current matrix as if `glMultMatrix'
18981were called with the following matrix as its argument:
18982
18983((X 0 0 0), (0 Y 0 0), (0 0 Z 0), (0 0 0 1),)
18984
18985If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
18986objects drawn after `glScale' is called are scaled.
18987
18988Use `glPushMatrix' and `glPopMatrix' to save and restore the unscaled
18989coordinate system.
18990
18991`GL_INVALID_OPERATION' is generated if `glScale' is executed between the
18992execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 18993
25072f02 18994(define-gl-procedures
bb894c9d
AW
18995 ((glScissor
18996 (x GLint)
18997 (y GLint)
18998 (width GLsizei)
18999 (height GLsizei)
19000 ->
19001 void))
3c9b6116
AW
19002 "Define the scissor box.
19003
19004X
19005 Y
19006
19007 Specify the lower left corner of the scissor box. Initially (0, 0).
19008
19009WIDTH
19010 HEIGHT
19011
19012 Specify the width and height of the scissor box. When a GL context
19013 is first attached to a window, WIDTH and HEIGHT are set to the
19014 dimensions of that window.
8925f36f 19015
3c9b6116
AW
19016`glScissor' defines a rectangle, called the scissor box, in window
19017coordinates. The first two arguments, X and Y, specify the lower left
19018corner of the box. WIDTH and HEIGHT specify the width and height of the
19019box.
19020
19021To enable and disable the scissor test, call `glEnable' and `glDisable'
19022with argument `GL_SCISSOR_TEST'. The test is initially disabled. While
19023the test is enabled, only pixels that lie within the scissor box can be
19024modified by drawing commands. Window coordinates have integer values at
19025the shared corners of frame buffer pixels. `glScissor(0,0,1,1)' allows
19026modification of only the lower left pixel in the window, and
19027`glScissor(0,0,0,0)' doesn't allow modification of any pixels in the
19028window.
19029
19030When the scissor test is disabled, it is as though the scissor box
19031includes the entire window.
19032
19033`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
19034
19035`GL_INVALID_OPERATION' is generated if `glScissor' is executed between
19036the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 19037
25072f02 19038(define-gl-procedures
bb894c9d
AW
19039 ((glSecondaryColorPointer
19040 (size GLint)
19041 (type GLenum)
19042 (stride GLsizei)
00239761 19043 (pointer const-GLvoid-*)
bb894c9d
AW
19044 ->
19045 void))
3c9b6116 19046 "Define an array of secondary colors.
8925f36f 19047
3c9b6116
AW
19048SIZE
19049 Specifies the number of components per color. Must be 3.
19050
19051TYPE
19052 Specifies the data type of each color component in the array.
19053 Symbolic constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
19054 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
19055 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
19056
19057STRIDE
19058 Specifies the byte offset between consecutive colors. If STRIDE is
19059 0, the colors are understood to be tightly packed in the array. The
19060 initial value is 0.
19061
19062POINTER
19063 Specifies a pointer to the first component of the first color
19064 element in the array. The initial value is 0.
19065
19066`glSecondaryColorPointer' specifies the location and data format of an
19067array of color components to use when rendering. SIZE specifies the
19068number of components per color, and must be 3. TYPE specifies the data
19069type of each color component, and STRIDE specifies the byte stride from
19070one color to the next, allowing vertices and attributes to be packed
19071into a single array or stored in separate arrays.
19072
19073If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
19074target (see `glBindBuffer') while a secondary color array is specified,
19075POINTER is treated as a byte offset into the buffer object's data store.
19076Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as
19077secondary color vertex array client-side state
19078(`GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING').
19079
19080When a secondary color array is specified, SIZE, TYPE, STRIDE, and
19081POINTER are saved as client-side state, in addition to the current
19082vertex array buffer object binding.
19083
19084To enable and disable the secondary color array, call
19085`glEnableClientState' and `glDisableClientState' with the argument
19086`GL_SECONDARY_COLOR_ARRAY'. If enabled, the secondary color array is
19087used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
19088`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
19089called.
19090
19091`GL_INVALID_VALUE' is generated if SIZE is not 3.
19092
19093`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
19094
19095`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 19096
25072f02 19097(define-gl-procedures
78aa45b9
DH
19098 ((glSecondaryColor3b
19099 (red GLbyte)
19100 (green GLbyte)
19101 (blue GLbyte)
19102 ->
19103 void)
19104 (glSecondaryColor3s
19105 (red GLshort)
19106 (green GLshort)
19107 (blue GLshort)
19108 ->
19109 void)
19110 (glSecondaryColor3i
bb894c9d
AW
19111 (red GLint)
19112 (green GLint)
19113 (blue GLint)
19114 ->
19115 void)
ca09631c
AW
19116 (glSecondaryColor3f
19117 (red GLfloat)
19118 (green GLfloat)
19119 (blue GLfloat)
bb894c9d
AW
19120 ->
19121 void)
78aa45b9
DH
19122 (glSecondaryColor3d
19123 (red GLdouble)
19124 (green GLdouble)
19125 (blue GLdouble)
19126 ->
19127 void)
19128 (glSecondaryColor3ub
19129 (red GLubyte)
19130 (green GLubyte)
19131 (blue GLubyte)
19132 ->
19133 void)
19134 (glSecondaryColor3us
19135 (red GLushort)
19136 (green GLushort)
19137 (blue GLushort)
19138 ->
19139 void)
bb894c9d
AW
19140 (glSecondaryColor3ui
19141 (red GLuint)
19142 (green GLuint)
19143 (blue GLuint)
19144 ->
78aa45b9
DH
19145 void)
19146 (glSecondaryColor3bv (v const-GLbyte-*) -> void)
19147 (glSecondaryColor3sv (v const-GLshort-*) -> void)
19148 (glSecondaryColor3iv (v const-GLint-*) -> void)
19149 (glSecondaryColor3fv (v const-GLfloat-*) -> void)
19150 (glSecondaryColor3dv
19151 (v const-GLdouble-*)
19152 ->
19153 void)
19154 (glSecondaryColor3ubv
19155 (v const-GLubyte-*)
19156 ->
19157 void)
19158 (glSecondaryColor3usv
19159 (v const-GLushort-*)
19160 ->
19161 void)
19162 (glSecondaryColor3uiv (v const-GLuint-*) -> void))
3c9b6116
AW
19163 "Set the current secondary color.
19164
19165RED
19166 GREEN
19167
19168 BLUE
19169
19170 Specify new red, green, and blue values for the current secondary
19171 color.
19172
19173The GL stores both a primary four-valued RGBA color and a secondary
19174four-valued RGBA color (where alpha is always set to 0.0) that is
19175associated with every vertex.
19176
19177The secondary color is interpolated and applied to each fragment during
19178rasterization when `GL_COLOR_SUM' is enabled. When lighting is enabled,
19179and `GL_SEPARATE_SPECULAR_COLOR' is specified, the value of the
19180secondary color is assigned the value computed from the specular term of
19181the lighting computation. Both the primary and secondary current colors
19182are applied to each fragment, regardless of the state of `GL_COLOR_SUM',
19183under such conditions. When `GL_SEPARATE_SPECULAR_COLOR' is specified,
19184the value returned from querying the current secondary color is
19185undefined.
19186
19187`glSecondaryColor3b', `glSecondaryColor3s', and `glSecondaryColor3i'
19188take three signed byte, short, or long integers as arguments. When *v*
19189is appended to the name, the color commands can take a pointer to an
19190array of such values.
19191
19192Color values are stored in floating-point format, with unspecified
19193mantissa and exponent sizes. Unsigned integer color components, when
19194specified, are linearly mapped to floating-point values such that the
19195largest representable value maps to 1.0 (full intensity), and 0 maps to
191960.0 (zero intensity). Signed integer color components, when specified,
19197are linearly mapped to floating-point values such that the most positive
19198representable value maps to 1.0, and the most negative representable
19199value maps to -1.0 . (Note that this mapping does not convert 0
19200precisely to 0.0). Floating-point values are mapped directly.
19201
19202Neither floating-point nor signed integer values are clamped to the
19203range [0,1] before the current color is updated. However, color
19204components are clamped to this range before they are interpolated or
19205written into a color buffer.")
8925f36f 19206
25072f02 19207(define-gl-procedures
bb894c9d
AW
19208 ((glSelectBuffer
19209 (size GLsizei)
00239761 19210 (buffer GLuint-*)
bb894c9d
AW
19211 ->
19212 void))
3c9b6116
AW
19213 "Establish a buffer for selection mode values.
19214
19215SIZE
19216 Specifies the size of BUFFER.
19217
19218BUFFER
19219 Returns the selection data.
19220
19221`glSelectBuffer' has two arguments: BUFFER is a pointer to an array of
19222unsigned integers, and SIZE indicates the size of the array. BUFFER
19223returns values from the name stack (see `glInitNames', `glLoadName',
19224`glPushName') when the rendering mode is `GL_SELECT' (see
19225`glRenderMode'). `glSelectBuffer' must be issued before selection mode
19226is enabled, and it must not be issued while the rendering mode is
19227`GL_SELECT'.
19228
19229A programmer can use selection to determine which primitives are drawn
19230into some region of a window. The region is defined by the current
19231modelview and perspective matrices.
19232
19233In selection mode, no pixel fragments are produced from rasterization.
19234Instead, if a primitive or a raster position intersects the clipping
19235volume defined by the viewing frustum and the user-defined clipping
19236planes, this primitive causes a selection hit. (With polygons, no hit
19237occurs if the polygon is culled.) When a change is made to the name
19238stack, or when `glRenderMode' is called, a hit record is copied to
19239BUFFER if any hits have occurred since the last such event (name stack
19240change or `glRenderMode' call). The hit record consists of the number of
19241names in the name stack at the time of the event, followed by the
19242minimum and maximum depth values of all vertices that hit since the
19243previous event, followed by the name stack contents, bottom name first.
19244
19245Depth values (which are in the range [0,1]) are multiplied by 2^32-1 ,
19246before being placed in the hit record.
19247
19248An internal index into BUFFER is reset to 0 whenever selection mode is
19249entered. Each time a hit record is copied into BUFFER, the index is
19250incremented to point to the cell just past the end of the block of
19251names\\(emthat is, to the next available cell If the hit record is larger
19252than the number of remaining locations in BUFFER, as much data as can
19253fit is copied, and the overflow flag is set. If the name stack is empty
19254when a hit record is copied, that record consists of 0 followed by the
19255minimum and maximum depth values.
19256
19257To exit selection mode, call `glRenderMode' with an argument other than
19258`GL_SELECT'. Whenever `glRenderMode' is called while the render mode is
19259`GL_SELECT', it returns the number of hit records copied to BUFFER,
19260resets the overflow flag and the selection buffer pointer, and
19261initializes the name stack to be empty. If the overflow bit was set when
19262`glRenderMode' was called, a negative hit record count is returned.
19263
19264`GL_INVALID_VALUE' is generated if SIZE is negative.
19265
19266`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is called while
19267the render mode is `GL_SELECT', or if `glRenderMode' is called with
19268argument `GL_SELECT' before `glSelectBuffer' is called at least once.
19269
19270`GL_INVALID_OPERATION' is generated if `glSelectBuffer' is executed
19271between the execution of `glBegin' and the corresponding execution of
19272`glEnd'.")
8925f36f 19273
25072f02 19274(define-gl-procedures
bb894c9d
AW
19275 ((glSeparableFilter2D
19276 (target GLenum)
19277 (internalformat GLenum)
19278 (width GLsizei)
19279 (height GLsizei)
19280 (format GLenum)
19281 (type GLenum)
00239761
AW
19282 (row const-GLvoid-*)
19283 (column const-GLvoid-*)
bb894c9d
AW
19284 ->
19285 void))
3c9b6116 19286 "Define a separable two-dimensional convolution filter.
8925f36f 19287
3c9b6116
AW
19288TARGET
19289 Must be `GL_SEPARABLE_2D'.
19290
19291INTERNALFORMAT
19292 The internal format of the convolution filter kernel. The allowable
19293 values are `GL_ALPHA', `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12',
19294 `GL_ALPHA16', `GL_LUMINANCE', `GL_LUMINANCE4', `GL_LUMINANCE8',
19295 `GL_LUMINANCE12', `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA',
19296 `GL_LUMINANCE4_ALPHA4', `GL_LUMINANCE6_ALPHA2',
19297 `GL_LUMINANCE8_ALPHA8', `GL_LUMINANCE12_ALPHA4',
19298 `GL_LUMINANCE12_ALPHA12', `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY',
19299 `GL_INTENSITY4', `GL_INTENSITY8', `GL_INTENSITY12',
19300 `GL_INTENSITY16', `GL_R3_G3_B2', `GL_RGB', `GL_RGB4', `GL_RGB5',
19301 `GL_RGB8', `GL_RGB10', `GL_RGB12', `GL_RGB16', `GL_RGBA',
19302 `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1', `GL_RGBA8', `GL_RGB10_A2',
19303 `GL_RGBA12', or `GL_RGBA16'.
19304
19305WIDTH
19306 The number of elements in the pixel array referenced by ROW. (This
19307 is the width of the separable filter kernel.)
19308
19309HEIGHT
19310 The number of elements in the pixel array referenced by COLUMN.
19311 (This is the height of the separable filter kernel.)
19312
19313FORMAT
19314 The format of the pixel data in ROW and COLUMN. The allowable
19315 values are `GL_RED', `GL_GREEN', `GL_BLUE', `GL_ALPHA', `GL_RGB',
19316 `GL_BGR', `GL_RGBA', `GL_BGRA', `GL_INTENSITY', `GL_LUMINANCE', and
19317 `GL_LUMINANCE_ALPHA'.
19318
19319TYPE
19320 The type of the pixel data in ROW and COLUMN. Symbolic constants
19321 `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP', `GL_UNSIGNED_SHORT',
19322 `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT', `GL_FLOAT',
19323 `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
19324 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
19325 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
19326 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
19327 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
19328 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'
19329 are accepted.
19330
19331ROW
19332 Pointer to a one-dimensional array of pixel data that is processed
19333 to build the row filter kernel.
19334
19335COLUMN
19336 Pointer to a one-dimensional array of pixel data that is processed
19337 to build the column filter kernel.
19338
19339`glSeparableFilter2D' builds a two-dimensional separable convolution
19340filter kernel from two arrays of pixels.
19341
19342The pixel arrays specified by (WIDTH, FORMAT, TYPE, ROW) and (HEIGHT,
19343FORMAT, TYPE, COLUMN) are processed just as if they had been passed to
19344`glDrawPixels', but processing stops after the final expansion to RGBA
19345is completed.
19346
19347If a non-zero named buffer object is bound to the
19348`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a convolution
19349filter is specified, ROW and COLUMN are treated as byte offsets into the
19350buffer object's data store.
19351
19352Next, the R, G, B, and A components of all pixels in both arrays are
19353scaled by the four separable 2D `GL_CONVOLUTION_FILTER_SCALE' parameters
19354and biased by the four separable 2D `GL_CONVOLUTION_FILTER_BIAS'
19355parameters. (The scale and bias parameters are set by
19356`glConvolutionParameter' using the `GL_SEPARABLE_2D' target and the
19357names `GL_CONVOLUTION_FILTER_SCALE' and `GL_CONVOLUTION_FILTER_BIAS'.
19358The parameters themselves are vectors of four values that are applied to
19359red, green, blue, and alpha, in that order.) The R, G, B, and A values
19360are not clamped to [0,1] at any time during this process.
19361
19362Each pixel is then converted to the internal format specified by
19363INTERNALFORMAT. This conversion simply maps the component values of the
19364pixel (R, G, B, and A) to the values included in the internal format
19365(red, green, blue, alpha, luminance, and intensity). The mapping is as
19366follows:
19367
19368*Internal Format*
19369 *Red*, *Green*, *Blue*, *Alpha*, *Luminance*, *Intensity*
19370
19371`GL_LUMINANCE'
19372 , , , , R ,
19373
19374`GL_LUMINANCE_ALPHA'
19375 , , , A , R ,
19376
19377`GL_INTENSITY'
19378 , , , , , R
19379
19380`GL_RGB'
19381 R , G , B , , ,
19382
19383`GL_RGBA'
19384 R , G , B , A , ,
19385
19386The red, green, blue, alpha, luminance, and/or intensity components of
19387the resulting pixels are stored in floating-point rather than integer
19388format. They form two one-dimensional filter kernel images. The row
19389image is indexed by coordinate I starting at zero and increasing from
19390left to right. Each location in the row image is derived from element I
19391of ROW. The column image is indexed by coordinate J starting at zero and
19392increasing from bottom to top. Each location in the column image is
19393derived from element J of COLUMN.
19394
19395Note that after a convolution is performed, the resulting color
19396components are also scaled by their corresponding
19397`GL_POST_CONVOLUTION_c_SCALE' parameters and biased by their
19398corresponding `GL_POST_CONVOLUTION_c_BIAS' parameters (where C takes on
19399the values *RED*, *GREEN*, *BLUE*, and *ALPHA*). These parameters are
19400set by `glPixelTransfer'.
19401
19402`GL_INVALID_ENUM' is generated if TARGET is not `GL_SEPARABLE_2D'.
19403
19404`GL_INVALID_ENUM' is generated if INTERNALFORMAT is not one of the
19405allowable values.
19406
19407`GL_INVALID_ENUM' is generated if FORMAT is not one of the allowable
19408values.
19409
19410`GL_INVALID_ENUM' is generated if TYPE is not one of the allowable
19411values.
19412
19413`GL_INVALID_VALUE' is generated if WIDTH is less than zero or greater
19414than the maximum supported value. This value may be queried with
19415`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
19416`GL_MAX_CONVOLUTION_WIDTH'.
19417
19418`GL_INVALID_VALUE' is generated if HEIGHT is less than zero or greater
19419than the maximum supported value. This value may be queried with
19420`glGetConvolutionParameter' using target `GL_SEPARABLE_2D' and name
19421`GL_MAX_CONVOLUTION_HEIGHT'.
19422
19423`GL_INVALID_OPERATION' is generated if HEIGHT is one of
19424`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
19425`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
19426is not `GL_RGB'.
19427
19428`GL_INVALID_OPERATION' is generated if HEIGHT is one of
19429`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
19430`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
19431`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
19432`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
19433FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
19434
19435`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19436bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
19437data store is currently mapped.
19438
19439`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19440bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
19441unpacked from the buffer object such that the memory reads required
19442would exceed the data store size.
19443
19444`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
19445bound to the `GL_PIXEL_UNPACK_BUFFER' target and ROW or COLUMN is not
19446evenly divisible into the number of bytes needed to store in memory a
19447datum indicated by TYPE.
19448
19449`GL_INVALID_OPERATION' is generated if `glSeparableFilter2D' is executed
19450between the execution of `glBegin' and the corresponding execution of
19451`glEnd'.")
8925f36f 19452
25072f02 19453(define-gl-procedures
bb894c9d 19454 ((glShadeModel (mode GLenum) -> void))
3c9b6116
AW
19455 "Select flat or smooth shading.
19456
19457MODE
19458 Specifies a symbolic value representing a shading technique.
19459 Accepted values are `GL_FLAT' and `GL_SMOOTH'. The initial value is
19460 `GL_SMOOTH'.
19461
19462GL primitives can have either flat or smooth shading. Smooth shading,
19463the default, causes the computed colors of vertices to be interpolated
19464as the primitive is rasterized, typically assigning different colors to
19465each resulting pixel fragment. Flat shading selects the computed color
19466of just one vertex and assigns it to all the pixel fragments generated
19467by rasterizing a single primitive. In either case, the computed color of
19468a vertex is the result of lighting if lighting is enabled, or it is the
19469current color at the time the vertex was specified if lighting is
19470disabled.
19471
19472Flat and smooth shading are indistinguishable for points. Starting when
19473`glBegin' is issued and counting vertices and primitives from 1, the GL
19474gives each flat-shaded line segment I the computed color of vertex I+1 ,
19475its second vertex. Counting similarly from 1, the GL gives each
19476flat-shaded polygon the computed color of the vertex listed in the
19477following table. This is the last vertex to specify the polygon in all
19478cases except single polygons, where the first vertex specifies the
19479flat-shaded color.
19480
19481
19482
19483* Primitive Type of Polygon I *
19484 *Vertex*
19485
19486Single polygon (I==1 )
19487 1
19488
19489Triangle strip
19490 I+2
19491
19492Triangle fan
19493 I+2
19494
19495Independent triangle
19496 3\u2062I
19497
19498Quad strip
19499 2\u2062I+2
19500
19501Independent quad
19502 4\u2062I
19503
19504Flat and smooth shading are specified by `glShadeModel' with MODE set to
19505`GL_FLAT' and `GL_SMOOTH', respectively.
19506
19507`GL_INVALID_ENUM' is generated if MODE is any value other than `GL_FLAT'
19508or `GL_SMOOTH'.
19509
19510`GL_INVALID_OPERATION' is generated if `glShadeModel' is executed
19511between the execution of `glBegin' and the corresponding execution of
19512`glEnd'.")
8925f36f 19513
25072f02 19514(define-gl-procedures
bb894c9d
AW
19515 ((glShaderSource
19516 (shader GLuint)
19517 (count GLsizei)
00239761
AW
19518 (string const-GLchar-**)
19519 (length const-GLint-*)
bb894c9d
AW
19520 ->
19521 void))
3c9b6116
AW
19522 "Replaces the source code in a shader object.
19523
19524SHADER
19525 Specifies the handle of the shader object whose source code is to
19526 be replaced.
19527
19528COUNT
19529 Specifies the number of elements in the STRING and LENGTH arrays.
19530
19531STRING
19532 Specifies an array of pointers to strings containing the source
19533 code to be loaded into the shader.
19534
19535LENGTH
19536 Specifies an array of string lengths.
19537
19538`glShaderSource' sets the source code in SHADER to the source code in
19539the array of strings specified by STRING. Any source code previously
19540stored in the shader object is completely replaced. The number of
19541strings in the array is specified by COUNT. If LENGTH is `NULL', each
19542string is assumed to be null terminated. If LENGTH is a value other than
19543`NULL', it points to an array containing a string length for each of the
19544corresponding elements of STRING. Each element in the LENGTH array may
19545contain the length of the corresponding string (the null character is
19546not counted as part of the string length) or a value less than 0 to
19547indicate that the string is null terminated. The source code strings are
19548not scanned or parsed at this time; they are simply copied into the
19549specified shader object.
19550
19551`GL_INVALID_VALUE' is generated if SHADER is not a value generated by
19552OpenGL.
19553
19554`GL_INVALID_OPERATION' is generated if SHADER is not a shader object.
19555
19556`GL_INVALID_VALUE' is generated if COUNT is less than 0.
19557
19558`GL_INVALID_OPERATION' is generated if `glShaderSource' is executed
19559between the execution of `glBegin' and the corresponding execution of
19560`glEnd'.")
8925f36f 19561
25072f02 19562(define-gl-procedures
bb894c9d
AW
19563 ((glStencilFuncSeparate
19564 (face GLenum)
19565 (func GLenum)
19566 (ref GLint)
19567 (mask GLuint)
19568 ->
19569 void))
3c9b6116
AW
19570 "Set front and/or back function and reference value for stencil testing.
19571
19572FACE
19573 Specifies whether front and/or back stencil state is updated. Three
19574 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
19575 `GL_FRONT_AND_BACK'.
19576
19577FUNC
19578 Specifies the test function. Eight symbolic constants are valid:
19579 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
19580 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
19581 `GL_ALWAYS'.
19582
19583REF
19584 Specifies the reference value for the stencil test. REF is clamped
19585 to the range [0,2^N-1] , where N is the number of bitplanes in the
19586 stencil buffer. The initial value is 0.
19587
19588MASK
19589 Specifies a mask that is ANDed with both the reference value and
19590 the stored stencil value when the test is done. The initial value
19591 is all 1's.
19592
19593Stenciling, like depth-buffering, enables and disables drawing on a
19594per-pixel basis. You draw into the stencil planes using GL drawing
19595primitives, then render geometry and images, using the stencil planes to
19596mask out portions of the screen. Stenciling is typically used in
19597multipass rendering algorithms to achieve special effects, such as
19598decals, outlining, and constructive solid geometry rendering.
19599
19600The stencil test conditionally eliminates a pixel based on the outcome
19601of a comparison between the reference value and the value in the stencil
19602buffer. To enable and disable the test, call `glEnable' and `glDisable'
19603with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
19604of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
19605
19606There can be two separate sets of FUNC, REF, and MASK parameters; one
19607affects back-facing polygons, and the other affects front-facing
19608polygons as well as other non-polygon primitives. `glStencilFunc' sets
19609both front and back stencil state to the same values, as if
19610`glStencilFuncSeparate' were called with FACE set to
19611`GL_FRONT_AND_BACK'.
19612
19613FUNC is a symbolic constant that determines the stencil comparison
19614function. It accepts one of eight values, shown in the following list.
19615REF is an integer reference value that is used in the stencil
19616comparison. It is clamped to the range [0,2^N-1] , where N is the number
19617of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
19618reference value and the stored stencil value, with the ANDed values
19619participating in the comparison.
19620
19621If STENCIL represents the value stored in the corresponding stencil
19622buffer location, the following list shows the effect of each comparison
19623function that can be specified by FUNC. Only if the comparison succeeds
19624is the pixel passed through to the next stage in the rasterization
19625process (see `glStencilOp'). All tests treat STENCIL values as unsigned
19626integers in the range [0,2^N-1] , where N is the number of bitplanes in
19627the stencil buffer.
19628
19629The following values are accepted by FUNC:
19630
19631`GL_NEVER'
19632 Always fails.
19633
19634`GL_LESS'
19635 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
19636
19637`GL_LEQUAL'
19638 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
19639
19640`GL_GREATER'
19641 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
19642
19643`GL_GEQUAL'
19644 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
19645
19646`GL_EQUAL'
19647 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
19648
19649`GL_NOTEQUAL'
19650 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
19651
19652`GL_ALWAYS'
19653 Always passes.
19654
19655`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
19656values.
19657
19658`GL_INVALID_OPERATION' is generated if `glStencilFuncSeparate' is
19659executed between the execution of `glBegin' and the corresponding
19660execution of `glEnd'.")
8925f36f 19661
25072f02 19662(define-gl-procedures
bb894c9d
AW
19663 ((glStencilFunc
19664 (func GLenum)
19665 (ref GLint)
19666 (mask GLuint)
19667 ->
19668 void))
3c9b6116
AW
19669 "Set front and back function and reference value for stencil testing.
19670
19671FUNC
19672 Specifies the test function. Eight symbolic constants are valid:
19673 `GL_NEVER', `GL_LESS', `GL_LEQUAL', `GL_GREATER', `GL_GEQUAL',
19674 `GL_EQUAL', `GL_NOTEQUAL', and `GL_ALWAYS'. The initial value is
19675 `GL_ALWAYS'.
19676
19677REF
19678 Specifies the reference value for the stencil test. REF is clamped
19679 to the range [0,2^N-1] , where N is the number of bitplanes in the
19680 stencil buffer. The initial value is 0.
19681
19682MASK
19683 Specifies a mask that is ANDed with both the reference value and
19684 the stored stencil value when the test is done. The initial value
19685 is all 1's.
19686
19687Stenciling, like depth-buffering, enables and disables drawing on a
19688per-pixel basis. Stencil planes are first drawn into using GL drawing
19689primitives, then geometry and images are rendered using the stencil
19690planes to mask out portions of the screen. Stenciling is typically used
19691in multipass rendering algorithms to achieve special effects, such as
19692decals, outlining, and constructive solid geometry rendering.
19693
19694The stencil test conditionally eliminates a pixel based on the outcome
19695of a comparison between the reference value and the value in the stencil
19696buffer. To enable and disable the test, call `glEnable' and `glDisable'
19697with argument `GL_STENCIL_TEST'. To specify actions based on the outcome
19698of the stencil test, call `glStencilOp' or `glStencilOpSeparate'.
19699
19700There can be two separate sets of FUNC, REF, and MASK parameters; one
19701affects back-facing polygons, and the other affects front-facing
19702polygons as well as other non-polygon primitives. `glStencilFunc' sets
19703both front and back stencil state to the same values. Use
19704`glStencilFuncSeparate' to set front and back stencil state to different
19705values.
19706
19707FUNC is a symbolic constant that determines the stencil comparison
19708function. It accepts one of eight values, shown in the following list.
19709REF is an integer reference value that is used in the stencil
19710comparison. It is clamped to the range [0,2^N-1] , where N is the number
19711of bitplanes in the stencil buffer. MASK is bitwise ANDed with both the
19712reference value and the stored stencil value, with the ANDed values
19713participating in the comparison.
19714
19715If STENCIL represents the value stored in the corresponding stencil
19716buffer location, the following list shows the effect of each comparison
19717function that can be specified by FUNC. Only if the comparison succeeds
19718is the pixel passed through to the next stage in the rasterization
19719process (see `glStencilOp'). All tests treat STENCIL values as unsigned
19720integers in the range [0,2^N-1] , where N is the number of bitplanes in
19721the stencil buffer.
19722
19723The following values are accepted by FUNC:
19724
19725`GL_NEVER'
19726 Always fails.
19727
19728`GL_LESS'
19729 Passes if ( REF & MASK ) < ( STENCIL & MASK ).
19730
19731`GL_LEQUAL'
19732 Passes if ( REF & MASK ) <= ( STENCIL & MASK ).
19733
19734`GL_GREATER'
19735 Passes if ( REF & MASK ) > ( STENCIL & MASK ).
19736
19737`GL_GEQUAL'
19738 Passes if ( REF & MASK ) >= ( STENCIL & MASK ).
19739
19740`GL_EQUAL'
19741 Passes if ( REF & MASK ) = ( STENCIL & MASK ).
19742
19743`GL_NOTEQUAL'
19744 Passes if ( REF & MASK ) != ( STENCIL & MASK ).
19745
19746`GL_ALWAYS'
19747 Always passes.
19748
19749`GL_INVALID_ENUM' is generated if FUNC is not one of the eight accepted
19750values.
19751
19752`GL_INVALID_OPERATION' is generated if `glStencilFunc' is executed
19753between the execution of `glBegin' and the corresponding execution of
19754`glEnd'.")
8925f36f 19755
25072f02 19756(define-gl-procedures
bb894c9d
AW
19757 ((glStencilMaskSeparate
19758 (face GLenum)
19759 (mask GLuint)
19760 ->
19761 void))
3c9b6116
AW
19762 "Control the front and/or back writing of individual bits in the stencil
19763planes.
19764
19765FACE
19766 Specifies whether the front and/or back stencil writemask is
19767 updated. Three symbolic constants are valid: `GL_FRONT', `GL_BACK',
19768 and `GL_FRONT_AND_BACK'.
19769
19770MASK
19771 Specifies a bit mask to enable and disable writing of individual
19772 bits in the stencil planes. Initially, the mask is all 1's.
19773
19774`glStencilMaskSeparate' controls the writing of individual bits in the
19775stencil planes. The least significant N bits of MASK, where N is the
19776number of bits in the stencil buffer, specify a mask. Where a 1 appears
19777in the mask, it's possible to write to the corresponding bit in the
19778stencil buffer. Where a 0 appears, the corresponding bit is
19779write-protected. Initially, all bits are enabled for writing.
19780
19781There can be two separate MASK writemasks; one affects back-facing
19782polygons, and the other affects front-facing polygons as well as other
19783non-polygon primitives. `glStencilMask' sets both front and back stencil
19784writemasks to the same values, as if `glStencilMaskSeparate' were called
19785with FACE set to `GL_FRONT_AND_BACK'.
19786
19787`GL_INVALID_OPERATION' is generated if `glStencilMaskSeparate' is
19788executed between the execution of `glBegin' and the corresponding
19789execution of `glEnd'.")
8925f36f 19790
25072f02 19791(define-gl-procedures
bb894c9d 19792 ((glStencilMask (mask GLuint) -> void))
3c9b6116
AW
19793 "Control the front and back writing of individual bits in the stencil
19794planes.
19795
19796MASK
19797 Specifies a bit mask to enable and disable writing of individual
19798 bits in the stencil planes. Initially, the mask is all 1's.
19799
19800`glStencilMask' controls the writing of individual bits in the stencil
19801planes. The least significant N bits of MASK, where N is the number of
19802bits in the stencil buffer, specify a mask. Where a 1 appears in the
19803mask, it's possible to write to the corresponding bit in the stencil
19804buffer. Where a 0 appears, the corresponding bit is write-protected.
19805Initially, all bits are enabled for writing.
19806
19807There can be two separate MASK writemasks; one affects back-facing
19808polygons, and the other affects front-facing polygons as well as other
19809non-polygon primitives. `glStencilMask' sets both front and back stencil
19810writemasks to the same values. Use `glStencilMaskSeparate' to set front
19811and back stencil writemasks to different values.
19812
19813`GL_INVALID_OPERATION' is generated if `glStencilMask' is executed
19814between the execution of `glBegin' and the corresponding execution of
19815`glEnd'.")
8925f36f 19816
25072f02 19817(define-gl-procedures
bb894c9d
AW
19818 ((glStencilOpSeparate
19819 (face GLenum)
19820 (sfail GLenum)
19821 (dpfail GLenum)
19822 (dppass GLenum)
19823 ->
19824 void))
3c9b6116
AW
19825 "Set front and/or back stencil test actions.
19826
19827FACE
19828 Specifies whether front and/or back stencil state is updated. Three
19829 symbolic constants are valid: `GL_FRONT', `GL_BACK', and
19830 `GL_FRONT_AND_BACK'.
19831
19832SFAIL
19833 Specifies the action to take when the stencil test fails. Eight
19834 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19835 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19836 and `GL_INVERT'. The initial value is `GL_KEEP'.
19837
19838DPFAIL
19839 Specifies the stencil action when the stencil test passes, but the
19840 depth test fails. DPFAIL accepts the same symbolic constants as
19841 SFAIL. The initial value is `GL_KEEP'.
19842
19843DPPASS
19844 Specifies the stencil action when both the stencil test and the
19845 depth test pass, or when the stencil test passes and either there
19846 is no depth buffer or depth testing is not enabled. DPPASS accepts
19847 the same symbolic constants as SFAIL. The initial value is
19848 `GL_KEEP'.
19849
19850Stenciling, like depth-buffering, enables and disables drawing on a
19851per-pixel basis. You draw into the stencil planes using GL drawing
19852primitives, then render geometry and images, using the stencil planes to
19853mask out portions of the screen. Stenciling is typically used in
19854multipass rendering algorithms to achieve special effects, such as
19855decals, outlining, and constructive solid geometry rendering.
19856
19857The stencil test conditionally eliminates a pixel based on the outcome
19858of a comparison between the value in the stencil buffer and a reference
19859value. To enable and disable the test, call `glEnable' and `glDisable'
19860with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19861`glStencilFuncSeparate'.
19862
19863There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19864one affects back-facing polygons, and the other affects front-facing
19865polygons as well as other non-polygon primitives. `glStencilOp' sets
19866both front and back stencil state to the same values, as if
19867`glStencilOpSeparate' were called with FACE set to `GL_FRONT_AND_BACK'.
19868
19869`glStencilOpSeparate' takes three arguments that indicate what happens
19870to the stored stencil value while stenciling is enabled. If the stencil
19871test fails, no change is made to the pixel's color or depth buffers, and
19872SFAIL specifies what happens to the stencil buffer contents. The
19873following eight actions are possible.
19874
19875`GL_KEEP'
19876 Keeps the current value.
19877
19878`GL_ZERO'
19879 Sets the stencil buffer value to 0.
19880
19881`GL_REPLACE'
19882 Sets the stencil buffer value to REF, as specified by
19883 `glStencilFunc'.
19884
19885`GL_INCR'
19886 Increments the current stencil buffer value. Clamps to the maximum
19887 representable unsigned value.
19888
19889`GL_INCR_WRAP'
19890 Increments the current stencil buffer value. Wraps stencil buffer
19891 value to zero when incrementing the maximum representable unsigned
19892 value.
19893
19894`GL_DECR'
19895 Decrements the current stencil buffer value. Clamps to 0.
19896
19897`GL_DECR_WRAP'
19898 Decrements the current stencil buffer value. Wraps stencil buffer
19899 value to the maximum representable unsigned value when decrementing
19900 a stencil buffer value of zero.
19901
19902`GL_INVERT'
19903 Bitwise inverts the current stencil buffer value.
19904
19905Stencil buffer values are treated as unsigned integers. When incremented
19906and decremented, values are clamped to 0 and 2^N-1 , where N is the
19907value returned by querying `GL_STENCIL_BITS'.
19908
19909The other two arguments to `glStencilOpSeparate' specify stencil buffer
19910actions that depend on whether subsequent depth buffer tests succeed
19911(DPPASS) or fail (DPFAIL) (see `glDepthFunc'). The actions are specified
19912using the same eight symbolic constants as SFAIL. Note that DPFAIL is
19913ignored when there is no depth buffer, or when the depth buffer is not
19914enabled. In these cases, SFAIL and DPPASS specify stencil action when
19915the stencil test fails and passes, respectively.
19916
19917`GL_INVALID_ENUM' is generated if FACE is any value other than
19918`GL_FRONT', `GL_BACK', or `GL_FRONT_AND_BACK'.
19919
19920`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
19921other than the eight defined constant values.
19922
19923`GL_INVALID_OPERATION' is generated if `glStencilOpSeparate' is executed
19924between the execution of `glBegin' and the corresponding execution of
19925`glEnd'.")
8925f36f 19926
25072f02 19927(define-gl-procedures
bb894c9d
AW
19928 ((glStencilOp
19929 (sfail GLenum)
19930 (dpfail GLenum)
19931 (dppass GLenum)
19932 ->
19933 void))
3c9b6116
AW
19934 "Set front and back stencil test actions.
19935
19936SFAIL
19937 Specifies the action to take when the stencil test fails. Eight
19938 symbolic constants are accepted: `GL_KEEP', `GL_ZERO',
19939 `GL_REPLACE', `GL_INCR', `GL_INCR_WRAP', `GL_DECR', `GL_DECR_WRAP',
19940 and `GL_INVERT'. The initial value is `GL_KEEP'.
19941
19942DPFAIL
19943 Specifies the stencil action when the stencil test passes, but the
19944 depth test fails. DPFAIL accepts the same symbolic constants as
19945 SFAIL. The initial value is `GL_KEEP'.
19946
19947DPPASS
19948 Specifies the stencil action when both the stencil test and the
19949 depth test pass, or when the stencil test passes and either there
19950 is no depth buffer or depth testing is not enabled. DPPASS accepts
19951 the same symbolic constants as SFAIL. The initial value is
19952 `GL_KEEP'.
19953
19954Stenciling, like depth-buffering, enables and disables drawing on a
19955per-pixel basis. You draw into the stencil planes using GL drawing
19956primitives, then render geometry and images, using the stencil planes to
19957mask out portions of the screen. Stenciling is typically used in
19958multipass rendering algorithms to achieve special effects, such as
19959decals, outlining, and constructive solid geometry rendering.
19960
19961The stencil test conditionally eliminates a pixel based on the outcome
19962of a comparison between the value in the stencil buffer and a reference
19963value. To enable and disable the test, call `glEnable' and `glDisable'
19964with argument `GL_STENCIL_TEST'; to control it, call `glStencilFunc' or
19965`glStencilFuncSeparate'.
19966
19967There can be two separate sets of SFAIL, DPFAIL, and DPPASS parameters;
19968one affects back-facing polygons, and the other affects front-facing
19969polygons as well as other non-polygon primitives. `glStencilOp' sets
19970both front and back stencil state to the same values. Use
19971`glStencilOpSeparate' to set front and back stencil state to different
19972values.
19973
19974`glStencilOp' takes three arguments that indicate what happens to the
19975stored stencil value while stenciling is enabled. If the stencil test
19976fails, no change is made to the pixel's color or depth buffers, and
19977SFAIL specifies what happens to the stencil buffer contents. The
19978following eight actions are possible.
19979
19980`GL_KEEP'
19981 Keeps the current value.
19982
19983`GL_ZERO'
19984 Sets the stencil buffer value to 0.
19985
19986`GL_REPLACE'
19987 Sets the stencil buffer value to REF, as specified by
19988 `glStencilFunc'.
19989
19990`GL_INCR'
19991 Increments the current stencil buffer value. Clamps to the maximum
19992 representable unsigned value.
19993
19994`GL_INCR_WRAP'
19995 Increments the current stencil buffer value. Wraps stencil buffer
19996 value to zero when incrementing the maximum representable unsigned
19997 value.
19998
19999`GL_DECR'
20000 Decrements the current stencil buffer value. Clamps to 0.
20001
20002`GL_DECR_WRAP'
20003 Decrements the current stencil buffer value. Wraps stencil buffer
20004 value to the maximum representable unsigned value when decrementing
20005 a stencil buffer value of zero.
20006
20007`GL_INVERT'
20008 Bitwise inverts the current stencil buffer value.
20009
20010Stencil buffer values are treated as unsigned integers. When incremented
20011and decremented, values are clamped to 0 and 2^N-1 , where N is the
20012value returned by querying `GL_STENCIL_BITS'.
20013
20014The other two arguments to `glStencilOp' specify stencil buffer actions
20015that depend on whether subsequent depth buffer tests succeed (DPPASS) or
20016fail (DPFAIL) (see `glDepthFunc'). The actions are specified using the
20017same eight symbolic constants as SFAIL. Note that DPFAIL is ignored when
20018there is no depth buffer, or when the depth buffer is not enabled. In
20019these cases, SFAIL and DPPASS specify stencil action when the stencil
20020test fails and passes, respectively.
20021
20022`GL_INVALID_ENUM' is generated if SFAIL, DPFAIL, or DPPASS is any value
20023other than the eight defined constant values.
20024
20025`GL_INVALID_OPERATION' is generated if `glStencilOp' is executed between
20026the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 20027
25072f02 20028(define-gl-procedures
bb894c9d
AW
20029 ((glTexCoordPointer
20030 (size GLint)
20031 (type GLenum)
20032 (stride GLsizei)
00239761 20033 (pointer const-GLvoid-*)
bb894c9d
AW
20034 ->
20035 void))
3c9b6116
AW
20036 "Define an array of texture coordinates.
20037
20038SIZE
20039 Specifies the number of coordinates per array element. Must be 1,
20040 2, 3, or 4. The initial value is 4.
20041
20042TYPE
20043 Specifies the data type of each texture coordinate. Symbolic
20044 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
20045 accepted. The initial value is `GL_FLOAT'.
20046
20047STRIDE
20048 Specifies the byte offset between consecutive texture coordinate
20049 sets. If STRIDE is 0, the array elements are understood to be
20050 tightly packed. The initial value is 0.
20051
20052POINTER
20053 Specifies a pointer to the first coordinate of the first texture
20054 coordinate set in the array. The initial value is 0.
20055
20056`glTexCoordPointer' specifies the location and data format of an array
20057of texture coordinates to use when rendering. SIZE specifies the number
20058of coordinates per texture coordinate set, and must be 1, 2, 3, or 4.
20059TYPE specifies the data type of each texture coordinate, and STRIDE
20060specifies the byte stride from one texture coordinate set to the next,
20061allowing vertices and attributes to be packed into a single array or
20062stored in separate arrays. (Single-array storage may be more efficient
20063on some implementations; see `glInterleavedArrays'.)
20064
20065If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
20066target (see `glBindBuffer') while a texture coordinate array is
20067specified, POINTER is treated as a byte offset into the buffer object's
20068data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
20069is saved as texture coordinate vertex array client-side state
20070(`GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING').
20071
20072When a texture coordinate array is specified, SIZE, TYPE, STRIDE, and
20073POINTER are saved as client-side state, in addition to the current
20074vertex array buffer object binding.
20075
20076To enable and disable a texture coordinate array, call
20077`glEnableClientState' and `glDisableClientState' with the argument
20078`GL_TEXTURE_COORD_ARRAY'. If enabled, the texture coordinate array is
20079used when `glArrayElement', `glDrawArrays', `glMultiDrawArrays',
20080`glDrawElements', `glMultiDrawElements', or `glDrawRangeElements' is
20081called.
20082
20083`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
20084
20085`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
20086
20087`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 20088
25072f02 20089(define-gl-procedures
78aa45b9
DH
20090 ((glTexCoord1s (s GLshort) -> void)
20091 (glTexCoord1i (s GLint) -> void)
ca09631c 20092 (glTexCoord1f (s GLfloat) -> void)
78aa45b9
DH
20093 (glTexCoord1d (s GLdouble) -> void)
20094 (glTexCoord2s (s GLshort) (t GLshort) -> void)
bb894c9d 20095 (glTexCoord2i (s GLint) (t GLint) -> void)
ca09631c 20096 (glTexCoord2f (s GLfloat) (t GLfloat) -> void)
78aa45b9
DH
20097 (glTexCoord2d (s GLdouble) (t GLdouble) -> void)
20098 (glTexCoord3s
20099 (s GLshort)
20100 (t GLshort)
20101 (r GLshort)
20102 ->
20103 void)
bb894c9d
AW
20104 (glTexCoord3i
20105 (s GLint)
20106 (t GLint)
20107 (r GLint)
20108 ->
20109 void)
ca09631c
AW
20110 (glTexCoord3f
20111 (s GLfloat)
20112 (t GLfloat)
20113 (r GLfloat)
bb894c9d
AW
20114 ->
20115 void)
78aa45b9
DH
20116 (glTexCoord3d
20117 (s GLdouble)
20118 (t GLdouble)
20119 (r GLdouble)
20120 ->
20121 void)
20122 (glTexCoord4s
20123 (s GLshort)
20124 (t GLshort)
20125 (r GLshort)
20126 (q GLshort)
20127 ->
20128 void)
bb894c9d
AW
20129 (glTexCoord4i
20130 (s GLint)
20131 (t GLint)
20132 (r GLint)
20133 (q GLint)
20134 ->
20135 void)
ca09631c
AW
20136 (glTexCoord4f
20137 (s GLfloat)
20138 (t GLfloat)
20139 (r GLfloat)
20140 (q GLfloat)
bb894c9d 20141 ->
78aa45b9
DH
20142 void)
20143 (glTexCoord4d
20144 (s GLdouble)
20145 (t GLdouble)
20146 (r GLdouble)
20147 (q GLdouble)
20148 ->
20149 void)
20150 (glTexCoord1sv (v const-GLshort-*) -> void)
20151 (glTexCoord1iv (v const-GLint-*) -> void)
20152 (glTexCoord1fv (v const-GLfloat-*) -> void)
20153 (glTexCoord1dv (v const-GLdouble-*) -> void)
20154 (glTexCoord2sv (v const-GLshort-*) -> void)
20155 (glTexCoord2iv (v const-GLint-*) -> void)
20156 (glTexCoord2fv (v const-GLfloat-*) -> void)
20157 (glTexCoord2dv (v const-GLdouble-*) -> void)
20158 (glTexCoord3sv (v const-GLshort-*) -> void)
20159 (glTexCoord3iv (v const-GLint-*) -> void)
20160 (glTexCoord3fv (v const-GLfloat-*) -> void)
20161 (glTexCoord3dv (v const-GLdouble-*) -> void)
20162 (glTexCoord4sv (v const-GLshort-*) -> void)
20163 (glTexCoord4iv (v const-GLint-*) -> void)
20164 (glTexCoord4fv (v const-GLfloat-*) -> void)
20165 (glTexCoord4dv (v const-GLdouble-*) -> void))
3c9b6116
AW
20166 "Set the current texture coordinates.
20167
20168S
20169 T
20170
20171 R
20172
20173 Q
20174
20175 Specify S, T, R, and Q texture coordinates. Not all parameters are
20176 present in all forms of the command.
20177
20178`glTexCoord' specifies texture coordinates in one, two, three, or four
20179dimensions. `glTexCoord1' sets the current texture coordinates to
20180(S,001) ; a call to `glTexCoord2' sets them to (S,T01) . Similarly,
20181`glTexCoord3' specifies the texture coordinates as (S,TR1) , and
20182`glTexCoord4' defines all four components explicitly as (S,TRQ) .
20183
20184The current texture coordinates are part of the data that is associated
20185with each vertex and with the current raster position. Initially, the
20186values for S, T, R, and Q are (0, 0, 0, 1).")
8925f36f 20187
25072f02 20188(define-gl-procedures
bb894c9d
AW
20189 ((glTexEnvf
20190 (target GLenum)
20191 (pname GLenum)
20192 (param GLfloat)
20193 ->
20194 void)
20195 (glTexEnvi
20196 (target GLenum)
20197 (pname GLenum)
20198 (param GLint)
20199 ->
78aa45b9
DH
20200 void)
20201 (glTexEnvfv
20202 (target GLenum)
20203 (pname GLenum)
20204 (params const-GLfloat-*)
20205 ->
20206 void)
20207 (glTexEnviv
20208 (target GLenum)
20209 (pname GLenum)
20210 (params const-GLint-*)
20211 ->
bb894c9d 20212 void))
3c9b6116
AW
20213 "Set texture environment parameters.
20214
20215TARGET
20216 Specifies a texture environment. May be `GL_TEXTURE_ENV',
20217 `GL_TEXTURE_FILTER_CONTROL' or `GL_POINT_SPRITE'.
20218
20219PNAME
20220 Specifies the symbolic name of a single-valued texture environment
20221 parameter. May be either `GL_TEXTURE_ENV_MODE',
20222 `GL_TEXTURE_LOD_BIAS', `GL_COMBINE_RGB', `GL_COMBINE_ALPHA',
20223 `GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
20224 `GL_SRC1_ALPHA', `GL_SRC2_ALPHA', `GL_OPERAND0_RGB',
20225 `GL_OPERAND1_RGB', `GL_OPERAND2_RGB', `GL_OPERAND0_ALPHA',
20226 `GL_OPERAND1_ALPHA', `GL_OPERAND2_ALPHA', `GL_RGB_SCALE',
20227 `GL_ALPHA_SCALE', or `GL_COORD_REPLACE'.
20228
20229PARAM
20230 Specifies a single symbolic constant, one of `GL_ADD',
20231 `GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_MODULATE', `GL_DECAL',
20232 `GL_BLEND', `GL_REPLACE', `GL_SUBTRACT', `GL_COMBINE',
20233 `GL_TEXTURE', `GL_CONSTANT', `GL_PRIMARY_COLOR', `GL_PREVIOUS',
20234 `GL_SRC_COLOR', `GL_ONE_MINUS_SRC_COLOR', `GL_SRC_ALPHA',
20235 `GL_ONE_MINUS_SRC_ALPHA', a single boolean value for the point
20236 sprite texture coordinate replacement, a single floating-point
20237 value for the texture level-of-detail bias, or 1.0, 2.0, or 4.0
20238 when specifying the `GL_RGB_SCALE' or `GL_ALPHA_SCALE'.
20239
20240A texture environment specifies how texture values are interpreted when
20241a fragment is textured. When TARGET is `GL_TEXTURE_FILTER_CONTROL',
20242PNAME must be `GL_TEXTURE_LOD_BIAS'. When TARGET is `GL_TEXTURE_ENV',
20243PNAME can be `GL_TEXTURE_ENV_MODE', `GL_TEXTURE_ENV_COLOR',
20244`GL_COMBINE_RGB', `GL_COMBINE_ALPHA', `GL_RGB_SCALE', `GL_ALPHA_SCALE',
20245`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
20246`GL_SRC1_ALPHA', or `GL_SRC2_ALPHA'.
20247
20248If PNAME is `GL_TEXTURE_ENV_MODE', then PARAMS is (or points to) the
20249symbolic name of a texture function. Six texture functions may be
20250specified: `GL_ADD', `GL_MODULATE', `GL_DECAL', `GL_BLEND',
20251`GL_REPLACE', or `GL_COMBINE'.
20252
20253The following table shows the correspondence of filtered texture values
20254R_T , G_T , B_T , A_T , L_T , I_T to texture source components. C_S and
20255A_S are used by the texture functions described below.
20256
20257
20258
20259Texture Base Internal Format
20260 `C'_S , `A'_S
20261
20262`GL_ALPHA'
20263 (0, 0, 0) , A_T
20264
20265`GL_LUMINANCE'
20266 ( L_T , L_T , L_T ) , 1
20267
20268`GL_LUMINANCE_ALPHA'
20269 ( L_T , L_T , L_T ) , A_T
20270
20271`GL_INTENSITY'
20272 ( I_T , I_T , I_T ) , I_T
20273
20274`GL_RGB'
20275 ( R_T , G_T , B_T ) , 1
20276
20277`GL_RGBA'
20278 ( R_T , G_T , B_T ) , A_T
20279
20280A texture function acts on the fragment to be textured using the texture
20281image value that applies to the fragment (see `glTexParameter') and
20282produces an RGBA color for that fragment. The following table shows how
20283the RGBA color is produced for each of the first five texture functions
20284that can be chosen. C is a triple of color values (RGB) and A is the
20285associated alpha value. RGBA values extracted from a texture image are
20286in the range [0,1]. The subscript P refers to the color computed from
20287the previous texture stage (or the incoming fragment if processing
20288texture stage 0), the subscript S to the texture source color, the
20289subscript C to the texture environment color, and the subscript V
20290indicates a value produced by the texture function.
20291
20292
20293
20294Texture Base Internal Format
20295 `Value', `GL_REPLACE' Function , `GL_MODULATE' Function ,
20296 `GL_DECAL' Function , `GL_BLEND' Function , `GL_ADD' Function
20297
20298`GL_ALPHA'
20299 C_V= , C_P , C_P , undefined , C_P , C_P
20300
20301
20302 A_V= , A_S , A_P\u2062A_S , , A_V=A_P\u2062A_S , A_P\u2062A_S
20303
20304`GL_LUMINANCE'
20305 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
20306
20307(or 1)
20308 A_V= , A_P , A_P , , A_P , A_P
20309
20310`GL_LUMINANCE_ALPHA'
20311 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
20312
20313(or 2)
20314 A_V= , A_S , A_P\u2062A_S , , A_P\u2062A_S , A_P\u2062A_S
20315
20316`GL_INTENSITY'
20317 C_V= , C_S , C_P\u2062C_S , undefined , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
20318
20319
20320 A_V= , A_S , A_P\u2062A_S , , A_P\u2062(1-A_S,)+A_C\u2062A_S , A_P+A_S
20321
20322`GL_RGB'
20323 C_V= , C_S , C_P\u2062C_S , C_S , C_P\u2062(1-C_S,)+C_C\u2062C_S , C_P+C_S
20324
20325(or 3)
20326 A_V= , A_P , A_P , A_P , A_P , A_P
20327
20328`GL_RGBA'
20329 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
20330 , C_P+C_S
20331
20332(or 4)
20333 A_V= , A_S , A_P\u2062A_S , A_P , A_P\u2062A_S , A_P\u2062A_S
20334
20335If PNAME is `GL_TEXTURE_ENV_MODE', and PARAMS is `GL_COMBINE', the form
20336of the texture function depends on the values of `GL_COMBINE_RGB' and
20337`GL_COMBINE_ALPHA'.
20338
20339The following describes how the texture sources, as specified by
20340`GL_SRC0_RGB', `GL_SRC1_RGB', `GL_SRC2_RGB', `GL_SRC0_ALPHA',
20341`GL_SRC1_ALPHA', and `GL_SRC2_ALPHA', are combined to produce a final
20342texture color. In the following tables, `GL_SRC0_c' is represented by
20343ARG0 , `GL_SRC1_c' is represented by ARG1 , and `GL_SRC2_c' is
20344represented by ARG2 .
20345
20346`GL_COMBINE_RGB' accepts any of `GL_REPLACE', `GL_MODULATE', `GL_ADD',
20347`GL_ADD_SIGNED', `GL_INTERPOLATE', `GL_SUBTRACT', `GL_DOT3_RGB', or
20348`GL_DOT3_RGBA'.
20349
20350
20351
20352*`GL_COMBINE_RGB'*
20353 *Texture Function*
20354
20355`GL_REPLACE'
20356 ARG0
20357
20358`GL_MODULATE'
20359 ARG0×ARG1
20360
20361`GL_ADD'
20362 ARG0+ARG1
20363
20364`GL_ADD_SIGNED'
20365 ARG0+ARG1-0.5
20366
20367`GL_INTERPOLATE'
20368 ARG0×ARG2+ARG1×(1-ARG2,)
20369
20370`GL_SUBTRACT'
20371 ARG0-ARG1
20372
20373`GL_DOT3_RGB' or `GL_DOT3_RGBA'
20374 4×(((ARG0_R,-0.5,)×(ARG1_R,-0.5,),)+((ARG0_G,-0.5,)×(ARG1_G,-0.5,),
20375 )+((ARG0_B,-0.5,)×(ARG1_B,-0.5,),),)
20376
20377The scalar results for `GL_DOT3_RGB' and `GL_DOT3_RGBA' are placed into
20378each of the 3 (RGB) or 4 (RGBA) components on output.
20379
20380Likewise, `GL_COMBINE_ALPHA' accepts any of `GL_REPLACE', `GL_MODULATE',
20381`GL_ADD', `GL_ADD_SIGNED', `GL_INTERPOLATE', or `GL_SUBTRACT'. The
20382following table describes how alpha values are combined:
20383
20384
20385
20386*`GL_COMBINE_ALPHA'*
20387 *Texture Function*
20388
20389`GL_REPLACE'
20390 ARG0
20391
20392`GL_MODULATE'
20393 ARG0×ARG1
20394
20395`GL_ADD'
20396 ARG0+ARG1
20397
20398`GL_ADD_SIGNED'
20399 ARG0+ARG1-0.5
20400
20401`GL_INTERPOLATE'
20402 ARG0×ARG2+ARG1×(1-ARG2,)
20403
20404`GL_SUBTRACT'
20405 ARG0-ARG1
20406
20407In the following tables, the value C_S represents the color sampled from
20408the currently bound texture, C_C represents the constant
20409texture-environment color, C_F represents the primary color of the
20410incoming fragment, and C_P represents the color computed from the
20411previous texture stage or C_F if processing texture stage 0. Likewise,
20412A_S , A_C , A_F , and A_P represent the respective alpha values.
20413
20414The following table describes the values assigned to ARG0 , ARG1 , and
20415ARG2 based upon the RGB sources and operands:
20416
20417
20418
20419*`GL_SRCn_RGB'*
20420 *`GL_OPERANDn_RGB'*, *Argument Value*
20421
20422`GL_TEXTURE'
20423 `GL_SRC_COLOR', C_S,
20424
20425
20426 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
20427
20428
20429 `GL_SRC_ALPHA', A_S,
20430
20431
20432 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
20433
20434`GL_TEXTUREn'
20435 `GL_SRC_COLOR', C_S,
20436
20437
20438 `GL_ONE_MINUS_SRC_COLOR', 1-C_S,
20439
20440
20441 `GL_SRC_ALPHA', A_S,
20442
20443
20444 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
20445
20446`GL_CONSTANT'
20447 `GL_SRC_COLOR', C_C,
20448
20449
20450 `GL_ONE_MINUS_SRC_COLOR', 1-C_C,
20451
20452
20453 `GL_SRC_ALPHA', A_C,
20454
20455
20456 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
20457
20458`GL_PRIMARY_COLOR'
20459 `GL_SRC_COLOR', C_F,
20460
8925f36f 20461
3c9b6116 20462 `GL_ONE_MINUS_SRC_COLOR', 1-C_F,
8925f36f 20463
8925f36f 20464
3c9b6116 20465 `GL_SRC_ALPHA', A_F,
8925f36f 20466
8925f36f 20467
3c9b6116 20468 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
8925f36f 20469
3c9b6116
AW
20470`GL_PREVIOUS'
20471 `GL_SRC_COLOR', C_P,
8925f36f 20472
8925f36f 20473
3c9b6116 20474 `GL_ONE_MINUS_SRC_COLOR', 1-C_P,
8925f36f 20475
8925f36f 20476
3c9b6116 20477 `GL_SRC_ALPHA', A_P,
8925f36f 20478
8925f36f 20479
3c9b6116 20480 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
8925f36f 20481
3c9b6116
AW
20482For `GL_TEXTUREn' sources, C_S and A_S represent the color and alpha,
20483respectively, produced from texture stage N .
8925f36f 20484
3c9b6116
AW
20485The follow table describes the values assigned to ARG0 , ARG1 , and ARG2
20486based upon the alpha sources and operands:
8925f36f 20487
8925f36f 20488
8925f36f 20489
3c9b6116
AW
20490*`GL_SRCn_ALPHA'*
20491 *`GL_OPERANDn_ALPHA'*, *Argument Value*
8925f36f 20492
3c9b6116
AW
20493`GL_TEXTURE'
20494 `GL_SRC_ALPHA', A_S,
8925f36f 20495
8925f36f 20496
3c9b6116 20497 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 20498
3c9b6116
AW
20499`GL_TEXTUREn'
20500 `GL_SRC_ALPHA', A_S,
8925f36f 20501
8925f36f 20502
3c9b6116 20503 `GL_ONE_MINUS_SRC_ALPHA', 1-A_S,
8925f36f 20504
3c9b6116
AW
20505`GL_CONSTANT'
20506 `GL_SRC_ALPHA', A_C,
8925f36f 20507
8925f36f 20508
3c9b6116 20509 `GL_ONE_MINUS_SRC_ALPHA', 1-A_C,
8925f36f 20510
3c9b6116
AW
20511`GL_PRIMARY_COLOR'
20512 `GL_SRC_ALPHA', A_F,
8925f36f 20513
8925f36f 20514
3c9b6116
AW
20515 `GL_ONE_MINUS_SRC_ALPHA', 1-A_F,
20516
20517`GL_PREVIOUS'
20518 `GL_SRC_ALPHA', A_P,
20519
20520
20521 `GL_ONE_MINUS_SRC_ALPHA', 1-A_P,
20522
20523The RGB and alpha results of the texture function are multipled by the
20524values of `GL_RGB_SCALE' and `GL_ALPHA_SCALE', respectively, and clamped
20525to the range [0,1] .
20526
20527If PNAME is `GL_TEXTURE_ENV_COLOR', PARAMS is a pointer to an array that
20528holds an RGBA color consisting of four values. Integer color components
20529are interpreted linearly such that the most positive integer maps to
205301.0, and the most negative integer maps to -1.0. The values are clamped
20531to the range [0,1] when they are specified. C_C takes these four values.
20532
20533If PNAME is `GL_TEXTURE_LOD_BIAS', the value specified is added to the
20534texture level-of-detail parameter, that selects which mipmap, or mipmaps
20535depending upon the selected `GL_TEXTURE_MIN_FILTER', will be sampled.
20536
20537`GL_TEXTURE_ENV_MODE' defaults to `GL_MODULATE' and
20538`GL_TEXTURE_ENV_COLOR' defaults to (0, 0, 0, 0).
8925f36f 20539
3c9b6116
AW
20540If TARGET is `GL_POINT_SPRITE' and PNAME is `GL_COORD_REPLACE', the
20541boolean value specified is used to either enable or disable point sprite
20542texture coordinate replacement. The default value is `GL_FALSE'.
8925f36f 20543
3c9b6116
AW
20544`GL_INVALID_ENUM' is generated when TARGET or PNAME is not one of the
20545accepted defined values, or when PARAMS should have a defined constant
20546value (based on the value of PNAME) and does not.
20547
20548`GL_INVALID_VALUE' is generated if the PARAMS value for `GL_RGB_SCALE'
20549or `GL_ALPHA_SCALE' are not one of 1.0, 2.0, or 4.0.
20550
20551`GL_INVALID_OPERATION' is generated if `glTexEnv' is executed between
20552the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 20553
25072f02 20554(define-gl-procedures
bb894c9d
AW
20555 ((glTexGeni
20556 (coord GLenum)
20557 (pname GLenum)
20558 (param GLint)
20559 ->
20560 void)
ca09631c 20561 (glTexGenf
bb894c9d
AW
20562 (coord GLenum)
20563 (pname GLenum)
ca09631c 20564 (param GLfloat)
bb894c9d 20565 ->
78aa45b9
DH
20566 void)
20567 (glTexGend
20568 (coord GLenum)
20569 (pname GLenum)
20570 (param GLdouble)
20571 ->
20572 void)
20573 (glTexGeniv
20574 (coord GLenum)
20575 (pname GLenum)
20576 (params const-GLint-*)
20577 ->
20578 void)
20579 (glTexGenfv
20580 (coord GLenum)
20581 (pname GLenum)
20582 (params const-GLfloat-*)
20583 ->
20584 void)
20585 (glTexGendv
20586 (coord GLenum)
20587 (pname GLenum)
20588 (params const-GLdouble-*)
20589 ->
bb894c9d 20590 void))
3c9b6116 20591 "Control the generation of texture coordinates.
8925f36f 20592
3c9b6116
AW
20593COORD
20594 Specifies a texture coordinate. Must be one of `GL_S', `GL_T',
20595 `GL_R', or `GL_Q'.
8925f36f 20596
3c9b6116
AW
20597PNAME
20598 Specifies the symbolic name of the texture-coordinate generation
20599 function. Must be `GL_TEXTURE_GEN_MODE'.
8925f36f 20600
3c9b6116
AW
20601PARAM
20602 Specifies a single-valued texture generation parameter, one of
20603 `GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP',
20604 `GL_NORMAL_MAP', or `GL_REFLECTION_MAP'.
8925f36f 20605
3c9b6116
AW
20606`glTexGen' selects a texture-coordinate generation function or supplies
20607coefficients for one of the functions. COORD names one of the (S, T, R,
20608Q) texture coordinates; it must be one of the symbols `GL_S', `GL_T',
20609`GL_R', or `GL_Q'. PNAME must be one of three symbolic constants:
20610`GL_TEXTURE_GEN_MODE', `GL_OBJECT_PLANE', or `GL_EYE_PLANE'. If PNAME is
20611`GL_TEXTURE_GEN_MODE', then PARAMS chooses a mode, one of
20612`GL_OBJECT_LINEAR', `GL_EYE_LINEAR', `GL_SPHERE_MAP', `GL_NORMAL_MAP',
20613or `GL_REFLECTION_MAP'. If PNAME is either `GL_OBJECT_PLANE' or
20614`GL_EYE_PLANE', PARAMS contains coefficients for the corresponding
20615texture generation function.
8925f36f 20616
3c9b6116 20617If the texture generation function is `GL_OBJECT_LINEAR', the function
8925f36f 20618
3c9b6116 20619G=P_1×X_O+P_2×Y_O+P_3×Z_O+P_4×W_O
8925f36f 20620
3c9b6116
AW
20621is used, where G is the value computed for the coordinate named in
20622COORD, P_1 , P_2 , P_3 , and P_4 are the four values supplied in PARAMS,
20623and X_O , Y_O , Z_O , and W_O are the object coordinates of the vertex.
20624This function can be used, for example, to texture-map terrain using sea
20625level as a reference plane (defined by P_1 , P_2 , P_3 , and P_4 ). The
20626altitude of a terrain vertex is computed by the `GL_OBJECT_LINEAR'
20627coordinate generation function as its distance from sea level; that
20628altitude can then be used to index the texture image to map white snow
20629onto peaks and green grass onto foothills.
8925f36f 20630
3c9b6116
AW
20631If the texture generation function is `GL_EYE_LINEAR', the function
20632
20633G=P_1,^″×X_E+P_2,^″×Y_E+P_3,^″×Z_E+P_4,^″×W_E
20634
20635is used, where
20636
20637(P_1,^″\u2062P_2,^″\u2062P_3,^″\u2062P_4,^″,)=(P_1\u2062P_2\u2062P_3\u2062P_4,)\u2062M^-1
20638
20639and X_E , Y_E , Z_E , and W_E are the eye coordinates of the vertex, P_1
20640, P_2 , P_3 , and P_4 are the values supplied in PARAMS, and M is the
20641modelview matrix when `glTexGen' is invoked. If M is poorly conditioned
20642or singular, texture coordinates generated by the resulting function may
20643be inaccurate or undefined.
20644
20645Note that the values in PARAMS define a reference plane in eye
20646coordinates. The modelview matrix that is applied to them may not be the
20647same one in effect when the polygon vertices are transformed. This
20648function establishes a field of texture coordinates that can produce
20649dynamic contour lines on moving objects.
20650
20651If the texture generation function is `GL_SPHERE_MAP' and COORD is
20652either `GL_S' or `GL_T', S and T texture coordinates are generated as
20653follows. Let U be the unit vector pointing from the origin to the
20654polygon vertex (in eye coordinates). Let N sup prime be the current
20655normal, after transformation to eye coordinates. Let
20656
20657F=(F_X\u2062F_Y\u2062F_Z,)^T be the reflection vector such that
20658
20659F=U-2\u2062N^″\u2062N^″,^T\u2062U
20660
20661Finally, let M=2\u2062√(F_X,^2+F_Y,^2+(F_Z+1,)^2,) . Then the values assigned
20662to the S and T texture coordinates are
20663
20664S=F_X/M+1/2
20665
20666T=F_Y/M+1/2
20667
20668To enable or disable a texture-coordinate generation function, call
20669`glEnable' or `glDisable' with one of the symbolic texture-coordinate
20670names (`GL_TEXTURE_GEN_S', `GL_TEXTURE_GEN_T', `GL_TEXTURE_GEN_R', or
20671`GL_TEXTURE_GEN_Q') as the argument. When enabled, the specified texture
20672coordinate is computed according to the generating function associated
20673with that coordinate. When disabled, subsequent vertices take the
20674specified texture coordinate from the current set of texture
20675coordinates. Initially, all texture generation functions are set to
20676`GL_EYE_LINEAR' and are disabled. Both S plane equations are (1, 0, 0,
206770), both T plane equations are (0, 1, 0, 0), and all R and Q plane
20678equations are (0, 0, 0, 0).
20679
20680When the `ARB_multitexture' extension is supported, `glTexGen' sets the
20681texture generation parameters for the currently active texture unit,
20682selected with `glActiveTexture'.
20683
20684`GL_INVALID_ENUM' is generated when COORD or PNAME is not an accepted
20685defined value, or when PNAME is `GL_TEXTURE_GEN_MODE' and PARAMS is not
20686an accepted defined value.
20687
20688`GL_INVALID_ENUM' is generated when PNAME is `GL_TEXTURE_GEN_MODE',
20689PARAMS is `GL_SPHERE_MAP', and COORD is either `GL_R' or `GL_Q'.
20690
20691`GL_INVALID_OPERATION' is generated if `glTexGen' is executed between
20692the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 20693
25072f02 20694(define-gl-procedures
bb894c9d
AW
20695 ((glTexImage1D
20696 (target GLenum)
20697 (level GLint)
20698 (internalFormat GLint)
20699 (width GLsizei)
20700 (border GLint)
20701 (format GLenum)
20702 (type GLenum)
00239761 20703 (data const-GLvoid-*)
bb894c9d
AW
20704 ->
20705 void))
3c9b6116 20706 "Specify a one-dimensional texture image.
8925f36f 20707
3c9b6116
AW
20708TARGET
20709 Specifies the target texture. Must be `GL_TEXTURE_1D' or
20710 `GL_PROXY_TEXTURE_1D'.
8925f36f 20711
3c9b6116
AW
20712LEVEL
20713 Specifies the level-of-detail number. Level 0 is the base image
20714 level. Level N is the Nth mipmap reduction image.
8925f36f 20715
3c9b6116
AW
20716INTERNALFORMAT
20717 Specifies the number of color components in the texture. Must be 1,
20718 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
20719 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
20720 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
20721 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
20722 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
20723 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
20724 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
20725 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
20726 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
20727 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
20728 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
20729 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
20730 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
20731 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
20732 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
20733 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
20734 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
20735 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
20736 `GL_SRGB8_ALPHA8'.
8925f36f 20737
3c9b6116
AW
20738WIDTH
20739 Specifies the width of the texture image including the border if
20740 any. If the GL version does not support non-power-of-two sizes,
20741 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
20742 implementations support texture images that are at least 64 texels
20743 wide. The height of the 1D texture image is 1.
8925f36f 20744
3c9b6116
AW
20745BORDER
20746 Specifies the width of the border. Must be either 0 or 1.
8925f36f 20747
3c9b6116
AW
20748FORMAT
20749 Specifies the format of the pixel data. The following symbolic
20750 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
20751 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
20752 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 20753
3c9b6116
AW
20754TYPE
20755 Specifies the data type of the pixel data. The following symbolic
20756 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
20757 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
20758 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20759 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
20760 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20761 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20762 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20763 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
20764
20765DATA
20766 Specifies a pointer to the image data in memory.
20767
20768Texturing maps a portion of a specified texture image onto each
20769graphical primitive for which texturing is enabled. To enable and
20770disable one-dimensional texturing, call `glEnable' and `glDisable' with
20771argument `GL_TEXTURE_1D'.
20772
20773Texture images are defined with `glTexImage1D'. The arguments describe
20774the parameters of the texture image, such as width, width of the border,
20775level-of-detail number (see `glTexParameter'), and the internal
20776resolution and format used to store the image. The last three arguments
20777describe how the image is represented in memory; they are identical to
20778the pixel formats used for `glDrawPixels'.
20779
20780If TARGET is `GL_PROXY_TEXTURE_1D', no data is read from DATA, but all
20781of the texture image state is recalculated, checked for consistency, and
20782checked against the implementation's capabilities. If the implementation
20783cannot handle a texture of the requested texture size, it sets all of
20784the image state to 0, but does not generate an error (see `glGetError').
20785To query for an entire mipmap array, use an image array level greater
20786than or equal to 1.
20787
20788If TARGET is `GL_TEXTURE_1D', data is read from DATA as a sequence of
20789signed or unsigned bytes, shorts, or longs, or single-precision
20790floating-point values, depending on TYPE. These values are grouped into
20791sets of one, two, three, or four values, depending on FORMAT, to form
20792elements. If TYPE is `GL_BITMAP', the data is considered as a string of
20793unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
20794treated as eight 1-bit elements, with bit ordering determined by
20795`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
20796
20797If a non-zero named buffer object is bound to the
20798`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
20799image is specified, DATA is treated as a byte offset into the buffer
20800object's data store.
20801
20802The first element corresponds to the left end of the texture array.
20803Subsequent elements progress left-to-right through the remaining texels
20804in the texture array. The final element corresponds to the right end of
20805the texture array.
20806
20807FORMAT determines the composition of each element in DATA. It can assume
20808one of these symbolic values:
20809
20810`GL_COLOR_INDEX'
20811 Each element is a single value, a color index. The GL converts it
20812 to fixed point (with an unspecified number of zero bits to the
20813 right of the binary point), shifted left or right depending on the
20814 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
20815 (see `glPixelTransfer'). The resulting index is converted to a set
20816 of color components using the `GL_PIXEL_MAP_I_TO_R',
20817 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
20818 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
20819
20820`GL_RED'
20821 Each element is a single red component. The GL converts it to
20822 floating point and assembles it into an RGBA element by attaching 0
20823 for green and blue, and 1 for alpha. Each component is then
20824 multiplied by the signed scale factor `GL_c_SCALE', added to the
20825 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20826 `glPixelTransfer').
20827
20828`GL_GREEN'
20829 Each element is a single green component. The GL converts it to
20830 floating point and assembles it into an RGBA element by attaching 0
20831 for red and blue, and 1 for alpha. Each component is then
20832 multiplied by the signed scale factor `GL_c_SCALE', added to the
20833 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20834 `glPixelTransfer').
20835
20836`GL_BLUE'
20837 Each element is a single blue component. The GL converts it to
20838 floating point and assembles it into an RGBA element by attaching 0
20839 for red and green, and 1 for alpha. Each component is then
20840 multiplied by the signed scale factor `GL_c_SCALE', added to the
20841 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20842 `glPixelTransfer').
20843
20844`GL_ALPHA'
20845 Each element is a single alpha component. The GL converts it to
20846 floating point and assembles it into an RGBA element by attaching 0
20847 for red, green, and blue. Each component is then multiplied by the
20848 signed scale factor `GL_c_SCALE', added to the signed bias
20849 `GL_c_BIAS', and clamped to the range [0,1] (see
20850 `glPixelTransfer').
20851
20852`GL_INTENSITY'
20853 Each element is a single intensity value. The GL converts it to
20854 floating point, then assembles it into an RGBA element by
20855 replicating the intensity value three times for red, green, blue,
20856 and alpha. Each component is then multiplied by the signed scale
20857 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
20858 clamped to the range [0,1] (see `glPixelTransfer').
20859
20860`GL_RGB'
20861`GL_BGR'
20862 Each element is an RGB triple. The GL converts it to floating point
20863 and assembles it into an RGBA element by attaching 1 for alpha.
20864 Each component is then multiplied by the signed scale factor
20865 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20866 the range [0,1] (see `glPixelTransfer').
20867
20868`GL_RGBA'
20869`GL_BGRA'
20870 Each element contains all four components. Each component is
20871 multiplied by the signed scale factor `GL_c_SCALE', added to the
20872 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
20873 `glPixelTransfer').
20874
20875`GL_LUMINANCE'
20876 Each element is a single luminance value. The GL converts it to
20877 floating point, then assembles it into an RGBA element by
20878 replicating the luminance value three times for red, green, and
20879 blue and attaching 1 for alpha. Each component is then multiplied
20880 by the signed scale factor `GL_c_SCALE', added to the signed bias
20881 `GL_c_BIAS', and clamped to the range [0,1] (see
20882 `glPixelTransfer').
20883
20884`GL_LUMINANCE_ALPHA'
20885 Each element is a luminance/alpha pair. The GL converts it to
20886 floating point, then assembles it into an RGBA element by
20887 replicating the luminance value three times for red, green, and
20888 blue. Each component is then multiplied by the signed scale factor
20889 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
20890 the range [0,1] (see `glPixelTransfer').
20891
20892`GL_DEPTH_COMPONENT'
20893 Each element is a single depth value. The GL converts it to
20894 floating point, multiplies by the signed scale factor
20895 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
20896 to the range [0,1] (see `glPixelTransfer').
20897
20898Refer to the `glDrawPixels' reference page for a description of the
20899acceptable values for the TYPE parameter.
20900
20901If an application wants to store the texture at a certain resolution or
20902in a certain format, it can request the resolution and format with
20903INTERNALFORMAT. The GL will choose an internal representation that
20904closely approximates that requested by INTERNALFORMAT, but it may not
20905match exactly. (The representations specified by `GL_LUMINANCE',
20906`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
20907numeric values 1, 2, 3, and 4 may also be used to specify the above
20908representations.)
20909
20910If the INTERNALFORMAT parameter is one of the generic compressed
20911formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
20912`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
20913`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
20914internal format with the symbolic constant for a specific internal
20915format and compress the texture before storage. If no corresponding
20916internal format is available, or the GL can not compress that image for
20917any reason, the internal format is instead replaced with a corresponding
20918base internal format.
20919
20920If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
20921`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
20922`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
20923treated as if the red, green, blue, or luminance components are encoded
20924in the sRGB color space. Any alpha component is left unchanged. The
20925conversion from the sRGB encoded component C_S to a linear component C_L
20926is:
20927
20928C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
20929C_S>0.04045)
20930
20931Assume C_S is the sRGB component in the range [0,1].
20932
20933Use the `GL_PROXY_TEXTURE_1D' target to try out a resolution and format.
20934The implementation will update and recompute its best match for the
20935requested storage resolution and format. To then query this state, call
20936`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
20937state is set to 0.
20938
20939A one-component texture image uses only the red component of the RGBA
20940color from DATA. A two-component image uses the R and A values. A
20941three-component image uses the R, G, and B values. A four-component
20942image uses all of the RGBA components.
20943
20944Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
20945during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
20946\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
20947generate a boolean result. See `glTexParameter' for details on texture
20948comparison.
20949
20950`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_1D' or
20951`GL_PROXY_TEXTURE_1D'.
20952
20953`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
20954constant. Format constants other than `GL_STENCIL_INDEX' are accepted.
20955
20956`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
20957
20958`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
20959`GL_COLOR_INDEX'.
20960
20961`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
8925f36f 20962
3c9b6116
AW
20963`GL_INVALID_VALUE' may be generated if LEVEL is greater than
20964LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
8925f36f 20965
3c9b6116
AW
20966`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
20967one of the accepted resolution and format symbolic constants.
8925f36f 20968
3c9b6116
AW
20969`GL_INVALID_VALUE' is generated if WIDTH is less than 0 or greater than
209702 + `GL_MAX_TEXTURE_SIZE'.
8925f36f 20971
3c9b6116
AW
20972`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
20973supported and the WIDTH cannot be represented as 2^N+2\u2061(BORDER,) for
20974some integer value of N.
8925f36f 20975
3c9b6116 20976`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
8925f36f 20977
3c9b6116
AW
20978`GL_INVALID_OPERATION' is generated if TYPE is one of
20979`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
20980`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
20981is not `GL_RGB'.
8925f36f 20982
3c9b6116
AW
20983`GL_INVALID_OPERATION' is generated if TYPE is one of
20984`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
20985`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
20986`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
20987`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
20988FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 20989
3c9b6116
AW
20990`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
20991and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
20992`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
8925f36f 20993
3c9b6116
AW
20994`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
20995`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
20996`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
8925f36f 20997
3c9b6116
AW
20998`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
20999bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21000data store is currently mapped.
8925f36f 21001
3c9b6116
AW
21002`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21003bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21004unpacked from the buffer object such that the memory reads required
21005would exceed the data store size.
8925f36f 21006
3c9b6116
AW
21007`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21008bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21009divisible into the number of bytes needed to store in memory a datum
21010indicated by TYPE.
21011
21012`GL_INVALID_OPERATION' is generated if `glTexImage1D' is executed
21013between the execution of `glBegin' and the corresponding execution of
21014`glEnd'.")
8925f36f 21015
25072f02 21016(define-gl-procedures
bb894c9d
AW
21017 ((glTexImage2D
21018 (target GLenum)
21019 (level GLint)
21020 (internalFormat GLint)
21021 (width GLsizei)
21022 (height GLsizei)
21023 (border GLint)
21024 (format GLenum)
21025 (type GLenum)
00239761 21026 (data const-GLvoid-*)
bb894c9d
AW
21027 ->
21028 void))
3c9b6116 21029 "Specify a two-dimensional texture image.
8925f36f 21030
3c9b6116
AW
21031TARGET
21032 Specifies the target texture. Must be `GL_TEXTURE_2D',
21033 `GL_PROXY_TEXTURE_2D', `GL_TEXTURE_CUBE_MAP_POSITIVE_X',
21034 `GL_TEXTURE_CUBE_MAP_NEGATIVE_X', `GL_TEXTURE_CUBE_MAP_POSITIVE_Y',
21035 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', `GL_TEXTURE_CUBE_MAP_POSITIVE_Z',
21036 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', or `GL_PROXY_TEXTURE_CUBE_MAP'.
8925f36f 21037
3c9b6116
AW
21038LEVEL
21039 Specifies the level-of-detail number. Level 0 is the base image
21040 level. Level N is the Nth mipmap reduction image.
8925f36f 21041
3c9b6116
AW
21042INTERNALFORMAT
21043 Specifies the number of color components in the texture. Must be 1,
21044 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
21045 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
21046 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
21047 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
21048 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_DEPTH_COMPONENT',
21049 `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24',
21050 `GL_DEPTH_COMPONENT32', `GL_LUMINANCE', `GL_LUMINANCE4',
21051 `GL_LUMINANCE8', `GL_LUMINANCE12', `GL_LUMINANCE16',
21052 `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
21053 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
21054 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
21055 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
21056 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
21057 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
21058 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
21059 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
21060 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
21061 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
21062 `GL_SRGB8_ALPHA8'.
8925f36f 21063
3c9b6116
AW
21064WIDTH
21065 Specifies the width of the texture image including the border if
21066 any. If the GL version does not support non-power-of-two sizes,
21067 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
21068 implementations support texture images that are at least 64 texels
21069 wide.
8925f36f 21070
3c9b6116
AW
21071HEIGHT
21072 Specifies the height of the texture image including the border if
21073 any. If the GL version does not support non-power-of-two sizes,
21074 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
21075 implementations support texture images that are at least 64 texels
21076 high.
8925f36f 21077
3c9b6116
AW
21078BORDER
21079 Specifies the width of the border. Must be either 0 or 1.
8925f36f 21080
3c9b6116
AW
21081FORMAT
21082 Specifies the format of the pixel data. The following symbolic
21083 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21084 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21085 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 21086
3c9b6116
AW
21087TYPE
21088 Specifies the data type of the pixel data. The following symbolic
21089 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21090 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21091 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21092 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21093 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21094 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21095 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21096 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 21097
3c9b6116
AW
21098DATA
21099 Specifies a pointer to the image data in memory.
8925f36f 21100
3c9b6116
AW
21101Texturing maps a portion of a specified texture image onto each
21102graphical primitive for which texturing is enabled. To enable and
21103disable two-dimensional texturing, call `glEnable' and `glDisable' with
21104argument `GL_TEXTURE_2D'. To enable and disable texturing using
21105cube-mapped texture, call `glEnable' and `glDisable' with argument
21106`GL_TEXTURE_CUBE_MAP'.
21107
21108To define texture images, call `glTexImage2D'. The arguments describe
21109the parameters of the texture image, such as height, width, width of the
21110border, level-of-detail number (see `glTexParameter'), and number of
21111color components provided. The last three arguments describe how the
21112image is represented in memory; they are identical to the pixel formats
21113used for `glDrawPixels'.
21114
21115If TARGET is `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP', no
21116data is read from DATA, but all of the texture image state is
21117recalculated, checked for consistency, and checked against the
21118implementation's capabilities. If the implementation cannot handle a
21119texture of the requested texture size, it sets all of the image state to
211200, but does not generate an error (see `glGetError'). To query for an
21121entire mipmap array, use an image array level greater than or equal to
211221.
21123
21124If TARGET is `GL_TEXTURE_2D', or one of the `GL_TEXTURE_CUBE_MAP'
21125targets, data is read from DATA as a sequence of signed or unsigned
21126bytes, shorts, or longs, or single-precision floating-point values,
21127depending on TYPE. These values are grouped into sets of one, two,
21128three, or four values, depending on FORMAT, to form elements. If TYPE is
21129`GL_BITMAP', the data is considered as a string of unsigned bytes (and
21130FORMAT must be `GL_COLOR_INDEX'). Each data byte is treated as eight
211311-bit elements, with bit ordering determined by `GL_UNPACK_LSB_FIRST'
21132(see `glPixelStore').
21133
21134If a non-zero named buffer object is bound to the
21135`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21136image is specified, DATA is treated as a byte offset into the buffer
21137object's data store.
21138
21139The first element corresponds to the lower left corner of the texture
21140image. Subsequent elements progress left-to-right through the remaining
21141texels in the lowest row of the texture image, and then in successively
21142higher rows of the texture image. The final element corresponds to the
21143upper right corner of the texture image.
21144
21145FORMAT determines the composition of each element in DATA. It can assume
21146one of these symbolic values:
21147
21148`GL_COLOR_INDEX'
21149 Each element is a single value, a color index. The GL converts it
21150 to fixed point (with an unspecified number of zero bits to the
21151 right of the binary point), shifted left or right depending on the
21152 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
21153 (see `glPixelTransfer'). The resulting index is converted to a set
21154 of color components using the `GL_PIXEL_MAP_I_TO_R',
21155 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
21156 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
21157
21158`GL_RED'
21159 Each element is a single red component. The GL converts it to
21160 floating point and assembles it into an RGBA element by attaching 0
21161 for green and blue, and 1 for alpha. Each component is then
21162 multiplied by the signed scale factor `GL_c_SCALE', added to the
21163 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21164 `glPixelTransfer').
21165
21166`GL_GREEN'
21167 Each element is a single green component. The GL converts it to
21168 floating point and assembles it into an RGBA element by attaching 0
21169 for red and blue, and 1 for alpha. Each component is then
21170 multiplied by the signed scale factor `GL_c_SCALE', added to the
21171 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21172 `glPixelTransfer').
21173
21174`GL_BLUE'
21175 Each element is a single blue component. The GL converts it to
21176 floating point and assembles it into an RGBA element by attaching 0
21177 for red and green, and 1 for alpha. Each component is then
21178 multiplied by the signed scale factor `GL_c_SCALE', added to the
21179 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21180 `glPixelTransfer').
21181
21182`GL_ALPHA'
21183 Each element is a single alpha component. The GL converts it to
21184 floating point and assembles it into an RGBA element by attaching 0
21185 for red, green, and blue. Each component is then multiplied by the
21186 signed scale factor `GL_c_SCALE', added to the signed bias
21187 `GL_c_BIAS', and clamped to the range [0,1] (see
21188 `glPixelTransfer').
21189
21190`GL_INTENSITY'
21191 Each element is a single intensity value. The GL converts it to
21192 floating point, then assembles it into an RGBA element by
21193 replicating the intensity value three times for red, green, blue,
21194 and alpha. Each component is then multiplied by the signed scale
21195 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
21196 clamped to the range [0,1] (see `glPixelTransfer').
21197
21198`GL_RGB'
21199`GL_BGR'
21200 Each element is an RGB triple. The GL converts it to floating point
21201 and assembles it into an RGBA element by attaching 1 for alpha.
21202 Each component is then multiplied by the signed scale factor
21203 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21204 the range [0,1] (see `glPixelTransfer').
21205
21206`GL_RGBA'
21207`GL_BGRA'
21208 Each element contains all four components. Each component is
21209 multiplied by the signed scale factor `GL_c_SCALE', added to the
21210 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21211 `glPixelTransfer').
21212
21213`GL_LUMINANCE'
21214 Each element is a single luminance value. The GL converts it to
21215 floating point, then assembles it into an RGBA element by
21216 replicating the luminance value three times for red, green, and
21217 blue and attaching 1 for alpha. Each component is then multiplied
21218 by the signed scale factor `GL_c_SCALE', added to the signed bias
21219 `GL_c_BIAS', and clamped to the range [0,1] (see
21220 `glPixelTransfer').
21221
21222`GL_LUMINANCE_ALPHA'
21223 Each element is a luminance/alpha pair. The GL converts it to
21224 floating point, then assembles it into an RGBA element by
21225 replicating the luminance value three times for red, green, and
21226 blue. Each component is then multiplied by the signed scale factor
21227 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21228 the range [0,1] (see `glPixelTransfer').
21229
21230`GL_DEPTH_COMPONENT'
21231 Each element is a single depth value. The GL converts it to
21232 floating point, multiplies by the signed scale factor
21233 `GL_DEPTH_SCALE', adds the signed bias `GL_DEPTH_BIAS', and clamps
21234 to the range [0,1] (see `glPixelTransfer').
21235
21236Refer to the `glDrawPixels' reference page for a description of the
21237acceptable values for the TYPE parameter.
21238
21239If an application wants to store the texture at a certain resolution or
21240in a certain format, it can request the resolution and format with
21241INTERNALFORMAT. The GL will choose an internal representation that
21242closely approximates that requested by INTERNALFORMAT, but it may not
21243match exactly. (The representations specified by `GL_LUMINANCE',
21244`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
21245numeric values 1, 2, 3, and 4 may also be used to specify the above
21246representations.)
21247
21248If the INTERNALFORMAT parameter is one of the generic compressed
21249formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
21250`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
21251`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
21252internal format with the symbolic constant for a specific internal
21253format and compress the texture before storage. If no corresponding
21254internal format is available, or the GL can not compress that image for
21255any reason, the internal format is instead replaced with a corresponding
21256base internal format.
21257
21258If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
21259`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
21260`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
21261treated as if the red, green, blue, or luminance components are encoded
21262in the sRGB color space. Any alpha component is left unchanged. The
21263conversion from the sRGB encoded component C_S to a linear component C_L
21264is:
21265
21266C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
21267C_S>0.04045)
21268
21269Assume C_S is the sRGB component in the range [0,1].
21270
21271Use the `GL_PROXY_TEXTURE_2D' or `GL_PROXY_TEXTURE_CUBE_MAP' target to
21272try out a resolution and format. The implementation will update and
21273recompute its best match for the requested storage resolution and
21274format. To then query this state, call `glGetTexLevelParameter'. If the
21275texture cannot be accommodated, texture state is set to 0.
21276
21277A one-component texture image uses only the red component of the RGBA
21278color extracted from DATA. A two-component image uses the R and A
21279values. A three-component image uses the R, G, and B values. A
21280four-component image uses all of the RGBA components.
21281
21282Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures
21283during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be
21284\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to
21285generate a boolean result. See `glTexParameter' for details on texture
21286comparison.
21287
21288`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
21289`GL_PROXY_TEXTURE_2D', `GL_PROXY_TEXTURE_CUBE_MAP',
21290`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
21291`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
21292`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
21293
21294`GL_INVALID_ENUM' is generated if TARGET is one of the six cube map 2D
21295image targets and the width and height parameters are not equal.
21296
21297`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21298
21299`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21300`GL_COLOR_INDEX'.
21301
21302`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
21303greater than 2 + `GL_MAX_TEXTURE_SIZE'.
21304
21305`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21306
21307`GL_INVALID_VALUE' may be generated if LEVEL is greater than
21308LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21309
21310`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
21311one of the accepted resolution and format symbolic constants.
21312
21313`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0 or
21314greater than 2 + `GL_MAX_TEXTURE_SIZE'.
21315
21316`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
21317supported and the WIDTH or HEIGHT cannot be represented as
213182^K+2\u2061(BORDER,) for some integer value of K.
21319
21320`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
21321
21322`GL_INVALID_OPERATION' is generated if TYPE is one of
21323`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21324`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21325is not `GL_RGB'.
21326
21327`GL_INVALID_OPERATION' is generated if TYPE is one of
21328`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21329`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21330`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21331`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21332FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
8925f36f 21333
3c9b6116
AW
21334`GL_INVALID_OPERATION' is generated if TARGET is not `GL_TEXTURE_2D' or
21335`GL_PROXY_TEXTURE_2D' and INTERNALFORMAT is `GL_DEPTH_COMPONENT',
21336`GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
21337`GL_DEPTH_COMPONENT32'.
21338
21339`GL_INVALID_OPERATION' is generated if FORMAT is `GL_DEPTH_COMPONENT'
21340and INTERNALFORMAT is not `GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16',
21341`GL_DEPTH_COMPONENT24', or `GL_DEPTH_COMPONENT32'.
21342
21343`GL_INVALID_OPERATION' is generated if INTERNALFORMAT is
21344`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
21345`GL_DEPTH_COMPONENT32', and FORMAT is not `GL_DEPTH_COMPONENT'.
21346
21347`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21348bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21349data store is currently mapped.
21350
21351`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21352bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21353unpacked from the buffer object such that the memory reads required
21354would exceed the data store size.
21355
21356`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21357bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21358divisible into the number of bytes needed to store in memory a datum
21359indicated by TYPE.
21360
21361`GL_INVALID_OPERATION' is generated if `glTexImage2D' is executed
21362between the execution of `glBegin' and the corresponding execution of
21363`glEnd'.")
8925f36f 21364
25072f02 21365(define-gl-procedures
bb894c9d
AW
21366 ((glTexImage3D
21367 (target GLenum)
21368 (level GLint)
21369 (internalFormat GLint)
21370 (width GLsizei)
21371 (height GLsizei)
21372 (depth GLsizei)
21373 (border GLint)
21374 (format GLenum)
21375 (type GLenum)
00239761 21376 (data const-GLvoid-*)
bb894c9d
AW
21377 ->
21378 void))
3c9b6116 21379 "Specify a three-dimensional texture image.
8925f36f 21380
3c9b6116
AW
21381TARGET
21382 Specifies the target texture. Must be `GL_TEXTURE_3D' or
21383 `GL_PROXY_TEXTURE_3D'.
8925f36f 21384
3c9b6116
AW
21385LEVEL
21386 Specifies the level-of-detail number. Level 0 is the base image
21387 level. Level N is the N^TH mipmap reduction image.
8925f36f 21388
3c9b6116
AW
21389INTERNALFORMAT
21390 Specifies the number of color components in the texture. Must be 1,
21391 2, 3, or 4, or one of the following symbolic constants: `GL_ALPHA',
21392 `GL_ALPHA4', `GL_ALPHA8', `GL_ALPHA12', `GL_ALPHA16',
21393 `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_LUMINANCE',
21394 `GL_COMPRESSED_LUMINANCE_ALPHA', `GL_COMPRESSED_INTENSITY',
21395 `GL_COMPRESSED_RGB', `GL_COMPRESSED_RGBA', `GL_LUMINANCE',
21396 `GL_LUMINANCE4', `GL_LUMINANCE8', `GL_LUMINANCE12',
21397 `GL_LUMINANCE16', `GL_LUMINANCE_ALPHA', `GL_LUMINANCE4_ALPHA4',
21398 `GL_LUMINANCE6_ALPHA2', `GL_LUMINANCE8_ALPHA8',
21399 `GL_LUMINANCE12_ALPHA4', `GL_LUMINANCE12_ALPHA12',
21400 `GL_LUMINANCE16_ALPHA16', `GL_INTENSITY', `GL_INTENSITY4',
21401 `GL_INTENSITY8', `GL_INTENSITY12', `GL_INTENSITY16', `GL_R3_G3_B2',
21402 `GL_RGB', `GL_RGB4', `GL_RGB5', `GL_RGB8', `GL_RGB10', `GL_RGB12',
21403 `GL_RGB16', `GL_RGBA', `GL_RGBA2', `GL_RGBA4', `GL_RGB5_A1',
21404 `GL_RGBA8', `GL_RGB10_A2', `GL_RGBA12', `GL_RGBA16',
21405 `GL_SLUMINANCE', `GL_SLUMINANCE8', `GL_SLUMINANCE_ALPHA',
21406 `GL_SLUMINANCE8_ALPHA8', `GL_SRGB', `GL_SRGB8', `GL_SRGB_ALPHA', or
21407 `GL_SRGB8_ALPHA8'.
8925f36f 21408
3c9b6116
AW
21409WIDTH
21410 Specifies the width of the texture image including the border if
21411 any. If the GL version does not support non-power-of-two sizes,
21412 this value must be 2^N+2\u2061(BORDER,) for some integer N . All
21413 implementations support 3D texture images that are at least 16
21414 texels wide.
8925f36f 21415
3c9b6116
AW
21416HEIGHT
21417 Specifies the height of the texture image including the border if
21418 any. If the GL version does not support non-power-of-two sizes,
21419 this value must be 2^M+2\u2061(BORDER,) for some integer M . All
21420 implementations support 3D texture images that are at least 16
21421 texels high.
8925f36f 21422
3c9b6116
AW
21423DEPTH
21424 Specifies the depth of the texture image including the border if
21425 any. If the GL version does not support non-power-of-two sizes,
21426 this value must be 2^K+2\u2061(BORDER,) for some integer K . All
21427 implementations support 3D texture images that are at least 16
21428 texels deep.
8925f36f 21429
3c9b6116
AW
21430BORDER
21431 Specifies the width of the border. Must be either 0 or 1.
8925f36f 21432
3c9b6116
AW
21433FORMAT
21434 Specifies the format of the pixel data. The following symbolic
21435 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
21436 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
21437 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
8925f36f 21438
3c9b6116
AW
21439TYPE
21440 Specifies the data type of the pixel data. The following symbolic
21441 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
21442 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
21443 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21444 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
21445 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21446 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21447 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21448 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
8925f36f 21449
3c9b6116
AW
21450DATA
21451 Specifies a pointer to the image data in memory.
21452
21453Texturing maps a portion of a specified texture image onto each
21454graphical primitive for which texturing is enabled. To enable and
21455disable three-dimensional texturing, call `glEnable' and `glDisable'
21456with argument `GL_TEXTURE_3D'.
21457
21458To define texture images, call `glTexImage3D'. The arguments describe
21459the parameters of the texture image, such as height, width, depth, width
21460of the border, level-of-detail number (see `glTexParameter'), and number
21461of color components provided. The last three arguments describe how the
21462image is represented in memory; they are identical to the pixel formats
21463used for `glDrawPixels'.
21464
21465If TARGET is `GL_PROXY_TEXTURE_3D', no data is read from DATA, but all
21466of the texture image state is recalculated, checked for consistency, and
21467checked against the implementation's capabilities. If the implementation
21468cannot handle a texture of the requested texture size, it sets all of
21469the image state to 0, but does not generate an error (see `glGetError').
21470To query for an entire mipmap array, use an image array level greater
21471than or equal to 1.
21472
21473If TARGET is `GL_TEXTURE_3D', data is read from DATA as a sequence of
21474signed or unsigned bytes, shorts, or longs, or single-precision
21475floating-point values, depending on TYPE. These values are grouped into
21476sets of one, two, three, or four values, depending on FORMAT, to form
21477elements. If TYPE is `GL_BITMAP', the data is considered as a string of
21478unsigned bytes (and FORMAT must be `GL_COLOR_INDEX'). Each data byte is
21479treated as eight 1-bit elements, with bit ordering determined by
21480`GL_UNPACK_LSB_FIRST' (see `glPixelStore').
21481
21482If a non-zero named buffer object is bound to the
21483`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
21484image is specified, DATA is treated as a byte offset into the buffer
21485object's data store.
21486
21487The first element corresponds to the lower left corner of the texture
21488image. Subsequent elements progress left-to-right through the remaining
21489texels in the lowest row of the texture image, and then in successively
21490higher rows of the texture image. The final element corresponds to the
21491upper right corner of the texture image.
21492
21493FORMAT determines the composition of each element in DATA. It can assume
21494one of these symbolic values:
21495
21496`GL_COLOR_INDEX'
21497 Each element is a single value, a color index. The GL converts it
21498 to fixed point (with an unspecified number of zero bits to the
21499 right of the binary point), shifted left or right depending on the
21500 value and sign of `GL_INDEX_SHIFT', and added to `GL_INDEX_OFFSET'
21501 (see `glPixelTransfer'). The resulting index is converted to a set
21502 of color components using the `GL_PIXEL_MAP_I_TO_R',
21503 `GL_PIXEL_MAP_I_TO_G', `GL_PIXEL_MAP_I_TO_B', and
21504 `GL_PIXEL_MAP_I_TO_A' tables, and clamped to the range [0,1].
21505
21506`GL_RED'
21507 Each element is a single red component. The GL converts it to
21508 floating point and assembles it into an RGBA element by attaching 0
21509 for green and blue, and 1 for alpha. Each component is then
21510 multiplied by the signed scale factor `GL_c_SCALE', added to the
21511 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21512 `glPixelTransfer').
21513
21514`GL_GREEN'
21515 Each element is a single green component. The GL converts it to
21516 floating point and assembles it into an RGBA element by attaching 0
21517 for red and blue, and 1 for alpha. Each component is then
21518 multiplied by the signed scale factor `GL_c_SCALE', added to the
21519 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21520 `glPixelTransfer').
21521
21522`GL_BLUE'
21523 Each element is a single blue component. The GL converts it to
21524 floating point and assembles it into an RGBA element by attaching 0
21525 for red and green, and 1 for alpha. Each component is then
21526 multiplied by the signed scale factor `GL_c_SCALE', added to the
21527 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21528 `glPixelTransfer').
21529
21530`GL_ALPHA'
21531 Each element is a single alpha component. The GL converts it to
21532 floating point and assembles it into an RGBA element by attaching 0
21533 for red, green, and blue. Each component is then multiplied by the
21534 signed scale factor `GL_c_SCALE', added to the signed bias
21535 `GL_c_BIAS', and clamped to the range [0,1] (see
21536 `glPixelTransfer').
21537
21538`GL_INTENSITY'
21539 Each element is a single intensity value. The GL converts it to
21540 floating point, then assembles it into an RGBA element by
21541 replicating the intensity value three times for red, green, blue,
21542 and alpha. Each component is then multiplied by the signed scale
21543 factor `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and
21544 clamped to the range [0,1] (see `glPixelTransfer').
21545
21546`GL_RGB'
21547`GL_BGR'
21548 Each element is an RGB triple. The GL converts it to floating point
21549 and assembles it into an RGBA element by attaching 1 for alpha.
21550 Each component is then multiplied by the signed scale factor
21551 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21552 the range [0,1] (see `glPixelTransfer').
21553
21554`GL_RGBA'
21555`GL_BGRA'
21556 Each element contains all four components. Each component is
21557 multiplied by the signed scale factor `GL_c_SCALE', added to the
21558 signed bias `GL_c_BIAS', and clamped to the range [0,1] (see
21559 `glPixelTransfer').
21560
21561`GL_LUMINANCE'
21562 Each element is a single luminance value. The GL converts it to
21563 floating point, then assembles it into an RGBA element by
21564 replicating the luminance value three times for red, green, and
21565 blue and attaching 1 for alpha. Each component is then multiplied
21566 by the signed scale factor `GL_c_SCALE', added to the signed bias
21567 `GL_c_BIAS', and clamped to the range [0,1] (see
21568 `glPixelTransfer').
21569
21570`GL_LUMINANCE_ALPHA'
21571 Each element is a luminance/alpha pair. The GL converts it to
21572 floating point, then assembles it into an RGBA element by
21573 replicating the luminance value three times for red, green, and
21574 blue. Each component is then multiplied by the signed scale factor
21575 `GL_c_SCALE', added to the signed bias `GL_c_BIAS', and clamped to
21576 the range [0,1] (see `glPixelTransfer').
21577
21578Refer to the `glDrawPixels' reference page for a description of the
21579acceptable values for the TYPE parameter.
21580
21581If an application wants to store the texture at a certain resolution or
21582in a certain format, it can request the resolution and format with
21583INTERNALFORMAT. The GL will choose an internal representation that
21584closely approximates that requested by INTERNALFORMAT, but it may not
21585match exactly. (The representations specified by `GL_LUMINANCE',
21586`GL_LUMINANCE_ALPHA', `GL_RGB', and `GL_RGBA' must match exactly. The
21587numeric values 1, 2, 3, and 4 may also be used to specify the above
21588representations.)
21589
21590If the INTERNALFORMAT parameter is one of the generic compressed
21591formats, `GL_COMPRESSED_ALPHA', `GL_COMPRESSED_INTENSITY',
21592`GL_COMPRESSED_LUMINANCE', `GL_COMPRESSED_LUMINANCE_ALPHA',
21593`GL_COMPRESSED_RGB', or `GL_COMPRESSED_RGBA', the GL will replace the
21594internal format with the symbolic constant for a specific internal
21595format and compress the texture before storage. If no corresponding
21596internal format is available, or the GL can not compress that image for
21597any reason, the internal format is instead replaced with a corresponding
21598base internal format.
21599
21600If the INTERNALFORMAT parameter is `GL_SRGB', `GL_SRGB8',
21601`GL_SRGB_ALPHA', `GL_SRGB8_ALPHA8', `GL_SLUMINANCE', `GL_SLUMINANCE8',
21602`GL_SLUMINANCE_ALPHA', or `GL_SLUMINANCE8_ALPHA8', the texture is
21603treated as if the red, green, blue, or luminance components are encoded
21604in the sRGB color space. Any alpha component is left unchanged. The
21605conversion from the sRGB encoded component C_S to a linear component C_L
21606is:
21607
21608C_L={(C_S/12.92 if C_S≤0.04045), ((`c'_`s'+0.055/1.055)^2.4 if
21609C_S>0.04045)
21610
21611Assume C_S is the sRGB component in the range [0,1].
21612
21613Use the `GL_PROXY_TEXTURE_3D' target to try out a resolution and format.
21614The implementation will update and recompute its best match for the
21615requested storage resolution and format. To then query this state, call
21616`glGetTexLevelParameter'. If the texture cannot be accommodated, texture
21617state is set to 0.
21618
21619A one-component texture image uses only the red component of the RGBA
21620color extracted from DATA. A two-component image uses the R and A
21621values. A three-component image uses the R, G, and B values. A
21622four-component image uses all of the RGBA components.
21623
21624`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_3D' or
21625`GL_PROXY_TEXTURE_3D'.
21626
21627`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
21628constant. Format constants other than `GL_STENCIL_INDEX' and
21629`GL_DEPTH_COMPONENT' are accepted.
21630
21631`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
21632
21633`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
21634`GL_COLOR_INDEX'.
21635
21636`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
21637
21638`GL_INVALID_VALUE' may be generated if LEVEL is greater than
21639LOG_2\u2061(MAX,) , where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
21640
21641`GL_INVALID_VALUE' is generated if INTERNALFORMAT is not 1, 2, 3, 4, or
21642one of the accepted resolution and format symbolic constants.
21643
21644`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
216450 or greater than 2 + `GL_MAX_TEXTURE_SIZE'.
21646
21647`GL_INVALID_VALUE' is generated if non-power-of-two textures are not
21648supported and the WIDTH, HEIGHT, or DEPTH cannot be represented as
216492^K+2\u2061(BORDER,) for some integer value of K.
21650
21651`GL_INVALID_VALUE' is generated if BORDER is not 0 or 1.
21652
21653`GL_INVALID_OPERATION' is generated if TYPE is one of
21654`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
21655`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
21656is not `GL_RGB'.
21657
21658`GL_INVALID_OPERATION' is generated if TYPE is one of
21659`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
21660`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
21661`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
21662`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
21663FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
21664
21665`GL_INVALID_OPERATION' is generated if FORMAT or INTERNALFORMAT is
21666`GL_DEPTH_COMPONENT', `GL_DEPTH_COMPONENT16', `GL_DEPTH_COMPONENT24', or
21667`GL_DEPTH_COMPONENT32'.
21668
21669`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21670bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
21671data store is currently mapped.
21672
21673`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21674bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
21675unpacked from the buffer object such that the memory reads required
21676would exceed the data store size.
21677
21678`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
21679bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
21680divisible into the number of bytes needed to store in memory a datum
21681indicated by TYPE.
21682
21683`GL_INVALID_OPERATION' is generated if `glTexImage3D' is executed
21684between the execution of `glBegin' and the corresponding execution of
21685`glEnd'.")
8925f36f 21686
25072f02 21687(define-gl-procedures
bb894c9d
AW
21688 ((glTexParameterf
21689 (target GLenum)
21690 (pname GLenum)
21691 (param GLfloat)
21692 ->
21693 void)
21694 (glTexParameteri
21695 (target GLenum)
21696 (pname GLenum)
21697 (param GLint)
21698 ->
78aa45b9
DH
21699 void)
21700 (glTexParameterfv
21701 (target GLenum)
21702 (pname GLenum)
21703 (params const-GLfloat-*)
21704 ->
21705 void)
21706 (glTexParameteriv
21707 (target GLenum)
21708 (pname GLenum)
21709 (params const-GLint-*)
21710 ->
bb894c9d 21711 void))
3c9b6116 21712 "Set texture parameters.
8925f36f 21713
3c9b6116
AW
21714TARGET
21715 Specifies the target texture, which must be either `GL_TEXTURE_1D',
21716 `GL_TEXTURE_2D', `GL_TEXTURE_3D', or `GL_TEXTURE_CUBE_MAP'.
8925f36f 21717
3c9b6116
AW
21718PNAME
21719 Specifies the symbolic name of a single-valued texture parameter.
21720 PNAME can be one of the following: `GL_TEXTURE_MIN_FILTER',
21721 `GL_TEXTURE_MAG_FILTER', `GL_TEXTURE_MIN_LOD',
21722 `GL_TEXTURE_MAX_LOD', `GL_TEXTURE_BASE_LEVEL',
21723 `GL_TEXTURE_MAX_LEVEL', `GL_TEXTURE_WRAP_S', `GL_TEXTURE_WRAP_T',
21724 `GL_TEXTURE_WRAP_R', `GL_TEXTURE_PRIORITY',
21725 `GL_TEXTURE_COMPARE_MODE', `GL_TEXTURE_COMPARE_FUNC',
21726 `GL_DEPTH_TEXTURE_MODE', or `GL_GENERATE_MIPMAP'.
21727
21728PARAM
21729 Specifies the value of PNAME.
21730
21731Texture mapping is a technique that applies an image onto an object's
21732surface as if the image were a decal or cellophane shrink-wrap. The
21733image is created in texture space, with an (S , T ) coordinate system. A
21734texture is a one- or two-dimensional image and a set of parameters that
21735determine how samples are derived from the image.
21736
21737`glTexParameter' assigns the value or values in PARAMS to the texture
21738parameter specified as PNAME. TARGET defines the target texture, either
21739`GL_TEXTURE_1D', `GL_TEXTURE_2D', or `GL_TEXTURE_3D'. The following
21740symbols are accepted in PNAME:
21741
21742`GL_TEXTURE_MIN_FILTER'
21743 The texture minifying function is used whenever the pixel being
21744 textured maps to an area greater than one texture element. There
21745 are six defined minifying functions. Two of them use the nearest
21746 one or nearest four texture elements to compute the texture value.
21747 The other four use mipmaps.
21748
21749 A mipmap is an ordered set of arrays representing the same image at
21750 progressively lower resolutions. If the texture has dimensions
21751 2^N×2^M , there are MAX\u2061(N,M)+1 mipmaps. The first mipmap is the
21752 original texture, with dimensions 2^N×2^M . Each subsequent mipmap
21753 has dimensions 2^K-1,×2^L-1, , where 2^K×2^L are the dimensions of
21754 the previous mipmap, until either K=0 or L=0 . At that point,
21755 subsequent mipmaps have dimension 1×2^L-1, or 2^K-1,×1 until the
21756 final mipmap, which has dimension 1×1 . To define the mipmaps, call
21757 `glTexImage1D', `glTexImage2D', `glTexImage3D', `glCopyTexImage1D',
21758 or `glCopyTexImage2D' with the LEVEL argument indicating the order
21759 of the mipmaps. Level 0 is the original texture; level MAX\u2061(N,M) is
21760 the final 1×1 mipmap.
21761
21762 PARAMS supplies a function for minifying the texture as one of the
21763 following:
21764
21765 As more texture elements are sampled in the minification process,
21766 fewer aliasing artifacts will be apparent. While the `GL_NEAREST'
21767 and `GL_LINEAR' minification functions can be faster than the other
21768 four, they sample only one or four texture elements to determine
21769 the texture value of the pixel being rendered and can produce moire
21770 patterns or ragged transitions. The initial value of
21771 `GL_TEXTURE_MIN_FILTER' is `GL_NEAREST_MIPMAP_LINEAR'.
21772
21773`GL_TEXTURE_MAG_FILTER'
21774 The texture magnification function is used when the pixel being
21775 textured maps to an area less than or equal to one texture element.
21776 It sets the texture magnification function to either `GL_NEAREST'
21777 or `GL_LINEAR' (see below). `GL_NEAREST' is generally faster than
21778 `GL_LINEAR', but it can produce textured images with sharper edges
21779 because the transition between texture elements is not as smooth.
21780 The initial value of `GL_TEXTURE_MAG_FILTER' is `GL_LINEAR'.
21781
21782`GL_NEAREST'
21783 Returns the value of the texture element that is nearest (in
21784 Manhattan distance) to the center of the pixel being textured.
21785
21786`GL_LINEAR'
21787 Returns the weighted average of the four texture elements that are
21788 closest to the center of the pixel being textured. These can
21789 include border texture elements, depending on the values of
21790 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
21791 mapping.
21792
21793`GL_NEAREST_MIPMAP_NEAREST'
21794 Chooses the mipmap that most closely matches the size of the pixel
21795 being textured and uses the `GL_NEAREST' criterion (the texture
21796 element nearest to the center of the pixel) to produce a texture
21797 value.
21798
21799`GL_LINEAR_MIPMAP_NEAREST'
21800 Chooses the mipmap that most closely matches the size of the pixel
21801 being textured and uses the `GL_LINEAR' criterion (a weighted
21802 average of the four texture elements that are closest to the center
21803 of the pixel) to produce a texture value.
21804
21805`GL_NEAREST_MIPMAP_LINEAR'
21806 Chooses the two mipmaps that most closely match the size of the
21807 pixel being textured and uses the `GL_NEAREST' criterion (the
21808 texture element nearest to the center of the pixel) to produce a
21809 texture value from each mipmap. The final texture value is a
21810 weighted average of those two values.
21811
21812`GL_LINEAR_MIPMAP_LINEAR'
21813 Chooses the two mipmaps that most closely match the size of the
21814 pixel being textured and uses the `GL_LINEAR' criterion (a weighted
21815 average of the four texture elements that are closest to the center
21816 of the pixel) to produce a texture value from each mipmap. The
21817 final texture value is a weighted average of those two values.
21818
21819`GL_NEAREST'
21820 Returns the value of the texture element that is nearest (in
21821 Manhattan distance) to the center of the pixel being textured.
21822
21823`GL_LINEAR'
21824 Returns the weighted average of the four texture elements that are
21825 closest to the center of the pixel being textured. These can
21826 include border texture elements, depending on the values of
21827 `GL_TEXTURE_WRAP_S' and `GL_TEXTURE_WRAP_T', and on the exact
21828 mapping.
21829
21830
21831
21832`GL_TEXTURE_MIN_LOD'
21833 Sets the minimum level-of-detail parameter. This floating-point
21834 value limits the selection of highest resolution mipmap (lowest
21835 mipmap level). The initial value is -1000.
21836
21837
21838
21839`GL_TEXTURE_MAX_LOD'
21840 Sets the maximum level-of-detail parameter. This floating-point
21841 value limits the selection of the lowest resolution mipmap (highest
21842 mipmap level). The initial value is 1000.
21843
21844
21845
21846`GL_TEXTURE_BASE_LEVEL'
21847 Specifies the index of the lowest defined mipmap level. This is an
21848 integer value. The initial value is 0.
21849
21850
21851
21852`GL_TEXTURE_MAX_LEVEL'
21853 Sets the index of the highest defined mipmap level. This is an
21854 integer value. The initial value is 1000.
21855
21856
21857
21858`GL_TEXTURE_WRAP_S'
21859 Sets the wrap parameter for texture coordinate S to either
21860 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21861 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. `GL_CLAMP' causes S
21862 coordinates to be clamped to the range [0,1] and is useful for
21863 preventing wrapping artifacts when mapping a single image onto an
21864 object. `GL_CLAMP_TO_BORDER' causes the S coordinate to be clamped
21865 to the range [-1/2N,,1+1/2N,] , where N is the size of the texture
21866 in the direction of clamping.`GL_CLAMP_TO_EDGE' causes S
21867 coordinates to be clamped to the range [1/2N,,1-1/2N,] , where N is
21868 the size of the texture in the direction of clamping. `GL_REPEAT'
21869 causes the integer part of the S coordinate to be ignored; the GL
21870 uses only the fractional part, thereby creating a repeating
21871 pattern. `GL_MIRRORED_REPEAT' causes the S coordinate to be set to
21872 the fractional part of the texture coordinate if the integer part
21873 of S is even; if the integer part of S is odd, then the S texture
21874 coordinate is set to 1-FRAC\u2061(S,) , where FRAC\u2061(S,) represents the
21875 fractional part of S . Border texture elements are accessed only if
21876 wrapping is set to `GL_CLAMP' or `GL_CLAMP_TO_BORDER'. Initially,
21877 `GL_TEXTURE_WRAP_S' is set to `GL_REPEAT'.
21878
21879
21880
21881`GL_TEXTURE_WRAP_T'
21882 Sets the wrap parameter for texture coordinate T to either
21883 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21884 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21885 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_T' is set to
21886 `GL_REPEAT'.
21887
21888`GL_TEXTURE_WRAP_R'
21889 Sets the wrap parameter for texture coordinate R to either
21890 `GL_CLAMP', `GL_CLAMP_TO_BORDER', `GL_CLAMP_TO_EDGE',
21891 `GL_MIRRORED_REPEAT', or `GL_REPEAT'. See the discussion under
21892 `GL_TEXTURE_WRAP_S'. Initially, `GL_TEXTURE_WRAP_R' is set to
21893 `GL_REPEAT'.
21894
21895`GL_TEXTURE_BORDER_COLOR'
21896 Sets a border color. PARAMS contains four values that comprise the
21897 RGBA color of the texture border. Integer color components are
21898 interpreted linearly such that the most positive integer maps to
21899 1.0, and the most negative integer maps to -1.0. The values are
21900 clamped to the range [0,1] when they are specified. Initially, the
21901 border color is (0, 0, 0, 0).
21902
21903`GL_TEXTURE_PRIORITY'
21904 Specifies the texture residence priority of the currently bound
21905 texture. Permissible values are in the range [0,1] . See
21906 `glPrioritizeTextures' and `glBindTexture' for more information.
21907
21908`GL_TEXTURE_COMPARE_MODE'
21909 Specifies the texture comparison mode for currently bound depth
21910 textures. That is, a texture whose internal format is
21911 `GL_DEPTH_COMPONENT_*'; see `glTexImage2D') Permissible values are:
21912
21913`GL_TEXTURE_COMPARE_FUNC'
21914 Specifies the comparison operator used when
21915 `GL_TEXTURE_COMPARE_MODE' is set to `GL_COMPARE_R_TO_TEXTURE'.
21916 Permissible values are: where R is the current interpolated texture
21917 coordinate, and D_T is the depth texture value sampled from the
21918 currently bound depth texture. RESULT is assigned to the either the
21919 luminance, intensity, or alpha (as specified by
21920 `GL_DEPTH_TEXTURE_MODE'.)
21921
21922`GL_DEPTH_TEXTURE_MODE'
21923 Specifies a single symbolic constant indicating how depth values
21924 should be treated during filtering and texture application.
21925 Accepted values are `GL_LUMINANCE', `GL_INTENSITY', and `GL_ALPHA'.
21926 The initial value is `GL_LUMINANCE'.
21927
21928`GL_GENERATE_MIPMAP'
21929 Specifies a boolean value that indicates if all levels of a mipmap
21930 array should be automatically updated when any modification to the
21931 base level mipmap is done. The initial value is `GL_FALSE'.
21932
21933`GL_COMPARE_R_TO_TEXTURE'
21934 Specifies that the interpolated and clamped R texture coordinate
21935 should be compared to the value in the currently bound depth
21936 texture. See the discussion of `GL_TEXTURE_COMPARE_FUNC' for
21937 details of how the comparison is evaluated. The result of the
21938 comparison is assigned to luminance, intensity, or alpha (as
21939 specified by `GL_DEPTH_TEXTURE_MODE').
21940
21941`GL_NONE'
21942 Specifies that the luminance, intensity, or alpha (as specified by
21943 `GL_DEPTH_TEXTURE_MODE') should be assigned the appropriate value
21944 from the currently bound depth texture.
21945
21946*Texture Comparison Function*
21947 *Computed result*
21948
21949`GL_LEQUAL'
21950 RESULT={(1.0), (0.0)\u2062\xa0(R<=D_T,), (R>D_T,),
21951
21952`GL_GEQUAL'
21953 RESULT={(1.0), (0.0)\u2062\xa0(R>=D_T,), (R<D_T,),
21954
21955`GL_LESS'
21956 RESULT={(1.0), (0.0)\u2062\xa0(R<D_T,), (R>=D_T,),
21957
21958`GL_GREATER'
21959 RESULT={(1.0), (0.0)\u2062\xa0(R>D_T,), (R<=D_T,),
8925f36f 21960
3c9b6116
AW
21961`GL_EQUAL'
21962 RESULT={(1.0), (0.0)\u2062\xa0(R=D_T,), (R≠D_T,),
8925f36f 21963
3c9b6116
AW
21964`GL_NOTEQUAL'
21965 RESULT={(1.0), (0.0)\u2062\xa0(R≠D_T,), (R=D_T,),
8925f36f 21966
3c9b6116
AW
21967`GL_ALWAYS'
21968 RESULT=`1.0'
21969
21970`GL_NEVER'
21971 RESULT=`0.0'
21972
21973`GL_INVALID_ENUM' is generated if TARGET or PNAME is not one of the
21974accepted defined values.
21975
21976`GL_INVALID_ENUM' is generated if PARAMS should have a defined constant
21977value (based on the value of PNAME) and does not.
21978
21979`GL_INVALID_OPERATION' is generated if `glTexParameter' is executed
21980between the execution of `glBegin' and the corresponding execution of
21981`glEnd'.")
8925f36f 21982
25072f02 21983(define-gl-procedures
bb894c9d
AW
21984 ((glTexSubImage1D
21985 (target GLenum)
21986 (level GLint)
21987 (xoffset GLint)
21988 (width GLsizei)
21989 (format GLenum)
21990 (type GLenum)
00239761 21991 (data const-GLvoid-*)
bb894c9d
AW
21992 ->
21993 void))
3c9b6116
AW
21994 "Specify a one-dimensional texture subimage.
21995
21996TARGET
21997 Specifies the target texture. Must be `GL_TEXTURE_1D'.
21998
21999LEVEL
22000 Specifies the level-of-detail number. Level 0 is the base image
22001 level. Level N is the Nth mipmap reduction image.
22002
22003XOFFSET
22004 Specifies a texel offset in the x direction within the texture
22005 array.
22006
22007WIDTH
22008 Specifies the width of the texture subimage.
22009
22010FORMAT
22011 Specifies the format of the pixel data. The following symbolic
22012 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
22013 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
22014 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
22015
22016TYPE
22017 Specifies the data type of the pixel data. The following symbolic
22018 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
22019 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
22020 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22021 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
22022 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22023 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22024 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22025 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
22026
22027DATA
22028 Specifies a pointer to the image data in memory.
22029
22030Texturing maps a portion of a specified texture image onto each
22031graphical primitive for which texturing is enabled. To enable or disable
22032one-dimensional texturing, call `glEnable' and `glDisable' with argument
22033`GL_TEXTURE_1D'.
22034
22035`glTexSubImage1D' redefines a contiguous subregion of an existing
22036one-dimensional texture image. The texels referenced by DATA replace the
22037portion of the existing texture array with x indices XOFFSET and
22038XOFFSET+WIDTH-1 , inclusive. This region may not include any texels
22039outside the range of the texture array as it was originally specified.
22040It is not an error to specify a subtexture with width of 0, but such a
22041specification has no effect.
22042
22043If a non-zero named buffer object is bound to the
22044`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
22045image is specified, DATA is treated as a byte offset into the buffer
22046object's data store.
22047
22048`GL_INVALID_ENUM' is generated if TARGET is not one of the allowable
22049values.
22050
22051`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
22052constant.
22053
22054`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
22055
22056`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
22057`GL_COLOR_INDEX'.
22058
22059`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
22060
22061`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
22062where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
22063
22064`GL_INVALID_VALUE' is generated if XOFFSET<-B , or if
22065(XOFFSET+WIDTH,)>(W-B,) , where W is the `GL_TEXTURE_WIDTH', and B is
22066the width of the `GL_TEXTURE_BORDER' of the texture image being
22067modified. Note that W includes twice the border width.
22068
22069`GL_INVALID_VALUE' is generated if WIDTH is less than 0.
22070
22071`GL_INVALID_OPERATION' is generated if the texture array has not been
22072defined by a previous `glTexImage1D' operation.
22073
22074`GL_INVALID_OPERATION' is generated if TYPE is one of
22075`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22076`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
22077is not `GL_RGB'.
22078
22079`GL_INVALID_OPERATION' is generated if TYPE is one of
22080`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22081`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22082`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22083`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
22084FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
22085
22086`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22087bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
22088data store is currently mapped.
22089
22090`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22091bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
22092unpacked from the buffer object such that the memory reads required
22093would exceed the data store size.
22094
22095`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22096bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
22097divisible into the number of bytes needed to store in memory a datum
22098indicated by TYPE.
22099
22100`GL_INVALID_OPERATION' is generated if `glTexSubImage1D' is executed
22101between the execution of `glBegin' and the corresponding execution of
22102`glEnd'.")
8925f36f 22103
25072f02 22104(define-gl-procedures
bb894c9d
AW
22105 ((glTexSubImage2D
22106 (target GLenum)
22107 (level GLint)
22108 (xoffset GLint)
22109 (yoffset GLint)
22110 (width GLsizei)
22111 (height GLsizei)
22112 (format GLenum)
22113 (type GLenum)
00239761 22114 (data const-GLvoid-*)
bb894c9d
AW
22115 ->
22116 void))
3c9b6116
AW
22117 "Specify a two-dimensional texture subimage.
22118
22119TARGET
22120 Specifies the target texture. Must be `GL_TEXTURE_2D',
22121 `GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
22122 `GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
22123 `GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or
22124 `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
22125
22126LEVEL
22127 Specifies the level-of-detail number. Level 0 is the base image
22128 level. Level N is the Nth mipmap reduction image.
22129
22130XOFFSET
22131 Specifies a texel offset in the x direction within the texture
22132 array.
22133
22134YOFFSET
22135 Specifies a texel offset in the y direction within the texture
22136 array.
22137
22138WIDTH
22139 Specifies the width of the texture subimage.
22140
22141HEIGHT
22142 Specifies the height of the texture subimage.
22143
22144FORMAT
22145 Specifies the format of the pixel data. The following symbolic
22146 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
22147 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
22148 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
22149
22150TYPE
22151 Specifies the data type of the pixel data. The following symbolic
22152 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
22153 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
22154 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22155 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
22156 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22157 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22158 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22159 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
22160
22161DATA
22162 Specifies a pointer to the image data in memory.
22163
22164Texturing maps a portion of a specified texture image onto each
22165graphical primitive for which texturing is enabled. To enable and
22166disable two-dimensional texturing, call `glEnable' and `glDisable' with
22167argument `GL_TEXTURE_2D'.
22168
22169`glTexSubImage2D' redefines a contiguous subregion of an existing
22170two-dimensional texture image. The texels referenced by DATA replace the
22171portion of the existing texture array with x indices XOFFSET and
22172XOFFSET+WIDTH-1 , inclusive, and y indices YOFFSET and YOFFSET+HEIGHT-1
22173, inclusive. This region may not include any texels outside the range of
22174the texture array as it was originally specified. It is not an error to
22175specify a subtexture with zero width or height, but such a specification
22176has no effect.
22177
22178If a non-zero named buffer object is bound to the
22179`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
22180image is specified, DATA is treated as a byte offset into the buffer
22181object's data store.
22182
22183`GL_INVALID_ENUM' is generated if TARGET is not `GL_TEXTURE_2D',
22184`GL_TEXTURE_CUBE_MAP_POSITIVE_X', `GL_TEXTURE_CUBE_MAP_NEGATIVE_X',
22185`GL_TEXTURE_CUBE_MAP_POSITIVE_Y', `GL_TEXTURE_CUBE_MAP_NEGATIVE_Y',
22186`GL_TEXTURE_CUBE_MAP_POSITIVE_Z', or `GL_TEXTURE_CUBE_MAP_NEGATIVE_Z'.
22187
22188`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
22189constant.
22190
22191`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
22192
22193`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
22194`GL_COLOR_INDEX'.
22195
22196`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
22197
22198`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
22199where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
22200
22201`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
22202, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , where W is the
22203`GL_TEXTURE_WIDTH', H is the `GL_TEXTURE_HEIGHT', and B is the border
22204width of the texture image being modified. Note that W and H include
22205twice the border width.
22206
22207`GL_INVALID_VALUE' is generated if WIDTH or HEIGHT is less than 0.
22208
22209`GL_INVALID_OPERATION' is generated if the texture array has not been
22210defined by a previous `glTexImage2D' operation.
22211
22212`GL_INVALID_OPERATION' is generated if TYPE is one of
22213`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22214`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
22215is not `GL_RGB'.
22216
22217`GL_INVALID_OPERATION' is generated if TYPE is one of
22218`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22219`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22220`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22221`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
22222FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
22223
22224`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22225bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
22226data store is currently mapped.
22227
22228`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22229bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
22230unpacked from the buffer object such that the memory reads required
22231would exceed the data store size.
22232
22233`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22234bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
22235divisible into the number of bytes needed to store in memory a datum
22236indicated by TYPE.
22237
22238`GL_INVALID_OPERATION' is generated if `glTexSubImage2D' is executed
22239between the execution of `glBegin' and the corresponding execution of
22240`glEnd'.")
8925f36f 22241
25072f02 22242(define-gl-procedures
bb894c9d
AW
22243 ((glTexSubImage3D
22244 (target GLenum)
22245 (level GLint)
22246 (xoffset GLint)
22247 (yoffset GLint)
22248 (zoffset GLint)
22249 (width GLsizei)
22250 (height GLsizei)
22251 (depth GLsizei)
22252 (format GLenum)
22253 (type GLenum)
00239761 22254 (data const-GLvoid-*)
bb894c9d
AW
22255 ->
22256 void))
3c9b6116
AW
22257 "Specify a three-dimensional texture subimage.
22258
22259TARGET
22260 Specifies the target texture. Must be `GL_TEXTURE_3D'.
22261
22262LEVEL
22263 Specifies the level-of-detail number. Level 0 is the base image
22264 level. Level N is the Nth mipmap reduction image.
22265
22266XOFFSET
22267 Specifies a texel offset in the x direction within the texture
22268 array.
22269
22270YOFFSET
22271 Specifies a texel offset in the y direction within the texture
22272 array.
22273
22274ZOFFSET
22275 Specifies a texel offset in the z direction within the texture
22276 array.
22277
22278WIDTH
22279 Specifies the width of the texture subimage.
22280
22281HEIGHT
22282 Specifies the height of the texture subimage.
22283
22284DEPTH
22285 Specifies the depth of the texture subimage.
22286
22287FORMAT
22288 Specifies the format of the pixel data. The following symbolic
22289 values are accepted: `GL_COLOR_INDEX', `GL_RED', `GL_GREEN',
22290 `GL_BLUE', `GL_ALPHA', `GL_RGB', `GL_BGR', `GL_RGBA', `GL_BGRA',
22291 `GL_LUMINANCE', and `GL_LUMINANCE_ALPHA'.
22292
22293TYPE
22294 Specifies the data type of the pixel data. The following symbolic
22295 values are accepted: `GL_UNSIGNED_BYTE', `GL_BYTE', `GL_BITMAP',
22296 `GL_UNSIGNED_SHORT', `GL_SHORT', `GL_UNSIGNED_INT', `GL_INT',
22297 `GL_FLOAT', `GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22298 `GL_UNSIGNED_SHORT_5_6_5', `GL_UNSIGNED_SHORT_5_6_5_REV',
22299 `GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22300 `GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22301 `GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22302 `GL_UNSIGNED_INT_10_10_10_2', and `GL_UNSIGNED_INT_2_10_10_10_REV'.
22303
22304DATA
22305 Specifies a pointer to the image data in memory.
22306
22307Texturing maps a portion of a specified texture image onto each
22308graphical primitive for which texturing is enabled. To enable and
22309disable three-dimensional texturing, call `glEnable' and `glDisable'
22310with argument `GL_TEXTURE_3D'.
22311
22312`glTexSubImage3D' redefines a contiguous subregion of an existing
22313three-dimensional texture image. The texels referenced by DATA replace
22314the portion of the existing texture array with x indices XOFFSET and
22315XOFFSET+WIDTH-1 , inclusive, y indices YOFFSET and YOFFSET+HEIGHT-1 ,
22316inclusive, and z indices ZOFFSET and ZOFFSET+DEPTH-1 , inclusive. This
22317region may not include any texels outside the range of the texture array
22318as it was originally specified. It is not an error to specify a
22319subtexture with zero width, height, or depth but such a specification
22320has no effect.
22321
22322If a non-zero named buffer object is bound to the
22323`GL_PIXEL_UNPACK_BUFFER' target (see `glBindBuffer') while a texture
22324image is specified, DATA is treated as a byte offset into the buffer
22325object's data store.
22326
22327`GL_INVALID_ENUM' is generated if /TARGET is not `GL_TEXTURE_3D'.
22328
22329`GL_INVALID_ENUM' is generated if FORMAT is not an accepted format
22330constant.
22331
22332`GL_INVALID_ENUM' is generated if TYPE is not a type constant.
22333
22334`GL_INVALID_ENUM' is generated if TYPE is `GL_BITMAP' and FORMAT is not
22335`GL_COLOR_INDEX'.
22336
22337`GL_INVALID_VALUE' is generated if LEVEL is less than 0.
22338
22339`GL_INVALID_VALUE' may be generated if LEVEL is greater than LOG_2 MAX,
22340where MAX is the returned value of `GL_MAX_TEXTURE_SIZE'.
22341
22342`GL_INVALID_VALUE' is generated if XOFFSET<-B , (XOFFSET+WIDTH,)>(W-B,)
22343, YOFFSET<-B , or (YOFFSET+HEIGHT,)>(H-B,) , or ZOFFSET<-B , or
22344(ZOFFSET+DEPTH,)>(D-B,) , where W is the `GL_TEXTURE_WIDTH', H is the
22345`GL_TEXTURE_HEIGHT', D is the `GL_TEXTURE_DEPTH' and B is the border
22346width of the texture image being modified. Note that W , H , and D
22347include twice the border width.
22348
22349`GL_INVALID_VALUE' is generated if WIDTH, HEIGHT, or DEPTH is less than
223500.
22351
22352`GL_INVALID_OPERATION' is generated if the texture array has not been
22353defined by a previous `glTexImage3D' operation.
22354
22355`GL_INVALID_OPERATION' is generated if TYPE is one of
22356`GL_UNSIGNED_BYTE_3_3_2', `GL_UNSIGNED_BYTE_2_3_3_REV',
22357`GL_UNSIGNED_SHORT_5_6_5', or `GL_UNSIGNED_SHORT_5_6_5_REV' and FORMAT
22358is not `GL_RGB'.
22359
22360`GL_INVALID_OPERATION' is generated if TYPE is one of
22361`GL_UNSIGNED_SHORT_4_4_4_4', `GL_UNSIGNED_SHORT_4_4_4_4_REV',
22362`GL_UNSIGNED_SHORT_5_5_5_1', `GL_UNSIGNED_SHORT_1_5_5_5_REV',
22363`GL_UNSIGNED_INT_8_8_8_8', `GL_UNSIGNED_INT_8_8_8_8_REV',
22364`GL_UNSIGNED_INT_10_10_10_2', or `GL_UNSIGNED_INT_2_10_10_10_REV' and
22365FORMAT is neither `GL_RGBA' nor `GL_BGRA'.
22366
22367`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22368bound to the `GL_PIXEL_UNPACK_BUFFER' target and the buffer object's
22369data store is currently mapped.
22370
22371`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22372bound to the `GL_PIXEL_UNPACK_BUFFER' target and the data would be
22373unpacked from the buffer object such that the memory reads required
22374would exceed the data store size.
22375
22376`GL_INVALID_OPERATION' is generated if a non-zero buffer object name is
22377bound to the `GL_PIXEL_UNPACK_BUFFER' target and DATA is not evenly
22378divisible into the number of bytes needed to store in memory a datum
22379indicated by TYPE.
22380
22381`GL_INVALID_OPERATION' is generated if `glTexSubImage3D' is executed
22382between the execution of `glBegin' and the corresponding execution of
22383`glEnd'.")
8925f36f 22384
25072f02 22385(define-gl-procedures
78aa45b9
DH
22386 ((glTranslated
22387 (x GLdouble)
22388 (y GLdouble)
22389 (z GLdouble)
22390 ->
22391 void)
22392 (glTranslatef
ca09631c
AW
22393 (x GLfloat)
22394 (y GLfloat)
22395 (z GLfloat)
bb894c9d
AW
22396 ->
22397 void))
3c9b6116
AW
22398 "Multiply the current matrix by a translation matrix.
22399
22400X
22401 Y
22402
22403 Z
22404
22405 Specify the X, Y, and Z coordinates of a translation vector.
22406
22407`glTranslate' produces a translation by (X,YZ) . The current matrix (see
22408`glMatrixMode') is multiplied by this translation matrix, with the
22409product replacing the current matrix, as if `glMultMatrix' were called
22410with the following matrix for its argument:
22411
22412((1 0 0 X), (0 1 0 Y), (0 0 1 Z), (0 0 0 1),)
22413
22414
22415
22416If the matrix mode is either `GL_MODELVIEW' or `GL_PROJECTION', all
22417objects drawn after a call to `glTranslate' are translated.
22418
22419Use `glPushMatrix' and `glPopMatrix' to save and restore the
22420untranslated coordinate system.
22421
22422`GL_INVALID_OPERATION' is generated if `glTranslate' is executed between
22423the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 22424
25072f02 22425(define-gl-procedures
bb894c9d
AW
22426 ((glUniform1f
22427 (location GLint)
22428 (v0 GLfloat)
22429 ->
22430 void)
22431 (glUniform2f
22432 (location GLint)
22433 (v0 GLfloat)
22434 (v1 GLfloat)
22435 ->
22436 void)
22437 (glUniform3f
22438 (location GLint)
22439 (v0 GLfloat)
22440 (v1 GLfloat)
22441 (v2 GLfloat)
22442 ->
22443 void)
22444 (glUniform4f
22445 (location GLint)
22446 (v0 GLfloat)
22447 (v1 GLfloat)
22448 (v2 GLfloat)
22449 (v3 GLfloat)
22450 ->
22451 void)
22452 (glUniform1i (location GLint) (v0 GLint) -> void)
22453 (glUniform2i
22454 (location GLint)
22455 (v0 GLint)
22456 (v1 GLint)
22457 ->
22458 void)
22459 (glUniform3i
22460 (location GLint)
22461 (v0 GLint)
22462 (v1 GLint)
22463 (v2 GLint)
22464 ->
22465 void)
22466 (glUniform4i
22467 (location GLint)
22468 (v0 GLint)
22469 (v1 GLint)
22470 (v2 GLint)
22471 (v3 GLint)
22472 ->
b002944d 22473 void)
78aa45b9
DH
22474 (glUniform1fv
22475 (location GLint)
22476 (count GLsizei)
22477 (value const-GLfloat-*)
22478 ->
22479 void)
22480 (glUniform2fv
22481 (location GLint)
22482 (count GLsizei)
22483 (value const-GLfloat-*)
22484 ->
22485 void)
22486 (glUniform3fv
22487 (location GLint)
22488 (count GLsizei)
22489 (value const-GLfloat-*)
22490 ->
22491 void)
22492 (glUniform4fv
22493 (location GLint)
22494 (count GLsizei)
22495 (value const-GLfloat-*)
22496 ->
22497 void)
22498 (glUniform1iv
22499 (location GLint)
22500 (count GLsizei)
22501 (value const-GLint-*)
22502 ->
22503 void)
22504 (glUniform2iv
22505 (location GLint)
22506 (count GLsizei)
22507 (value const-GLint-*)
22508 ->
22509 void)
22510 (glUniform3iv
22511 (location GLint)
22512 (count GLsizei)
22513 (value const-GLint-*)
22514 ->
22515 void)
22516 (glUniform4iv
22517 (location GLint)
22518 (count GLsizei)
22519 (value const-GLint-*)
22520 ->
22521 void)
b002944d
AW
22522 (glUniformMatrix2fv
22523 (location GLint)
22524 (count GLsizei)
22525 (transpose GLboolean)
22526 (value const-GLfloat-*)
22527 ->
22528 void)
22529 (glUniformMatrix3fv
22530 (location GLint)
22531 (count GLsizei)
22532 (transpose GLboolean)
22533 (value const-GLfloat-*)
22534 ->
22535 void)
22536 (glUniformMatrix4fv
22537 (location GLint)
22538 (count GLsizei)
22539 (transpose GLboolean)
22540 (value const-GLfloat-*)
22541 ->
22542 void)
22543 (glUniformMatrix2x3fv
22544 (location GLint)
22545 (count GLsizei)
22546 (transpose GLboolean)
22547 (value const-GLfloat-*)
22548 ->
22549 void)
22550 (glUniformMatrix3x2fv
22551 (location GLint)
22552 (count GLsizei)
22553 (transpose GLboolean)
22554 (value const-GLfloat-*)
22555 ->
22556 void)
22557 (glUniformMatrix2x4fv
22558 (location GLint)
22559 (count GLsizei)
22560 (transpose GLboolean)
22561 (value const-GLfloat-*)
22562 ->
22563 void)
22564 (glUniformMatrix4x2fv
22565 (location GLint)
22566 (count GLsizei)
22567 (transpose GLboolean)
22568 (value const-GLfloat-*)
22569 ->
22570 void)
22571 (glUniformMatrix3x4fv
22572 (location GLint)
22573 (count GLsizei)
22574 (transpose GLboolean)
22575 (value const-GLfloat-*)
22576 ->
22577 void)
22578 (glUniformMatrix4x3fv
22579 (location GLint)
22580 (count GLsizei)
22581 (transpose GLboolean)
22582 (value const-GLfloat-*)
22583 ->
bb894c9d 22584 void))
3c9b6116
AW
22585 "Specify the value of a uniform variable for the current program object.
22586
22587LOCATION
22588 Specifies the location of the uniform variable to be modified.
22589
22590V0, V1, V2, V3
22591 Specifies the new values to be used for the specified uniform
22592 variable.
22593
22594`glUniform' modifies the value of a uniform variable or a uniform
22595variable array. The location of the uniform variable to be modified is
22596specified by LOCATION, which should be a value returned by
22597`glGetUniformLocation'. `glUniform' operates on the program object that
22598was made part of current state by calling `glUseProgram'.
22599
22600The commands `glUniform{1|2|3|4}{f|i}' are used to change the value of
22601the uniform variable specified by LOCATION using the values passed as
22602arguments. The number specified in the command should match the number
22603of components in the data type of the specified uniform variable (e.g.,
22604`1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The suffix
22605`f' indicates that floating-point values are being passed; the suffix
22606`i' indicates that integer values are being passed, and this type should
22607also match the data type of the specified uniform variable. The `i'
22608variants of this function should be used to provide values for uniform
22609variables defined as int, ivec2, ivec3, ivec4, or arrays of these. The
22610`f' variants should be used to provide values for uniform variables of
22611type float, vec2, vec3, vec4, or arrays of these. Either the `i' or the
22612`f' variants may be used to provide values for uniform variables of type
22613bool, bvec2, bvec3, bvec4, or arrays of these. The uniform variable will
22614be set to false if the input value is 0 or 0.0f, and it will be set to
22615true otherwise.
22616
22617All active uniform variables defined in a program object are initialized
22618to 0 when the program object is linked successfully. They retain the
22619values assigned to them by a call to `glUniform ' until the next
22620successful link operation occurs on the program object, when they are
22621once again initialized to 0.
22622
22623The commands `glUniform{1|2|3|4}{f|i}v' can be used to modify a single
22624uniform variable or a uniform variable array. These commands pass a
22625count and a pointer to the values to be loaded into a uniform variable
22626or a uniform variable array. A count of 1 should be used if modifying
22627the value of a single uniform variable, and a count of 1 or greater can
22628be used to modify an entire array or part of an array. When loading N
22629elements starting at an arbitrary position M in a uniform variable
22630array, elements M + N - 1 in the array will be replaced with the new
22631values. If M + N - 1 is larger than the size of the uniform variable
22632array, values for all array elements beyond the end of the array will be
22633ignored. The number specified in the name of the command indicates the
22634number of components for each element in VALUE, and it should match the
22635number of components in the data type of the specified uniform variable
22636(e.g., `1' for float, int, bool; `2' for vec2, ivec2, bvec2, etc.). The
22637data type specified in the name of the command must match the data type
22638for the specified uniform variable as described previously for
22639`glUniform{1|2|3|4}{f|i}'.
22640
22641For uniform variable arrays, each element of the array is considered to
22642be of the type indicated in the name of the command (e.g., `glUniform3f'
22643or `glUniform3fv' can be used to load a uniform variable array of type
22644vec3). The number of elements of the uniform variable array to be
22645modified is specified by COUNT
22646
22647The commands `glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv' are used
22648to modify a matrix or an array of matrices. The numbers in the command
22649name are interpreted as the dimensionality of the matrix. The number `2'
22650indicates a 2 × 2 matrix (i.e., 4 values), the number `3' indicates a 3
22651× 3 matrix (i.e., 9 values), and the number `4' indicates a 4 × 4 matrix
22652(i.e., 16 values). Non-square matrix dimensionality is explicit, with
22653the first number representing the number of columns and the second
22654number representing the number of rows. For example, `2x4' indicates a 2
22655× 4 matrix with 2 columns and 4 rows (i.e., 8 values). If TRANSPOSE is
22656`GL_FALSE', each matrix is assumed to be supplied in column major order.
22657If TRANSPOSE is `GL_TRUE', each matrix is assumed to be supplied in row
22658major order. The COUNT argument indicates the number of matrices to be
22659passed. A count of 1 should be used if modifying the value of a single
22660matrix, and a count greater than 1 can be used to modify an array of
22661matrices.
22662
22663`GL_INVALID_OPERATION' is generated if there is no current program
22664object.
22665
22666`GL_INVALID_OPERATION' is generated if the size of the uniform variable
22667declared in the shader does not match the size indicated by the
22668`glUniform' command.
22669
22670`GL_INVALID_OPERATION' is generated if one of the integer variants of
22671this function is used to load a uniform variable of type float, vec2,
22672vec3, vec4, or an array of these, or if one of the floating-point
22673variants of this function is used to load a uniform variable of type
22674int, ivec2, ivec3, or ivec4, or an array of these.
22675
22676`GL_INVALID_OPERATION' is generated if LOCATION is an invalid uniform
22677location for the current program object and LOCATION is not equal to -1.
22678
22679`GL_INVALID_VALUE' is generated if COUNT is less than 0.
22680
22681`GL_INVALID_OPERATION' is generated if COUNT is greater than 1 and the
22682indicated uniform variable is not an array variable.
22683
22684`GL_INVALID_OPERATION' is generated if a sampler is loaded using a
22685command other than `glUniform1i' and `glUniform1iv'.
22686
22687`GL_INVALID_OPERATION' is generated if `glUniform' is executed between
22688the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 22689
25072f02 22690(define-gl-procedures
bb894c9d 22691 ((glUseProgram (program GLuint) -> void))
3c9b6116
AW
22692 "Installs a program object as part of current rendering state.
22693
22694PROGRAM
22695 Specifies the handle of the program object whose executables are to
22696 be used as part of current rendering state.
22697
22698`glUseProgram' installs the program object specified by PROGRAM as part
22699of current rendering state. One or more executables are created in a
22700program object by successfully attaching shader objects to it with
22701`glAttachShader', successfully compiling the shader objects with
22702`glCompileShader', and successfully linking the program object with
22703`glLinkProgram'.
22704
22705A program object will contain an executable that will run on the vertex
22706processor if it contains one or more shader objects of type
22707`GL_VERTEX_SHADER' that have been successfully compiled and linked.
22708Similarly, a program object will contain an executable that will run on
22709the fragment processor if it contains one or more shader objects of type
22710`GL_FRAGMENT_SHADER' that have been successfully compiled and linked.
22711
22712Successfully installing an executable on a programmable processor will
22713cause the corresponding fixed functionality of OpenGL to be disabled.
22714Specifically, if an executable is installed on the vertex processor, the
22715OpenGL fixed functionality will be disabled as follows.
22716
22717 * The projection matrix is not applied to vertex coordinates.
22718
22719 * The texture matrices are not applied to texture coordinates.
22720
22721 * Normals are not transformed to eye coordinates.
22722
22723 * Normals are not rescaled or normalized.
22724
22725 * Normalization of `GL_AUTO_NORMAL' evaluated normals is not
22726 performed.
22727
22728 * Texture coordinates are not generated automatically.
22729
22730 * Per-vertex lighting is not performed.
22731
22732 * Color material computations are not performed.
22733
22734 * Color index lighting is not performed.
22735
22736 * This list also applies when setting the current raster position.
22737
22738The executable that is installed on the vertex processor is expected to
22739implement any or all of the desired functionality from the preceding
22740list. Similarly, if an executable is installed on the fragment
22741processor, the OpenGL fixed functionality will be disabled as follows.
22742
22743 * Texture application is not applied.
22744
22745 * Color sum is not applied.
22746
22747 * Fog is not applied.
22748
22749Again, the fragment shader that is installed is expected to implement
22750any or all of the desired functionality from the preceding list.
22751
22752While a program object is in use, applications are free to modify
22753attached shader objects, compile attached shader objects, attach
22754additional shader objects, and detach or delete shader objects. None of
22755these operations will affect the executables that are part of the
22756current state. However, relinking the program object that is currently
22757in use will install the program object as part of the current rendering
22758state if the link operation was successful (see `glLinkProgram' ). If
22759the program object currently in use is relinked unsuccessfully, its link
22760status will be set to `GL_FALSE', but the executables and associated
22761state will remain part of the current state until a subsequent call to
22762`glUseProgram' removes it from use. After it is removed from use, it
22763cannot be made part of current state until it has been successfully
22764relinked.
22765
22766If PROGRAM contains shader objects of type `GL_VERTEX_SHADER' but it
22767does not contain shader objects of type `GL_FRAGMENT_SHADER', an
22768executable will be installed on the vertex processor, but fixed
22769functionality will be used for fragment processing. Similarly, if
22770PROGRAM contains shader objects of type `GL_FRAGMENT_SHADER' but it does
22771not contain shader objects of type `GL_VERTEX_SHADER', an executable
22772will be installed on the fragment processor, but fixed functionality
22773will be used for vertex processing. If PROGRAM is 0, the programmable
22774processors will be disabled, and fixed functionality will be used for
22775both vertex and fragment processing.
22776
22777`GL_INVALID_VALUE' is generated if PROGRAM is neither 0 nor a value
22778generated by OpenGL.
22779
22780`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
22781
22782`GL_INVALID_OPERATION' is generated if PROGRAM could not be made part of
22783current state.
22784
22785`GL_INVALID_OPERATION' is generated if `glUseProgram' is executed
22786between the execution of `glBegin' and the corresponding execution of
22787`glEnd'.")
8925f36f 22788
25072f02 22789(define-gl-procedures
bb894c9d 22790 ((glValidateProgram (program GLuint) -> void))
3c9b6116
AW
22791 "Validates a program object.
22792
22793PROGRAM
22794 Specifies the handle of the program object to be validated.
22795
22796`glValidateProgram' checks to see whether the executables contained in
22797PROGRAM can execute given the current OpenGL state. The information
22798generated by the validation process will be stored in PROGRAM's
22799information log. The validation information may consist of an empty
22800string, or it may be a string containing information about how the
22801current program object interacts with the rest of current OpenGL state.
22802This provides a way for OpenGL implementers to convey more information
22803about why the current program is inefficient, suboptimal, failing to
22804execute, and so on.
22805
22806The status of the validation operation will be stored as part of the
22807program object's state. This value will be set to `GL_TRUE' if the
22808validation succeeded, and `GL_FALSE' otherwise. It can be queried by
22809calling `glGetProgram' with arguments PROGRAM and `GL_VALIDATE_STATUS'.
22810If validation is successful, PROGRAM is guaranteed to execute given the
22811current state. Otherwise, PROGRAM is guaranteed to not execute.
22812
22813This function is typically useful only during application development.
22814The informational string stored in the information log is completely
22815implementation dependent; therefore, an application should not expect
22816different OpenGL implementations to produce identical information
22817strings.
22818
22819`GL_INVALID_VALUE' is generated if PROGRAM is not a value generated by
22820OpenGL.
22821
22822`GL_INVALID_OPERATION' is generated if PROGRAM is not a program object.
22823
22824`GL_INVALID_OPERATION' is generated if `glValidateProgram' is executed
22825between the execution of `glBegin' and the corresponding execution of
22826`glEnd'.")
8925f36f 22827
25072f02 22828(define-gl-procedures
bb894c9d
AW
22829 ((glVertexAttribPointer
22830 (index GLuint)
22831 (size GLint)
22832 (type GLenum)
22833 (normalized GLboolean)
22834 (stride GLsizei)
00239761 22835 (pointer const-GLvoid-*)
bb894c9d
AW
22836 ->
22837 void))
3c9b6116
AW
22838 "Define an array of generic vertex attribute data.
22839
22840INDEX
22841 Specifies the index of the generic vertex attribute to be modified.
22842
22843SIZE
22844 Specifies the number of components per generic vertex attribute.
22845 Must be 1, 2, 3, or 4. The initial value is 4.
22846
22847TYPE
22848 Specifies the data type of each component in the array. Symbolic
22849 constants `GL_BYTE', `GL_UNSIGNED_BYTE', `GL_SHORT',
22850 `GL_UNSIGNED_SHORT', `GL_INT', `GL_UNSIGNED_INT', `GL_FLOAT', or
22851 `GL_DOUBLE' are accepted. The initial value is `GL_FLOAT'.
22852
22853NORMALIZED
22854 Specifies whether fixed-point data values should be normalized
22855 (`GL_TRUE') or converted directly as fixed-point values
22856 (`GL_FALSE') when they are accessed.
22857
22858STRIDE
22859 Specifies the byte offset between consecutive generic vertex
22860 attributes. If STRIDE is 0, the generic vertex attributes are
22861 understood to be tightly packed in the array. The initial value is
22862 0.
22863
22864POINTER
22865 Specifies a pointer to the first component of the first generic
22866 vertex attribute in the array. The initial value is 0.
22867
22868`glVertexAttribPointer' specifies the location and data format of the
22869array of generic vertex attributes at index INDEX to use when rendering.
22870SIZE specifies the number of components per attribute and must be 1, 2,
228713, or 4. TYPE specifies the data type of each component, and STRIDE
22872specifies the byte stride from one attribute to the next, allowing
22873vertices and attributes to be packed into a single array or stored in
22874separate arrays. If set to `GL_TRUE', NORMALIZED indicates that values
22875stored in an integer format are to be mapped to the range [-1,1] (for
22876signed values) or [0,1] (for unsigned values) when they are accessed and
22877converted to floating point. Otherwise, values will be converted to
22878floats directly without normalization.
22879
22880If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
22881target (see `glBindBuffer') while a generic vertex attribute array is
22882specified, POINTER is treated as a byte offset into the buffer object's
22883data store. Also, the buffer object binding (`GL_ARRAY_BUFFER_BINDING')
22884is saved as generic vertex attribute array client-side state
22885(`GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING') for index INDEX.
22886
22887When a generic vertex attribute array is specified, SIZE, TYPE,
22888NORMALIZED, STRIDE, and POINTER are saved as client-side state, in
22889addition to the current vertex array buffer object binding.
22890
22891To enable and disable a generic vertex attribute array, call
22892`glEnableVertexAttribArray' and `glDisableVertexAttribArray' with INDEX.
22893If enabled, the generic vertex attribute array is used when
22894`glArrayElement', `glDrawArrays', `glMultiDrawArrays', `glDrawElements',
22895`glMultiDrawElements', or `glDrawRangeElements' is called.
22896
22897`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
22898`GL_MAX_VERTEX_ATTRIBS'.
22899
22900`GL_INVALID_VALUE' is generated if SIZE is not 1, 2, 3, or 4.
22901
22902`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
22903
22904`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 22905
25072f02 22906(define-gl-procedures
ca09631c
AW
22907 ((glVertexAttrib1f
22908 (index GLuint)
22909 (v0 GLfloat)
22910 ->
22911 void)
22912 (glVertexAttrib1s
bb894c9d
AW
22913 (index GLuint)
22914 (v0 GLshort)
22915 ->
22916 void)
78aa45b9
DH
22917 (glVertexAttrib1d
22918 (index GLuint)
22919 (v0 GLdouble)
22920 ->
22921 void)
ca09631c 22922 (glVertexAttrib2f
bb894c9d 22923 (index GLuint)
ca09631c
AW
22924 (v0 GLfloat)
22925 (v1 GLfloat)
bb894c9d
AW
22926 ->
22927 void)
22928 (glVertexAttrib2s
22929 (index GLuint)
22930 (v0 GLshort)
22931 (v1 GLshort)
22932 ->
22933 void)
78aa45b9
DH
22934 (glVertexAttrib2d
22935 (index GLuint)
22936 (v0 GLdouble)
22937 (v1 GLdouble)
22938 ->
22939 void)
ca09631c 22940 (glVertexAttrib3f
bb894c9d 22941 (index GLuint)
ca09631c
AW
22942 (v0 GLfloat)
22943 (v1 GLfloat)
22944 (v2 GLfloat)
bb894c9d
AW
22945 ->
22946 void)
22947 (glVertexAttrib3s
22948 (index GLuint)
22949 (v0 GLshort)
22950 (v1 GLshort)
22951 (v2 GLshort)
22952 ->
22953 void)
78aa45b9
DH
22954 (glVertexAttrib3d
22955 (index GLuint)
22956 (v0 GLdouble)
22957 (v1 GLdouble)
22958 (v2 GLdouble)
22959 ->
22960 void)
ca09631c 22961 (glVertexAttrib4f
bb894c9d 22962 (index GLuint)
ca09631c
AW
22963 (v0 GLfloat)
22964 (v1 GLfloat)
22965 (v2 GLfloat)
22966 (v3 GLfloat)
bb894c9d
AW
22967 ->
22968 void)
22969 (glVertexAttrib4s
22970 (index GLuint)
22971 (v0 GLshort)
22972 (v1 GLshort)
22973 (v2 GLshort)
22974 (v3 GLshort)
22975 ->
22976 void)
78aa45b9
DH
22977 (glVertexAttrib4d
22978 (index GLuint)
22979 (v0 GLdouble)
22980 (v1 GLdouble)
22981 (v2 GLdouble)
22982 (v3 GLdouble)
22983 ->
22984 void)
bb894c9d
AW
22985 (glVertexAttrib4Nub
22986 (index GLuint)
22987 (v0 GLubyte)
22988 (v1 GLubyte)
22989 (v2 GLubyte)
22990 (v3 GLubyte)
22991 ->
b002944d 22992 void)
78aa45b9
DH
22993 (glVertexAttrib1fv
22994 (index GLuint)
22995 (v const-GLfloat-*)
22996 ->
22997 void)
22998 (glVertexAttrib1sv
22999 (index GLuint)
23000 (v const-GLshort-*)
23001 ->
23002 void)
23003 (glVertexAttrib1dv
23004 (index GLuint)
23005 (v const-GLdouble-*)
23006 ->
23007 void)
23008 (glVertexAttrib2fv
23009 (index GLuint)
23010 (v const-GLfloat-*)
23011 ->
23012 void)
23013 (glVertexAttrib2sv
23014 (index GLuint)
23015 (v const-GLshort-*)
23016 ->
23017 void)
23018 (glVertexAttrib2dv
23019 (index GLuint)
23020 (v const-GLdouble-*)
23021 ->
23022 void)
23023 (glVertexAttrib3fv
23024 (index GLuint)
23025 (v const-GLfloat-*)
23026 ->
23027 void)
23028 (glVertexAttrib3sv
23029 (index GLuint)
23030 (v const-GLshort-*)
23031 ->
23032 void)
23033 (glVertexAttrib3dv
23034 (index GLuint)
23035 (v const-GLdouble-*)
23036 ->
23037 void)
23038 (glVertexAttrib4fv
23039 (index GLuint)
23040 (v const-GLfloat-*)
23041 ->
23042 void)
23043 (glVertexAttrib4sv
23044 (index GLuint)
23045 (v const-GLshort-*)
23046 ->
23047 void)
23048 (glVertexAttrib4dv
23049 (index GLuint)
23050 (v const-GLdouble-*)
23051 ->
23052 void)
b002944d
AW
23053 (glVertexAttrib4iv
23054 (index GLuint)
23055 (v const-GLint-*)
23056 ->
23057 void)
78aa45b9
DH
23058 (glVertexAttrib4bv
23059 (index GLuint)
23060 (v const-GLbyte-*)
23061 ->
23062 void)
23063 (glVertexAttrib4ubv
23064 (index GLuint)
23065 (v const-GLubyte-*)
23066 ->
23067 void)
23068 (glVertexAttrib4usv
23069 (index GLuint)
23070 (v const-GLushort-*)
23071 ->
23072 void)
b002944d
AW
23073 (glVertexAttrib4uiv
23074 (index GLuint)
23075 (v const-GLuint-*)
23076 ->
23077 void)
78aa45b9
DH
23078 (glVertexAttrib4Nbv
23079 (index GLuint)
23080 (v const-GLbyte-*)
23081 ->
23082 void)
23083 (glVertexAttrib4Nsv
23084 (index GLuint)
23085 (v const-GLshort-*)
23086 ->
23087 void)
b002944d
AW
23088 (glVertexAttrib4Niv
23089 (index GLuint)
23090 (v const-GLint-*)
23091 ->
23092 void)
78aa45b9
DH
23093 (glVertexAttrib4Nubv
23094 (index GLuint)
23095 (v const-GLubyte-*)
23096 ->
23097 void)
23098 (glVertexAttrib4Nusv
23099 (index GLuint)
23100 (v const-GLushort-*)
23101 ->
23102 void)
b002944d
AW
23103 (glVertexAttrib4Nuiv
23104 (index GLuint)
23105 (v const-GLuint-*)
23106 ->
bb894c9d 23107 void))
3c9b6116
AW
23108 "Specifies the value of a generic vertex attribute.
23109
23110INDEX
23111 Specifies the index of the generic vertex attribute to be modified.
23112
23113V0, V1, V2, V3
23114 Specifies the new values to be used for the specified vertex
23115 attribute.
23116
23117OpenGL defines a number of standard vertex attributes that applications
23118can modify with standard API entry points (color, normal, texture
23119coordinates, etc.). The `glVertexAttrib' family of entry points allows
23120an application to pass generic vertex attributes in numbered locations.
23121
23122Generic attributes are defined as four-component values that are
23123organized into an array. The first entry of this array is numbered 0,
23124and the size of the array is specified by the implementation-dependent
23125constant `GL_MAX_VERTEX_ATTRIBS'. Individual elements of this array can
23126be modified with a `glVertexAttrib' call that specifies the index of the
23127element to be modified and a value for that element.
23128
23129These commands can be used to specify one, two, three, or all four
23130components of the generic vertex attribute specified by INDEX. A `1' in
23131the name of the command indicates that only one value is passed, and it
23132will be used to modify the first component of the generic vertex
23133attribute. The second and third components will be set to 0, and the
23134fourth component will be set to 1. Similarly, a `2' in the name of the
23135command indicates that values are provided for the first two components,
23136the third component will be set to 0, and the fourth component will be
23137set to 1. A `3' in the name of the command indicates that values are
23138provided for the first three components and the fourth component will be
23139set to 1, whereas a `4' in the name indicates that values are provided
23140for all four components.
23141
23142The letters `s', `f', `i', `d', `ub', `us', and `ui' indicate whether
23143the arguments are of type short, float, int, double, unsigned byte,
23144unsigned short, or unsigned int. When `v' is appended to the name, the
23145commands can take a pointer to an array of such values. The commands
23146containing `N' indicate that the arguments will be passed as fixed-point
23147values that are scaled to a normalized range according to the component
23148conversion rules defined by the OpenGL specification. Signed values are
23149understood to represent fixed-point values in the range [-1,1], and
23150unsigned values are understood to represent fixed-point values in the
23151range [0,1].
23152
23153OpenGL Shading Language attribute variables are allowed to be of type
23154mat2, mat3, or mat4. Attributes of these types may be loaded using the
23155`glVertexAttrib' entry points. Matrices must be loaded into successive
23156generic attribute slots in column major order, with one column of the
23157matrix in each generic attribute slot.
23158
23159A user-defined attribute variable declared in a vertex shader can be
23160bound to a generic attribute index by calling `glBindAttribLocation'.
23161This allows an application to use more descriptive variable names in a
23162vertex shader. A subsequent change to the specified generic vertex
23163attribute will be immediately reflected as a change to the corresponding
23164attribute variable in the vertex shader.
23165
23166The binding between a generic vertex attribute index and a user-defined
23167attribute variable in a vertex shader is part of the state of a program
23168object, but the current value of the generic vertex attribute is not.
23169The value of each generic vertex attribute is part of current state,
23170just like standard vertex attributes, and it is maintained even if a
23171different program object is used.
23172
23173An application may freely modify generic vertex attributes that are not
23174bound to a named vertex shader attribute variable. These values are
23175simply maintained as part of current state and will not be accessed by
23176the vertex shader. If a generic vertex attribute bound to an attribute
23177variable in a vertex shader is not updated while the vertex shader is
23178executing, the vertex shader will repeatedly use the current value for
23179the generic vertex attribute.
23180
23181The generic vertex attribute with index 0 is the same as the vertex
23182position attribute previously defined by OpenGL. A `glVertex2',
23183`glVertex3', or `glVertex4' command is completely equivalent to the
23184corresponding `glVertexAttrib' command with an index argument of 0. A
23185vertex shader can access generic vertex attribute 0 by using the
23186built-in attribute variable GL_VERTEX. There are no current values for
23187generic vertex attribute 0. This is the only generic vertex attribute
23188with this property; calls to set other standard vertex attributes can be
23189freely mixed with calls to set any of the other generic vertex
23190attributes.
23191
23192`GL_INVALID_VALUE' is generated if INDEX is greater than or equal to
23193`GL_MAX_VERTEX_ATTRIBS'.")
8925f36f 23194
25072f02 23195(define-gl-procedures
bb894c9d
AW
23196 ((glVertexPointer
23197 (size GLint)
23198 (type GLenum)
23199 (stride GLsizei)
00239761 23200 (pointer const-GLvoid-*)
bb894c9d
AW
23201 ->
23202 void))
3c9b6116
AW
23203 "Define an array of vertex data.
23204
23205SIZE
23206 Specifies the number of coordinates per vertex. Must be 2, 3, or 4.
23207 The initial value is 4.
23208
23209TYPE
23210 Specifies the data type of each coordinate in the array. Symbolic
23211 constants `GL_SHORT', `GL_INT', `GL_FLOAT', or `GL_DOUBLE' are
23212 accepted. The initial value is `GL_FLOAT'.
23213
23214STRIDE
23215 Specifies the byte offset between consecutive vertices. If STRIDE
23216 is 0, the vertices are understood to be tightly packed in the
23217 array. The initial value is 0.
23218
23219POINTER
23220 Specifies a pointer to the first coordinate of the first vertex in
23221 the array. The initial value is 0.
23222
23223`glVertexPointer' specifies the location and data format of an array of
23224vertex coordinates to use when rendering. SIZE specifies the number of
23225coordinates per vertex, and must be 2, 3, or 4. TYPE specifies the data
23226type of each coordinate, and STRIDE specifies the byte stride from one
23227vertex to the next, allowing vertices and attributes to be packed into a
23228single array or stored in separate arrays. (Single-array storage may be
23229more efficient on some implementations; see `glInterleavedArrays'.)
23230
23231If a non-zero named buffer object is bound to the `GL_ARRAY_BUFFER'
23232target (see `glBindBuffer') while a vertex array is specified, POINTER
23233is treated as a byte offset into the buffer object's data store. Also,
23234the buffer object binding (`GL_ARRAY_BUFFER_BINDING') is saved as vertex
23235array client-side state (`GL_VERTEX_ARRAY_BUFFER_BINDING').
23236
23237When a vertex array is specified, SIZE, TYPE, STRIDE, and POINTER are
23238saved as client-side state, in addition to the current vertex array
23239buffer object binding.
23240
23241To enable and disable the vertex array, call `glEnableClientState' and
23242`glDisableClientState' with the argument `GL_VERTEX_ARRAY'. If enabled,
23243the vertex array is used when `glArrayElement', `glDrawArrays',
23244`glMultiDrawArrays', `glDrawElements', `glMultiDrawElements', or
23245`glDrawRangeElements' is called.
23246
23247`GL_INVALID_VALUE' is generated if SIZE is not 2, 3, or 4.
23248
23249`GL_INVALID_ENUM' is generated if TYPE is not an accepted value.
23250
23251`GL_INVALID_VALUE' is generated if STRIDE is negative.")
8925f36f 23252
25072f02 23253(define-gl-procedures
78aa45b9
DH
23254 ((glVertex2s (x GLshort) (y GLshort) -> void)
23255 (glVertex2i (x GLint) (y GLint) -> void)
ca09631c 23256 (glVertex2f (x GLfloat) (y GLfloat) -> void)
78aa45b9
DH
23257 (glVertex2d (x GLdouble) (y GLdouble) -> void)
23258 (glVertex3s
23259 (x GLshort)
23260 (y GLshort)
23261 (z GLshort)
23262 ->
23263 void)
bb894c9d
AW
23264 (glVertex3i
23265 (x GLint)
23266 (y GLint)
23267 (z GLint)
23268 ->
23269 void)
ca09631c
AW
23270 (glVertex3f
23271 (x GLfloat)
23272 (y GLfloat)
23273 (z GLfloat)
bb894c9d
AW
23274 ->
23275 void)
78aa45b9
DH
23276 (glVertex3d
23277 (x GLdouble)
23278 (y GLdouble)
23279 (z GLdouble)
23280 ->
23281 void)
23282 (glVertex4s
23283 (x GLshort)
23284 (y GLshort)
23285 (z GLshort)
23286 (w GLshort)
23287 ->
23288 void)
bb894c9d
AW
23289 (glVertex4i
23290 (x GLint)
23291 (y GLint)
23292 (z GLint)
23293 (w GLint)
23294 ->
23295 void)
ca09631c
AW
23296 (glVertex4f
23297 (x GLfloat)
23298 (y GLfloat)
23299 (z GLfloat)
23300 (w GLfloat)
bb894c9d 23301 ->
78aa45b9
DH
23302 void)
23303 (glVertex4d
23304 (x GLdouble)
23305 (y GLdouble)
23306 (z GLdouble)
23307 (w GLdouble)
23308 ->
23309 void)
23310 (glVertex2sv (v const-GLshort-*) -> void)
23311 (glVertex2iv (v const-GLint-*) -> void)
23312 (glVertex2fv (v const-GLfloat-*) -> void)
23313 (glVertex2dv (v const-GLdouble-*) -> void)
23314 (glVertex3sv (v const-GLshort-*) -> void)
23315 (glVertex3iv (v const-GLint-*) -> void)
23316 (glVertex3fv (v const-GLfloat-*) -> void)
23317 (glVertex3dv (v const-GLdouble-*) -> void)
23318 (glVertex4sv (v const-GLshort-*) -> void)
23319 (glVertex4iv (v const-GLint-*) -> void)
23320 (glVertex4fv (v const-GLfloat-*) -> void)
23321 (glVertex4dv (v const-GLdouble-*) -> void))
3c9b6116
AW
23322 "Specify a vertex.
23323
23324X
23325 Y
23326
23327 Z
23328
23329 W
23330
23331 Specify X, Y, Z, and W coordinates of a vertex. Not all parameters
23332 are present in all forms of the command.
23333
23334`glVertex' commands are used within `glBegin'/`glEnd' pairs to specify
23335point, line, and polygon vertices. The current color, normal, texture
23336coordinates, and fog coordinate are associated with the vertex when
23337`glVertex' is called.
23338
23339When only X and Y are specified, Z defaults to 0 and W defaults to 1.
23340When X , Y , and Z are specified, W defaults to 1.")
8925f36f 23341
25072f02 23342(define-gl-procedures
bb894c9d
AW
23343 ((glViewport
23344 (x GLint)
23345 (y GLint)
23346 (width GLsizei)
23347 (height GLsizei)
23348 ->
23349 void))
3c9b6116
AW
23350 "Set the viewport.
23351
23352X
23353 Y
23354
23355 Specify the lower left corner of the viewport rectangle, in pixels.
23356 The initial value is (0,0).
23357
23358WIDTH
23359 HEIGHT
23360
23361 Specify the width and height of the viewport. When a GL context is
23362 first attached to a window, WIDTH and HEIGHT are set to the
23363 dimensions of that window.
23364
23365`glViewport' specifies the affine transformation of X and Y from
23366normalized device coordinates to window coordinates. Let (X_ND,Y_ND) be
23367normalized device coordinates. Then the window coordinates (X_W,Y_W) are
23368computed as follows:
23369
23370X_W=(X_ND+1,)\u2062(WIDTH/2,)+X
23371
23372Y_W=(Y_ND+1,)\u2062(HEIGHT/2,)+Y
23373
23374Viewport width and height are silently clamped to a range that depends
23375on the implementation. To query this range, call `glGet' with argument
23376`GL_MAX_VIEWPORT_DIMS'.
23377
23378`GL_INVALID_VALUE' is generated if either WIDTH or HEIGHT is negative.
23379
23380`GL_INVALID_OPERATION' is generated if `glViewport' is executed between
23381the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 23382
25072f02 23383(define-gl-procedures
78aa45b9
DH
23384 ((glWindowPos2s (x GLshort) (y GLshort) -> void)
23385 (glWindowPos2i (x GLint) (y GLint) -> void)
ca09631c 23386 (glWindowPos2f (x GLfloat) (y GLfloat) -> void)
78aa45b9
DH
23387 (glWindowPos2d (x GLdouble) (y GLdouble) -> void)
23388 (glWindowPos3s
23389 (x GLshort)
23390 (y GLshort)
23391 (z GLshort)
23392 ->
23393 void)
bb894c9d
AW
23394 (glWindowPos3i
23395 (x GLint)
23396 (y GLint)
23397 (z GLint)
23398 ->
23399 void)
ca09631c
AW
23400 (glWindowPos3f
23401 (x GLfloat)
23402 (y GLfloat)
23403 (z GLfloat)
bb894c9d 23404 ->
78aa45b9
DH
23405 void)
23406 (glWindowPos3d
23407 (x GLdouble)
23408 (y GLdouble)
23409 (z GLdouble)
23410 ->
23411 void)
23412 (glWindowPos2sv (v const-GLshort-*) -> void)
23413 (glWindowPos2iv (v const-GLint-*) -> void)
23414 (glWindowPos2fv (v const-GLfloat-*) -> void)
23415 (glWindowPos2dv (v const-GLdouble-*) -> void)
23416 (glWindowPos3sv (v const-GLshort-*) -> void)
23417 (glWindowPos3iv (v const-GLint-*) -> void)
23418 (glWindowPos3fv (v const-GLfloat-*) -> void)
23419 (glWindowPos3dv (v const-GLdouble-*) -> void))
3c9b6116
AW
23420 "Specify the raster position in window coordinates for pixel operations.
23421
23422X
23423 Y
23424
23425 Z
23426
23427 Specify the X , Y , Z coordinates for the raster position.
23428
23429The GL maintains a 3D position in window coordinates. This position,
23430called the raster position, is used to position pixel and bitmap write
23431operations. It is maintained with subpixel accuracy. See `glBitmap',
23432`glDrawPixels', and `glCopyPixels'.
23433
23434`glWindowPos2' specifies the X and Y coordinates, while Z is implicitly
23435set to 0. `glWindowPos3' specifies all three coordinates. The W
23436coordinate of the current raster position is always set to 1.0.
23437
23438`glWindowPos' directly updates the X and Y coordinates of the current
23439raster position with the values specified. That is, the values are
23440neither transformed by the current modelview and projection matrices,
23441nor by the viewport-to-window transform. The Z coordinate of the current
23442raster position is updated in the following manner:
23443
23444Z={(N), (F), (N+Z×(F-N,),)\u2062(IF\u2062Z<=0), (IF\u2062Z>=1), (`otherwise',),
23445
23446
23447
23448where N is `GL_DEPTH_RANGE''s near value, and F is `GL_DEPTH_RANGE''s
23449far value. See `glDepthRange'.
23450
23451The specified coordinates are not clip-tested, causing the raster
23452position to always be valid.
23453
8925f36f 23454The current raster position also includes some associated color data and
3c9b6116
AW
23455texture coordinates. If lighting is enabled, then
23456`GL_CURRENT_RASTER_COLOR' (in RGBA mode) or `GL_CURRENT_RASTER_INDEX'
8925f36f 23457(in color index mode) is set to the color produced by the lighting
3c9b6116
AW
23458calculation (see `glLight', `glLightModel', and `glShadeModel'). If
23459lighting is disabled, current color (in RGBA mode, state variable
23460`GL_CURRENT_COLOR') or color index (in color index mode, state variable
23461`GL_CURRENT_INDEX') is used to update the current raster color.
23462`GL_CURRENT_RASTER_SECONDARY_COLOR' (in RGBA mode) is likewise updated.
23463
23464Likewise, `GL_CURRENT_RASTER_TEXTURE_COORDS' is updated as a function of
23465`GL_CURRENT_TEXTURE_COORDS', based on the texture matrix and the texture
23466generation functions (see `glTexGen'). The `GL_CURRENT_RASTER_DISTANCE'
23467is set to the `GL_CURRENT_FOG_COORD'.
23468
23469
23470
23471`GL_INVALID_OPERATION' is generated if `glWindowPos' is executed between
23472the execution of `glBegin' and the corresponding execution of `glEnd'.")
8925f36f 23473