generate separate modules for gl, glu, glx; add info target
[clinton/guile-figl.git] / figl / low-level / gl.scm
1 ;;; figl -*- mode: scheme; coding: utf-8 -*-
2 ;;; Copyright (C) 2013 Andy Wingo <wingo@pobox.com>
3 ;;;
4 ;;; Figl is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Lesser General Public License as
6 ;;; published by the Free Software Foundation, either version 3 of the
7 ;;; License, or (at your option) any later version.
8 ;;;
9 ;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12 ;;; Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
17 ;;;
18 ;;; Derived from upstream OpenGL documentation.
19 ;;;
20 ;;; Copyright
21 ;;; =========
22 ;;;
23 ;;; Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed
24 ;;; under the SGI Free Software B License. For details, see
25 ;;; http://oss.sgi.com/projects/FreeB/ (http://oss.sgi.com/projects/FreeB/).
26 ;;;
27 ;;; Copyright
28 ;;; =========
29 ;;;
30 ;;; Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be
31 ;;; distributed subject to the terms and conditions set forth in the Open
32 ;;; Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
33 ;;; (http://opencontent.org/openpub/).
34 ;;;
35 ;;; Copyright
36 ;;; =========
37 ;;;
38 ;;; Copyright (C) 2005 Addison-Wesley. This material may be distributed
39 ;;; subject to the terms and conditions set forth in the Open Publication
40 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
41 ;;; (http://opencontent.org/openpub/).
42 ;;;
43 ;;; Copyright
44 ;;; =========
45 ;;;
46 ;;; Copyright (C) 2006 Khronos Group. This material may be distributed
47 ;;; subject to the terms and conditions set forth in the Open Publication
48 ;;; License, v 1.0, 8 June 1999. http://opencontent.org/openpub/
49 ;;; (http://opencontent.org/openpub/).
50 ;;;
51 ;;; Automatically generated; you probably don't want to edit this. To
52 ;;; update, run "make update" in the top-level build tree.
53 ;;;
54
55 (define-module
56 (figl low-level gl)
57 #:use-module
58 (figl low-level support)
59 #:export
60 (glAccum
61 glActiveTexture
62 glAlphaFunc
63 glAreTexturesResident
64 glArrayElement
65 glAttachShader
66 glBeginQuery
67 glBegin
68 glBindAttribLocation
69 glBindBuffer
70 glBindTexture
71 glBitmap
72 glBlendColor
73 glBlendEquationSeparate
74 glBlendEquation
75 glBlendFuncSeparate
76 glBlendFunc
77 glBufferData
78 glBufferSubData
79 glCallLists
80 glCallList
81 glClearAccum
82 glClearColor
83 glClearDepth
84 glClearIndex
85 glClearStencil
86 glClear
87 glClientActiveTexture
88 glClipPlane
89 glColorMask
90 glColorMaterial
91 glColorPointer
92 glColorSubTable
93 glColorTableParameter
94 glColorTable
95 glColor
96 glCompileShader
97 glCompressedTexImage1D
98 glCompressedTexImage2D
99 glCompressedTexImage3D
100 glCompressedTexSubImage1D
101 glCompressedTexSubImage2D
102 glCompressedTexSubImage3D
103 glConvolutionFilter1D
104 glConvolutionFilter2D
105 glConvolutionParameter
106 glCopyColorSubTable
107 glCopyColorTable
108 glCopyConvolutionFilter1D
109 glCopyConvolutionFilter2D
110 glCopyPixels
111 glCopyTexImage1D
112 glCopyTexImage2D
113 glCopyTexSubImage1D
114 glCopyTexSubImage2D
115 glCopyTexSubImage3D
116 glCreateProgram
117 glCreateShader
118 glCullFace
119 glDeleteBuffers
120 glDeleteLists
121 glDeleteProgram
122 glDeleteQueries
123 glDeleteShader
124 glDeleteTextures
125 glDepthFunc
126 glDepthMask
127 glDepthRange
128 glDetachShader
129 glDrawArrays
130 glDrawBuffers
131 glDrawBuffer
132 glDrawElements
133 glDrawPixels
134 glDrawRangeElements
135 glEdgeFlagPointer
136 glEdgeFlag
137 glEnableClientState
138 glEnableVertexAttribArray
139 glEnable
140 glEvalCoord
141 glEvalMesh
142 glEvalPoint
143 glFeedbackBuffer
144 glFinish
145 glFlush
146 glFogCoordPointer
147 glFogCoord
148 glFog
149 glFrontFace
150 glFrustum
151 glGenBuffers
152 glGenLists
153 glGenQueries
154 glGenTextures
155 glGetActiveAttrib
156 glGetActiveUniform
157 glGetAttachedShaders
158 glGetAttribLocation
159 glGetBufferParameteriv
160 glGetBufferPointerv
161 glGetBufferSubData
162 glGetClipPlane
163 glGetColorTableParameter
164 glGetColorTable
165 glGetCompressedTexImage
166 glGetConvolutionFilter
167 glGetConvolutionParameter
168 glGetError
169 glGetHistogramParameter
170 glGetHistogram
171 glGetLight
172 glGetMap
173 glGetMaterial
174 glGetMinmaxParameter
175 glGetMinmax
176 glGetPixelMap
177 glGetPointerv
178 glGetPolygonStipple
179 glGetProgramInfoLog
180 glGetProgramiv
181 glGetQueryiv
182 glGetQueryObject
183 glGetSeparableFilter
184 glGetShaderInfoLog
185 glGetShaderSource
186 glGetShaderiv
187 glGetString
188 glGetTexEnv
189 glGetTexGen
190 glGetTexImage
191 glGetTexLevelParameter
192 glGetTexParameter
193 glGetUniformLocation
194 glGetUniformfv
195 glGetVertexAttribPointerv
196 glGetVertexAttribdv
197 glGet
198 glHint
199 glHistogram
200 glIndexMask
201 glIndexPointer
202 glIndex
203 glInitNames
204 glInterleavedArrays
205 glIsBuffer
206 glIsEnabled
207 glIsList
208 glIsProgram
209 glIsQuery
210 glIsShader
211 glIsTexture
212 glLightModel
213 glLight
214 glLineStipple
215 glLineWidth
216 glLinkProgram
217 glListBase
218 glLoadIdentity
219 glLoadMatrix
220 glLoadName
221 glLoadTransposeMatrix
222 glLogicOp
223 glMap1
224 glMap2
225 glMapBuffer
226 glMapGrid
227 glMaterial
228 glMatrixMode
229 glMinmax
230 glMultiDrawArrays
231 glMultiDrawElements
232 glMultiTexCoord
233 glMultMatrix
234 glMultTransposeMatrix
235 glNewList
236 glNormalPointer
237 glNormal
238 glOrtho
239 glPassThrough
240 glPixelMap
241 glPixelStore
242 glPixelTransfer
243 glPixelZoom
244 glPointParameter
245 glPointSize
246 glPolygonMode
247 glPolygonOffset
248 glPolygonStipple
249 glPrioritizeTextures
250 glPushAttrib
251 glPushClientAttrib
252 glPushMatrix
253 glPushName
254 glRasterPos
255 glReadBuffer
256 glReadPixels
257 glRect
258 glRenderMode
259 glResetHistogram
260 glResetMinmax
261 glRotate
262 glSampleCoverage
263 glScale
264 glScissor
265 glSecondaryColorPointer
266 glSecondaryColor
267 glSelectBuffer
268 glSeparableFilter2D
269 glShadeModel
270 glShaderSource
271 glStencilFuncSeparate
272 glStencilFunc
273 glStencilMaskSeparate
274 glStencilMask
275 glStencilOpSeparate
276 glStencilOp
277 glTexCoordPointer
278 glTexCoord
279 glTexEnv
280 glTexGen
281 glTexImage1D
282 glTexImage2D
283 glTexImage3D
284 glTexParameter
285 glTexSubImage1D
286 glTexSubImage2D
287 glTexSubImage3D
288 glTranslate
289 glUniform1f
290 glUseProgram
291 glValidateProgram
292 glVertexAttribPointer
293 glVertexAttrib
294 glVertexPointer
295 glVertex
296 glViewport
297 glWindowPos))
298
299 (define-gl-procedure
300 glAccum
301 "glAccum"
302 (funcsynopsis
303 (funcprototype
304 (funcdef "void " (function "glAccum"))
305 (paramdef "GLenum " (parameter "op"))
306 (paramdef "GLfloat " (parameter "value"))))
307 '(*fragment*
308 (heading "operate on the accumulation buffer")
309 (heading "Parameters")
310 (table (% (formatter (asis)))
311 (entry (% (heading (var "op")))
312 (para "
313 Specifies the accumulation buffer operation.
314 Symbolic constants "
315 (code "GL_ACCUM")
316 ", "
317 (code "GL_LOAD")
318 ", "
319 (code "GL_ADD")
320 ", "
321 (code "GL_MULT")
322 ",
323 and "
324 (code "GL_RETURN")
325 " are accepted. "))
326 (entry (% (heading (var "value")))
327 (para "
328 Specifies a floating-point value used in the accumulation buffer operation. "
329 (var "op")
330 " determines how "
331 (var "value")
332 " is used. ")))
333 (heading "Description")
334 (para "
335 The accumulation buffer is an extended-range color buffer.
336 Images are not rendered into it.
337 Rather,
338 images rendered into one of the color buffers
339 are added to the contents of the accumulation buffer after rendering.
340 Effects such as antialiasing (of points, lines, and polygons),
341 motion blur,
342 and depth of field can be created
343 by accumulating images generated with different transformation matrices. ")
344 (para "
345 Each pixel in the accumulation buffer consists of
346 red, green, blue, and alpha values.
347 The number of bits per component in the accumulation buffer
348 depends on the implementation. You can examine this number
349 by calling "
350 (code "glGetIntegerv")
351 " four times,
352 with arguments "
353 (code "GL_ACCUM_RED_BITS")
354 ", "
355 (code "GL_ACCUM_GREEN_BITS")
356 ", "
357 (code "GL_ACCUM_BLUE_BITS")
358 ",
359 and "
360 (code "GL_ACCUM_ALPHA_BITS")
361 ".
362 Regardless of the number of bits per component,
363 the range of values stored by each component is "
364 (math "[" "-1" "," "1" "]")
365 ".
366 The accumulation buffer pixels are mapped one-to-one with frame buffer pixels. ")
367 (para (code "glAccum")
368 " operates on the accumulation buffer.
369 The first argument, "
370 (var "op")
371 ",
372 is a symbolic constant that selects an accumulation buffer operation.
373 The second argument, "
374 (var "value")
375 ",
376 is a floating-point value to be used in that operation.
377 Five operations are specified: "
378 (code "GL_ACCUM")
379 ", "
380 (code "GL_LOAD")
381 ", "
382 (code "GL_ADD")
383 ", "
384 (code "GL_MULT")
385 ", and "
386 (code "GL_RETURN")
387 ". ")
388 (para "
389 All accumulation buffer operations are limited
390 to the area of the current scissor box and applied identically to
391 the red, green, blue, and alpha components of each pixel.
392 If a "
393 (code "glAccum")
394 " operation results in a value outside the range "
395 (math "[" "-1" "," "1" "]")
396 ",
397 the contents of an accumulation buffer pixel component are undefined. ")
398 (para "
399 The operations are as follows: ")
400 (table (% (formatter (asis)))
401 (entry (% (heading (code "GL_ACCUM")))
402 (para "
403 Obtains R, G, B, and A values
404 from the buffer currently selected for reading (see "
405 (code "glReadBuffer")
406 ").
407 Each component value is divided by "
408 (math "2" "^" (var "n") "-" "1")
409 ",
410 where "
411 (math (var "n"))
412 "
413 is the number of bits allocated to each color component
414 in the currently selected buffer.
415 The result is a floating-point value in the range "
416 (math "[" "0" "," "1" "]")
417 ",
418 which is multiplied by "
419 (var "value")
420 " and added to the corresponding pixel component
421 in the accumulation buffer,
422 thereby updating the accumulation buffer. "))
423 (entry (% (heading (code "GL_LOAD")))
424 (para "
425 Similar to "
426 (code "GL_ACCUM")
427 ",
428 except that the current value in the accumulation buffer is not used
429 in the calculation of the new value.
430 That is, the R, G, B, and A values from the currently selected buffer
431 are divided by "
432 (math "2" "^" (var "n") "-" "1")
433 ",
434 multiplied by "
435 (var "value")
436 ",
437 and then stored in the corresponding accumulation buffer cell,
438 overwriting the current value. "))
439 (entry (% (heading (code "GL_ADD")))
440 (para "
441 Adds "
442 (var "value")
443 " to each R, G, B, and A
444 in the accumulation buffer. "))
445 (entry (% (heading (code "GL_MULT")))
446 (para "
447 Multiplies each R, G, B, and A
448 in the accumulation buffer by "
449 (var "value")
450 " and returns the scaled component
451 to its corresponding accumulation buffer location. "))
452 (entry (% (heading (code "GL_RETURN")))
453 (para "
454 Transfers accumulation buffer values
455 to the color buffer or buffers currently selected for writing.
456 Each R, G, B, and A component is multiplied by "
457 (var "value")
458 ",
459 then multiplied by "
460 (math "2" "^" (var "n") "-" "1")
461 ",
462 clamped to the range "
463 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
464 ",
465 and stored
466 in the corresponding display buffer cell.
467 The only fragment operations that are applied to this transfer are
468 pixel ownership,
469 scissor,
470 dithering,
471 and color writemasks. ")))
472 (para "
473 To clear the accumulation buffer, call "
474 (code "glClearAccum")
475 " with R, G, B,
476 and A values to set it to, then call "
477 (code "glClear")
478 " with the
479 accumulation buffer enabled. ")
480 (heading "Errors")
481 (para (code "GL_INVALID_ENUM")
482 " is generated if "
483 (var "op")
484 " is not an accepted value. ")
485 (para (code "GL_INVALID_OPERATION")
486 " is generated if there is no accumulation buffer. ")
487 (para (code "GL_INVALID_OPERATION")
488 " is generated if "
489 (code "glAccum")
490 "
491 is executed between the execution of "
492 (code "glBegin")
493 " and the corresponding execution of "
494 (code "glEnd")
495 ". ")))
496
497 (define-gl-procedure
498 glActiveTexture
499 "glActiveTexture"
500 (funcsynopsis
501 (funcprototype
502 (funcdef "void " (function "glActiveTexture"))
503 (paramdef "GLenum " (parameter "texture"))))
504 '(*fragment*
505 (heading "select active texture unit")
506 (heading "Parameters")
507 (table (% (formatter (asis)))
508 (entry (% (heading (var "texture")))
509 (para "
510 Specifies which texture unit to make active. The number
511 of texture units is implementation dependent, but must be at least
512 two. "
513 (var "texture")
514 " must be one of "
515 (code "GL_TEXTURE")
516 (math (var "i"))
517 ",
518 where
519 i ranges from 0 to the larger of ("
520 (code "GL_MAX_TEXTURE_COORDS")
521 " - 1)
522 and ("
523 (code "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS")
524 " - 1).
525 The initial value is "
526 (code "GL_TEXTURE0")
527 ". ")))
528 (heading "Description")
529 (para (code "glActiveTexture")
530 " selects which texture unit subsequent texture state calls will
531 affect. The number of texture units an implementation supports is
532 implementation dependent, but must be at least 2. ")
533 (para "
534 Vertex arrays are client-side GL resources, which are selected by the "
535 (code "glClientActiveTexture")
536 " routine. ")
537 (heading "Errors")
538 (para (code "GL_INVALID_ENUM")
539 " is generated if "
540 (var "texture")
541 " is not one of "
542 (code "GL_TEXTURE")
543 (math (var "i"))
544 ",
545 where i ranges from 0 to the larger of ("
546 (code "GL_MAX_TEXTURE_COORDS")
547 " - 1)
548 and ("
549 (code "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS")
550 " - 1). ")))
551
552 (define-gl-procedure
553 glAlphaFunc
554 "glAlphaFunc"
555 (funcsynopsis
556 (funcprototype
557 (funcdef "void " (function "glAlphaFunc"))
558 (paramdef "GLenum " (parameter "func"))
559 (paramdef "GLclampf " (parameter "ref"))))
560 '(*fragment*
561 (heading "specify the alpha test function")
562 (heading "Parameters")
563 (table (% (formatter (asis)))
564 (entry (% (heading (var "func")))
565 (para "
566 Specifies the alpha comparison function.
567 Symbolic constants "
568 (code "GL_NEVER")
569 ", "
570 (code "GL_LESS")
571 ", "
572 (code "GL_EQUAL")
573 ", "
574 (code "GL_LEQUAL")
575 ", "
576 (code "GL_GREATER")
577 ", "
578 (code "GL_NOTEQUAL")
579 ", "
580 (code "GL_GEQUAL")
581 ", and "
582 (code "GL_ALWAYS")
583 " are accepted. The initial value is "
584 (code "GL_ALWAYS")
585 ". "))
586 (entry (% (heading (var "ref")))
587 (para "
588 Specifies the reference value that incoming alpha values are compared to.
589 This value is clamped to the range "
590 (math "[" "0" "," "1" "]")
591 ",
592 where 0 represents the lowest possible alpha value
593 and 1 the highest possible value.
594 The initial reference value is 0. ")))
595 (heading "Description")
596 (para "
597 The alpha test discards fragments depending on the outcome of a comparison
598 between an incoming fragment's alpha value and a constant reference value. "
599 (code "glAlphaFunc")
600 " specifies the reference value and the comparison function.
601 The comparison is performed only if alpha testing is enabled. By
602 default, it is not enabled.
603 (See "
604 (code "glEnable")
605 " and "
606 (code "glDisable")
607 " of "
608 (code "GL_ALPHA_TEST")
609 ".) ")
610 (para (var "func")
611 " and "
612 (var "ref")
613 " specify the conditions under which
614 the pixel is drawn.
615 The incoming alpha value is compared to "
616 (var "ref")
617 "
618 using the function specified by "
619 (var "func")
620 ".
621 If the value passes the comparison,
622 the incoming fragment is drawn
623 if it also passes subsequent stencil and depth buffer tests.
624 If the value fails the comparison,
625 no change is made to the frame buffer at that pixel location. The
626 comparison functions are as follows: ")
627 (table (% (formatter (asis)))
628 (entry (% (heading (code "GL_NEVER")))
629 (para "
630 Never passes. "))
631 (entry (% (heading (code "GL_LESS")))
632 (para "
633 Passes if the incoming alpha value is less than the reference value. "))
634 (entry (% (heading (code "GL_EQUAL")))
635 (para "
636 Passes if the incoming alpha value is equal to the reference value. "))
637 (entry (% (heading (code "GL_LEQUAL")))
638 (para "
639 Passes if the incoming alpha value is less than or equal to the reference value. "))
640 (entry (% (heading (code "GL_GREATER")))
641 (para "
642 Passes if the incoming alpha value is greater than the reference value. "))
643 (entry (% (heading (code "GL_NOTEQUAL")))
644 (para "
645 Passes if the incoming alpha value is not equal to the reference value. "))
646 (entry (% (heading (code "GL_GEQUAL")))
647 (para "
648 Passes if the incoming alpha value is greater than or equal to
649 the reference value. "))
650 (entry (% (heading (code "GL_ALWAYS")))
651 (para "
652 Always passes (initial value). ")))
653 (para (code "glAlphaFunc")
654 " operates on all pixel write operations,
655 including those resulting from the scan conversion of points,
656 lines,
657 polygons,
658 and bitmaps,
659 and from pixel draw and copy operations. "
660 (code "glAlphaFunc")
661 " does not affect screen clear operations. ")
662 (heading "Errors")
663 (para (code "GL_INVALID_ENUM")
664 " is generated if "
665 (var "func")
666 " is not an accepted value. ")
667 (para (code "GL_INVALID_OPERATION")
668 " is generated if "
669 (code "glAlphaFunc")
670 "
671 is executed between the execution of "
672 (code "glBegin")
673 "
674 and the corresponding execution of "
675 (code "glEnd")
676 ". ")))
677
678 (define-gl-procedure
679 glAreTexturesResident
680 "glAreTexturesResident"
681 (funcsynopsis
682 (funcprototype
683 (funcdef
684 "GLboolean "
685 (function "glAreTexturesResident"))
686 (paramdef "GLsizei " (parameter "n"))
687 (paramdef
688 "const GLuint * "
689 (parameter "textures"))
690 (paramdef
691 "GLboolean * "
692 (parameter "residences"))))
693 '(*fragment*
694 (heading
695 "determine if textures are loaded in texture memory")
696 (heading "Parameters")
697 (table (% (formatter (asis)))
698 (entry (% (heading (var "n")))
699 (para "
700 Specifies the number of textures to be queried. "))
701 (entry (% (heading (var "textures")))
702 (para "
703 Specifies an array containing the names of the textures to be queried. "))
704 (entry (% (heading (var "residences")))
705 (para "
706 Specifies an array in which the texture residence status is returned.
707 The residence status of a texture named by an element of "
708 (var "textures")
709 " is
710 returned in the corresponding element of "
711 (var "residences")
712 ". ")))
713 (heading "Description")
714 (para "
715 GL establishes
716 a ``working set'' of textures that are resident in texture memory.
717 These textures can be bound to a texture target much more efficiently
718 than textures that are not resident. ")
719 (para (code "glAreTexturesResident")
720 " queries the texture residence status of the "
721 (var "n")
722 " textures named by
723 the elements of "
724 (var "textures")
725 ".
726 If all the named textures are resident, "
727 (code "glAreTexturesResident")
728 " returns "
729 (code "GL_TRUE")
730 ",
731 and the contents of "
732 (var "residences")
733 " are undisturbed.
734 If not all the named textures are resident, "
735 (code "glAreTexturesResident")
736 " returns "
737 (code "GL_FALSE")
738 ",
739 and detailed status is returned in the "
740 (var "n")
741 " elements of "
742 (var "residences")
743 ".
744 If an element of "
745 (var "residences")
746 " is "
747 (code "GL_TRUE")
748 ", then the texture named by
749 the corresponding element of "
750 (var "textures")
751 " is resident. ")
752 (para "
753 The residence status of a single bound texture may also be queried
754 by calling "
755 (code "glGetTexParameter")
756 " with the "
757 (var "target")
758 " argument set to the
759 target to which the texture is bound, and the "
760 (var "pname")
761 " argument
762 set to "
763 (code "GL_TEXTURE_RESIDENT")
764 ".
765 This is the only way that the residence status of a default texture can be
766 queried. ")
767 (heading "Errors")
768 (para (code "GL_INVALID_VALUE")
769 " is generated if "
770 (var "n")
771 " is negative. ")
772 (para (code "GL_INVALID_VALUE")
773 " is generated if any element in "
774 (var "textures")
775 "
776 is 0 or does not name a texture. In that case, the function returns "
777 (code "GL_FALSE")
778 " and the contents of "
779 (var "residences")
780 " is indeterminate. ")
781 (para (code "GL_INVALID_OPERATION")
782 " is generated if "
783 (code "glAreTexturesResident")
784 " is executed
785 between the execution of "
786 (code "glBegin")
787 " and the corresponding
788 execution of "
789 (code "glEnd")
790 ". ")))
791
792 (define-gl-procedure
793 glArrayElement
794 "glArrayElement"
795 (funcsynopsis
796 (funcprototype
797 (funcdef "void " (function "glArrayElement"))
798 (paramdef "GLint " (parameter "i"))))
799 '(*fragment*
800 (heading
801 "render a vertex using the specified vertex array element")
802 (heading "Parameters")
803 (table (% (formatter (asis)))
804 (entry (% (heading (var "i")))
805 (para "
806 Specifies an index into the enabled vertex data arrays. ")))
807 (heading "Description")
808 (para (code "glArrayElement")
809 " commands are used within "
810 (code "glBegin")
811 "/"
812 (code "glEnd")
813 " pairs to
814 specify vertex and attribute data for point, line, and polygon
815 primitives. If "
816 (code "GL_VERTEX_ARRAY")
817 " is enabled when "
818 (code "glArrayElement")
819 " is called, a
820 single vertex is drawn, using
821 vertex and attribute data taken from location "
822 (var "i")
823 " of the enabled
824 arrays. If "
825 (code "GL_VERTEX_ARRAY")
826 " is not enabled, no drawing occurs but
827 the attributes corresponding to the enabled arrays are modified. ")
828 (para "
829 Use "
830 (code "glArrayElement")
831 " to construct primitives by indexing vertex data, rather than
832 by streaming through arrays of data in first-to-last order. Because
833 each call specifies only a single vertex, it is possible to explicitly
834 specify per-primitive attributes such as a single normal for each
835 triangle. ")
836 (para "
837 Changes made to array data between the execution of "
838 (code "glBegin")
839 " and the
840 corresponding execution of "
841 (code "glEnd")
842 " may affect calls to "
843 (code "glArrayElement")
844 " that are made
845 within the same "
846 (code "glBegin")
847 "/"
848 (code "glEnd")
849 " period in nonsequential ways.
850 That is, a call to "
851 (code "glArrayElement")
852 " that precedes a change to array data may
853 access the changed data, and a call that follows a change to array data
854 may access original data. ")
855 (heading "Errors")
856 (para (code "GL_INVALID_VALUE")
857 " may be generated if "
858 (var "i")
859 " is negative. ")
860 (para (code "GL_INVALID_OPERATION")
861 " is generated if a non-zero buffer object name is bound to an
862 enabled array and the buffer object's data store is currently mapped. ")))
863
864 (define-gl-procedure
865 glAttachShader
866 "glAttachShader"
867 (funcsynopsis
868 (funcprototype
869 (funcdef "void " (function "glAttachShader"))
870 (paramdef "GLuint " (parameter "program"))
871 (paramdef "GLuint " (parameter "shader"))))
872 '(*fragment*
873 (heading
874 "Attaches a shader object to a program object")
875 (heading "Parameters")
876 (table (% (formatter (asis)))
877 (entry (% (heading (var "program")))
878 (para "Specifies the program object to which a shader
879 \t\t object will be attached."))
880 (entry (% (heading (var "shader")))
881 (para "Specifies the shader object that is to be attached.")))
882 (heading "Description")
883 (para "In order to create an executable, there must be a way to
884 \tspecify the list of things that will be linked together. Program
885 \tobjects provide this mechanism. Shaders that are to be linked
886 \ttogether in a program object must first be attached to that
887 \tprogram object. "
888 (code "glAttachShader")
889 " attaches the
890 \tshader object specified by "
891 (var "shader")
892 " to the
893 \tprogram object specified by "
894 (var "program")
895 ". This
896 \tindicates that "
897 (var "shader")
898 " will be included in
899 \tlink operations that will be performed on\t"
900 (var "program")
901 ".")
902 (para "All operations that can be performed on a shader object
903 \tare valid whether or not the shader object is attached to a
904 \tprogram object. It is permissible to attach a shader object to a
905 \tprogram object before source code has been loaded into the
906 \tshader object or before the shader object has been compiled. It
907 \tis permissible to attach multiple shader objects of the same
908 \ttype because each may contain a portion of the complete shader.
909 \tIt is also permissible to attach a shader object to more than
910 \tone program object. If a shader object is deleted while it is
911 \tattached to a program object, it will be flagged for deletion,
912 \tand deletion will not occur until\t"
913 (code "glDetachShader")
914 "
915 is called to detach it from all program objects to which it is
916 \tattached.")
917 (heading "Errors")
918 (para (code "GL_INVALID_VALUE")
919 " is generated if either\t"
920 (var "program")
921 " or "
922 (var "shader")
923 "
924 is not a value generated by OpenGL.")
925 (para (code "GL_INVALID_OPERATION")
926 " is generated if\t"
927 (var "program")
928 " is not a program object.")
929 (para (code "GL_INVALID_OPERATION")
930 " is generated if\t"
931 (var "shader")
932 " is not a shader object.")
933 (para (code "GL_INVALID_OPERATION")
934 " is generated if\t"
935 (var "shader")
936 " is already attached to\t"
937 (var "program")
938 ".")
939 (para (code "GL_INVALID_OPERATION")
940 " is generated if\t"
941 (code "glAttachShader")
942 " is executed between the
943 \texecution of\t"
944 (code "glBegin")
945 "
946 and the corresponding execution of\t"
947 (code "glEnd")
948 ".")))
949
950 (define-gl-procedure
951 glBeginQuery
952 "glBeginQuery"
953 (funcsynopsis
954 (funcprototype
955 (funcdef "void " (function "glBeginQuery"))
956 (paramdef "GLenum " (parameter "target"))
957 (paramdef "GLuint " (parameter "id"))))
958 '(*fragment*
959 (heading
960 "delimit the boundaries of a query object")
961 (heading "Parameters")
962 (table (% (formatter (asis)))
963 (entry (% (heading (var "target")))
964 (para "
965 Specifies the target type of query object established between "
966 (code "glBeginQuery")
967 " and the subsequent "
968 (code "glEndQuery")
969 ".
970 The symbolic constant must be "
971 (code "GL_SAMPLES_PASSED")
972 ". "))
973 (entry (% (heading (var "id")))
974 (para "
975 Specifies the name of a query object. ")))
976 (heading "Description")
977 (para (code "glBeginQuery")
978 " and "
979 (code "glEndQuery")
980 " delimit the
981 boundaries of a query object. If a query object with name "
982 (var "id")
983 " does not yet exist it is created. ")
984 (para "
985 When "
986 (code "glBeginQuery")
987 " is executed, the query object's samples-passed counter is reset to 0. Subsequent
988 rendering will increment the counter once for every sample that passes the depth test. When "
989 (code "glEndQuery")
990 "
991 is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by
992 calling "
993 (code "glGetQueryObject")
994 " with "
995 (var "pname")
996 (code "GL_QUERY_RESULT")
997 ". ")
998 (para "
999 Querying the "
1000 (code "GL_QUERY_RESULT")
1001 " implicitly flushes the GL pipeline until the rendering delimited by the
1002 query object has completed and the result is available. "
1003 (code "GL_QUERY_RESULT_AVAILABLE")
1004 " can be queried to
1005 determine if the result is immediately available or if the rendering is not yet complete. ")
1006 (heading "Errors")
1007 (para (code "GL_INVALID_ENUM")
1008 " is generated if "
1009 (var "target")
1010 " is not "
1011 (code "GL_SAMPLES_PASSED")
1012 ". ")
1013 (para (code "GL_INVALID_OPERATION")
1014 " is generated if "
1015 (code "glBeginQuery")
1016 " is executed while
1017 a query object of the same "
1018 (var "target")
1019 " is already active. ")
1020 (para (code "GL_INVALID_OPERATION")
1021 " is generated if "
1022 (code "glEndQuery")
1023 "
1024 is executed when a query object of the same "
1025 (var "target")
1026 " is not active. ")
1027 (para (code "GL_INVALID_OPERATION")
1028 " is generated if "
1029 (var "id")
1030 " is 0. ")
1031 (para (code "GL_INVALID_OPERATION")
1032 " is generated if "
1033 (var "id")
1034 " is the name of an already active query object. ")
1035 (para (code "GL_INVALID_OPERATION")
1036 " is generated if "
1037 (code "glBeginQuery")
1038 " or "
1039 (code "glEndQuery")
1040 " is executed between the execution of "
1041 (code "glBegin")
1042 " and the corresponding execution of "
1043 (code "glEnd")
1044 ". ")))
1045
1046 (define-gl-procedure
1047 glBegin
1048 "glBegin"
1049 (funcsynopsis
1050 (funcprototype
1051 (funcdef "void " (function "glBegin"))
1052 (paramdef "GLenum " (parameter "mode"))))
1053 '(*fragment*
1054 (heading
1055 "delimit the vertices of a primitive or a group of like primitives")
1056 (heading "Parameters")
1057 (table (% (formatter (asis)))
1058 (entry (% (heading (var "mode")))
1059 (para "
1060 Specifies the primitive or primitives that will be created from vertices
1061 presented between "
1062 (code "glBegin")
1063 " and the subsequent "
1064 (code "glEnd")
1065 ".
1066 Ten symbolic constants are accepted: "
1067 (code "GL_POINTS")
1068 ", "
1069 (code "GL_LINES")
1070 ", "
1071 (code "GL_LINE_STRIP")
1072 ", "
1073 (code "GL_LINE_LOOP")
1074 ", "
1075 (code "GL_TRIANGLES")
1076 ", "
1077 (code "GL_TRIANGLE_STRIP")
1078 ", "
1079 (code "GL_TRIANGLE_FAN")
1080 ", "
1081 (code "GL_QUADS")
1082 ", "
1083 (code "GL_QUAD_STRIP")
1084 ", and "
1085 (code "GL_POLYGON")
1086 ". ")))
1087 (heading "Description")
1088 (para (code "glBegin")
1089 " and "
1090 (code "glEnd")
1091 " delimit the vertices that define a primitive or
1092 a group of like primitives. "
1093 (code "glBegin")
1094 " accepts a single argument that specifies in which of ten ways the
1095 vertices are interpreted.
1096 Taking "
1097 (math (var "n"))
1098 "
1099 as an integer count starting at one,
1100 and "
1101 (math (var "N"))
1102 "
1103 as the total number of vertices specified,
1104 the interpretations are as follows: ")
1105 (table (% (formatter (asis)))
1106 (entry (% (heading (code "GL_POINTS")))
1107 (para "
1108 Treats each vertex as a single point.
1109 Vertex "
1110 (math (var "n"))
1111 "
1112 defines point "
1113 (math (var "n"))
1114 ". "
1115 (math (var "N"))
1116 "
1117 points are drawn. "))
1118 (entry (% (heading (code "GL_LINES")))
1119 (para "
1120 Treats each pair of vertices as an independent line segment.
1121 Vertices "
1122 (math "2" "\u2062" (var "n") "-" "1")
1123 "
1124 and "
1125 (math "2" "\u2062" (var "n"))
1126 "
1127 define line "
1128 (math (var "n"))
1129 ". "
1130 (math (var "N") "/" "2")
1131 "
1132 lines are drawn. "))
1133 (entry (% (heading (code "GL_LINE_STRIP")))
1134 (para "
1135 Draws a connected group of line segments from the first vertex
1136 to the last.
1137 Vertices "
1138 (math (var "n"))
1139 "
1140 and "
1141 (math (var "n") "+" "1")
1142 "
1143 define line "
1144 (math (var "n"))
1145 ". "
1146 (math (var "N") "-" "1")
1147 "
1148 lines are drawn. "))
1149 (entry (% (heading (code "GL_LINE_LOOP")))
1150 (para "
1151 Draws a connected group of line segments from the first vertex
1152 to the last,
1153 then back to the first.
1154 Vertices "
1155 (math (var "n"))
1156 "
1157 and "
1158 (math (var "n") "+" "1")
1159 "
1160 define line "
1161 (math (var "n"))
1162 ".
1163 The last line, however, is defined by vertices "
1164 (math (var "N"))
1165 "
1166 and "
1167 (math "1")
1168 ". "
1169 (math (var "N"))
1170 "
1171 lines are drawn. "))
1172 (entry (% (heading (code "GL_TRIANGLES")))
1173 (para "
1174 Treats each triplet of vertices as an independent triangle.
1175 Vertices "
1176 (math "3" "\u2062" (var "n") "-" "2")
1177 ", "
1178 (math "3" "\u2062" (var "n") "-" "1")
1179 ",
1180 and "
1181 (math "3" "\u2062" (var "n"))
1182 "
1183 define triangle "
1184 (math (var "n"))
1185 ". "
1186 (math (var "N") "/" "3")
1187 "
1188 triangles are drawn. "))
1189 (entry (% (heading (code "GL_TRIANGLE_STRIP")))
1190 (para "
1191 Draws a connected group of triangles. One triangle is defined for each
1192 vertex presented after the first two vertices. For odd "
1193 (math (var "n"))
1194 ",
1195 vertices "
1196 (math (var "n"))
1197 ", "
1198 (math (var "n") "+" "1")
1199 ",
1200 and "
1201 (math (var "n") "+" "2")
1202 "
1203 define triangle "
1204 (math (var "n"))
1205 ".
1206 For even "
1207 (math (var "n"))
1208 ",
1209 vertices "
1210 (math (var "n") "+" "1")
1211 ", "
1212 (math (var "n"))
1213 ",
1214 and "
1215 (math (var "n") "+" "2")
1216 "
1217 define triangle "
1218 (math (var "n"))
1219 ". "
1220 (math (var "N") "-" "2")
1221 "
1222 triangles are
1223 drawn. "))
1224 (entry (% (heading (code "GL_TRIANGLE_FAN")))
1225 (para "
1226 Draws a connected group of triangles.
1227 One triangle is defined for each vertex presented after the first two vertices.
1228 Vertices "
1229 (math "1")
1230 ", "
1231 (math (var "n") "+" "1")
1232 ",
1233 and "
1234 (math (var "n") "+" "2")
1235 "
1236 define triangle "
1237 (math (var "n"))
1238 ". "
1239 (math (var "N") "-" "2")
1240 "
1241 triangles are drawn. "))
1242 (entry (% (heading (code "GL_QUADS")))
1243 (para "
1244 Treats each group of four vertices as an independent quadrilateral.
1245 Vertices "
1246 (math "4" "\u2062" (var "n") "-" "3")
1247 ", "
1248 (math "4" "\u2062" (var "n") "-" "2")
1249 ", "
1250 (math "4" "\u2062" (var "n") "-" "1")
1251 ",
1252 and "
1253 (math "4" "\u2062" (var "n"))
1254 "
1255 define quadrilateral "
1256 (math (var "n"))
1257 ". "
1258 (math (var "N") "/" "4")
1259 "
1260 quadrilaterals are drawn. "))
1261 (entry (% (heading (code "GL_QUAD_STRIP")))
1262 (para "
1263 Draws a connected group of quadrilaterals.
1264 One quadrilateral is defined for each pair of vertices presented
1265 after the first pair.
1266 Vertices "
1267 (math "2" "\u2062" (var "n") "-" "1")
1268 ", "
1269 (math "2" "\u2062" (var "n"))
1270 ", "
1271 (math "2" "\u2062" (var "n") "+" "2")
1272 ",
1273 and "
1274 (math "2" "\u2062" (var "n") "+" "1")
1275 "
1276 define quadrilateral "
1277 (math (var "n"))
1278 ". "
1279 (math (var "N") "/" "2" "-" "1")
1280 "
1281 quadrilaterals are drawn.
1282 Note that the order in which vertices are used to construct a quadrilateral
1283 from strip data is different from that used with independent data. "))
1284 (entry (% (heading (code "GL_POLYGON")))
1285 (para "
1286 Draws a single,
1287 convex polygon.
1288 Vertices "
1289 (math "1")
1290 "
1291 through "
1292 (math (var "N"))
1293 "
1294 define this polygon. ")))
1295 (para "
1296 Only a subset of GL commands can be used between "
1297 (code "glBegin")
1298 " and "
1299 (code "glEnd")
1300 ".
1301 The commands are "
1302 (code "glVertex")
1303 ", "
1304 (code "glColor")
1305 ", "
1306 (code "glSecondaryColor")
1307 ", "
1308 (code "glIndex")
1309 ", "
1310 (code "glNormal")
1311 ", "
1312 (code "glFogCoord")
1313 ", "
1314 (code "glTexCoord")
1315 ", "
1316 (code "glMultiTexCoord")
1317 ", "
1318 (code "glVertexAttrib")
1319 ", "
1320 (code "glEvalCoord")
1321 ", "
1322 (code "glEvalPoint")
1323 ", "
1324 (code "glArrayElement")
1325 ", "
1326 (code "glMaterial")
1327 ", and "
1328 (code "glEdgeFlag")
1329 ".
1330 Also,
1331 it is acceptable to use "
1332 (code "glCallList")
1333 " or "
1334 (code "glCallLists")
1335 " to execute
1336 display lists that include only the preceding commands.
1337 If any other GL command is executed between "
1338 (code "glBegin")
1339 " and "
1340 (code "glEnd")
1341 ",
1342 the error flag is set and the command is ignored. ")
1343 (para "
1344 Regardless of the value chosen for "
1345 (var "mode")
1346 ",
1347 there is no limit to the number of vertices that can be defined
1348 between "
1349 (code "glBegin")
1350 " and "
1351 (code "glEnd")
1352 ".
1353 Lines,
1354 triangles,
1355 quadrilaterals,
1356 and polygons that are incompletely specified are not drawn.
1357 Incomplete specification results when either too few vertices are
1358 provided to specify even a single primitive or when an incorrect multiple
1359 of vertices is specified. The incomplete primitive is ignored; the rest are drawn. ")
1360 (para "
1361 The minimum specification of vertices
1362 for each primitive is as follows:
1363 1 for a point,
1364 2 for a line,
1365 3 for a triangle,
1366 4 for a quadrilateral,
1367 and 3 for a polygon.
1368 Modes that require a certain multiple of vertices are "
1369 (code "GL_LINES")
1370 " (2), "
1371 (code "GL_TRIANGLES")
1372 " (3), "
1373 (code "GL_QUADS")
1374 " (4),
1375 and "
1376 (code "GL_QUAD_STRIP")
1377 " (2). ")
1378 (heading "Errors")
1379 (para (code "GL_INVALID_ENUM")
1380 " is generated if "
1381 (var "mode")
1382 " is set to an unaccepted value. ")
1383 (para (code "GL_INVALID_OPERATION")
1384 " is generated if "
1385 (code "glBegin")
1386 " is executed between a "
1387 (code "glBegin")
1388 "
1389 and the corresponding execution of "
1390 (code "glEnd")
1391 ". ")
1392 (para (code "GL_INVALID_OPERATION")
1393 " is generated if "
1394 (code "glEnd")
1395 " is executed without being
1396 preceded by a "
1397 (code "glBegin")
1398 ". ")
1399 (para (code "GL_INVALID_OPERATION")
1400 " is generated if a command other than "
1401 (code "glVertex")
1402 ", "
1403 (code "glColor")
1404 ", "
1405 (code "glSecondaryColor")
1406 ", "
1407 (code "glIndex")
1408 ", "
1409 (code "glNormal")
1410 ", "
1411 (code "glFogCoord")
1412 ", "
1413 (code "glTexCoord")
1414 ", "
1415 (code "glMultiTexCoord")
1416 ", "
1417 (code "glVertexAttrib")
1418 ", "
1419 (code "glEvalCoord")
1420 ", "
1421 (code "glEvalPoint")
1422 ", "
1423 (code "glArrayElement")
1424 ", "
1425 (code "glMaterial")
1426 ", "
1427 (code "glEdgeFlag")
1428 ", "
1429 (code "glCallList")
1430 ", or "
1431 (code "glCallLists")
1432 " is executed between
1433 the execution of "
1434 (code "glBegin")
1435 " and the corresponding
1436 execution "
1437 (code "glEnd")
1438 ". ")
1439 (para "
1440 Execution of "
1441 (code "glEnableClientState")
1442 ", "
1443 (code "glDisableClientState")
1444 ", "
1445 (code "glEdgeFlagPointer")
1446 ", "
1447 (code "glFogCoordPointer")
1448 ", "
1449 (code "glTexCoordPointer")
1450 ", "
1451 (code "glColorPointer")
1452 ", "
1453 (code "glSecondaryColorPointer")
1454 ", "
1455 (code "glIndexPointer")
1456 ", "
1457 (code "glNormalPointer")
1458 ", "
1459 (code "glVertexPointer")
1460 ", "
1461 (code "glVertexAttribPointer")
1462 ", "
1463 (code "glInterleavedArrays")
1464 ", or "
1465 (code "glPixelStore")
1466 " is not allowed after a call to "
1467 (code "glBegin")
1468 " and before
1469 the corresponding call to "
1470 (code "glEnd")
1471 ",
1472 but an error may or may not be generated. ")))
1473
1474 (define-gl-procedure
1475 glBindAttribLocation
1476 "glBindAttribLocation"
1477 (funcsynopsis
1478 (funcprototype
1479 (funcdef
1480 "void "
1481 (function "glBindAttribLocation"))
1482 (paramdef "GLuint " (parameter "program"))
1483 (paramdef "GLuint " (parameter "index"))
1484 (paramdef "const GLchar *" (parameter "name"))))
1485 '(*fragment*
1486 (heading
1487 "Associates a generic vertex attribute index with a named attribute variable")
1488 (heading "Parameters")
1489 (table (% (formatter (asis)))
1490 (entry (% (heading (var "program")))
1491 (para "Specifies the handle of the program object in
1492 \t\t which the association is to be made."))
1493 (entry (% (heading (var "index")))
1494 (para "Specifies the index of the generic vertex
1495 \t\t attribute to be bound."))
1496 (entry (% (heading (var "name")))
1497 (para "Specifies a null terminated string containing
1498 \t\t the name of the vertex shader attribute variable to
1499 \t\t which "
1500 (var "index")
1501 " is to be
1502 \t\t bound.")))
1503 (heading "Description")
1504 (para (code "glBindAttribLocation")
1505 " is used to
1506 \tassociate a user-defined attribute variable in the program
1507 \tobject specified by "
1508 (var "program")
1509 " with a
1510 \tgeneric vertex attribute index. The name of the user-defined
1511 \tattribute variable is passed as a null terminated string in\t"
1512 (var "name")
1513 ". The generic vertex attribute index
1514 \tto be bound to this variable is specified by\t"
1515 (var "index")
1516 ". When\t"
1517 (var "program")
1518 " is made part of current state,
1519 \tvalues provided via the generic vertex attribute\t"
1520 (var "index")
1521 " will modify the value of the
1522 \tuser-defined attribute variable specified by\t"
1523 (var "name")
1524 ".")
1525 (para "If "
1526 (var "name")
1527 " refers to a matrix
1528 \tattribute variable, "
1529 (var "index")
1530 " refers to the
1531 \tfirst column of the matrix. Other matrix columns are then
1532 \tautomatically bound to locations "
1533 (var "index+1")
1534 "
1535 for a matrix of type mat2; "
1536 (var "index+1")
1537 " and\t"
1538 (var "index+2")
1539 " for a matrix of type mat3; and\t"
1540 (var "index+1")
1541 ", "
1542 (var "index+2")
1543 ",
1544 \tand "
1545 (var "index+3")
1546 " for a matrix of type
1547 \tmat4.")
1548 (para "This command makes it possible for vertex shaders to use
1549 \tdescriptive names for attribute variables rather than generic
1550 \tvariables that are numbered from 0 to\t"
1551 (code "GL_MAX_VERTEX_ATTRIBS")
1552 " -1. The values sent
1553 \tto each generic attribute index are part of current state, just
1554 \tlike standard vertex attributes such as color, normal, and
1555 \tvertex position. If a different program object is made current
1556 \tby calling\t"
1557 (code "glUseProgram")
1558 ",
1559 \tthe generic vertex attributes are tracked in such a way that the
1560 \tsame values will be observed by attributes in the new program
1561 \tobject that are also bound to\t"
1562 (var "index")
1563 ".")
1564 (para "Attribute variable
1565 \tname-to-generic attribute index bindings for a program object
1566 \tcan be explicitly assigned at any time by calling\t"
1567 (code "glBindAttribLocation")
1568 ". Attribute bindings do
1569 \tnot go into effect until\t"
1570 (code "glLinkProgram")
1571 "
1572 is called. After a program object has been linked successfully,
1573 \tthe index values for generic attributes remain fixed (and their
1574 \tvalues can be queried) until the next link command
1575 \toccurs.")
1576 (para "Applications are not allowed to bind any of the standard
1577 \tOpenGL vertex attributes using this command, as they are bound
1578 \tautomatically when needed. Any attribute binding that occurs
1579 \tafter the program object has been linked will not take effect
1580 \tuntil the next time the program object is linked.")
1581 (heading "Errors")
1582 (para (code "GL_INVALID_VALUE")
1583 " is generated if\t"
1584 (var "index")
1585 " is greater than or equal to\t"
1586 (code "GL_MAX_VERTEX_ATTRIBS")
1587 ".")
1588 (para (code "GL_INVALID_OPERATION")
1589 " is generated if\t"
1590 (var "name")
1591 " starts with the reserved prefix
1592 \t\"gl_\".")
1593 (para (code "GL_INVALID_VALUE")
1594 " is generated if\t"
1595 (var "program")
1596 " is not a value generated by
1597 \tOpenGL.")
1598 (para (code "GL_INVALID_OPERATION")
1599 " is generated if\t"
1600 (var "program")
1601 " is not a program object.")
1602 (para (code "GL_INVALID_OPERATION")
1603 " is generated if\t"
1604 (code "glBindAttribLocation")
1605 " is executed between
1606 \tthe execution of\t"
1607 (code "glBegin")
1608 "
1609 and the corresponding execution of\t"
1610 (code "glEnd")
1611 ".")))
1612
1613 (define-gl-procedure
1614 glBindBuffer
1615 "glBindBuffer"
1616 (funcsynopsis
1617 (funcprototype
1618 (funcdef "void " (function "glBindBuffer"))
1619 (paramdef "GLenum " (parameter "target"))
1620 (paramdef "GLuint " (parameter "buffer"))))
1621 '(*fragment*
1622 (heading "bind a named buffer object")
1623 (heading "Parameters")
1624 (table (% (formatter (asis)))
1625 (entry (% (heading (var "target")))
1626 (para "
1627 Specifies the target to which the buffer object is bound.
1628 The symbolic constant must be "
1629 (code "GL_ARRAY_BUFFER")
1630 ", "
1631 (code "GL_ELEMENT_ARRAY_BUFFER")
1632 ", "
1633 (code "GL_PIXEL_PACK_BUFFER")
1634 ", or "
1635 (code "GL_PIXEL_UNPACK_BUFFER")
1636 ". "))
1637 (entry (% (heading (var "buffer")))
1638 (para "
1639 Specifies the name of a buffer object. ")))
1640 (heading "Description")
1641 (para (code "glBindBuffer")
1642 " lets you create or use a named buffer object. Calling "
1643 (code "glBindBuffer")
1644 " with "
1645 (var "target")
1646 " set to "
1647 (code "GL_ARRAY_BUFFER")
1648 ", "
1649 (code "GL_ELEMENT_ARRAY_BUFFER")
1650 ", "
1651 (code "GL_PIXEL_PACK_BUFFER")
1652 " or "
1653 (code "GL_PIXEL_UNPACK_BUFFER")
1654 " and "
1655 (var "buffer")
1656 " set to the name
1657 of the new buffer object binds the buffer object name to the target.
1658 When a buffer object is bound to a target, the previous binding for that
1659 target is automatically broken. ")
1660 (para "
1661 Buffer object names are unsigned integers. The value zero is reserved, but
1662 there is no default buffer object for each buffer object target. Instead, "
1663 (var "buffer")
1664 " set to zero
1665 effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target.
1666 Buffer object names and the corresponding buffer object contents are local to
1667 the shared display-list space (see "
1668 (code "glXCreateContext")
1669 ") of the current
1670 GL rendering context;
1671 two rendering contexts share buffer object names only if they
1672 also share display lists. ")
1673 (para "
1674 You may use "
1675 (code "glGenBuffers")
1676 " to generate a set of new buffer object names. ")
1677 (para "
1678 The state of a buffer object immediately after it is first bound is an unmapped zero-sized memory buffer with "
1679 (code "GL_READ_WRITE")
1680 " access and "
1681 (code "GL_STATIC_DRAW")
1682 " usage. ")
1683 (para "
1684 While a non-zero buffer object name is bound, GL operations on the target to which it is
1685 bound affect the bound buffer object, and queries of the target to which it is bound return state
1686 from the bound buffer object. While buffer object name zero is bound, as in the initial state,
1687 attempts to modify or query state on the target to which it is bound generates an "
1688 (code "GL_INVALID_OPERATION")
1689 " error. ")
1690 (para "
1691 When vertex array pointer state is changed, for example by a call to "
1692 (code "glNormalPointer")
1693 ",
1694 the current buffer object binding ("
1695 (code "GL_ARRAY_BUFFER_BINDING")
1696 ") is copied into the
1697 corresponding client state for the vertex array type being changed, for example "
1698 (code "GL_NORMAL_ARRAY_BUFFER_BINDING")
1699 ". While a non-zero buffer object is bound to the "
1700 (code "GL_ARRAY_BUFFER")
1701 " target, the vertex array pointer parameter that is traditionally
1702 interpreted as a pointer to client-side memory is instead interpreted as an offset within the
1703 buffer object measured in basic machine units. ")
1704 (para "
1705 While a non-zero buffer object is bound to the "
1706 (code "GL_ELEMENT_ARRAY_BUFFER")
1707 " target,
1708 the indices parameter of "
1709 (code "glDrawElements")
1710 ", "
1711 (code "glDrawRangeElements")
1712 ", or "
1713 (code "glMultiDrawElements")
1714 " that is traditionally
1715 interpreted as a pointer to client-side memory is instead interpreted as an offset within the
1716 buffer object measured in basic machine units. ")
1717 (para "
1718 While a non-zero buffer object is bound to the "
1719 (code "GL_PIXEL_PACK_BUFFER")
1720 " target,
1721 the following commands are affected: "
1722 (code "glGetCompressedTexImage")
1723 ", "
1724 (code "glGetConvolutionFilter")
1725 ", "
1726 (code "glGetHistogram")
1727 ", "
1728 (code "glGetMinmax")
1729 ", "
1730 (code "glGetPixelMap")
1731 ", "
1732 (code "glGetPolygonStipple")
1733 ", "
1734 (code "glGetSeparableFilter")
1735 ", "
1736 (code "glGetTexImage")
1737 ", and "
1738 (code "glReadPixels")
1739 ". The pointer parameter that is
1740 traditionally interpreted as a pointer to client-side memory where the pixels are to be packed is instead
1741 interpreted as an offset within the buffer object measured in basic machine units. ")
1742 (para "
1743 While a non-zero buffer object is bound to the "
1744 (code "GL_PIXEL_UNPACK_BUFFER")
1745 " target,
1746 the following commands are affected: "
1747 (code "glBitmap")
1748 ", "
1749 (code "glColorSubTable")
1750 ", "
1751 (code "glColorTable")
1752 ", "
1753 (code "glCompressedTexImage1D")
1754 ", "
1755 (code "glCompressedTexImage2D")
1756 ", "
1757 (code "glCompressedTexImage3D")
1758 ", "
1759 (code "glCompressedTexSubImage1D")
1760 ", "
1761 (code "glCompressedTexSubImage2D")
1762 ", "
1763 (code "glCompressedTexSubImage3D")
1764 ", "
1765 (code "glConvolutionFilter1D")
1766 ", "
1767 (code "glConvolutionFilter2D")
1768 ", "
1769 (code "glDrawPixels")
1770 ", "
1771 (code "glPixelMap")
1772 ", "
1773 (code "glPolygonStipple")
1774 ", "
1775 (code "glSeparableFilter2D")
1776 ", "
1777 (code "glTexImage1D")
1778 ", "
1779 (code "glTexImage2D")
1780 ", "
1781 (code "glTexImage3D")
1782 ", "
1783 (code "glTexSubImage1D")
1784 ", "
1785 (code "glTexSubImage2D")
1786 ", and "
1787 (code "glTexSubImage3D")
1788 ". The pointer parameter that is
1789 traditionally interpreted as a pointer to client-side memory from which the pixels are to be unpacked is
1790 instead interpreted as an offset within the buffer object measured in basic machine units. ")
1791 (para "
1792 A buffer object binding created with "
1793 (code "glBindBuffer")
1794 " remains active until a different
1795 buffer object name is bound to the same target, or until the bound buffer object is
1796 deleted with "
1797 (code "glDeleteBuffers")
1798 ". ")
1799 (para "
1800 Once created, a named buffer object may be re-bound to any target as often as needed. However,
1801 the GL implementation may make choices about how to optimize the storage of a buffer object based
1802 on its initial binding target. ")
1803 (heading "Errors")
1804 (para (code "GL_INVALID_ENUM")
1805 " is generated if "
1806 (var "target")
1807 " is not one of the allowable
1808 values. ")
1809 (para (code "GL_INVALID_OPERATION")
1810 " is generated if "
1811 (code "glBindBuffer")
1812 " is executed
1813 between the execution of "
1814 (code "glBegin")
1815 " and the corresponding
1816 execution of "
1817 (code "glEnd")
1818 ". ")))
1819
1820 (define-gl-procedure
1821 glBindTexture
1822 "glBindTexture"
1823 (funcsynopsis
1824 (funcprototype
1825 (funcdef "void " (function "glBindTexture"))
1826 (paramdef "GLenum " (parameter "target"))
1827 (paramdef "GLuint " (parameter "texture"))))
1828 '(*fragment*
1829 (heading
1830 "bind a named texture to a texturing target")
1831 (heading "Parameters")
1832 (table (% (formatter (asis)))
1833 (entry (% (heading (var "target")))
1834 (para "
1835 Specifies the target to which the texture is bound.
1836 Must be either "
1837 (code "GL_TEXTURE_1D")
1838 ", "
1839 (code "GL_TEXTURE_2D")
1840 ", "
1841 (code "GL_TEXTURE_3D")
1842 ", or "
1843 (code "GL_TEXTURE_CUBE_MAP")
1844 ". "))
1845 (entry (% (heading (var "texture")))
1846 (para "
1847 Specifies the name of a texture. ")))
1848 (heading "Description")
1849 (para (code "glBindTexture")
1850 " lets you create or use a named texture. Calling "
1851 (code "glBindTexture")
1852 " with "
1853 (var "target")
1854 " set to "
1855 (code "GL_TEXTURE_1D")
1856 ", "
1857 (code "GL_TEXTURE_2D")
1858 ", "
1859 (code "GL_TEXTURE_3D")
1860 " or "
1861 (code "GL_TEXTURE_CUBE_MAP")
1862 " and "
1863 (var "texture")
1864 " set to the name
1865 of the new texture binds the texture name to the target.
1866 When a texture is bound to a target, the previous binding for that
1867 target is automatically broken. ")
1868 (para "
1869 Texture names are unsigned integers. The value zero is reserved to
1870 represent the default texture for each texture target.
1871 Texture names and the corresponding texture contents are local to
1872 the shared display-list space (see "
1873 (code "glXCreateContext")
1874 ") of the current
1875 GL rendering context;
1876 two rendering contexts share texture names only if they
1877 also share display lists. ")
1878 (para "
1879 You may use "
1880 (code "glGenTextures")
1881 " to generate a set of new texture names. ")
1882 (para "
1883 When a texture is first bound, it assumes the specified target:
1884 A texture first bound to "
1885 (code "GL_TEXTURE_1D")
1886 " becomes one-dimensional texture, a
1887 texture first bound to "
1888 (code "GL_TEXTURE_2D")
1889 " becomes two-dimensional texture, a
1890 texture first bound to "
1891 (code "GL_TEXTURE_3D")
1892 " becomes three-dimensional texture, and a
1893 texture first bound to "
1894 (code "GL_TEXTURE_CUBE_MAP")
1895 "
1896 becomes a cube-mapped texture. The state of a one-dimensional texture
1897 immediately after it is first bound is equivalent to the state of the
1898 default "
1899 (code "GL_TEXTURE_1D")
1900 " at GL initialization, and similarly for two-
1901 and three-dimensional textures and cube-mapped textures. ")
1902 (para "
1903 While a texture is bound, GL operations on the target to which it is
1904 bound affect the bound texture, and queries of the target to which it
1905 is bound return state from the bound texture. If texture mapping is active
1906 on the target to which a texture is bound, the bound texture is used.
1907 In effect, the texture targets become aliases for the textures currently
1908 bound to them, and the texture name zero refers to the default textures
1909 that were bound to them at initialization. ")
1910 (para "
1911 A texture binding created with "
1912 (code "glBindTexture")
1913 " remains active until a different
1914 texture is bound to the same target, or until the bound texture is
1915 deleted with "
1916 (code "glDeleteTextures")
1917 ". ")
1918 (para "
1919 Once created, a named texture may be re-bound to its same original target as often as needed.
1920 It is usually much faster to use "
1921 (code "glBindTexture")
1922 " to bind an existing named
1923 texture to one of the texture targets than it is to reload the texture image
1924 using "
1925 (code "glTexImage1D")
1926 ", "
1927 (code "glTexImage2D")
1928 ", or "
1929 (code "glTexImage3D")
1930 ".
1931 For additional control over performance, use "
1932 (code "glPrioritizeTextures")
1933 ". ")
1934 (para (code "glBindTexture")
1935 " is included in display lists. ")
1936 (heading "Errors")
1937 (para (code "GL_INVALID_ENUM")
1938 " is generated if "
1939 (var "target")
1940 " is not one of the allowable
1941 values. ")
1942 (para (code "GL_INVALID_OPERATION")
1943 " is generated if "
1944 (var "texture")
1945 " was previously created with a target
1946 that doesn't match that of "
1947 (var "target")
1948 ". ")
1949 (para (code "GL_INVALID_OPERATION")
1950 " is generated if "
1951 (code "glBindTexture")
1952 " is executed
1953 between the execution of "
1954 (code "glBegin")
1955 " and the corresponding
1956 execution of "
1957 (code "glEnd")
1958 ". ")))
1959
1960 (define-gl-procedure
1961 glBitmap
1962 "glBitmap"
1963 (funcsynopsis
1964 (funcprototype
1965 (funcdef "void " (function "glBitmap"))
1966 (paramdef "GLsizei " (parameter "width"))
1967 (paramdef "GLsizei " (parameter "height"))
1968 (paramdef "GLfloat " (parameter "xorig"))
1969 (paramdef "GLfloat " (parameter "yorig"))
1970 (paramdef "GLfloat " (parameter "xmove"))
1971 (paramdef "GLfloat " (parameter "ymove"))
1972 (paramdef
1973 "const GLubyte * "
1974 (parameter "bitmap"))))
1975 '(*fragment*
1976 (heading "draw a bitmap")
1977 (heading "Parameters")
1978 (table (% (formatter (asis)))
1979 (entry (% (heading (var "width")))
1980 (itemx (var "height"))
1981 (para "
1982 Specify the pixel width and height of the bitmap image. "))
1983 (entry (% (heading (var "xorig")))
1984 (itemx (var "yorig"))
1985 (para "
1986 Specify the location of the origin in the bitmap image.
1987 The origin is measured from the lower left corner of the bitmap,
1988 with right and up being the positive axes. "))
1989 (entry (% (heading (var "xmove")))
1990 (itemx (var "ymove"))
1991 (para "
1992 Specify the "
1993 (var "x")
1994 " and "
1995 (var "y")
1996 " offsets to be added to the current raster position
1997 after the bitmap is drawn. "))
1998 (entry (% (heading (var "bitmap")))
1999 (para "
2000 Specifies the address of the bitmap image. ")))
2001 (heading "Description")
2002 (para "
2003 A bitmap is a binary image.
2004 When drawn,
2005 the bitmap is positioned relative to the current raster position,
2006 and frame buffer pixels corresponding to 1's in the bitmap are
2007 written using the current raster color or index.
2008 Frame buffer pixels corresponding to 0's in the bitmap are not modified. ")
2009 (para (code "glBitmap")
2010 " takes seven arguments.
2011 The first pair specifies the width and height of the bitmap image.
2012 The second pair specifies the location of the bitmap origin relative
2013 to the lower left corner of the bitmap image.
2014 The third pair of arguments specifies "
2015 (var "x")
2016 " and "
2017 (var "y")
2018 " offsets to be added
2019 to the current raster position after the bitmap has been drawn.
2020 The final argument is a pointer to the bitmap image itself. ")
2021 (para "
2022 If a non-zero named buffer object is bound to the "
2023 (code "GL_PIXEL_UNPACK_BUFFER")
2024 " target
2025 (see "
2026 (code "glBindBuffer")
2027 ") while a bitmap image is
2028 specified, "
2029 (var "bitmap")
2030 " is treated as a byte offset into the buffer object's data store. ")
2031 (para "
2032 The bitmap image is interpreted like image data for the "
2033 (code "glDrawPixels")
2034 "
2035 command,
2036 with "
2037 (var "width")
2038 " and "
2039 (var "height")
2040 " corresponding to the width and height arguments
2041 of that command,
2042 and with "
2043 (var "type")
2044 " set to "
2045 (code "GL_BITMAP")
2046 "
2047 and "
2048 (var "format")
2049 " set to "
2050 (code "GL_COLOR_INDEX")
2051 ".
2052 Modes specified using "
2053 (code "glPixelStore")
2054 " affect the
2055 interpretation of bitmap image data;
2056 modes specified using "
2057 (code "glPixelTransfer")
2058 " do not. ")
2059 (para "
2060 If the current raster position is invalid, "
2061 (code "glBitmap")
2062 " is ignored.
2063 Otherwise,
2064 the lower left corner of the bitmap image is positioned at the window coordinates ")
2065 (para (math (var "x")
2066 "_"
2067 (var "w")
2068 "="
2069 "⌊"
2070 (var "x")
2071 "_"
2072 (var "r")
2073 "-"
2074 (var "x")
2075 "_"
2076 (var "o")
2077 ","
2078 "⌋"))
2079 (para (math (var "y")
2080 "_"
2081 (var "w")
2082 "="
2083 "⌊"
2084 (var "y")
2085 "_"
2086 (var "r")
2087 "-"
2088 (var "y")
2089 "_"
2090 (var "o")
2091 ","
2092 "⌋"))
2093 (para "
2094 where "
2095 (math "("
2096 (var "x")
2097 "_"
2098 (var "r")
2099 ","
2100 (var "y")
2101 "_"
2102 (var "r")
2103 ")")
2104 "
2105 is the raster position
2106 and "
2107 (math "("
2108 (var "x")
2109 "_"
2110 (var "o")
2111 ","
2112 (var "y")
2113 "_"
2114 (var "o")
2115 ")")
2116 "
2117 is the bitmap origin.
2118 Fragments are then generated for each pixel corresponding to a 1 (one)
2119 in the bitmap image.
2120 These fragments are generated using the current raster "
2121 (var "z")
2122 " coordinate,
2123 color or color index, and current raster texture coordinates.
2124 They are then treated just as if they had been generated
2125 by a point, line, or polygon,
2126 including texture mapping,
2127 fogging,
2128 and all per-fragment operations such as alpha and depth testing. ")
2129 (para "
2130 After the bitmap has been drawn,
2131 the "
2132 (var "x")
2133 " and "
2134 (var "y")
2135 " coordinates of the current raster position are offset by "
2136 (var "xmove")
2137 " and "
2138 (var "ymove")
2139 ".
2140 No change is made to the "
2141 (var "z")
2142 " coordinate of the current raster position,
2143 or to the current raster color, texture coordinates, or index. ")
2144 (heading "Errors")
2145 (para (code "GL_INVALID_VALUE")
2146 " is generated if "
2147 (var "width")
2148 " or "
2149 (var "height")
2150 " is negative. ")
2151 (para (code "GL_INVALID_OPERATION")
2152 " is generated if a non-zero buffer object name is bound to the "
2153 (code "GL_PIXEL_UNPACK_BUFFER")
2154 " target and the buffer object's data store is currently mapped. ")
2155 (para (code "GL_INVALID_OPERATION")
2156 " is generated if a non-zero buffer object name is bound to the "
2157 (code "GL_PIXEL_UNPACK_BUFFER")
2158 " target and the data would be unpacked from the buffer
2159 object such that the memory reads required would exceed the data store size. ")
2160 (para (code "GL_INVALID_OPERATION")
2161 " is generated if "
2162 (code "glBitmap")
2163 "
2164 is executed between the execution of "
2165 (code "glBegin")
2166 " and the corresponding execution of "
2167 (code "glEnd")
2168 ". ")))
2169
2170 (define-gl-procedure
2171 glBlendColor
2172 "glBlendColor"
2173 (funcsynopsis
2174 (funcprototype
2175 (funcdef "void " (function "glBlendColor"))
2176 (paramdef "GLclampf " (parameter "red"))
2177 (paramdef "GLclampf " (parameter "green"))
2178 (paramdef "GLclampf " (parameter "blue"))
2179 (paramdef "GLclampf " (parameter "alpha"))))
2180 '(*fragment*
2181 (heading "set the blend color")
2182 (heading "Parameters")
2183 (table (% (formatter (asis)))
2184 (entry (% (heading (var "red")))
2185 (itemx (var "green"))
2186 (itemx (var "blue"))
2187 (itemx (var "alpha"))
2188 (para "
2189 specify the components of "
2190 (code "GL_BLEND_COLOR"))))
2191 (heading "Description")
2192 (para "
2193 The "
2194 (code "GL_BLEND_COLOR")
2195 " may be used to calculate the source and destination
2196 blending factors. The color components are clamped to the range "
2197 (math "[" "0" "," "1" "]")
2198 "
2199 before being stored. See "
2200 (code "glBlendFunc")
2201 " for a complete description of the
2202 blending operations.
2203 Initially the "
2204 (code "GL_BLEND_COLOR")
2205 " is set to (0, 0, 0, 0). ")
2206 (heading "Errors")
2207 (para (code "GL_INVALID_OPERATION")
2208 " is generated if "
2209 (code "glBlendColor")
2210 " is executed
2211 between the execution of "
2212 (code "glBegin")
2213 " and the corresponding
2214 execution of "
2215 (code "glEnd")
2216 ". ")
2217 (para)))
2218
2219 (define-gl-procedure
2220 glBlendEquationSeparate
2221 "glBlendEquationSeparate"
2222 (funcsynopsis
2223 (funcprototype
2224 (funcdef
2225 "void "
2226 (function "glBlendEquationSeparate"))
2227 (paramdef "GLenum " (parameter "modeRGB"))
2228 (paramdef "GLenum " (parameter "modeAlpha"))))
2229 '(*fragment*
2230 (heading
2231 "set the RGB blend equation and the alpha blend equation separately")
2232 (heading "Parameters")
2233 (table (% (formatter (asis)))
2234 (entry (% (heading (var "modeRGB")))
2235 (para "
2236 specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined.
2237 It must be "
2238 (code "GL_FUNC_ADD")
2239 ", "
2240 (code "GL_FUNC_SUBTRACT")
2241 ", "
2242 (code "GL_FUNC_REVERSE_SUBTRACT")
2243 ", "
2244 (code "GL_MIN")
2245 ", "
2246 (code "GL_MAX")
2247 ". "))
2248 (entry (% (heading (var "modeAlpha")))
2249 (para "
2250 specifies the alpha blend equation, how the alpha component of the source and destination colors are combined.
2251 It must be "
2252 (code "GL_FUNC_ADD")
2253 ", "
2254 (code "GL_FUNC_SUBTRACT")
2255 ", "
2256 (code "GL_FUNC_REVERSE_SUBTRACT")
2257 ", "
2258 (code "GL_MIN")
2259 ", "
2260 (code "GL_MAX")
2261 ". ")))
2262 (heading "Description")
2263 (para "
2264 The blend equations determines how a new pixel (the ''source'' color)
2265 is combined with a pixel already in the framebuffer (the ''destination''
2266 color). This function specifies one blend equation for the RGB-color
2267 components and one blend equation for the alpha component. ")
2268 (para "
2269 The blend equations use the source and destination blend factors
2270 specified by either "
2271 (code "glBlendFunc")
2272 " or "
2273 (code "glBlendFuncSeparate")
2274 ".
2275 See "
2276 (code "glBlendFunc")
2277 " or "
2278 (code "glBlendFuncSeparate")
2279 "
2280 for a description of the various blend factors. ")
2281 (para "
2282 In the equations that follow, source and destination
2283 color components are referred to as "
2284 (math "("
2285 (var "R")
2286 "_"
2287 (var "s")
2288 ","
2289 (var "G")
2290 "_"
2291 (var "s")
2292 (var "B")
2293 "_"
2294 (var "s")
2295 (var "A")
2296 "_"
2297 (var "s")
2298 ")")
2299 "
2300 and "
2301 (math "("
2302 (var "R")
2303 "_"
2304 (var "d")
2305 ","
2306 (var "G")
2307 "_"
2308 (var "d")
2309 (var "B")
2310 "_"
2311 (var "d")
2312 (var "A")
2313 "_"
2314 (var "d")
2315 ")")
2316 ",
2317 respectively.
2318 The result color is referred to as "
2319 (math "("
2320 (var "R")
2321 "_"
2322 (var "r")
2323 ","
2324 (var "G")
2325 "_"
2326 (var "r")
2327 (var "B")
2328 "_"
2329 (var "r")
2330 (var "A")
2331 "_"
2332 (var "r")
2333 ")")
2334 ".
2335 The source and destination blend factors are denoted "
2336 (math "("
2337 (var "s")
2338 "_"
2339 (var "R")
2340 ","
2341 (var "s")
2342 "_"
2343 (var "G")
2344 (var "s")
2345 "_"
2346 (var "B")
2347 (var "s")
2348 "_"
2349 (var "A")
2350 ")")
2351 "
2352 and "
2353 (math "("
2354 (var "d")
2355 "_"
2356 (var "R")
2357 ","
2358 (var "d")
2359 "_"
2360 (var "G")
2361 (var "d")
2362 "_"
2363 (var "B")
2364 (var "d")
2365 "_"
2366 (var "A")
2367 ")")
2368 ",
2369 respectively.
2370 For these equations all color components are understood to have values
2371 in the range "
2372 (math "[" "0" "," "1" "]")
2373 ". ")
2374 (table (% (formatter (asis)))
2375 (entry (% (heading (strong "Mode")))
2376 (para (strong "RGB Components")
2377 ", "
2378 (strong "Alpha Component")))
2379 (entry (% (heading (code "GL_FUNC_ADD")))
2380 (para (math (var "Rr")
2381 "="
2382 (var "R")
2383 "_"
2384 (var "s")
2385 "\u2062"
2386 (var "s")
2387 "_"
2388 (var "R")
2389 "+"
2390 (var "R")
2391 "_"
2392 (var "d")
2393 "\u2062"
2394 (var "d")
2395 "_"
2396 (var "R"))
2397 (math (var "Gr")
2398 "="
2399 (var "G")
2400 "_"
2401 (var "s")
2402 "\u2062"
2403 (var "s")
2404 "_"
2405 (var "G")
2406 "+"
2407 (var "G")
2408 "_"
2409 (var "d")
2410 "\u2062"
2411 (var "d")
2412 "_"
2413 (var "G"))
2414 (math (var "Br")
2415 "="
2416 (var "B")
2417 "_"
2418 (var "s")
2419 "\u2062"
2420 (var "s")
2421 "_"
2422 (var "B")
2423 "+"
2424 (var "B")
2425 "_"
2426 (var "d")
2427 "\u2062"
2428 (var "d")
2429 "_"
2430 (var "B"))
2431 ", "
2432 (math (var "Ar")
2433 "="
2434 (var "A")
2435 "_"
2436 (var "s")
2437 "\u2062"
2438 (var "s")
2439 "_"
2440 (var "A")
2441 "+"
2442 (var "A")
2443 "_"
2444 (var "d")
2445 "\u2062"
2446 (var "d")
2447 "_"
2448 (var "A"))))
2449 (entry (% (heading (code "GL_FUNC_SUBTRACT")))
2450 (para (math (var "Rr")
2451 "="
2452 (var "R")
2453 "_"
2454 (var "s")
2455 "\u2062"
2456 (var "s")
2457 "_"
2458 (var "R")
2459 "-"
2460 (var "R")
2461 "_"
2462 (var "d")
2463 "\u2062"
2464 (var "d")
2465 "_"
2466 (var "R"))
2467 (math (var "Gr")
2468 "="
2469 (var "G")
2470 "_"
2471 (var "s")
2472 "\u2062"
2473 (var "s")
2474 "_"
2475 (var "G")
2476 "-"
2477 (var "G")
2478 "_"
2479 (var "d")
2480 "\u2062"
2481 (var "d")
2482 "_"
2483 (var "G"))
2484 (math (var "Br")
2485 "="
2486 (var "B")
2487 "_"
2488 (var "s")
2489 "\u2062"
2490 (var "s")
2491 "_"
2492 (var "B")
2493 "-"
2494 (var "B")
2495 "_"
2496 (var "d")
2497 "\u2062"
2498 (var "d")
2499 "_"
2500 (var "B"))
2501 ", "
2502 (math (var "Ar")
2503 "="
2504 (var "A")
2505 "_"
2506 (var "s")
2507 "\u2062"
2508 (var "s")
2509 "_"
2510 (var "A")
2511 "-"
2512 (var "A")
2513 "_"
2514 (var "d")
2515 "\u2062"
2516 (var "d")
2517 "_"
2518 (var "A"))))
2519 (entry (% (heading (code "GL_FUNC_REVERSE_SUBTRACT")))
2520 (para (math (var "Rr")
2521 "="
2522 (var "R")
2523 "_"
2524 (var "d")
2525 "\u2062"
2526 (var "d")
2527 "_"
2528 (var "R")
2529 "-"
2530 (var "R")
2531 "_"
2532 (var "s")
2533 "\u2062"
2534 (var "s")
2535 "_"
2536 (var "R"))
2537 (math (var "Gr")
2538 "="
2539 (var "G")
2540 "_"
2541 (var "d")
2542 "\u2062"
2543 (var "d")
2544 "_"
2545 (var "G")
2546 "-"
2547 (var "G")
2548 "_"
2549 (var "s")
2550 "\u2062"
2551 (var "s")
2552 "_"
2553 (var "G"))
2554 (math (var "Br")
2555 "="
2556 (var "B")
2557 "_"
2558 (var "d")
2559 "\u2062"
2560 (var "d")
2561 "_"
2562 (var "B")
2563 "-"
2564 (var "B")
2565 "_"
2566 (var "s")
2567 "\u2062"
2568 (var "s")
2569 "_"
2570 (var "B"))
2571 ", "
2572 (math (var "Ar")
2573 "="
2574 (var "A")
2575 "_"
2576 (var "d")
2577 "\u2062"
2578 (var "d")
2579 "_"
2580 (var "A")
2581 "-"
2582 (var "A")
2583 "_"
2584 (var "s")
2585 "\u2062"
2586 (var "s")
2587 "_"
2588 (var "A"))))
2589 (entry (% (heading (code "GL_MIN")))
2590 (para (math (var "Rr")
2591 "="
2592 (var "min")
2593 "\u2061"
2594 "("
2595 (var "R")
2596 "_"
2597 (var "s")
2598 ","
2599 (var "R")
2600 "_"
2601 (var "d")
2602 ")")
2603 (math (var "Gr")
2604 "="
2605 (var "min")
2606 "\u2061"
2607 "("
2608 (var "G")
2609 "_"
2610 (var "s")
2611 ","
2612 (var "G")
2613 "_"
2614 (var "d")
2615 ")")
2616 (math (var "Br")
2617 "="
2618 (var "min")
2619 "\u2061"
2620 "("
2621 (var "B")
2622 "_"
2623 (var "s")
2624 ","
2625 (var "B")
2626 "_"
2627 (var "d")
2628 ")")
2629 ", "
2630 (math (var "Ar")
2631 "="
2632 (var "min")
2633 "\u2061"
2634 "("
2635 (var "A")
2636 "_"
2637 (var "s")
2638 ","
2639 (var "A")
2640 "_"
2641 (var "d")
2642 ")")))
2643 (entry (% (heading (code "GL_MAX")))
2644 (para (math (var "Rr")
2645 "="
2646 (var "max")
2647 "\u2061"
2648 "("
2649 (var "R")
2650 "_"
2651 (var "s")
2652 ","
2653 (var "R")
2654 "_"
2655 (var "d")
2656 ")")
2657 (math (var "Gr")
2658 "="
2659 (var "max")
2660 "\u2061"
2661 "("
2662 (var "G")
2663 "_"
2664 (var "s")
2665 ","
2666 (var "G")
2667 "_"
2668 (var "d")
2669 ")")
2670 (math (var "Br")
2671 "="
2672 (var "max")
2673 "\u2061"
2674 "("
2675 (var "B")
2676 "_"
2677 (var "s")
2678 ","
2679 (var "B")
2680 "_"
2681 (var "d")
2682 ")")
2683 ", "
2684 (math (var "Ar")
2685 "="
2686 (var "max")
2687 "\u2061"
2688 "("
2689 (var "A")
2690 "_"
2691 (var "s")
2692 ","
2693 (var "A")
2694 "_"
2695 (var "d")
2696 ")"))))
2697 (para "
2698 The results of these equations are clamped to the range "
2699 (math "[" "0" "," "1" "]")
2700 ". ")
2701 (para "
2702 The "
2703 (code "GL_MIN")
2704 " and "
2705 (code "GL_MAX")
2706 " equations are useful for applications
2707 that analyze image data (image thresholding against a constant color,
2708 for example).
2709 The "
2710 (code "GL_FUNC_ADD")
2711 " equation is useful
2712 for antialiasing and transparency, among other things. ")
2713 (para "
2714 Initially, both the RGB blend equation and the alpha blend equation are set to "
2715 (code "GL_FUNC_ADD")
2716 ". ")
2717 (para)
2718 (heading "Errors")
2719 (para (code "GL_INVALID_ENUM")
2720 " is generated if either "
2721 (var "modeRGB")
2722 " or "
2723 (var "modeAlpha")
2724 " is not one of "
2725 (code "GL_FUNC_ADD")
2726 ", "
2727 (code "GL_FUNC_SUBTRACT")
2728 ", "
2729 (code "GL_FUNC_REVERSE_SUBTRACT")
2730 ", "
2731 (code "GL_MAX")
2732 ", or "
2733 (code "GL_MIN")
2734 ". ")
2735 (para (code "GL_INVALID_OPERATION")
2736 " is generated if "
2737 (code "glBlendEquationSeparate")
2738 " is executed
2739 between the execution of "
2740 (code "glBegin")
2741 " and the corresponding
2742 execution of "
2743 (code "glEnd")
2744 ". ")))
2745
2746 (define-gl-procedure
2747 glBlendEquation
2748 "glBlendEquation"
2749 (funcsynopsis
2750 (funcprototype
2751 (funcdef "void " (function "glBlendEquation"))
2752 (paramdef "GLenum " (parameter "mode"))))
2753 '(*fragment*
2754 (heading
2755 "specify the equation used for both the RGB blend equation and the Alpha blend equation")
2756 (heading "Parameters")
2757 (table (% (formatter (asis)))
2758 (entry (% (heading (var "mode")))
2759 (para "
2760 specifies how source and destination colors are combined.
2761 It must be "
2762 (code "GL_FUNC_ADD")
2763 ", "
2764 (code "GL_FUNC_SUBTRACT")
2765 ", "
2766 (code "GL_FUNC_REVERSE_SUBTRACT")
2767 ", "
2768 (code "GL_MIN")
2769 ", "
2770 (code "GL_MAX")
2771 ". ")))
2772 (heading "Description")
2773 (para "
2774 The blend equations determine how a new pixel (the ''source'' color)
2775 is combined with a pixel already in the framebuffer (the ''destination''
2776 color). This function sets both the RGB blend equation and the alpha
2777 blend equation to a single equation. ")
2778 (para "
2779 These equations use the source and destination blend factors
2780 specified by either "
2781 (code "glBlendFunc")
2782 " or "
2783 (code "glBlendFuncSeparate")
2784 ".
2785 See "
2786 (code "glBlendFunc")
2787 " or "
2788 (code "glBlendFuncSeparate")
2789 "
2790 for a description of the various blend factors. ")
2791 (para "
2792 In the equations that follow, source and destination
2793 color components are referred to as "
2794 (math "("
2795 (var "R")
2796 "_"
2797 (var "s")
2798 ","
2799 (var "G")
2800 "_"
2801 (var "s")
2802 (var "B")
2803 "_"
2804 (var "s")
2805 (var "A")
2806 "_"
2807 (var "s")
2808 ")")
2809 "
2810 and "
2811 (math "("
2812 (var "R")
2813 "_"
2814 (var "d")
2815 ","
2816 (var "G")
2817 "_"
2818 (var "d")
2819 (var "B")
2820 "_"
2821 (var "d")
2822 (var "A")
2823 "_"
2824 (var "d")
2825 ")")
2826 ",
2827 respectively.
2828 The result color is referred to as "
2829 (math "("
2830 (var "R")
2831 "_"
2832 (var "r")
2833 ","
2834 (var "G")
2835 "_"
2836 (var "r")
2837 (var "B")
2838 "_"
2839 (var "r")
2840 (var "A")
2841 "_"
2842 (var "r")
2843 ")")
2844 ".
2845 The source and destination blend factors are denoted "
2846 (math "("
2847 (var "s")
2848 "_"
2849 (var "R")
2850 ","
2851 (var "s")
2852 "_"
2853 (var "G")
2854 (var "s")
2855 "_"
2856 (var "B")
2857 (var "s")
2858 "_"
2859 (var "A")
2860 ")")
2861 "
2862 and "
2863 (math "("
2864 (var "d")
2865 "_"
2866 (var "R")
2867 ","
2868 (var "d")
2869 "_"
2870 (var "G")
2871 (var "d")
2872 "_"
2873 (var "B")
2874 (var "d")
2875 "_"
2876 (var "A")
2877 ")")
2878 ",
2879 respectively.
2880 For these equations all color components are understood to have values
2881 in the range "
2882 (math "[" "0" "," "1" "]")
2883 ". ")
2884 (table (% (formatter (asis)))
2885 (entry (% (heading (strong "Mode")))
2886 (para (strong "RGB Components")
2887 ", "
2888 (strong "Alpha Component")))
2889 (entry (% (heading (code "GL_FUNC_ADD")))
2890 (para (math (var "Rr")
2891 "="
2892 (var "R")
2893 "_"
2894 (var "s")
2895 "\u2062"
2896 (var "s")
2897 "_"
2898 (var "R")
2899 "+"
2900 (var "R")
2901 "_"
2902 (var "d")
2903 "\u2062"
2904 (var "d")
2905 "_"
2906 (var "R"))
2907 (math (var "Gr")
2908 "="
2909 (var "G")
2910 "_"
2911 (var "s")
2912 "\u2062"
2913 (var "s")
2914 "_"
2915 (var "G")
2916 "+"
2917 (var "G")
2918 "_"
2919 (var "d")
2920 "\u2062"
2921 (var "d")
2922 "_"
2923 (var "G"))
2924 (math (var "Br")
2925 "="
2926 (var "B")
2927 "_"
2928 (var "s")
2929 "\u2062"
2930 (var "s")
2931 "_"
2932 (var "B")
2933 "+"
2934 (var "B")
2935 "_"
2936 (var "d")
2937 "\u2062"
2938 (var "d")
2939 "_"
2940 (var "B"))
2941 ", "
2942 (math (var "Ar")
2943 "="
2944 (var "A")
2945 "_"
2946 (var "s")
2947 "\u2062"
2948 (var "s")
2949 "_"
2950 (var "A")
2951 "+"
2952 (var "A")
2953 "_"
2954 (var "d")
2955 "\u2062"
2956 (var "d")
2957 "_"
2958 (var "A"))))
2959 (entry (% (heading (code "GL_FUNC_SUBTRACT")))
2960 (para (math (var "Rr")
2961 "="
2962 (var "R")
2963 "_"
2964 (var "s")
2965 "\u2062"
2966 (var "s")
2967 "_"
2968 (var "R")
2969 "-"
2970 (var "R")
2971 "_"
2972 (var "d")
2973 "\u2062"
2974 (var "d")
2975 "_"
2976 (var "R"))
2977 (math (var "Gr")
2978 "="
2979 (var "G")
2980 "_"
2981 (var "s")
2982 "\u2062"
2983 (var "s")
2984 "_"
2985 (var "G")
2986 "-"
2987 (var "G")
2988 "_"
2989 (var "d")
2990 "\u2062"
2991 (var "d")
2992 "_"
2993 (var "G"))
2994 (math (var "Br")
2995 "="
2996 (var "B")
2997 "_"
2998 (var "s")
2999 "\u2062"
3000 (var "s")
3001 "_"
3002 (var "B")
3003 "-"
3004 (var "B")
3005 "_"
3006 (var "d")
3007 "\u2062"
3008 (var "d")
3009 "_"
3010 (var "B"))
3011 ", "
3012 (math (var "Ar")
3013 "="
3014 (var "A")
3015 "_"
3016 (var "s")
3017 "\u2062"
3018 (var "s")
3019 "_"
3020 (var "A")
3021 "-"
3022 (var "A")
3023 "_"
3024 (var "d")
3025 "\u2062"
3026 (var "d")
3027 "_"
3028 (var "A"))))
3029 (entry (% (heading (code "GL_FUNC_REVERSE_SUBTRACT")))
3030 (para (math (var "Rr")
3031 "="
3032 (var "R")
3033 "_"
3034 (var "d")
3035 "\u2062"
3036 (var "d")
3037 "_"
3038 (var "R")
3039 "-"
3040 (var "R")
3041 "_"
3042 (var "s")
3043 "\u2062"
3044 (var "s")
3045 "_"
3046 (var "R"))
3047 (math (var "Gr")
3048 "="
3049 (var "G")
3050 "_"
3051 (var "d")
3052 "\u2062"
3053 (var "d")
3054 "_"
3055 (var "G")
3056 "-"
3057 (var "G")
3058 "_"
3059 (var "s")
3060 "\u2062"
3061 (var "s")
3062 "_"
3063 (var "G"))
3064 (math (var "Br")
3065 "="
3066 (var "B")
3067 "_"
3068 (var "d")
3069 "\u2062"
3070 (var "d")
3071 "_"
3072 (var "B")
3073 "-"
3074 (var "B")
3075 "_"
3076 (var "s")
3077 "\u2062"
3078 (var "s")
3079 "_"
3080 (var "B"))
3081 ", "
3082 (math (var "Ar")
3083 "="
3084 (var "A")
3085 "_"
3086 (var "d")
3087 "\u2062"
3088 (var "d")
3089 "_"
3090 (var "A")
3091 "-"
3092 (var "A")
3093 "_"
3094 (var "s")
3095 "\u2062"
3096 (var "s")
3097 "_"
3098 (var "A"))))
3099 (entry (% (heading (code "GL_MIN")))
3100 (para (math (var "Rr")
3101 "="
3102 (var "min")
3103 "\u2061"
3104 "("
3105 (var "R")
3106 "_"
3107 (var "s")
3108 ","
3109 (var "R")
3110 "_"
3111 (var "d")
3112 ")")
3113 (math (var "Gr")
3114 "="
3115 (var "min")
3116 "\u2061"
3117 "("
3118 (var "G")
3119 "_"
3120 (var "s")
3121 ","
3122 (var "G")
3123 "_"
3124 (var "d")
3125 ")")
3126 (math (var "Br")
3127 "="
3128 (var "min")
3129 "\u2061"
3130 "("
3131 (var "B")
3132 "_"
3133 (var "s")
3134 ","
3135 (var "B")
3136 "_"
3137 (var "d")
3138 ")")
3139 ", "
3140 (math (var "Ar")
3141 "="
3142 (var "min")
3143 "\u2061"
3144 "("
3145 (var "A")
3146 "_"
3147 (var "s")
3148 ","
3149 (var "A")
3150 "_"
3151 (var "d")
3152 ")")))
3153 (entry (% (heading (code "GL_MAX")))
3154 (para (math (var "Rr")
3155 "="
3156 (var "max")
3157 "\u2061"
3158 "("
3159 (var "R")
3160 "_"
3161 (var "s")
3162 ","
3163 (var "R")
3164 "_"
3165 (var "d")
3166 ")")
3167 (math (var "Gr")
3168 "="
3169 (var "max")
3170 "\u2061"
3171 "("
3172 (var "G")
3173 "_"
3174 (var "s")
3175 ","
3176 (var "G")
3177 "_"
3178 (var "d")
3179 ")")
3180 (math (var "Br")
3181 "="
3182 (var "max")
3183 "\u2061"
3184 "("
3185 (var "B")
3186 "_"
3187 (var "s")
3188 ","
3189 (var "B")
3190 "_"
3191 (var "d")
3192 ")")
3193 ", "
3194 (math (var "Ar")
3195 "="
3196 (var "max")
3197 "\u2061"
3198 "("
3199 (var "A")
3200 "_"
3201 (var "s")
3202 ","
3203 (var "A")
3204 "_"
3205 (var "d")
3206 ")"))))
3207 (para "
3208 The results of these equations are clamped to the range "
3209 (math "[" "0" "," "1" "]")
3210 ". ")
3211 (para "
3212 The "
3213 (code "GL_MIN")
3214 " and "
3215 (code "GL_MAX")
3216 " equations are useful for applications
3217 that analyze image data (image thresholding against a constant color,
3218 for example).
3219 The "
3220 (code "GL_FUNC_ADD")
3221 " equation is useful
3222 for antialiasing and transparency, among other things. ")
3223 (para "
3224 Initially, both the RGB blend equation and the alpha blend equation are set to "
3225 (code "GL_FUNC_ADD")
3226 ". ")
3227 (para)
3228 (heading "Errors")
3229 (para (code "GL_INVALID_ENUM")
3230 " is generated if "
3231 (var "mode")
3232 " is not one of "
3233 (code "GL_FUNC_ADD")
3234 ", "
3235 (code "GL_FUNC_SUBTRACT")
3236 ", "
3237 (code "GL_FUNC_REVERSE_SUBTRACT")
3238 ", "
3239 (code "GL_MAX")
3240 ", or "
3241 (code "GL_MIN")
3242 ". ")
3243 (para (code "GL_INVALID_OPERATION")
3244 " is generated if "
3245 (code "glBlendEquation")
3246 " is executed
3247 between the execution of "
3248 (code "glBegin")
3249 " and the corresponding
3250 execution of "
3251 (code "glEnd")
3252 ". ")))
3253
3254 (define-gl-procedure
3255 glBlendFuncSeparate
3256 "glBlendFuncSeparate"
3257 (funcsynopsis
3258 (funcprototype
3259 (funcdef
3260 "void "
3261 (function "glBlendFuncSeparate"))
3262 (paramdef "GLenum " (parameter "srcRGB"))
3263 (paramdef "GLenum " (parameter "dstRGB"))
3264 (paramdef "GLenum " (parameter "srcAlpha"))
3265 (paramdef "GLenum " (parameter "dstAlpha"))))
3266 '(*fragment*
3267 (heading
3268 "specify pixel arithmetic for RGB and alpha components separately")
3269 (heading "Parameters")
3270 (table (% (formatter (asis)))
3271 (entry (% (heading (var "srcRGB")))
3272 (para "
3273 Specifies how the red, green, and blue blending factors are computed.
3274 The following symbolic constants are accepted: "
3275 (code "GL_ZERO")
3276 ", "
3277 (code "GL_ONE")
3278 ", "
3279 (code "GL_SRC_COLOR")
3280 ", "
3281 (code "GL_ONE_MINUS_SRC_COLOR")
3282 ", "
3283 (code "GL_DST_COLOR")
3284 ", "
3285 (code "GL_ONE_MINUS_DST_COLOR")
3286 ", "
3287 (code "GL_SRC_ALPHA")
3288 ", "
3289 (code "GL_ONE_MINUS_SRC_ALPHA")
3290 ", "
3291 (code "GL_DST_ALPHA")
3292 ", "
3293 (code "GL_ONE_MINUS_DST_ALPHA")
3294 ", "
3295 (code "GL_CONSTANT_COLOR")
3296 ", "
3297 (code "GL_ONE_MINUS_CONSTANT_COLOR")
3298 ", "
3299 (code "GL_CONSTANT_ALPHA")
3300 ", "
3301 (code "GL_ONE_MINUS_CONSTANT_ALPHA")
3302 ", and "
3303 (code "GL_SRC_ALPHA_SATURATE")
3304 ".
3305 The initial value is "
3306 (code "GL_ONE")
3307 ". "))
3308 (entry (% (heading (var "dstRGB")))
3309 (para "
3310 Specifies how the red, green, and blue destination blending factors are
3311 computed. The following symbolic constants are accepted: "
3312 (code "GL_ZERO")
3313 ", "
3314 (code "GL_ONE")
3315 ", "
3316 (code "GL_SRC_COLOR")
3317 ", "
3318 (code "GL_ONE_MINUS_SRC_COLOR")
3319 ", "
3320 (code "GL_DST_COLOR")
3321 ", "
3322 (code "GL_ONE_MINUS_DST_COLOR")
3323 ", "
3324 (code "GL_SRC_ALPHA")
3325 ", "
3326 (code "GL_ONE_MINUS_SRC_ALPHA")
3327 ", "
3328 (code "GL_DST_ALPHA")
3329 ", "
3330 (code "GL_ONE_MINUS_DST_ALPHA")
3331 ". "
3332 (code "GL_CONSTANT_COLOR")
3333 ", "
3334 (code "GL_ONE_MINUS_CONSTANT_COLOR")
3335 ", "
3336 (code "GL_CONSTANT_ALPHA")
3337 ", and "
3338 (code "GL_ONE_MINUS_CONSTANT_ALPHA")
3339 ".
3340 The initial value is "
3341 (code "GL_ZERO")
3342 ". "))
3343 (entry (% (heading (var "srcAlpha")))
3344 (para "
3345 Specified how the alpha source blending factor is computed. The same
3346 symbolic constants are accepted as for "
3347 (var "srcRGB")
3348 ".
3349 The initial value is "
3350 (code "GL_ONE")
3351 ". "))
3352 (entry (% (heading (var "dstAlpha")))
3353 (para "
3354 Specified how the alpha destination blending factor is computed. The same
3355 symbolic constants are accepted as for "
3356 (var "dstRGB")
3357 ".
3358 The initial value is "
3359 (code "GL_ZERO")
3360 ". ")))
3361 (heading "Description")
3362 (para "
3363 In RGBA mode, pixels can be drawn using a function that blends
3364 the incoming (source) RGBA values with the RGBA values
3365 that are already in the frame buffer (the destination values).
3366 Blending is initially disabled.
3367 Use "
3368 (code "glEnable")
3369 " and "
3370 (code "glDisable")
3371 " with argument "
3372 (code "GL_BLEND")
3373 "
3374 to enable and disable blending. ")
3375 (para (code "glBlendFuncSeparate")
3376 " defines the operation of blending when it is enabled. "
3377 (var "srcRGB")
3378 " specifies which method is used to scale the
3379 source RGB-color components. "
3380 (var "dstRGB")
3381 " specifies which method is used to scale the
3382 destination RGB-color components.
3383 Likewise, "
3384 (var "srcAlpha")
3385 " specifies which method is used to scale the source alpha
3386 color component, and "
3387 (var "dstAlpha")
3388 " specifies which method is used to scale the
3389 destination alpha component.
3390 The possible methods are described in the following table.
3391 Each method defines four scale factors,
3392 one each for red, green, blue, and alpha. ")
3393 (para "
3394 In the table and in subsequent equations, source and destination
3395 color components are referred to as "
3396 (math "("
3397 (var "R")
3398 "_"
3399 (var "s")
3400 ","
3401 (var "G")
3402 "_"
3403 (var "s")
3404 (var "B")
3405 "_"
3406 (var "s")
3407 (var "A")
3408 "_"
3409 (var "s")
3410 ")")
3411 "
3412 and "
3413 (math "("
3414 (var "R")
3415 "_"
3416 (var "d")
3417 ","
3418 (var "G")
3419 "_"
3420 (var "d")
3421 (var "B")
3422 "_"
3423 (var "d")
3424 (var "A")
3425 "_"
3426 (var "d")
3427 ")")
3428 ".
3429 The color specified by "
3430 (code "glBlendColor")
3431 " is referred to as "
3432 (math "("
3433 (var "R")
3434 "_"
3435 (var "c")
3436 ","
3437 (var "G")
3438 "_"
3439 (var "c")
3440 (var "B")
3441 "_"
3442 (var "c")
3443 (var "A")
3444 "_"
3445 (var "c")
3446 ")")
3447 ".
3448 They are understood to have integer values between 0 and "
3449 (math "("
3450 (var "k")
3451 "_"
3452 (var "R")
3453 ","
3454 (var "k")
3455 "_"
3456 (var "G")
3457 (var "k")
3458 "_"
3459 (var "B")
3460 (var "k")
3461 "_"
3462 (var "A")
3463 ")")
3464 ",
3465 where ")
3466 (para (para (math (var "k")
3467 "_"
3468 (var "c")
3469 "="
3470 "2"
3471 "^"
3472 (var "m")
3473 "_"
3474 (var "c")
3475 ","
3476 "-"
3477 "1")))
3478 (para "
3479 and "
3480 (math "("
3481 (var "m")
3482 "_"
3483 (var "R")
3484 ","
3485 (var "m")
3486 "_"
3487 (var "G")
3488 (var "m")
3489 "_"
3490 (var "B")
3491 (var "m")
3492 "_"
3493 (var "A")
3494 ")")
3495 "
3496 is the number of red,
3497 green,
3498 blue,
3499 and alpha bitplanes. ")
3500 (para "
3501 Source and destination scale factors are referred to as "
3502 (math "("
3503 (var "s")
3504 "_"
3505 (var "R")
3506 ","
3507 (var "s")
3508 "_"
3509 (var "G")
3510 (var "s")
3511 "_"
3512 (var "B")
3513 (var "s")
3514 "_"
3515 (var "A")
3516 ")")
3517 "
3518 and "
3519 (math "("
3520 (var "d")
3521 "_"
3522 (var "R")
3523 ","
3524 (var "d")
3525 "_"
3526 (var "G")
3527 (var "d")
3528 "_"
3529 (var "B")
3530 (var "d")
3531 "_"
3532 (var "A")
3533 ")")
3534 ".
3535 All scale factors have range "
3536 (math "[" "0" "," "1" "]")
3537 ". ")
3538 (para)
3539 (table (% (formatter (asis)))
3540 (entry (% (heading (strong "Parameter")))
3541 (para (strong "RGB Factor")
3542 ", "
3543 (strong "Alpha Factor")))
3544 (entry (% (heading (code "GL_ZERO")))
3545 (para (math "(" "0" "," "0" "0" ")")
3546 ", "
3547 (math "0")))
3548 (entry (% (heading (code "GL_ONE")))
3549 (para (math "(" "1" "," "1" "1" ")")
3550 ", "
3551 (math "1")))
3552 (entry (% (heading (code "GL_SRC_COLOR")))
3553 (para (math "("
3554 (var "R")
3555 "_"
3556 (var "s")
3557 "/"
3558 (var "k")
3559 "_"
3560 (var "R")
3561 ","
3562 (var "G")
3563 "_"
3564 (var "s")
3565 "/"
3566 (var "k")
3567 "_"
3568 (var "G")
3569 (var "B")
3570 "_"
3571 (var "s")
3572 "/"
3573 (var "k")
3574 "_"
3575 (var "B")
3576 ")")
3577 ", "
3578 (math (var "A")
3579 "_"
3580 (var "s")
3581 "/"
3582 (var "k")
3583 "_"
3584 (var "A"))))
3585 (entry (% (heading (code "GL_ONE_MINUS_SRC_COLOR")))
3586 (para (math "("
3587 "1"
3588 ","
3589 "1"
3590 "1"
3591 "1"
3592 ")"
3593 "-"
3594 "("
3595 (var "R")
3596 "_"
3597 (var "s")
3598 "/"
3599 (var "k")
3600 "_"
3601 (var "R")
3602 ","
3603 (var "G")
3604 "_"
3605 (var "s")
3606 "/"
3607 (var "k")
3608 "_"
3609 (var "G")
3610 (var "B")
3611 "_"
3612 (var "s")
3613 "/"
3614 (var "k")
3615 "_"
3616 (var "B")
3617 ")")
3618 ", "
3619 (math "1"
3620 "-"
3621 (var "A")
3622 "_"
3623 (var "s")
3624 "/"
3625 (var "k")
3626 "_"
3627 (var "A"))))
3628 (entry (% (heading (code "GL_DST_COLOR")))
3629 (para (math "("
3630 (var "R")
3631 "_"
3632 (var "d")
3633 "/"
3634 (var "k")
3635 "_"
3636 (var "R")
3637 ","
3638 (var "G")
3639 "_"
3640 (var "d")
3641 "/"
3642 (var "k")
3643 "_"
3644 (var "G")
3645 (var "B")
3646 "_"
3647 (var "d")
3648 "/"
3649 (var "k")
3650 "_"
3651 (var "B")
3652 ")")
3653 ", "
3654 (math (var "A")
3655 "_"
3656 (var "d")
3657 "/"
3658 (var "k")
3659 "_"
3660 (var "A"))))
3661 (entry (% (heading (code "GL_ONE_MINUS_DST_COLOR")))
3662 (para (math "("
3663 "1"
3664 ","
3665 "1"
3666 "1"
3667 ")"
3668 "-"
3669 "("
3670 (var "R")
3671 "_"
3672 (var "d")
3673 "/"
3674 (var "k")
3675 "_"
3676 (var "R")
3677 ","
3678 (var "G")
3679 "_"
3680 (var "d")
3681 "/"
3682 (var "k")
3683 "_"
3684 (var "G")
3685 (var "B")
3686 "_"
3687 (var "d")
3688 "/"
3689 (var "k")
3690 "_"
3691 (var "B")
3692 ")")
3693 ", "
3694 (math "1"
3695 "-"
3696 (var "A")
3697 "_"
3698 (var "d")
3699 "/"
3700 (var "k")
3701 "_"
3702 (var "A"))))
3703 (entry (% (heading (code "GL_SRC_ALPHA")))
3704 (para (math "("
3705 (var "A")
3706 "_"
3707 (var "s")
3708 "/"
3709 (var "k")
3710 "_"
3711 (var "A")
3712 ","
3713 (var "A")
3714 "_"
3715 (var "s")
3716 "/"
3717 (var "k")
3718 "_"
3719 (var "A")
3720 (var "A")
3721 "_"
3722 (var "s")
3723 "/"
3724 (var "k")
3725 "_"
3726 (var "A")
3727 ")")
3728 ", "
3729 (math (var "A")
3730 "_"
3731 (var "s")
3732 "/"
3733 (var "k")
3734 "_"
3735 (var "A"))))
3736 (entry (% (heading (code "GL_ONE_MINUS_SRC_ALPHA")))
3737 (para (math "("
3738 "1"
3739 ","
3740 "1"
3741 "1"
3742 ")"
3743 "-"
3744 "("
3745 (var "A")
3746 "_"
3747 (var "s")
3748 "/"
3749 (var "k")
3750 "_"
3751 (var "A")
3752 ","
3753 (var "A")
3754 "_"
3755 (var "s")
3756 "/"
3757 (var "k")
3758 "_"
3759 (var "A")
3760 (var "A")
3761 "_"
3762 (var "s")
3763 "/"
3764 (var "k")
3765 "_"
3766 (var "A")
3767 ")")
3768 ", "
3769 (math "1"
3770 "-"
3771 (var "A")
3772 "_"
3773 (var "s")
3774 "/"
3775 (var "k")
3776 "_"
3777 (var "A"))))
3778 (entry (% (heading (code "GL_DST_ALPHA")))
3779 (para (math "("
3780 (var "A")
3781 "_"
3782 (var "d")
3783 "/"
3784 (var "k")
3785 "_"
3786 (var "A")
3787 ","
3788 (var "A")
3789 "_"
3790 (var "d")
3791 "/"
3792 (var "k")
3793 "_"
3794 (var "A")
3795 (var "A")
3796 "_"
3797 (var "d")
3798 "/"
3799 (var "k")
3800 "_"
3801 (var "A")
3802 ")")
3803 ", "
3804 (math (var "A")
3805 "_"
3806 (var "d")
3807 "/"
3808 (var "k")
3809 "_"
3810 (var "A"))))
3811 (entry (% (heading (code "GL_ONE_MINUS_DST_ALPHA")))
3812 (para (math "("
3813 "1"
3814 ","
3815 "1"
3816 "1"
3817 ")"
3818 "-"
3819 "("
3820 (var "A")
3821 "_"
3822 (var "d")
3823 "/"
3824 (var "k")
3825 "_"
3826 (var "A")
3827 ","
3828 (var "A")
3829 "_"
3830 (var "d")
3831 "/"
3832 (var "k")
3833 "_"
3834 (var "A")
3835 (var "A")
3836 "_"
3837 (var "d")
3838 "/"
3839 (var "k")
3840 "_"
3841 (var "A")
3842 ")")
3843 ", "
3844 (math "1"
3845 "-"
3846 (var "A")
3847 "_"
3848 (var "d")
3849 "/"
3850 (var "k")
3851 "_"
3852 (var "A"))))
3853 (entry (% (heading (code "GL_CONSTANT_COLOR")))
3854 (para (math "("
3855 (var "R")
3856 "_"
3857 (var "c")
3858 ","
3859 (var "G")
3860 "_"
3861 (var "c")
3862 (var "B")
3863 "_"
3864 (var "c")
3865 ")")
3866 ", "
3867 (math (var "A") "_" (var "c"))))
3868 (entry (% (heading (code "GL_ONE_MINUS_CONSTANT_COLOR")))
3869 (para (math "("
3870 "1"
3871 ","
3872 "1"
3873 "1"
3874 ")"
3875 "-"
3876 "("
3877 (var "R")
3878 "_"
3879 (var "c")
3880 ","
3881 (var "G")
3882 "_"
3883 (var "c")
3884 (var "B")
3885 "_"
3886 (var "c")
3887 ")")
3888 ", "
3889 (math "1" "-" (var "A") "_" (var "c"))))
3890 (entry (% (heading (code "GL_CONSTANT_ALPHA")))
3891 (para (math "("
3892 (var "A")
3893 "_"
3894 (var "c")
3895 ","
3896 (var "A")
3897 "_"
3898 (var "c")
3899 (var "A")
3900 "_"
3901 (var "c")
3902 ")")
3903 ", "
3904 (math (var "A") "_" (var "c"))))
3905 (entry (% (heading (code "GL_ONE_MINUS_CONSTANT_ALPHA")))
3906 (para (math "("
3907 "1"
3908 ","
3909 "1"
3910 "1"
3911 ")"
3912 "-"
3913 "("
3914 (var "A")
3915 "_"
3916 (var "c")
3917 ","
3918 (var "A")
3919 "_"
3920 (var "c")
3921 (var "A")
3922 "_"
3923 (var "c")
3924 ")")
3925 ", "
3926 (math "1" "-" (var "A") "_" (var "c"))))
3927 (entry (% (heading (code "GL_SRC_ALPHA_SATURATE")))
3928 (para (math "(" (var "i") "," (var "i") (var "i") ")")
3929 ", "
3930 (math "1"))))
3931 (para "
3932 In the table, ")
3933 (para (para (math (var "i")
3934 "="
3935 (var "min")
3936 "\u2061"
3937 "("
3938 (var "A")
3939 "_"
3940 (var "s")
3941 ","
3942 "1"
3943 "-"
3944 (var "A")
3945 "_"
3946 (var "d")
3947 ","
3948 ")")))
3949 (para "
3950 To determine the blended RGBA values of a pixel when drawing in RGBA mode,
3951 the system uses the following equations: ")
3952 (para (para (math (var "R")
3953 "_"
3954 (var "d")
3955 "="
3956 (var "min")
3957 "\u2061"
3958 "("
3959 (var "k")
3960 "_"
3961 (var "R")
3962 ","
3963 (var "R")
3964 "_"
3965 (var "s")
3966 "\u2062"
3967 (var "s")
3968 "_"
3969 (var "R")
3970 "+"
3971 (var "R")
3972 "_"
3973 (var "d")
3974 "\u2062"
3975 (var "d")
3976 "_"
3977 (var "R")
3978 ")")
3979 (math (var "G")
3980 "_"
3981 (var "d")
3982 "="
3983 (var "min")
3984 "\u2061"
3985 "("
3986 (var "k")
3987 "_"
3988 (var "G")
3989 ","
3990 (var "G")
3991 "_"
3992 (var "s")
3993 "\u2062"
3994 (var "s")
3995 "_"
3996 (var "G")
3997 "+"
3998 (var "G")
3999 "_"
4000 (var "d")
4001 "\u2062"
4002 (var "d")
4003 "_"
4004 (var "G")
4005 ")")
4006 (math (var "B")
4007 "_"
4008 (var "d")
4009 "="
4010 (var "min")
4011 "\u2061"
4012 "("
4013 (var "k")
4014 "_"
4015 (var "B")
4016 ","
4017 (var "B")
4018 "_"
4019 (var "s")
4020 "\u2062"
4021 (var "s")
4022 "_"
4023 (var "B")
4024 "+"
4025 (var "B")
4026 "_"
4027 (var "d")
4028 "\u2062"
4029 (var "d")
4030 "_"
4031 (var "B")
4032 ")")
4033 (math (var "A")
4034 "_"
4035 (var "d")
4036 "="
4037 (var "min")
4038 "\u2061"
4039 "("
4040 (var "k")
4041 "_"
4042 (var "A")
4043 ","
4044 (var "A")
4045 "_"
4046 (var "s")
4047 "\u2062"
4048 (var "s")
4049 "_"
4050 (var "A")
4051 "+"
4052 (var "A")
4053 "_"
4054 (var "d")
4055 "\u2062"
4056 (var "d")
4057 "_"
4058 (var "A")
4059 ")")))
4060 (para "
4061 Despite the apparent precision of the above equations, blending arithmetic
4062 is not exactly specified, because blending operates with imprecise integer
4063 color values. However, a blend factor that should be equal to 1 is
4064 guaranteed not to modify its multiplicand, and a blend factor equal to 0
4065 reduces its multiplicand to 0. For example, when "
4066 (var "srcRGB")
4067 " is "
4068 (code "GL_SRC_ALPHA")
4069 ", "
4070 (var "dstRGB")
4071 " is "
4072 (code "GL_ONE_MINUS_SRC_ALPHA")
4073 ", and "
4074 (math (var "A") "_" (var "s"))
4075 "
4076 is
4077 equal to "
4078 (math (var "k") "_" (var "A"))
4079 ",
4080 the equations reduce to simple replacement: ")
4081 (para (para (math (var "R")
4082 "_"
4083 (var "d")
4084 "="
4085 (var "R")
4086 "_"
4087 (var "s"))
4088 (math (var "G")
4089 "_"
4090 (var "d")
4091 "="
4092 (var "G")
4093 "_"
4094 (var "s"))
4095 (math (var "B")
4096 "_"
4097 (var "d")
4098 "="
4099 (var "B")
4100 "_"
4101 (var "s"))
4102 (math (var "A")
4103 "_"
4104 (var "d")
4105 "="
4106 (var "A")
4107 "_"
4108 (var "s"))))
4109 (para)
4110 (heading "Errors")
4111 (para (code "GL_INVALID_ENUM")
4112 " is generated if either "
4113 (var "srcRGB")
4114 " or "
4115 (var "dstRGB")
4116 " is not an
4117 accepted value. ")
4118 (para (code "GL_INVALID_OPERATION")
4119 " is generated if "
4120 (code "glBlendFuncSeparate")
4121 "
4122 is executed between the execution of "
4123 (code "glBegin")
4124 "
4125 and the corresponding execution of "
4126 (code "glEnd")
4127 ". ")))
4128
4129 (define-gl-procedure
4130 glBlendFunc
4131 "glBlendFunc"
4132 (funcsynopsis
4133 (funcprototype
4134 (funcdef "void " (function "glBlendFunc"))
4135 (paramdef "GLenum " (parameter "sfactor"))
4136 (paramdef "GLenum " (parameter "dfactor"))))
4137 '(*fragment*
4138 (heading "specify pixel arithmetic")
4139 (heading "Parameters")
4140 (table (% (formatter (asis)))
4141 (entry (% (heading (var "sfactor")))
4142 (para "
4143 Specifies how the red, green, blue,
4144 and alpha source blending factors are computed.
4145 The following symbolic constants are accepted: "
4146 (code "GL_ZERO")
4147 ", "
4148 (code "GL_ONE")
4149 ", "
4150 (code "GL_SRC_COLOR")
4151 ", "
4152 (code "GL_ONE_MINUS_SRC_COLOR")
4153 ", "
4154 (code "GL_DST_COLOR")
4155 ", "
4156 (code "GL_ONE_MINUS_DST_COLOR")
4157 ", "
4158 (code "GL_SRC_ALPHA")
4159 ", "
4160 (code "GL_ONE_MINUS_SRC_ALPHA")
4161 ", "
4162 (code "GL_DST_ALPHA")
4163 ", "
4164 (code "GL_ONE_MINUS_DST_ALPHA")
4165 ", "
4166 (code "GL_CONSTANT_COLOR")
4167 ", "
4168 (code "GL_ONE_MINUS_CONSTANT_COLOR")
4169 ", "
4170 (code "GL_CONSTANT_ALPHA")
4171 ", "
4172 (code "GL_ONE_MINUS_CONSTANT_ALPHA")
4173 ", and "
4174 (code "GL_SRC_ALPHA_SATURATE")
4175 ".
4176 The initial value is "
4177 (code "GL_ONE")
4178 ". "))
4179 (entry (% (heading (var "dfactor")))
4180 (para "
4181 Specifies how the red, green, blue,
4182 and alpha destination blending factors are computed.
4183 The following symbolic constants are accepted: "
4184 (code "GL_ZERO")
4185 ", "
4186 (code "GL_ONE")
4187 ", "
4188 (code "GL_SRC_COLOR")
4189 ", "
4190 (code "GL_ONE_MINUS_SRC_COLOR")
4191 ", "
4192 (code "GL_DST_COLOR")
4193 ", "
4194 (code "GL_ONE_MINUS_DST_COLOR")
4195 ", "
4196 (code "GL_SRC_ALPHA")
4197 ", "
4198 (code "GL_ONE_MINUS_SRC_ALPHA")
4199 ", "
4200 (code "GL_DST_ALPHA")
4201 ", "
4202 (code "GL_ONE_MINUS_DST_ALPHA")
4203 ". "
4204 (code "GL_CONSTANT_COLOR")
4205 ", "
4206 (code "GL_ONE_MINUS_CONSTANT_COLOR")
4207 ", "
4208 (code "GL_CONSTANT_ALPHA")
4209 ", and "
4210 (code "GL_ONE_MINUS_CONSTANT_ALPHA")
4211 ".
4212 The initial value is "
4213 (code "GL_ZERO")
4214 ". ")))
4215 (heading "Description")
4216 (para "
4217 In RGBA mode, pixels can be drawn using a function that blends
4218 the incoming (source) RGBA values with the RGBA values
4219 that are already in the frame buffer (the destination values).
4220 Blending is initially disabled.
4221 Use "
4222 (code "glEnable")
4223 " and "
4224 (code "glDisable")
4225 " with argument "
4226 (code "GL_BLEND")
4227 "
4228 to enable and disable blending. ")
4229 (para (code "glBlendFunc")
4230 " defines the operation of blending when it is enabled. "
4231 (var "sfactor")
4232 " specifies which method is used to scale the
4233 source color components. "
4234 (var "dfactor")
4235 " specifies which method is used to scale the
4236 destination color components.
4237 The possible methods are described in the following table.
4238 Each method defines four scale factors,
4239 one each for red, green, blue, and alpha.
4240 In the table and in subsequent equations, source and destination
4241 color components are referred to as "
4242 (math "("
4243 (var "R")
4244 "_"
4245 (var "s")
4246 ","
4247 (var "G")
4248 "_"
4249 (var "s")
4250 (var "B")
4251 "_"
4252 (var "s")
4253 (var "A")
4254 "_"
4255 (var "s")
4256 ")")
4257 "
4258 and "
4259 (math "("
4260 (var "R")
4261 "_"
4262 (var "d")
4263 ","
4264 (var "G")
4265 "_"
4266 (var "d")
4267 (var "B")
4268 "_"
4269 (var "d")
4270 (var "A")
4271 "_"
4272 (var "d")
4273 ")")
4274 ".
4275 The color specified by "
4276 (code "glBlendColor")
4277 " is referred to as "
4278 (math "("
4279 (var "R")
4280 "_"
4281 (var "c")
4282 ","
4283 (var "G")
4284 "_"
4285 (var "c")
4286 (var "B")
4287 "_"
4288 (var "c")
4289 (var "A")
4290 "_"
4291 (var "c")
4292 ")")
4293 ".
4294 They are understood to have integer values between 0 and "
4295 (math "("
4296 (var "k")
4297 "_"
4298 (var "R")
4299 ","
4300 (var "k")
4301 "_"
4302 (var "G")
4303 (var "k")
4304 "_"
4305 (var "B")
4306 (var "k")
4307 "_"
4308 (var "A")
4309 ")")
4310 ",
4311 where ")
4312 (para (para (math (var "k")
4313 "_"
4314 (var "c")
4315 "="
4316 "2"
4317 "^"
4318 (var "m")
4319 "_"
4320 (var "c")
4321 ","
4322 "-"
4323 "1")))
4324 (para "
4325 and "
4326 (math "("
4327 (var "m")
4328 "_"
4329 (var "R")
4330 ","
4331 (var "m")
4332 "_"
4333 (var "G")
4334 (var "m")
4335 "_"
4336 (var "B")
4337 (var "m")
4338 "_"
4339 (var "A")
4340 ")")
4341 "
4342 is the number of red,
4343 green,
4344 blue,
4345 and alpha bitplanes. ")
4346 (para "
4347 Source and destination scale factors are referred to as "
4348 (math "("
4349 (var "s")
4350 "_"
4351 (var "R")
4352 ","
4353 (var "s")
4354 "_"
4355 (var "G")
4356 (var "s")
4357 "_"
4358 (var "B")
4359 (var "s")
4360 "_"
4361 (var "A")
4362 ")")
4363 "
4364 and "
4365 (math "("
4366 (var "d")
4367 "_"
4368 (var "R")
4369 ","
4370 (var "d")
4371 "_"
4372 (var "G")
4373 (var "d")
4374 "_"
4375 (var "B")
4376 (var "d")
4377 "_"
4378 (var "A")
4379 ")")
4380 ".
4381 The scale factors described in the table,
4382 denoted "
4383 (math "("
4384 (var "f")
4385 "_"
4386 (var "R")
4387 ","
4388 (var "f")
4389 "_"
4390 (var "G")
4391 (var "f")
4392 "_"
4393 (var "B")
4394 (var "f")
4395 "_"
4396 (var "A")
4397 ")")
4398 ",
4399 represent either source or destination factors.
4400 All scale factors have range "
4401 (math "[" "0" "," "1" "]")
4402 ". ")
4403 (para)
4404 (table (% (formatter (asis)))
4405 (entry (% (heading (strong "Parameter")))
4406 (para (strong
4407 (math "("
4408 (var "f")
4409 "_"
4410 (var "R")
4411 ","
4412 (var "f")
4413 "_"
4414 (var "G")
4415 (var "f")
4416 "_"
4417 (var "B")
4418 (var "f")
4419 "_"
4420 (var "A")
4421 ")"))))
4422 (entry (% (heading (code "GL_ZERO")))
4423 (para (math "(" "0" "," "0" "0" "0" ")")))
4424 (entry (% (heading (code "GL_ONE")))
4425 (para (math "(" "1" "," "1" "1" "1" ")")))
4426 (entry (% (heading (code "GL_SRC_COLOR")))
4427 (para (math "("
4428 (var "R")
4429 "_"
4430 (var "s")
4431 "/"
4432 (var "k")
4433 "_"
4434 (var "R")
4435 ","
4436 (var "G")
4437 "_"
4438 (var "s")
4439 "/"
4440 (var "k")
4441 "_"
4442 (var "G")
4443 (var "B")
4444 "_"
4445 (var "s")
4446 "/"
4447 (var "k")
4448 "_"
4449 (var "B")
4450 (var "A")
4451 "_"
4452 (var "s")
4453 "/"
4454 (var "k")
4455 "_"
4456 (var "A")
4457 ")")))
4458 (entry (% (heading (code "GL_ONE_MINUS_SRC_COLOR")))
4459 (para (math "("
4460 "1"
4461 ","
4462 "1"
4463 "1"
4464 "1"
4465 ")"
4466 "-"
4467 "("
4468 (var "R")
4469 "_"
4470 (var "s")
4471 "/"
4472 (var "k")
4473 "_"
4474 (var "R")
4475 ","
4476 (var "G")
4477 "_"
4478 (var "s")
4479 "/"
4480 (var "k")
4481 "_"
4482 (var "G")
4483 (var "B")
4484 "_"
4485 (var "s")
4486 "/"
4487 (var "k")
4488 "_"
4489 (var "B")
4490 (var "A")
4491 "_"
4492 (var "s")
4493 "/"
4494 (var "k")
4495 "_"
4496 (var "A")
4497 ")")))
4498 (entry (% (heading (code "GL_DST_COLOR")))
4499 (para (math "("
4500 (var "R")
4501 "_"
4502 (var "d")
4503 "/"
4504 (var "k")
4505 "_"
4506 (var "R")
4507 ","
4508 (var "G")
4509 "_"
4510 (var "d")
4511 "/"
4512 (var "k")
4513 "_"
4514 (var "G")
4515 (var "B")
4516 "_"
4517 (var "d")
4518 "/"
4519 (var "k")
4520 "_"
4521 (var "B")
4522 (var "A")
4523 "_"
4524 (var "d")
4525 "/"
4526 (var "k")
4527 "_"
4528 (var "A")
4529 ")")))
4530 (entry (% (heading (code "GL_ONE_MINUS_DST_COLOR")))
4531 (para (math "("
4532 "1"
4533 ","
4534 "1"
4535 "1"
4536 "1"
4537 ")"
4538 "-"
4539 "("
4540 (var "R")
4541 "_"
4542 (var "d")
4543 "/"
4544 (var "k")
4545 "_"
4546 (var "R")
4547 ","
4548 (var "G")
4549 "_"
4550 (var "d")
4551 "/"
4552 (var "k")
4553 "_"
4554 (var "G")
4555 (var "B")
4556 "_"
4557 (var "d")
4558 "/"
4559 (var "k")
4560 "_"
4561 (var "B")
4562 (var "A")
4563 "_"
4564 (var "d")
4565 "/"
4566 (var "k")
4567 "_"
4568 (var "A")
4569 ")")))
4570 (entry (% (heading (code "GL_SRC_ALPHA")))
4571 (para (math "("
4572 (var "A")
4573 "_"
4574 (var "s")
4575 "/"
4576 (var "k")
4577 "_"
4578 (var "A")
4579 ","
4580 (var "A")
4581 "_"
4582 (var "s")
4583 "/"
4584 (var "k")
4585 "_"
4586 (var "A")
4587 (var "A")
4588 "_"
4589 (var "s")
4590 "/"
4591 (var "k")
4592 "_"
4593 (var "A")
4594 (var "A")
4595 "_"
4596 (var "s")
4597 "/"
4598 (var "k")
4599 "_"
4600 (var "A")
4601 ")")))
4602 (entry (% (heading (code "GL_ONE_MINUS_SRC_ALPHA")))
4603 (para (math "("
4604 "1"
4605 ","
4606 "1"
4607 "1"
4608 "1"
4609 ")"
4610 "-"
4611 "("
4612 (var "A")
4613 "_"
4614 (var "s")
4615 "/"
4616 (var "k")
4617 "_"
4618 (var "A")
4619 ","
4620 (var "A")
4621 "_"
4622 (var "s")
4623 "/"
4624 (var "k")
4625 "_"
4626 (var "A")
4627 (var "A")
4628 "_"
4629 (var "s")
4630 "/"
4631 (var "k")
4632 "_"
4633 (var "A")
4634 (var "A")
4635 "_"
4636 (var "s")
4637 "/"
4638 (var "k")
4639 "_"
4640 (var "A")
4641 ")")))
4642 (entry (% (heading (code "GL_DST_ALPHA")))
4643 (para (math "("
4644 (var "A")
4645 "_"
4646 (var "d")
4647 "/"
4648 (var "k")
4649 "_"
4650 (var "A")
4651 ","
4652 (var "A")
4653 "_"
4654 (var "d")
4655 "/"
4656 (var "k")
4657 "_"
4658 (var "A")
4659 (var "A")
4660 "_"
4661 (var "d")
4662 "/"
4663 (var "k")
4664 "_"
4665 (var "A")
4666 (var "A")
4667 "_"
4668 (var "d")
4669 "/"
4670 (var "k")
4671 "_"
4672 (var "A")
4673 ")")))
4674 (entry (% (heading (code "GL_ONE_MINUS_DST_ALPHA")))
4675 (para (math "("
4676 "1"
4677 ","
4678 "1"
4679 "1"
4680 "1"
4681 ")"
4682 "-"
4683 "("
4684 (var "A")
4685 "_"
4686 (var "d")
4687 "/"
4688 (var "k")
4689 "_"
4690 (var "A")
4691 ","
4692 (var "A")
4693 "_"
4694 (var "d")
4695 "/"
4696 (var "k")
4697 "_"
4698 (var "A")
4699 (var "A")
4700 "_"
4701 (var "d")
4702 "/"
4703 (var "k")
4704 "_"
4705 (var "A")
4706 (var "A")
4707 "_"
4708 (var "d")
4709 "/"
4710 (var "k")
4711 "_"
4712 (var "A")
4713 ")")))
4714 (entry (% (heading (code "GL_CONSTANT_COLOR")))
4715 (para (math "("
4716 (var "R")
4717 "_"
4718 (var "c")
4719 ","
4720 (var "G")
4721 "_"
4722 (var "c")
4723 (var "B")
4724 "_"
4725 (var "c")
4726 (var "A")
4727 "_"
4728 (var "c")
4729 ")")))
4730 (entry (% (heading (code "GL_ONE_MINUS_CONSTANT_COLOR")))
4731 (para (math "("
4732 "1"
4733 ","
4734 "1"
4735 "1"
4736 "1"
4737 ")"
4738 "-"
4739 "("
4740 (var "R")
4741 "_"
4742 (var "c")
4743 ","
4744 (var "G")
4745 "_"
4746 (var "c")
4747 (var "B")
4748 "_"
4749 (var "c")
4750 (var "A")
4751 "_"
4752 (var "c")
4753 ")")))
4754 (entry (% (heading (code "GL_CONSTANT_ALPHA")))
4755 (para (math "("
4756 (var "A")
4757 "_"
4758 (var "c")
4759 ","
4760 (var "A")
4761 "_"
4762 (var "c")
4763 (var "A")
4764 "_"
4765 (var "c")
4766 (var "A")
4767 "_"
4768 (var "c")
4769 ")")))
4770 (entry (% (heading (code "GL_ONE_MINUS_CONSTANT_ALPHA")))
4771 (para (math "("
4772 "1"
4773 ","
4774 "1"
4775 "1"
4776 "1"
4777 ")"
4778 "-"
4779 "("
4780 (var "A")
4781 "_"
4782 (var "c")
4783 ","
4784 (var "A")
4785 "_"
4786 (var "c")
4787 (var "A")
4788 "_"
4789 (var "c")
4790 (var "A")
4791 "_"
4792 (var "c")
4793 ")")))
4794 (entry (% (heading (code "GL_SRC_ALPHA_SATURATE")))
4795 (para (math "("
4796 (var "i")
4797 ","
4798 (var "i")
4799 (var "i")
4800 "1"
4801 ")"))))
4802 (para "
4803 In the table, ")
4804 (para (para (math (var "i")
4805 "="
4806 (var "min")
4807 "\u2061"
4808 "("
4809 (var "A")
4810 "_"
4811 (var "s")
4812 ","
4813 (var "k")
4814 "_"
4815 (var "A")
4816 "-"
4817 (var "A")
4818 "_"
4819 (var "d")
4820 ")"
4821 "/"
4822 (var "k")
4823 "_"
4824 (var "A"))))
4825 (para "
4826 To determine the blended RGBA values of a pixel when drawing in RGBA mode,
4827 the system uses the following equations: ")
4828 (para (para (math (var "R")
4829 "_"
4830 (var "d")
4831 "="
4832 (var "min")
4833 "\u2061"
4834 "("
4835 (var "k")
4836 "_"
4837 (var "R")
4838 ","
4839 (var "R")
4840 "_"
4841 (var "s")
4842 "\u2062"
4843 (var "s")
4844 "_"
4845 (var "R")
4846 "+"
4847 (var "R")
4848 "_"
4849 (var "d")
4850 "\u2062"
4851 (var "d")
4852 "_"
4853 (var "R")
4854 ")")
4855 (math (var "G")
4856 "_"
4857 (var "d")
4858 "="
4859 (var "min")
4860 "\u2061"
4861 "("
4862 (var "k")
4863 "_"
4864 (var "G")
4865 ","
4866 (var "G")
4867 "_"
4868 (var "s")
4869 "\u2062"
4870 (var "s")
4871 "_"
4872 (var "G")
4873 "+"
4874 (var "G")
4875 "_"
4876 (var "d")
4877 "\u2062"
4878 (var "d")
4879 "_"
4880 (var "G")
4881 ")")
4882 (math (var "B")
4883 "_"
4884 (var "d")
4885 "="
4886 (var "min")
4887 "\u2061"
4888 "("
4889 (var "k")
4890 "_"
4891 (var "B")
4892 ","
4893 (var "B")
4894 "_"
4895 (var "s")
4896 "\u2062"
4897 (var "s")
4898 "_"
4899 (var "B")
4900 "+"
4901 (var "B")
4902 "_"
4903 (var "d")
4904 "\u2062"
4905 (var "d")
4906 "_"
4907 (var "B")
4908 ")")
4909 (math (var "A")
4910 "_"
4911 (var "d")
4912 "="
4913 (var "min")
4914 "\u2061"
4915 "("
4916 (var "k")
4917 "_"
4918 (var "A")
4919 ","
4920 (var "A")
4921 "_"
4922 (var "s")
4923 "\u2062"
4924 (var "s")
4925 "_"
4926 (var "A")
4927 "+"
4928 (var "A")
4929 "_"
4930 (var "d")
4931 "\u2062"
4932 (var "d")
4933 "_"
4934 (var "A")
4935 ")")))
4936 (para "
4937 Despite the apparent precision of the above equations,
4938 blending arithmetic is not exactly specified,
4939 because blending operates with imprecise integer color values.
4940 However,
4941 a blend factor that should be equal to 1
4942 is guaranteed not to modify its multiplicand,
4943 and a blend factor equal to 0 reduces its multiplicand to 0.
4944 For example,
4945 when "
4946 (var "sfactor")
4947 " is "
4948 (code "GL_SRC_ALPHA")
4949 ", "
4950 (var "dfactor")
4951 " is "
4952 (code "GL_ONE_MINUS_SRC_ALPHA")
4953 ",
4954 and "
4955 (math (var "A") "_" (var "s"))
4956 "
4957 is equal to "
4958 (math (var "k") "_" (var "A"))
4959 ",
4960 the equations reduce to simple replacement: ")
4961 (para (para (math (var "R")
4962 "_"
4963 (var "d")
4964 "="
4965 (var "R")
4966 "_"
4967 (var "s"))
4968 (math (var "G")
4969 "_"
4970 (var "d")
4971 "="
4972 (var "G")
4973 "_"
4974 (var "s"))
4975 (math (var "B")
4976 "_"
4977 (var "d")
4978 "="
4979 (var "B")
4980 "_"
4981 (var "s"))
4982 (math (var "A")
4983 "_"
4984 (var "d")
4985 "="
4986 (var "A")
4987 "_"
4988 (var "s"))))
4989 (para)
4990 (heading "Errors")
4991 (para (code "GL_INVALID_ENUM")
4992 " is generated if either "
4993 (var "sfactor")
4994 " or "
4995 (var "dfactor")
4996 " is not an
4997 accepted value. ")
4998 (para (code "GL_INVALID_OPERATION")
4999 " is generated if "
5000 (code "glBlendFunc")
5001 "
5002 is executed between the execution of "
5003 (code "glBegin")
5004 "
5005 and the corresponding execution of "
5006 (code "glEnd")
5007 ". ")))
5008
5009 (define-gl-procedure
5010 glBufferData
5011 "glBufferData"
5012 (funcsynopsis
5013 (funcprototype
5014 (funcdef "void " (function "glBufferData"))
5015 (paramdef "GLenum " (parameter "target"))
5016 (paramdef "GLsizeiptr " (parameter "size"))
5017 (paramdef "const GLvoid * " (parameter "data"))
5018 (paramdef "GLenum " (parameter "usage"))))
5019 '(*fragment*
5020 (heading
5021 "creates and initializes a buffer object's data store")
5022 (heading "Parameters")
5023 (table (% (formatter (asis)))
5024 (entry (% (heading (var "target")))
5025 (para "
5026 Specifies the target buffer object.
5027 The symbolic constant must be "
5028 (code "GL_ARRAY_BUFFER")
5029 ", "
5030 (code "GL_ELEMENT_ARRAY_BUFFER")
5031 ", "
5032 (code "GL_PIXEL_PACK_BUFFER")
5033 ", or "
5034 (code "GL_PIXEL_UNPACK_BUFFER")
5035 ". "))
5036 (entry (% (heading (var "size")))
5037 (para "
5038 Specifies the size in bytes of the buffer object's new data store. "))
5039 (entry (% (heading (var "data")))
5040 (para "
5041 Specifies a pointer to data that will be copied into the data store for initialization,
5042 or "
5043 (code "NULL")
5044 " if no data is to be copied. "))
5045 (entry (% (heading (var "usage")))
5046 (para "
5047 Specifies the expected usage pattern of the data store. The symbolic constant must be "
5048 (code "GL_STREAM_DRAW")
5049 ", "
5050 (code "GL_STREAM_READ")
5051 ", "
5052 (code "GL_STREAM_COPY")
5053 ", "
5054 (code "GL_STATIC_DRAW")
5055 ", "
5056 (code "GL_STATIC_READ")
5057 ", "
5058 (code "GL_STATIC_COPY")
5059 ", "
5060 (code "GL_DYNAMIC_DRAW")
5061 ", "
5062 (code "GL_DYNAMIC_READ")
5063 ", or "
5064 (code "GL_DYNAMIC_COPY")
5065 ". ")))
5066 (heading "Description")
5067 (para (code "glBufferData")
5068 " creates a new data store for the buffer object currently bound to "
5069 (var "target")
5070 ". Any pre-existing data store is deleted. The new data store is created with the
5071 specified "
5072 (var "size")
5073 " in bytes and "
5074 (var "usage")
5075 ". If "
5076 (var "data")
5077 "
5078 is not "
5079 (code "NULL")
5080 ", the data store is initialized with data from this pointer. In its initial
5081 state, the new data store is not mapped, it has a "
5082 (code "NULL")
5083 " mapped pointer, and its mapped access
5084 is "
5085 (code "GL_READ_WRITE")
5086 ". ")
5087 (para (var "usage")
5088 " is a hint to the GL implementation as to how a buffer object's data store will be
5089 accessed. This enables the GL implementation to make more intelligent decisions that may significantly
5090 impact buffer object performance. It does not, however, constrain the actual usage of the data store. "
5091 (var "usage")
5092 " can be broken down into two parts: first, the frequency of access (modification
5093 and usage), and second, the nature of that access. The frequency of access may be one of these: ")
5094 (table (% (formatter (asis)))
5095 (entry (% (heading "STREAM"))
5096 (para "
5097 The data store contents will be modified once and used at most a few times. "))
5098 (entry (% (heading "STATIC"))
5099 (para "
5100 The data store contents will be modified once and used many times. "))
5101 (entry (% (heading "DYNAMIC"))
5102 (para "
5103 The data store contents will be modified repeatedly and used many times. ")))
5104 (para "
5105 The nature of access may be one of these: ")
5106 (table (% (formatter (asis)))
5107 (entry (% (heading "DRAW"))
5108 (para "
5109 The data store contents are modified by the application, and used as the source for GL drawing and
5110 image specification commands. "))
5111 (entry (% (heading "READ"))
5112 (para "
5113 The data store contents are modified by reading data from the GL, and used to return that data
5114 when queried by the application. "))
5115 (entry (% (heading "COPY"))
5116 (para "
5117 The data store contents are modified by reading data from the GL, and used as the source for GL
5118 drawing and image specification commands. ")))
5119 (heading "Errors")
5120 (para (code "GL_INVALID_ENUM")
5121 " is generated if "
5122 (var "target")
5123 " is not "
5124 (code "GL_ARRAY_BUFFER")
5125 ", "
5126 (code "GL_ELEMENT_ARRAY_BUFFER")
5127 ", "
5128 (code "GL_PIXEL_PACK_BUFFER")
5129 ", or "
5130 (code "GL_PIXEL_UNPACK_BUFFER")
5131 ". ")
5132 (para (code "GL_INVALID_ENUM")
5133 " is generated if "
5134 (var "usage")
5135 " is not "
5136 (code "GL_STREAM_DRAW")
5137 ", "
5138 (code "GL_STREAM_READ")
5139 ", "
5140 (code "GL_STREAM_COPY")
5141 ", "
5142 (code "GL_STATIC_DRAW")
5143 ", "
5144 (code "GL_STATIC_READ")
5145 ", "
5146 (code "GL_STATIC_COPY")
5147 ", "
5148 (code "GL_DYNAMIC_DRAW")
5149 ", "
5150 (code "GL_DYNAMIC_READ")
5151 ", or "
5152 (code "GL_DYNAMIC_COPY")
5153 ". ")
5154 (para (code "GL_INVALID_VALUE")
5155 " is generated if "
5156 (var "size")
5157 " is negative. ")
5158 (para (code "GL_INVALID_OPERATION")
5159 " is generated if the reserved buffer object name 0 is bound to "
5160 (var "target")
5161 ". ")
5162 (para (code "GL_OUT_OF_MEMORY")
5163 " is generated if the GL is unable to create a data store with the specified "
5164 (var "size")
5165 ". ")
5166 (para (code "GL_INVALID_OPERATION")
5167 " is generated if "
5168 (code "glBufferData")
5169 "
5170 is executed between the execution of "
5171 (code "glBegin")
5172 " and the corresponding execution of "
5173 (code "glEnd")
5174 ". ")))
5175
5176 (define-gl-procedure
5177 glBufferSubData
5178 "glBufferSubData"
5179 (funcsynopsis
5180 (funcprototype
5181 (funcdef "void " (function "glBufferSubData"))
5182 (paramdef "GLenum " (parameter "target"))
5183 (paramdef "GLintptr " (parameter "offset"))
5184 (paramdef "GLsizeiptr " (parameter "size"))
5185 (paramdef "const GLvoid * " (parameter "data"))))
5186 '(*fragment*
5187 (heading
5188 "updates a subset of a buffer object's data store")
5189 (heading "Parameters")
5190 (table (% (formatter (asis)))
5191 (entry (% (heading (var "target")))
5192 (para "
5193 Specifies the target buffer object.
5194 The symbolic constant must be "
5195 (code "GL_ARRAY_BUFFER")
5196 ", "
5197 (code "GL_ELEMENT_ARRAY_BUFFER")
5198 ", "
5199 (code "GL_PIXEL_PACK_BUFFER")
5200 ", or "
5201 (code "GL_PIXEL_UNPACK_BUFFER")
5202 ". "))
5203 (entry (% (heading (var "offset")))
5204 (para "
5205 Specifies the offset into the buffer object's data store where data replacement will begin,
5206 measured in bytes. "))
5207 (entry (% (heading (var "size")))
5208 (para "
5209 Specifies the size in bytes of the data store region being replaced. "))
5210 (entry (% (heading (var "data")))
5211 (para "
5212 Specifies a pointer to the new data that will be copied into the data store. ")))
5213 (heading "Description")
5214 (para (code "glBufferSubData")
5215 " redefines some or all of the data store for the buffer object currently
5216 bound to "
5217 (var "target")
5218 ". Data starting at byte offset "
5219 (var "offset")
5220 " and
5221 extending for "
5222 (var "size")
5223 " bytes is copied to the data store from the memory pointed to by "
5224 (var "data")
5225 ". An error is thrown if "
5226 (var "offset")
5227 " and "
5228 (var "size")
5229 "
5230 together define a range beyond the bounds of the buffer object's data store. ")
5231 (heading "Errors")
5232 (para (code "GL_INVALID_ENUM")
5233 " is generated if "
5234 (var "target")
5235 " is not "
5236 (code "GL_ARRAY_BUFFER")
5237 ", "
5238 (code "GL_ELEMENT_ARRAY_BUFFER")
5239 ", "
5240 (code "GL_PIXEL_PACK_BUFFER")
5241 ", or "
5242 (code "GL_PIXEL_UNPACK_BUFFER")
5243 ". ")
5244 (para (code "GL_INVALID_VALUE")
5245 " is generated if "
5246 (var "offset")
5247 " or "
5248 (var "size")
5249 " is negative, or if together they define a region of memory
5250 that extends beyond the buffer object's allocated data store. ")
5251 (para (code "GL_INVALID_OPERATION")
5252 " is generated if the reserved buffer object name 0 is bound to "
5253 (var "target")
5254 ". ")
5255 (para (code "GL_INVALID_OPERATION")
5256 " is generated if the buffer object being updated is mapped. ")
5257 (para (code "GL_INVALID_OPERATION")
5258 " is generated if "
5259 (code "glBufferSubData")
5260 "
5261 is executed between the execution of "
5262 (code "glBegin")
5263 " and the corresponding execution of "
5264 (code "glEnd")
5265 ". ")))
5266
5267 (define-gl-procedure
5268 glCallLists
5269 "glCallLists"
5270 (funcsynopsis
5271 (funcprototype
5272 (funcdef "void " (function "glCallLists"))
5273 (paramdef "GLsizei " (parameter "n"))
5274 (paramdef "GLenum " (parameter "type"))
5275 (paramdef "const GLvoid * " (parameter "lists"))))
5276 '(*fragment*
5277 (heading "execute a list of display lists")
5278 (heading "Parameters")
5279 (table (% (formatter (asis)))
5280 (entry (% (heading (var "n")))
5281 (para "
5282 Specifies the number of display lists to be executed. "))
5283 (entry (% (heading (var "type")))
5284 (para "
5285 Specifies the type of values in "
5286 (var "lists")
5287 ".
5288 Symbolic constants "
5289 (code "GL_BYTE")
5290 ", "
5291 (code "GL_UNSIGNED_BYTE")
5292 ", "
5293 (code "GL_SHORT")
5294 ", "
5295 (code "GL_UNSIGNED_SHORT")
5296 ", "
5297 (code "GL_INT")
5298 ", "
5299 (code "GL_UNSIGNED_INT")
5300 ", "
5301 (code "GL_FLOAT")
5302 ", "
5303 (code "GL_2_BYTES")
5304 ", "
5305 (code "GL_3_BYTES")
5306 ", and "
5307 (code "GL_4_BYTES")
5308 " are accepted. "))
5309 (entry (% (heading (var "lists")))
5310 (para "
5311 Specifies the address of an array of name offsets in the display list.
5312 The pointer type is void because the offsets can be bytes,
5313 shorts,
5314 ints,
5315 or floats,
5316 depending on the value of "
5317 (var "type")
5318 ". ")))
5319 (heading "Description")
5320 (para (code "glCallLists")
5321 " causes each display list in the list of names passed as "
5322 (var "lists")
5323 "
5324 to be executed.
5325 As a result,
5326 the commands saved in each display list are executed in order,
5327 just as if they were called without using a display list.
5328 Names of display lists that have not been defined are ignored. ")
5329 (para (code "glCallLists")
5330 " provides an efficient means for executing more than one display list. "
5331 (var "type")
5332 " allows lists with various name formats to be accepted.
5333 The formats are as
5334 follows: ")
5335 (table (% (formatter (asis)))
5336 (entry (% (heading (code "GL_BYTE")))
5337 (para (var "lists")
5338 " is treated as an array of signed bytes,
5339 each in the range "
5340 (math "-128")
5341 "
5342 through 127. "))
5343 (entry (% (heading (code "GL_UNSIGNED_BYTE")))
5344 (para (var "lists")
5345 " is treated as an array of unsigned bytes,
5346 each in the range 0 through 255. "))
5347 (entry (% (heading (code "GL_SHORT")))
5348 (para (var "lists")
5349 " is treated as an array of signed two-byte integers,
5350 each in the range "
5351 (math "-32768")
5352 "
5353 through 32767. "))
5354 (entry (% (heading (code "GL_UNSIGNED_SHORT")))
5355 (para (var "lists")
5356 " is treated as an array of unsigned two-byte integers,
5357 each in the range 0 through 65535. "))
5358 (entry (% (heading (code "GL_INT")))
5359 (para (var "lists")
5360 " is treated as an array of signed four-byte integers. "))
5361 (entry (% (heading (code "GL_UNSIGNED_INT")))
5362 (para (var "lists")
5363 " is treated as an array of unsigned four-byte integers. "))
5364 (entry (% (heading (code "GL_FLOAT")))
5365 (para (var "lists")
5366 " is treated as an array of four-byte floating-point values. "))
5367 (entry (% (heading (code "GL_2_BYTES")))
5368 (para (var "lists")
5369 " is treated as an array of unsigned bytes.
5370 Each pair of bytes specifies a single display-list name.
5371 The value of the pair is computed as 256 times the unsigned value
5372 of the first byte plus the unsigned value of the second byte. "))
5373 (entry (% (heading (code "GL_3_BYTES")))
5374 (para (var "lists")
5375 " is treated as an array of unsigned bytes.
5376 Each triplet of bytes specifies a single display-list name.
5377 The value of the triplet is computed as 65536 times the unsigned value
5378 of the first byte,
5379 plus 256 times the unsigned value of the second byte,
5380 plus the unsigned value of the third byte. "))
5381 (entry (% (heading (code "GL_4_BYTES")))
5382 (para (var "lists")
5383 " is treated as an array of unsigned bytes.
5384 Each quadruplet of bytes specifies a single display-list name.
5385 The value of the quadruplet is computed as 16777216 times the unsigned value
5386 of the first byte,
5387 plus 65536 times the unsigned value of the second byte,
5388 plus 256 times the unsigned value of the third byte,
5389 plus the unsigned value of the fourth byte. ")))
5390 (para "
5391 The list of display-list names is not null-terminated.
5392 Rather, "
5393 (var "n")
5394 " specifies how many names are to be taken from "
5395 (var "lists")
5396 ". ")
5397 (para "
5398 An additional level of indirection is made available with the "
5399 (code "glListBase")
5400 " command,
5401 which specifies an unsigned offset that is added to each display-list
5402 name specified in "
5403 (var "lists")
5404 " before that display list is executed. ")
5405 (para (code "glCallLists")
5406 " can appear inside a display list.
5407 To avoid the possibility of infinite recursion resulting from display lists
5408 calling one another,
5409 a limit is placed on the nesting level of display
5410 lists during display-list execution.
5411 This limit must be at least 64, and it depends on the implementation. ")
5412 (para "
5413 GL state is not saved and restored across a call to "
5414 (code "glCallLists")
5415 ".
5416 Thus,
5417 changes made to GL state during the execution of the display lists
5418 remain after execution is completed.
5419 Use "
5420 (code "glPushAttrib")
5421 ", "
5422 (code "glPopAttrib")
5423 ", "
5424 (code "glPushMatrix")
5425 ",
5426 and "
5427 (code "glPopMatrix")
5428 " to preserve GL state across "
5429 (code "glCallLists")
5430 " calls. ")
5431 (heading "Errors")
5432 (para (code "GL_INVALID_VALUE")
5433 " is generated if "
5434 (var "n")
5435 " is negative. ")
5436 (para (code "GL_INVALID_ENUM")
5437 " is generated if "
5438 (var "type")
5439 " is not one of "
5440 (code "GL_BYTE")
5441 ", "
5442 (code "GL_UNSIGNED_BYTE")
5443 ", "
5444 (code "GL_SHORT")
5445 ", "
5446 (code "GL_UNSIGNED_SHORT")
5447 ", "
5448 (code "GL_INT")
5449 ", "
5450 (code "GL_UNSIGNED_INT")
5451 ", "
5452 (code "GL_FLOAT")
5453 ", "
5454 (code "GL_2_BYTES")
5455 ", "
5456 (code "GL_3_BYTES")
5457 ", "
5458 (code "GL_4_BYTES")
5459 ". ")))
5460
5461 (define-gl-procedure
5462 glCallList
5463 "glCallList"
5464 (funcsynopsis
5465 (funcprototype
5466 (funcdef "void " (function "glCallList"))
5467 (paramdef "GLuint " (parameter "list"))))
5468 '(*fragment*
5469 (heading "execute a display list")
5470 (heading "Parameters")
5471 (table (% (formatter (asis)))
5472 (entry (% (heading (var "list")))
5473 (para "
5474 Specifies the integer name of the display list to be executed. ")))
5475 (heading "Description")
5476 (para (code "glCallList")
5477 " causes the named display list to be executed.
5478 The commands saved in the display list are executed in order,
5479 just as if they were called without using a display list.
5480 If "
5481 (var "list")
5482 " has not been defined as a display list, "
5483 (code "glCallList")
5484 " is ignored. ")
5485 (para (code "glCallList")
5486 " can appear inside a display list.
5487 To avoid the possibility of infinite recursion resulting from display lists
5488 calling one another,
5489 a limit is placed on the nesting level of display
5490 lists during display-list execution.
5491 This limit is at least 64, and it depends on the implementation. ")
5492 (para "
5493 GL state is not saved and restored across a call to "
5494 (code "glCallList")
5495 ".
5496 Thus,
5497 changes made to GL state during the execution of a display list
5498 remain after execution of the display list is completed.
5499 Use "
5500 (code "glPushAttrib")
5501 ", "
5502 (code "glPopAttrib")
5503 ", "
5504 (code "glPushMatrix")
5505 ",
5506 and "
5507 (code "glPopMatrix")
5508 " to preserve GL state across "
5509 (code "glCallList")
5510 " calls. ")))
5511
5512 (define-gl-procedure
5513 glClearAccum
5514 "glClearAccum"
5515 (funcsynopsis
5516 (funcprototype
5517 (funcdef "void " (function "glClearAccum"))
5518 (paramdef "GLfloat " (parameter "red"))
5519 (paramdef "GLfloat " (parameter "green"))
5520 (paramdef "GLfloat " (parameter "blue"))
5521 (paramdef "GLfloat " (parameter "alpha"))))
5522 '(*fragment*
5523 (heading
5524 "specify clear values for the accumulation buffer")
5525 (heading "Parameters")
5526 (table (% (formatter (asis)))
5527 (entry (% (heading (var "red")))
5528 (itemx (var "green"))
5529 (itemx (var "blue"))
5530 (itemx (var "alpha"))
5531 (para "
5532 Specify the red, green, blue, and alpha values used when the
5533 accumulation buffer is cleared.
5534 The initial values are all 0. ")))
5535 (heading "Description")
5536 (para (code "glClearAccum")
5537 " specifies the red, green, blue, and alpha values used by "
5538 (code "glClear")
5539 "
5540 to clear the accumulation buffer. ")
5541 (para "
5542 Values specified by "
5543 (code "glClearAccum")
5544 " are clamped to the
5545 range "
5546 (math "[" "-1" "," "1" "]")
5547 ". ")
5548 (heading "Errors")
5549 (para (code "GL_INVALID_OPERATION")
5550 " is generated if "
5551 (code "glClearAccum")
5552 "
5553 is executed between the execution of "
5554 (code "glBegin")
5555 "
5556 and the corresponding execution of "
5557 (code "glEnd")
5558 ". ")))
5559
5560 (define-gl-procedure
5561 glClearColor
5562 "glClearColor"
5563 (funcsynopsis
5564 (funcprototype
5565 (funcdef "void " (function "glClearColor"))
5566 (paramdef "GLclampf " (parameter "red"))
5567 (paramdef "GLclampf " (parameter "green"))
5568 (paramdef "GLclampf " (parameter "blue"))
5569 (paramdef "GLclampf " (parameter "alpha"))))
5570 '(*fragment*
5571 (heading
5572 "specify clear values for the color buffers")
5573 (heading "Parameters")
5574 (table (% (formatter (asis)))
5575 (entry (% (heading (var "red")))
5576 (itemx (var "green"))
5577 (itemx (var "blue"))
5578 (itemx (var "alpha"))
5579 (para "
5580 Specify the red, green, blue, and alpha values used when the
5581 color buffers are cleared.
5582 The initial values are all 0. ")))
5583 (heading "Description")
5584 (para (code "glClearColor")
5585 " specifies the red,
5586 green,
5587 blue,
5588 and alpha values used by "
5589 (code "glClear")
5590 " to clear the color buffers.
5591 Values specified by "
5592 (code "glClearColor")
5593 " are clamped to the range "
5594 (math "[" "0" "," "1" "]")
5595 ". ")
5596 (heading "Errors")
5597 (para (code "GL_INVALID_OPERATION")
5598 " is generated if "
5599 (code "glClearColor")
5600 "
5601 is executed between the execution of "
5602 (code "glBegin")
5603 "
5604 and the corresponding execution of "
5605 (code "glEnd")
5606 ". ")))
5607
5608 (define-gl-procedure
5609 glClearDepth
5610 "glClearDepth"
5611 (funcsynopsis
5612 (funcprototype
5613 (funcdef "void " (function "glClearDepth"))
5614 (paramdef "GLclampd " (parameter "depth"))))
5615 '(*fragment*
5616 (heading
5617 "specify the clear value for the depth buffer")
5618 (heading "Parameters")
5619 (table (% (formatter (asis)))
5620 (entry (% (heading (var "depth")))
5621 (para "
5622 Specifies the depth value used when the depth buffer is cleared. The
5623 initial value is 1. ")))
5624 (heading "Description")
5625 (para (code "glClearDepth")
5626 " specifies the depth value used by "
5627 (code "glClear")
5628 " to clear the depth buffer.
5629 Values specified by "
5630 (code "glClearDepth")
5631 " are clamped to the range "
5632 (math "[" "0" "," "1" "]")
5633 ". ")
5634 (heading "Errors")
5635 (para (code "GL_INVALID_OPERATION")
5636 " is generated if "
5637 (code "glClearDepth")
5638 "
5639 is executed between the execution of "
5640 (code "glBegin")
5641 "
5642 and the corresponding execution of "
5643 (code "glEnd")
5644 ". ")))
5645
5646 (define-gl-procedure
5647 glClearIndex
5648 "glClearIndex"
5649 (funcsynopsis
5650 (funcprototype
5651 (funcdef "void " (function "glClearIndex"))
5652 (paramdef "GLfloat " (parameter "c"))))
5653 '(*fragment*
5654 (heading
5655 "specify the clear value for the color index buffers")
5656 (heading "Parameters")
5657 (table (% (formatter (asis)))
5658 (entry (% (heading (var "c")))
5659 (para "
5660 Specifies the index used when the color index buffers are cleared.
5661 The initial value is 0. ")))
5662 (heading "Description")
5663 (para (code "glClearIndex")
5664 " specifies the index used by "
5665 (code "glClear")
5666 "
5667 to clear the color index buffers. "
5668 (var "c")
5669 " is not clamped.
5670 Rather, "
5671 (var "c")
5672 " is converted to a fixed-point value with unspecified precision
5673 to the right of the binary point.
5674 The integer part of this value is then masked with "
5675 (math "2" "^" (var "m") "-" "1")
5676 ",
5677 where "
5678 (math (var "m"))
5679 "
5680 is the number of bits in a color index stored in the frame buffer. ")
5681 (heading "Errors")
5682 (para (code "GL_INVALID_OPERATION")
5683 " is generated if "
5684 (code "glClearIndex")
5685 "
5686 is executed between the execution of "
5687 (code "glBegin")
5688 "
5689 and the corresponding execution of "
5690 (code "glEnd")
5691 ". ")))
5692
5693 (define-gl-procedure
5694 glClearStencil
5695 "glClearStencil"
5696 (funcsynopsis
5697 (funcprototype
5698 (funcdef "void " (function "glClearStencil"))
5699 (paramdef "GLint " (parameter "s"))))
5700 '(*fragment*
5701 (heading
5702 "specify the clear value for the stencil buffer")
5703 (heading "Parameters")
5704 (table (% (formatter (asis)))
5705 (entry (% (heading (var "s")))
5706 (para "
5707 Specifies the index used when the stencil buffer is cleared.
5708 The initial value is 0. ")))
5709 (heading "Description")
5710 (para (code "glClearStencil")
5711 " specifies the index used by "
5712 (code "glClear")
5713 " to clear the stencil buffer. "
5714 (var "s")
5715 " is masked with "
5716 (math "2" "^" (var "m") "-" "1")
5717 ",
5718 where "
5719 (math (var "m"))
5720 "
5721 is the number of bits in the stencil buffer. ")
5722 (heading "Errors")
5723 (para (code "GL_INVALID_OPERATION")
5724 " is generated if "
5725 (code "glClearStencil")
5726 "
5727 is executed between the execution of "
5728 (code "glBegin")
5729 "
5730 and the corresponding execution of "
5731 (code "glEnd")
5732 ". ")))
5733
5734 (define-gl-procedure
5735 glClear
5736 "glClear"
5737 (funcsynopsis
5738 (funcprototype
5739 (funcdef "void " (function "glClear"))
5740 (paramdef "GLbitfield " (parameter "mask"))))
5741 '(*fragment*
5742 (heading "clear buffers to preset values")
5743 (heading "Parameters")
5744 (table (% (formatter (asis)))
5745 (entry (% (heading (var "mask")))
5746 (para "
5747 Bitwise OR of masks that indicate the buffers to be cleared.
5748 The four masks are "
5749 (code "GL_COLOR_BUFFER_BIT")
5750 ", "
5751 (code "GL_DEPTH_BUFFER_BIT")
5752 ", "
5753 (code "GL_ACCUM_BUFFER_BIT")
5754 ", and "
5755 (code "GL_STENCIL_BUFFER_BIT")
5756 ". ")))
5757 (heading "Description")
5758 (para (code "glClear")
5759 " sets the bitplane area of the window to values previously selected
5760 by "
5761 (code "glClearColor")
5762 ", "
5763 (code "glClearIndex")
5764 ", "
5765 (code "glClearDepth")
5766 ", "
5767 (code "glClearStencil")
5768 ", and "
5769 (code "glClearAccum")
5770 ".
5771 Multiple color buffers can be cleared simultaneously by selecting
5772 more than one buffer at a time using "
5773 (code "glDrawBuffer")
5774 ". ")
5775 (para "
5776 The pixel ownership test,
5777 the scissor test,
5778 dithering, and the buffer writemasks affect the operation of "
5779 (code "glClear")
5780 ".
5781 The scissor box bounds the cleared region.
5782 Alpha function,
5783 blend function,
5784 logical operation,
5785 stenciling,
5786 texture mapping,
5787 and depth-buffering are ignored by "
5788 (code "glClear")
5789 ". ")
5790 (para (code "glClear")
5791 " takes a single argument that is the bitwise OR of several
5792 values indicating which buffer is to be cleared. ")
5793 (para "
5794 The values are as follows: ")
5795 (table (% (formatter (asis)))
5796 (entry (% (heading (code "GL_COLOR_BUFFER_BIT")))
5797 (para "
5798 Indicates the buffers currently enabled for color
5799 writing. "))
5800 (entry (% (heading (code "GL_DEPTH_BUFFER_BIT")))
5801 (para "
5802 Indicates the depth buffer. "))
5803 (entry (% (heading (code "GL_ACCUM_BUFFER_BIT")))
5804 (para "
5805 Indicates the accumulation buffer. "))
5806 (entry (% (heading (code "GL_STENCIL_BUFFER_BIT")))
5807 (para "
5808 Indicates the stencil buffer. ")))
5809 (para "
5810 The value to which each buffer is cleared depends on the setting of the
5811 clear value for that buffer. ")
5812 (heading "Errors")
5813 (para (code "GL_INVALID_VALUE")
5814 " is generated if any bit other than the four defined
5815 bits is set in "
5816 (var "mask")
5817 ". ")
5818 (para (code "GL_INVALID_OPERATION")
5819 " is generated if "
5820 (code "glClear")
5821 "
5822 is executed between the execution of "
5823 (code "glBegin")
5824 "
5825 and the corresponding execution of "
5826 (code "glEnd")
5827 ". ")))
5828
5829 (define-gl-procedure
5830 glClientActiveTexture
5831 "glClientActiveTexture"
5832 (funcsynopsis
5833 (funcprototype
5834 (funcdef
5835 "void "
5836 (function "glClientActiveTexture"))
5837 (paramdef "GLenum " (parameter "texture"))))
5838 '(*fragment*
5839 (heading "select active texture unit")
5840 (heading "Parameters")
5841 (table (% (formatter (asis)))
5842 (entry (% (heading (var "texture")))
5843 (para "
5844 Specifies which texture unit to make active. The number
5845 of texture units is implementation dependent, but must be at least
5846 two. "
5847 (var "texture")
5848 " must be one of "
5849 (code "GL_TEXTURE")
5850 (math (var "i"))
5851 ",
5852 where i ranges from 0 to the value of "
5853 (code "GL_MAX_TEXTURE_COORDS")
5854 " - 1, which is an
5855 implementation-dependent value. The initial value is "
5856 (code "GL_TEXTURE0")
5857 ". ")))
5858 (heading "Description")
5859 (para (code "glClientActiveTexture")
5860 " selects the vertex array client state parameters to be modified by "
5861 (code "glTexCoordPointer")
5862 ", and enabled or disabled with "
5863 (code "glEnableClientState")
5864 " or "
5865 (code "glDisableClientState")
5866 ", respectively,
5867 when called with a parameter of "
5868 (code "GL_TEXTURE_COORD_ARRAY")
5869 ". ")
5870 (heading "Errors")
5871 (para (code "GL_INVALID_ENUM")
5872 " is generated if "
5873 (var "texture")
5874 " is not one of "
5875 (code "GL_TEXTURE")
5876 (math (var "i"))
5877 ",
5878 where
5879 i ranges from 0 to the value of "
5880 (code "GL_MAX_TEXTURE_COORDS")
5881 " - 1. ")))
5882
5883 (define-gl-procedure
5884 glClipPlane
5885 "glClipPlane"
5886 (funcsynopsis
5887 (funcprototype
5888 (funcdef "void " (function "glClipPlane"))
5889 (paramdef "GLenum " (parameter "plane"))
5890 (paramdef
5891 "const GLdouble * "
5892 (parameter "equation"))))
5893 '(*fragment*
5894 (heading
5895 "specify a plane against which all geometry is clipped")
5896 (heading "Parameters")
5897 (table (% (formatter (asis)))
5898 (entry (% (heading (var "plane")))
5899 (para "
5900 Specifies which clipping plane is being positioned.
5901 Symbolic names of the form "
5902 (code "GL_CLIP_PLANE")
5903 (var "i")
5904 ",
5905 where "
5906 (var "i")
5907 " is an integer between 0 and "
5908 (code "GL_MAX_CLIP_PLANES")
5909 (math "-1")
5910 ",
5911 are accepted. "))
5912 (entry (% (heading (var "equation")))
5913 (para "
5914 Specifies the address of an array of four double-precision floating-point values.
5915 These values are interpreted as a plane equation. ")))
5916 (heading "Description")
5917 (para "
5918 Geometry is always clipped against the boundaries of a six-plane frustum
5919 in "
5920 (var "x")
5921 ", "
5922 (var "y")
5923 ", and "
5924 (var "z")
5925 ". "
5926 (code "glClipPlane")
5927 " allows the specification of additional planes,
5928 not necessarily perpendicular to the "
5929 (var "x")
5930 ", "
5931 (var "y")
5932 ", or "
5933 (var "z")
5934 " axis,
5935 against which all geometry is clipped.
5936 To determine the maximum number of additional clipping planes, call "
5937 (code "glGetIntegerv")
5938 " with argument "
5939 (code "GL_MAX_CLIP_PLANES")
5940 ". All
5941 implementations support at least six such clipping planes.
5942 Because the resulting clipping region is the intersection
5943 of the defined half-spaces,
5944 it is always convex. ")
5945 (para (code "glClipPlane")
5946 " specifies a half-space using a four-component plane equation.
5947 When "
5948 (code "glClipPlane")
5949 " is called, "
5950 (var "equation")
5951 " is transformed by the inverse of the modelview matrix
5952 and stored in the resulting eye coordinates.
5953 Subsequent changes to the modelview matrix have no effect on the
5954 stored plane-equation components.
5955 If the dot product of the eye coordinates of a vertex with the
5956 stored plane equation components is positive or zero,
5957 the vertex is "
5958 (var "in")
5959 " with respect to that clipping plane.
5960 Otherwise, it is "
5961 (var "out")
5962 ". ")
5963 (para "
5964 To enable and disable clipping planes, call "
5965 (code "glEnable")
5966 " and "
5967 (code "glDisable")
5968 " with the argument "
5969 (code "GL_CLIP_PLANE")
5970 (var "i")
5971 ",
5972 where "
5973 (var "i")
5974 " is the plane number. ")
5975 (para "
5976 All clipping planes are initially defined as (0, 0, 0, 0) in eye coordinates
5977 and are
5978 disabled. ")
5979 (heading "Errors")
5980 (para (code "GL_INVALID_ENUM")
5981 " is generated if "
5982 (var "plane")
5983 " is not an accepted value. ")
5984 (para (code "GL_INVALID_OPERATION")
5985 " is generated if "
5986 (code "glClipPlane")
5987 "
5988 is executed between the execution of "
5989 (code "glBegin")
5990 "
5991 and the corresponding execution of "
5992 (code "glEnd")
5993 ". ")))
5994
5995 (define-gl-procedure
5996 glColorMask
5997 "glColorMask"
5998 (funcsynopsis
5999 (funcprototype
6000 (funcdef "void " (function "glColorMask"))
6001 (paramdef "GLboolean " (parameter "red"))
6002 (paramdef "GLboolean " (parameter "green"))
6003 (paramdef "GLboolean " (parameter "blue"))
6004 (paramdef "GLboolean " (parameter "alpha"))))
6005 '(*fragment*
6006 (heading
6007 "enable and disable writing of frame buffer color components")
6008 (heading "Parameters")
6009 (table (% (formatter (asis)))
6010 (entry (% (heading (var "red")))
6011 (itemx (var "green"))
6012 (itemx (var "blue"))
6013 (itemx (var "alpha"))
6014 (para "
6015 Specify whether red, green, blue, and alpha can or cannot be written
6016 into the frame buffer.
6017 The initial values are all "
6018 (code "GL_TRUE")
6019 ",
6020 indicating that the color components can be written. ")))
6021 (heading "Description")
6022 (para (code "glColorMask")
6023 " specifies whether the individual color components in the frame buffer
6024 can or cannot be written.
6025 If "
6026 (var "red")
6027 " is "
6028 (code "GL_FALSE")
6029 ",
6030 for example,
6031 no change is made to the red component of any pixel in any of the
6032 color buffers,
6033 regardless of the drawing operation attempted. ")
6034 (para "
6035 Changes to individual bits of components cannot be controlled.
6036 Rather,
6037 changes are either enabled or disabled for entire color components. ")
6038 (heading "Errors")
6039 (para (code "GL_INVALID_OPERATION")
6040 " is generated if "
6041 (code "glColorMask")
6042 "
6043 is executed between the execution of "
6044 (code "glBegin")
6045 "
6046 and the corresponding execution of "
6047 (code "glEnd")
6048 ". ")))
6049
6050 (define-gl-procedure
6051 glColorMaterial
6052 "glColorMaterial"
6053 (funcsynopsis
6054 (funcprototype
6055 (funcdef "void " (function "glColorMaterial"))
6056 (paramdef "GLenum " (parameter "face"))
6057 (paramdef "GLenum " (parameter "mode"))))
6058 '(*fragment*
6059 (heading
6060 "cause a material color to track the current color")
6061 (heading "Parameters")
6062 (table (% (formatter (asis)))
6063 (entry (% (heading (var "face")))
6064 (para "
6065 Specifies whether front,
6066 back,
6067 or both front and back material parameters should track the current color.
6068 Accepted values are "
6069 (code "GL_FRONT")
6070 ", "
6071 (code "GL_BACK")
6072 ",
6073 and "
6074 (code "GL_FRONT_AND_BACK")
6075 ".
6076 The initial value is "
6077 (code "GL_FRONT_AND_BACK")
6078 ". "))
6079 (entry (% (heading (var "mode")))
6080 (para "
6081 Specifies which of several material parameters track the current color.
6082 Accepted values are "
6083 (code "GL_EMISSION")
6084 ", "
6085 (code "GL_AMBIENT")
6086 ", "
6087 (code "GL_DIFFUSE")
6088 ", "
6089 (code "GL_SPECULAR")
6090 ",
6091 and "
6092 (code "GL_AMBIENT_AND_DIFFUSE")
6093 ".
6094 The initial value is "
6095 (code "GL_AMBIENT_AND_DIFFUSE")
6096 ". ")))
6097 (heading "Description")
6098 (para (code "glColorMaterial")
6099 " specifies which material parameters track the current color.
6100 When "
6101 (code "GL_COLOR_MATERIAL")
6102 " is enabled,
6103 the material parameter or parameters specified by "
6104 (var "mode")
6105 ",
6106 of the material or materials specified by "
6107 (var "face")
6108 ",
6109 track the current color at all times. ")
6110 (para "
6111 To enable and disable "
6112 (code "GL_COLOR_MATERIAL")
6113 ", call "
6114 (code "glEnable")
6115 " and "
6116 (code "glDisable")
6117 " with argument "
6118 (code "GL_COLOR_MATERIAL")
6119 ". "
6120 (code "GL_COLOR_MATERIAL")
6121 " is initially disabled. ")
6122 (heading "Errors")
6123 (para (code "GL_INVALID_ENUM")
6124 " is generated if "
6125 (var "face")
6126 " or "
6127 (var "mode")
6128 " is not an
6129 accepted value. ")
6130 (para (code "GL_INVALID_OPERATION")
6131 " is generated if "
6132 (code "glColorMaterial")
6133 " is executed between
6134 the execution of "
6135 (code "glBegin")
6136 " and the corresponding execution of "
6137 (code "glEnd")
6138 ". ")))
6139
6140 (define-gl-procedure
6141 glColorPointer
6142 "glColorPointer"
6143 (funcsynopsis
6144 (funcprototype
6145 (funcdef "void " (function "glColorPointer"))
6146 (paramdef "GLint " (parameter "size"))
6147 (paramdef "GLenum " (parameter "type"))
6148 (paramdef "GLsizei " (parameter "stride"))
6149 (paramdef
6150 "const GLvoid * "
6151 (parameter "pointer"))))
6152 '(*fragment*
6153 (heading "define an array of colors")
6154 (heading "Parameters")
6155 (table (% (formatter (asis)))
6156 (entry (% (heading (var "size")))
6157 (para "
6158 Specifies the number of components per color. Must be 3 or 4.
6159 The initial value is 4. "))
6160 (entry (% (heading (var "type")))
6161 (para "
6162 Specifies the data type of each color component in the array.
6163 Symbolic constants "
6164 (code "GL_BYTE")
6165 ", "
6166 (code "GL_UNSIGNED_BYTE")
6167 ", "
6168 (code "GL_SHORT")
6169 ", "
6170 (code "GL_UNSIGNED_SHORT")
6171 ", "
6172 (code "GL_INT")
6173 ", "
6174 (code "GL_UNSIGNED_INT")
6175 ", "
6176 (code "GL_FLOAT")
6177 ",
6178 and "
6179 (code "GL_DOUBLE")
6180 "
6181 are accepted.
6182 The initial value is "
6183 (code "GL_FLOAT")
6184 ". "))
6185 (entry (% (heading (var "stride")))
6186 (para "
6187 Specifies the byte offset between consecutive colors.
6188 If "
6189 (var "stride")
6190 " is 0, the colors are understood to be
6191 tightly packed in the array. The initial value is 0. "))
6192 (entry (% (heading (var "pointer")))
6193 (para "
6194 Specifies a pointer to the first component of the first color element
6195 in the array. The initial value is 0. ")))
6196 (heading "Description")
6197 (para (code "glColorPointer")
6198 " specifies the location and data format of an array of color components
6199 to use when rendering. "
6200 (var "size")
6201 " specifies the number of components per color, and must be 3 or 4. "
6202 (var "type")
6203 " specifies the data type of each color component, and "
6204 (var "stride")
6205 "
6206 specifies the byte stride from one color to the next, allowing vertices and
6207 attributes to be packed into a single array or stored in separate arrays.
6208 (Single-array storage may be more efficient on some implementations;
6209 see "
6210 (code "glInterleavedArrays")
6211 ".) ")
6212 (para "
6213 If a non-zero named buffer object is bound to the "
6214 (code "GL_ARRAY_BUFFER")
6215 " target
6216 (see "
6217 (code "glBindBuffer")
6218 ") while a color array is
6219 specified, "
6220 (var "pointer")
6221 " is treated as a byte offset into the buffer object's data store.
6222 Also, the buffer object binding ("
6223 (code "GL_ARRAY_BUFFER_BINDING")
6224 ") is saved as color vertex array
6225 client-side state ("
6226 (code "GL_COLOR_ARRAY_BUFFER_BINDING")
6227 "). ")
6228 (para "
6229 When a color array is specified, "
6230 (var "size")
6231 ", "
6232 (var "type")
6233 ", "
6234 (var "stride")
6235 ", and "
6236 (var "pointer")
6237 " are saved as client-side
6238 state, in addition to the current vertex array buffer object binding. ")
6239 (para "
6240 To enable and disable the color array, call "
6241 (code "glEnableClientState")
6242 " and "
6243 (code "glDisableClientState")
6244 " with the argument "
6245 (code "GL_COLOR_ARRAY")
6246 ". If
6247 enabled, the color array is used
6248 when "
6249 (code "glDrawArrays")
6250 ", "
6251 (code "glMultiDrawArrays")
6252 ", "
6253 (code "glDrawElements")
6254 ", "
6255 (code "glMultiDrawElements")
6256 ", "
6257 (code "glDrawRangeElements")
6258 ", or "
6259 (code "glArrayElement")
6260 " is called. ")
6261 (heading "Errors")
6262 (para (code "GL_INVALID_VALUE")
6263 " is generated if "
6264 (var "size")
6265 " is not 3 or 4. ")
6266 (para (code "GL_INVALID_ENUM")
6267 " is generated if "
6268 (var "type")
6269 " is not an accepted value. ")
6270 (para (code "GL_INVALID_VALUE")
6271 " is generated if "
6272 (var "stride")
6273 " is negative. ")))
6274
6275 (define-gl-procedure
6276 glColorSubTable
6277 "glColorSubTable"
6278 (funcsynopsis
6279 (funcprototype
6280 (funcdef "void " (function "glColorSubTable"))
6281 (paramdef "GLenum " (parameter "target"))
6282 (paramdef "GLsizei " (parameter "start"))
6283 (paramdef "GLsizei " (parameter "count"))
6284 (paramdef "GLenum " (parameter "format"))
6285 (paramdef "GLenum " (parameter "type"))
6286 (paramdef "const GLvoid * " (parameter "data"))))
6287 '(*fragment*
6288 (heading "respecify a portion of a color table")
6289 (heading "Parameters")
6290 (table (% (formatter (asis)))
6291 (entry (% (heading (var "target")))
6292 (para "
6293 Must be one of "
6294 (code "GL_COLOR_TABLE")
6295 ", "
6296 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
6297 ", or "
6298 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
6299 ". "))
6300 (entry (% (heading (var "start")))
6301 (para "
6302 The starting index of the portion of the color table to be replaced. "))
6303 (entry (% (heading (var "count")))
6304 (para "
6305 The number of table entries to replace. "))
6306 (entry (% (heading (var "format")))
6307 (para "
6308 The format of the pixel data in "
6309 (var "data")
6310 ".
6311 The allowable values are "
6312 (code "GL_RED")
6313 ", "
6314 (code "GL_GREEN")
6315 ", "
6316 (code "GL_BLUE")
6317 ", "
6318 (code "GL_ALPHA")
6319 ", "
6320 (code "GL_LUMINANCE")
6321 ", "
6322 (code "GL_LUMINANCE_ALPHA")
6323 ", "
6324 (code "GL_RGB")
6325 ", "
6326 (code "GL_BGR")
6327 ", "
6328 (code "GL_RGBA")
6329 ", and "
6330 (code "GL_BGRA")
6331 ". "))
6332 (entry (% (heading (var "type")))
6333 (para "
6334 The type of the pixel data in "
6335 (var "data")
6336 ".
6337 The allowable values are "
6338 (code "GL_UNSIGNED_BYTE")
6339 ", "
6340 (code "GL_BYTE")
6341 ", "
6342 (code "GL_UNSIGNED_SHORT")
6343 ", "
6344 (code "GL_SHORT")
6345 ", "
6346 (code "GL_UNSIGNED_INT")
6347 ", "
6348 (code "GL_INT")
6349 ", "
6350 (code "GL_FLOAT")
6351 ", "
6352 (code "GL_UNSIGNED_BYTE_3_3_2")
6353 ", "
6354 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
6355 ", "
6356 (code "GL_UNSIGNED_SHORT_5_6_5")
6357 ", "
6358 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
6359 ", "
6360 (code "GL_UNSIGNED_SHORT_4_4_4_4")
6361 ", "
6362 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
6363 ", "
6364 (code "GL_UNSIGNED_SHORT_5_5_5_1")
6365 ", "
6366 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
6367 ", "
6368 (code "GL_UNSIGNED_INT_8_8_8_8")
6369 ", "
6370 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
6371 ", "
6372 (code "GL_UNSIGNED_INT_10_10_10_2")
6373 ", and "
6374 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
6375 ". "))
6376 (entry (% (heading (var "data")))
6377 (para "
6378 Pointer to a one-dimensional array of pixel data that is processed to
6379 replace the specified region of the color table. ")))
6380 (heading "Description")
6381 (para (code "glColorSubTable")
6382 " is used to respecify a contiguous portion of a color table previously
6383 defined using "
6384 (code "glColorTable")
6385 ". The pixels referenced by "
6386 (var "data")
6387 " replace the
6388 portion of the existing table from indices "
6389 (var "start")
6390 " to "
6391 (math (var "start") "+" (var "count") "-" "1")
6392 ",
6393 inclusive. This region may not include any
6394 entries outside the range of the color table as it was originally specified.
6395 It is not an error to specify a subtexture with width of 0, but such a
6396 specification has no effect. ")
6397 (para "
6398 If a non-zero named buffer object is bound to the "
6399 (code "GL_PIXEL_UNPACK_BUFFER")
6400 " target
6401 (see "
6402 (code "glBindBuffer")
6403 ") while a portion of a color table is
6404 respecified, "
6405 (var "data")
6406 " is treated as a byte offset into the buffer object's data store. ")
6407 (heading "Errors")
6408 (para (code "GL_INVALID_ENUM")
6409 " is generated if "
6410 (var "target")
6411 " is not one of the allowable
6412 values. ")
6413 (para (code "GL_INVALID_ENUM")
6414 " is generated if "
6415 (var "format")
6416 " is not one of the allowable
6417 values. ")
6418 (para (code "GL_INVALID_ENUM")
6419 " is generated if "
6420 (var "type")
6421 " is not one of the allowable
6422 values. ")
6423 (para (code "GL_INVALID_VALUE")
6424 " is generated if "
6425 (math (var "start")
6426 "+"
6427 (var "count")
6428 ">"
6429 (var "width"))
6430 ". ")
6431 (para (code "GL_INVALID_OPERATION")
6432 " is generated if a non-zero buffer object name is bound to the "
6433 (code "GL_PIXEL_UNPACK_BUFFER")
6434 " target and the buffer object's data store is currently mapped. ")
6435 (para (code "GL_INVALID_OPERATION")
6436 " is generated if a non-zero buffer object name is bound to the "
6437 (code "GL_PIXEL_UNPACK_BUFFER")
6438 " target and the data would be unpacked from the buffer
6439 object such that the memory reads required would exceed the data store size. ")
6440 (para (code "GL_INVALID_OPERATION")
6441 " is generated if a non-zero buffer object name is bound to the "
6442 (code "GL_PIXEL_UNPACK_BUFFER")
6443 " target and "
6444 (var "data")
6445 " is not evenly divisible
6446 into the number of bytes needed to store in memory a datum indicated by "
6447 (var "type")
6448 ". ")
6449 (para (code "GL_INVALID_OPERATION")
6450 " is generated if "
6451 (code "glColorSubTable")
6452 " is executed
6453 between the execution of "
6454 (code "glBegin")
6455 " and the corresponding
6456 execution of "
6457 (code "glEnd")
6458 ". ")))
6459
6460 (define-gl-procedure
6461 glColorTableParameter
6462 "glColorTableParameter"
6463 (funcsynopsis
6464 (funcprototype
6465 (funcdef
6466 "void "
6467 (function "glColorTableParameterfv"))
6468 (paramdef "GLenum " (parameter "target"))
6469 (paramdef "GLenum " (parameter "pname"))
6470 (paramdef
6471 "const GLfloat * "
6472 (parameter "params"))))
6473 '(*fragment*
6474 (heading "set color lookup table parameters")
6475 (heading "Parameters")
6476 (table (% (formatter (asis)))
6477 (entry (% (heading (var "target")))
6478 (para "
6479 The target color table.
6480 Must be "
6481 (code "GL_COLOR_TABLE")
6482 ", "
6483 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
6484 ", or "
6485 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
6486 ". "))
6487 (entry (% (heading (var "pname")))
6488 (para "
6489 The symbolic name of a texture color lookup table parameter.
6490 Must be one of "
6491 (code "GL_COLOR_TABLE_SCALE")
6492 " or "
6493 (code "GL_COLOR_TABLE_BIAS")
6494 ". "))
6495 (entry (% (heading (var "params")))
6496 (para "
6497 A pointer to an array where the values of the parameters are stored. ")))
6498 (heading "Description")
6499 (para (code "glColorTableParameter")
6500 " is used to specify the scale factors and bias terms applied to
6501 color components when they are loaded into a color table. "
6502 (var "target")
6503 "
6504 indicates which color table the scale and bias terms apply to; it
6505 must be set to "
6506 (code "GL_COLOR_TABLE")
6507 ", "
6508 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
6509 ", or "
6510 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
6511 ". ")
6512 (para (var "pname")
6513 " must be "
6514 (code "GL_COLOR_TABLE_SCALE")
6515 " to set the
6516 scale factors.
6517 In this case, "
6518 (var "params")
6519 " points to an array of four values, which are
6520 the scale factors for red, green, blue, and alpha, in that order. ")
6521 (para (var "pname")
6522 " must be "
6523 (code "GL_COLOR_TABLE_BIAS")
6524 " to set the
6525 bias terms. In this case, "
6526 (var "params")
6527 " points to an array of four values, which are the bias
6528 terms for red, green, blue, and alpha, in that order. ")
6529 (para "
6530 The color tables themselves are specified by
6531 calling "
6532 (code "glColorTable")
6533 ". ")
6534 (heading "Errors")
6535 (para (code "GL_INVALID_ENUM")
6536 " is generated if "
6537 (var "target")
6538 " or "
6539 (var "pname")
6540 " is not
6541 an acceptable value. ")
6542 (para (code "GL_INVALID_OPERATION")
6543 " is generated if "
6544 (code "glColorTableParameter")
6545 " is executed
6546 between the execution of "
6547 (code "glBegin")
6548 " and the corresponding
6549 execution of "
6550 (code "glEnd")
6551 ". ")))
6552
6553 (define-gl-procedure
6554 glColorTable
6555 "glColorTable"
6556 (funcsynopsis
6557 (funcprototype
6558 (funcdef "void " (function "glColorTable"))
6559 (paramdef "GLenum " (parameter "target"))
6560 (paramdef "GLenum " (parameter "internalformat"))
6561 (paramdef "GLsizei " (parameter "width"))
6562 (paramdef "GLenum " (parameter "format"))
6563 (paramdef "GLenum " (parameter "type"))
6564 (paramdef "const GLvoid * " (parameter "data"))))
6565 '(*fragment*
6566 (heading "define a color lookup table")
6567 (heading "Parameters")
6568 (table (% (formatter (asis)))
6569 (entry (% (heading (var "target")))
6570 (para "
6571 Must be one of "
6572 (code "GL_COLOR_TABLE")
6573 ", "
6574 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
6575 ", "
6576 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
6577 ", "
6578 (code "GL_PROXY_COLOR_TABLE")
6579 ", "
6580 (code "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE")
6581 ",
6582 or "
6583 (code "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE")
6584 ". "))
6585 (entry (% (heading (var "internalformat")))
6586 (para "
6587 The internal format of the color table.
6588 The allowable values are "
6589 (code "GL_ALPHA")
6590 ", "
6591 (code "GL_ALPHA4")
6592 ", "
6593 (code "GL_ALPHA8")
6594 ", "
6595 (code "GL_ALPHA12")
6596 ", "
6597 (code "GL_ALPHA16")
6598 ", "
6599 (code "GL_LUMINANCE")
6600 ", "
6601 (code "GL_LUMINANCE4")
6602 ", "
6603 (code "GL_LUMINANCE8")
6604 ", "
6605 (code "GL_LUMINANCE12")
6606 ", "
6607 (code "GL_LUMINANCE16")
6608 ", "
6609 (code "GL_LUMINANCE_ALPHA")
6610 ", "
6611 (code "GL_LUMINANCE4_ALPHA4")
6612 ", "
6613 (code "GL_LUMINANCE6_ALPHA2")
6614 ", "
6615 (code "GL_LUMINANCE8_ALPHA8")
6616 ", "
6617 (code "GL_LUMINANCE12_ALPHA4")
6618 ", "
6619 (code "GL_LUMINANCE12_ALPHA12")
6620 ", "
6621 (code "GL_LUMINANCE16_ALPHA16")
6622 ", "
6623 (code "GL_INTENSITY")
6624 ", "
6625 (code "GL_INTENSITY4")
6626 ", "
6627 (code "GL_INTENSITY8")
6628 ", "
6629 (code "GL_INTENSITY12")
6630 ", "
6631 (code "GL_INTENSITY16")
6632 ", "
6633 (code "GL_R3_G3_B2")
6634 ", "
6635 (code "GL_RGB")
6636 ", "
6637 (code "GL_RGB4")
6638 ", "
6639 (code "GL_RGB5")
6640 ", "
6641 (code "GL_RGB8")
6642 ", "
6643 (code "GL_RGB10")
6644 ", "
6645 (code "GL_RGB12")
6646 ", "
6647 (code "GL_RGB16")
6648 ", "
6649 (code "GL_RGBA")
6650 ", "
6651 (code "GL_RGBA2")
6652 ", "
6653 (code "GL_RGBA4")
6654 ", "
6655 (code "GL_RGB5_A1")
6656 ", "
6657 (code "GL_RGBA8")
6658 ", "
6659 (code "GL_RGB10_A2")
6660 ", "
6661 (code "GL_RGBA12")
6662 ", and "
6663 (code "GL_RGBA16")
6664 ". "))
6665 (entry (% (heading (var "width")))
6666 (para "
6667 The number of entries in the color lookup table specified by "
6668 (var "data")
6669 ". "))
6670 (entry (% (heading (var "format")))
6671 (para "
6672 The format of the pixel data in "
6673 (var "data")
6674 ".
6675 The allowable values are "
6676 (code "GL_RED")
6677 ", "
6678 (code "GL_GREEN")
6679 ", "
6680 (code "GL_BLUE")
6681 ", "
6682 (code "GL_ALPHA")
6683 ", "
6684 (code "GL_LUMINANCE")
6685 ", "
6686 (code "GL_LUMINANCE_ALPHA")
6687 ", "
6688 (code "GL_RGB")
6689 ", "
6690 (code "GL_BGR")
6691 ", "
6692 (code "GL_RGBA")
6693 ", and "
6694 (code "GL_BGRA")
6695 ". "))
6696 (entry (% (heading (var "type")))
6697 (para "
6698 The type of the pixel data in "
6699 (var "data")
6700 ".
6701 The allowable values are "
6702 (code "GL_UNSIGNED_BYTE")
6703 ", "
6704 (code "GL_BYTE")
6705 ", "
6706 (code "GL_UNSIGNED_SHORT")
6707 ", "
6708 (code "GL_SHORT")
6709 ", "
6710 (code "GL_UNSIGNED_INT")
6711 ", "
6712 (code "GL_INT")
6713 ", "
6714 (code "GL_FLOAT")
6715 ", "
6716 (code "GL_UNSIGNED_BYTE_3_3_2")
6717 ", "
6718 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
6719 ", "
6720 (code "GL_UNSIGNED_SHORT_5_6_5")
6721 ", "
6722 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
6723 ", "
6724 (code "GL_UNSIGNED_SHORT_4_4_4_4")
6725 ", "
6726 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
6727 ", "
6728 (code "GL_UNSIGNED_SHORT_5_5_5_1")
6729 ", "
6730 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
6731 ", "
6732 (code "GL_UNSIGNED_INT_8_8_8_8")
6733 ", "
6734 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
6735 ", "
6736 (code "GL_UNSIGNED_INT_10_10_10_2")
6737 ", and "
6738 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
6739 ". "))
6740 (entry (% (heading (var "data")))
6741 (para "
6742 Pointer to a one-dimensional array of pixel data that is processed to
6743 build the color table. ")))
6744 (heading "Description")
6745 (para (code "glColorTable")
6746 " may be used in two ways:
6747 to test the actual size and color resolution of a lookup table
6748 given a particular set of parameters,
6749 or to load the contents of a color lookup
6750 table.
6751 Use the targets "
6752 (code "GL_PROXY_*")
6753 " for the first case
6754 and the other targets for the second case. ")
6755 (para "
6756 If a non-zero named buffer object is bound to the "
6757 (code "GL_PIXEL_UNPACK_BUFFER")
6758 " target
6759 (see "
6760 (code "glBindBuffer")
6761 ") while a color table is
6762 specified, "
6763 (var "data")
6764 " is treated as a byte offset into the buffer object's data store. ")
6765 (para "
6766 If "
6767 (var "target")
6768 " is "
6769 (code "GL_COLOR_TABLE")
6770 ", "
6771 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
6772 ",
6773 or "
6774 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
6775 ", "
6776 (code "glColorTable")
6777 " builds a color lookup table from an array of pixels.
6778 The pixel array specified by "
6779 (var "width")
6780 ", "
6781 (var "format")
6782 ", "
6783 (var "type")
6784 ", and "
6785 (var "data")
6786 "
6787 is extracted from memory and
6788 processed just as if "
6789 (code "glDrawPixels")
6790 " were called, but processing
6791 stops after the final expansion to RGBA is completed. ")
6792 (para "
6793 The four scale parameters and the four bias parameters that are defined
6794 for the table are then used to scale and bias the R, G, B, and A components
6795 of each pixel.
6796 (Use "
6797 (code "glColorTableParameter")
6798 " to set these scale and bias
6799 parameters.) ")
6800 (para "
6801 Next, the R, G, B, and A values are clamped to the range "
6802 (math "[" "0" "," "1" "]")
6803 ".
6804 Each pixel is then converted to the internal format specified by "
6805 (var "internalformat")
6806 ".
6807 This conversion simply maps the component values of the pixel (R, G, B,
6808 and A) to the values included in the internal format (red, green, blue,
6809 alpha, luminance, and intensity). The mapping is as follows: ")
6810 (para)
6811 (table (% (formatter (asis)))
6812 (entry (% (heading (strong "Internal Format")))
6813 (para (strong "Red")
6814 ", "
6815 (strong "Green")
6816 ", "
6817 (strong "Blue")
6818 ", "
6819 (strong "Alpha")
6820 ", "
6821 (strong "Luminance")
6822 ", "
6823 (strong "Intensity")))
6824 (entry (% (heading (code "GL_ALPHA")))
6825 (para ", " ", " ", " "
6826 A " ", " ", "))
6827 (entry (% (heading (code "GL_LUMINANCE")))
6828 (para ", " ", " ", " ", " "
6829 R " ", "))
6830 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
6831 (para ", " ", " ", " "
6832 A " ", " "
6833 R " ", "))
6834 (entry (% (heading (code "GL_INTENSITY")))
6835 (para ", " ", " ", " ", " ", " "
6836 R "))
6837 (entry (% (heading (code "GL_RGB")))
6838 (para "
6839 R " ", " "
6840 G " ", " "
6841 B " ", " ", " ", "))
6842 (entry (% (heading (code "GL_RGBA")))
6843 (para "
6844 R "
6845 ", "
6846 "
6847 G "
6848 ", "
6849 "
6850 B "
6851 ", "
6852 "
6853 A "
6854 ", "
6855 ", ")))
6856 (para "
6857 Finally, the red, green, blue, alpha, luminance, and/or intensity components of
6858 the resulting pixels are stored in the color table.
6859 They form a one-dimensional table with indices in the range "
6860 (math "[" "0" "," (var "width") "-" "1" "]")
6861 ". ")
6862 (para "
6863 If "
6864 (var "target")
6865 " is "
6866 (code "GL_PROXY_*")
6867 ", "
6868 (code "glColorTable")
6869 " recomputes and stores the values of the proxy color table's state
6870 variables "
6871 (code "GL_COLOR_TABLE_FORMAT")
6872 ", "
6873 (code "GL_COLOR_TABLE_WIDTH")
6874 ", "
6875 (code "GL_COLOR_TABLE_RED_SIZE")
6876 ", "
6877 (code "GL_COLOR_TABLE_GREEN_SIZE")
6878 ", "
6879 (code "GL_COLOR_TABLE_BLUE_SIZE")
6880 ", "
6881 (code "GL_COLOR_TABLE_ALPHA_SIZE")
6882 ", "
6883 (code "GL_COLOR_TABLE_LUMINANCE_SIZE")
6884 ", and "
6885 (code "GL_COLOR_TABLE_INTENSITY_SIZE")
6886 ".
6887 There is no effect on the image or state of any actual color table.
6888 If the specified color table is too large to be supported, then all the
6889 proxy state variables listed above are set to zero.
6890 Otherwise, the color table could be supported by "
6891 (code "glColorTable")
6892 "
6893 using the corresponding non-proxy target,
6894 and the proxy state variables are set as if that target were being defined. ")
6895 (para "
6896 The proxy state variables can be retrieved by calling "
6897 (code "glGetColorTableParameter")
6898 " with a target of "
6899 (code "GL_PROXY_*")
6900 ".
6901 This allows the application to decide if a particular "
6902 (code "glColorTable")
6903 "
6904 command would succeed, and to determine what the resulting color table
6905 attributes would be. ")
6906 (para "
6907 If a color table is enabled, and its width is non-zero, then its
6908 contents are used to replace a subset of the components of each RGBA
6909 pixel group, based on the internal format of the table. ")
6910 (para "
6911 Each pixel group has color components (R, G, B, A)
6912 that are in the range "
6913 (math "[" "0.0" "," "1.0" "]")
6914 ".
6915 The color components are rescaled to
6916 the size of the color lookup table to form an index.
6917 Then a subset of the components based on the internal format of the table are
6918 replaced by the table entry selected by that index.
6919 If the color components and contents of the table are represented as follows: ")
6920 (para)
6921 (table (% (formatter (asis)))
6922 (entry (% (heading (strong "Representation")))
6923 (para (strong "Meaning")))
6924 (entry (% (heading (code "r")))
6925 (para "
6926 Table index computed from " (code "R")))
6927 (entry (% (heading (code "g")))
6928 (para "
6929 Table index computed from " (code "G")))
6930 (entry (% (heading (code "b")))
6931 (para "
6932 Table index computed from " (code "B")))
6933 (entry (% (heading (code "a")))
6934 (para "
6935 Table index computed from " (code "A")))
6936 (entry (% (heading (code "L[i]")))
6937 (para "
6938 Luminance value at table index "
6939 (code "i")))
6940 (entry (% (heading (code "I[i]")))
6941 (para "
6942 Intensity value at table index "
6943 (code "i")))
6944 (entry (% (heading (code "R[i]")))
6945 (para "
6946 Red value at table index " (code "i")))
6947 (entry (% (heading (code "G[i]")))
6948 (para "
6949 Green value at table index " (code "i")))
6950 (entry (% (heading (code "B[i]")))
6951 (para "
6952 Blue value at table index " (code "i")))
6953 (entry (% (heading (code "A[i]")))
6954 (para "
6955 Alpha value at table index " (code "i"))))
6956 (para "
6957 then the result of color table lookup is as follows: ")
6958 (para)
6959 (table (% (formatter (asis)))
6960 (entry (% (heading (strong)))
6961 (para (strong "Resulting Texture Components")))
6962 (entry (% (heading (strong "Table Internal Format")))
6963 (para (strong "R")
6964 ", "
6965 (strong "G")
6966 ", "
6967 (strong "B")
6968 ", "
6969 (strong "A")))
6970 (entry (% (heading (code "GL_ALPHA")))
6971 (para (code "R")
6972 ", "
6973 (code "G")
6974 ", "
6975 (code "B")
6976 ", "
6977 (code "A[a]")))
6978 (entry (% (heading (code "GL_LUMINANCE")))
6979 (para (code "L[r]")
6980 ", "
6981 (code "L[g]")
6982 ", "
6983 (code "L[b]")
6984 ", "
6985 (code "At")))
6986 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
6987 (para (code "L[r]")
6988 ", "
6989 (code "L[g]")
6990 ", "
6991 (code "L[b]")
6992 ", "
6993 (code "A[a]")))
6994 (entry (% (heading (code "GL_INTENSITY")))
6995 (para (code "I[r]")
6996 ", "
6997 (code "I[g]")
6998 ", "
6999 (code "I[b]")
7000 ", "
7001 (code "I[a]")))
7002 (entry (% (heading (code "GL_RGB")))
7003 (para (code "R[r]")
7004 ", "
7005 (code "G[g]")
7006 ", "
7007 (code "B[b]")
7008 ", "
7009 (code "A")))
7010 (entry (% (heading (code "GL_RGBA")))
7011 (para (code "R[r]")
7012 ", "
7013 (code "G[g]")
7014 ", "
7015 (code "B[b]")
7016 ", "
7017 (code "A[a]"))))
7018 (para "
7019 When "
7020 (code "GL_COLOR_TABLE")
7021 " is enabled, the colors resulting from
7022 the pixel map operation (if it is enabled) are mapped
7023 by the color lookup table before being passed to the convolution
7024 operation. The colors resulting from the convolution operation
7025 are modified by the post convolution color lookup table when "
7026 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
7027 "
7028 is enabled. These modified colors are then sent to the color matrix operation.
7029 Finally, if "
7030 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
7031 "
7032 is enabled, the colors resulting from the color matrix operation
7033 are mapped by the post color matrix color lookup table before being
7034 used by the histogram operation. ")
7035 (para)
7036 (heading "Errors")
7037 (para (code "GL_INVALID_ENUM")
7038 " is generated if "
7039 (var "target")
7040 " is not one of the allowable
7041 values. ")
7042 (para (code "GL_INVALID_ENUM")
7043 " is generated if "
7044 (var "internalformat")
7045 " is not one of the
7046 allowable values. ")
7047 (para (code "GL_INVALID_ENUM")
7048 " is generated if "
7049 (var "format")
7050 " is not one of the allowable
7051 values. ")
7052 (para (code "GL_INVALID_ENUM")
7053 " is generated if "
7054 (var "type")
7055 " is not one of the allowable
7056 values. ")
7057 (para (code "GL_INVALID_VALUE")
7058 " is generated if "
7059 (var "width")
7060 " is less than zero. ")
7061 (para (code "GL_TABLE_TOO_LARGE")
7062 " is generated if the requested color table
7063 is too large to be supported by the implementation, and "
7064 (var "target")
7065 " is
7066 not a "
7067 (code "GL_PROXY_*")
7068 " target. ")
7069 (para (code "GL_INVALID_OPERATION")
7070 " is generated if a non-zero buffer object name is bound to the "
7071 (code "GL_PIXEL_UNPACK_BUFFER")
7072 " target and the buffer object's data store is currently mapped. ")
7073 (para (code "GL_INVALID_OPERATION")
7074 " is generated if a non-zero buffer object name is bound to the "
7075 (code "GL_PIXEL_UNPACK_BUFFER")
7076 " target and the data would be unpacked from the buffer
7077 object such that the memory reads required would exceed the data store size. ")
7078 (para (code "GL_INVALID_OPERATION")
7079 " is generated if a non-zero buffer object name is bound to the "
7080 (code "GL_PIXEL_UNPACK_BUFFER")
7081 " target and "
7082 (var "data")
7083 " is not evenly divisible
7084 into the number of bytes needed to store in memory a datum indicated by "
7085 (var "type")
7086 ". ")
7087 (para (code "GL_INVALID_OPERATION")
7088 " is generated if "
7089 (code "glColorTable")
7090 " is executed
7091 between the execution of "
7092 (code "glBegin")
7093 " and the corresponding
7094 execution of "
7095 (code "glEnd")
7096 ". ")))
7097
7098 (define-gl-procedure
7099 glColor
7100 "glColor"
7101 (funcsynopsis
7102 (funcprototype
7103 (funcdef "void " (function "glColor3b"))
7104 (paramdef "GLbyte " (parameter "red"))
7105 (paramdef "GLbyte " (parameter "green"))
7106 (paramdef "GLbyte " (parameter "blue"))))
7107 '(*fragment*
7108 (heading "set the current color")
7109 (heading "Parameters")
7110 (table (% (formatter (asis)))
7111 (entry (% (heading (var "red")))
7112 (itemx (var "green"))
7113 (itemx (var "blue"))
7114 (para "
7115 Specify new red, green, and blue values for the current color. "))
7116 (entry (% (heading (var "alpha")))
7117 (para "
7118 Specifies a new alpha value for the current color.
7119 Included only in the four-argument "
7120 (code "glColor4")
7121 " commands. ")))
7122 (heading "Description")
7123 (para "
7124 The GL stores both a current single-valued color index
7125 and a current four-valued RGBA color. "
7126 (code "glColor")
7127 " sets a new four-valued RGBA color. "
7128 (code "glColor")
7129 " has two major variants: "
7130 (code "glColor3")
7131 " and "
7132 (code "glColor4")
7133 ". "
7134 (code "glColor3")
7135 " variants specify new red,
7136 green,
7137 and blue values explicitly
7138 and set the current alpha value to 1.0 (full intensity) implicitly. "
7139 (code "glColor4")
7140 " variants specify all four color components explicitly. ")
7141 (para (code "glColor3b")
7142 ", "
7143 (code "glColor4b")
7144 ", "
7145 (code "glColor3s")
7146 ", "
7147 (code "glColor4s")
7148 ", "
7149 (code "glColor3i")
7150 ", and "
7151 (code "glColor4i")
7152 " take
7153 three or four signed byte, short, or long integers as arguments.
7154 When "
7155 (strong "v")
7156 " is appended to the name,
7157 the color commands can take a pointer to an array of such values. ")
7158 (para "
7159 Current color values are stored in floating-point format,
7160 with unspecified mantissa and exponent sizes.
7161 Unsigned integer color components,
7162 when specified,
7163 are linearly mapped to floating-point values such that the largest
7164 representable value maps to 1.0 (full intensity),
7165 and 0 maps to 0.0 (zero intensity).
7166 Signed integer color components,
7167 when specified,
7168 are linearly mapped to floating-point values such that the most positive
7169 representable value maps to 1.0,
7170 and the most negative representable value maps to "
7171 (math "-1.0")
7172 ".
7173 (Note that
7174 this mapping does not convert 0 precisely to 0.0.)
7175 Floating-point values are mapped directly. ")
7176 (para "
7177 Neither floating-point nor signed integer values are clamped
7178 to the range "
7179 (math "[" "0" "," "1" "]")
7180 "
7181 before the current color is updated.
7182 However,
7183 color components are clamped to this range before they are interpolated
7184 or written into a color buffer. ")))
7185
7186 (define-gl-procedure
7187 glCompileShader
7188 "glCompileShader"
7189 (funcsynopsis
7190 (funcprototype
7191 (funcdef "void " (function "glCompileShader"))
7192 (paramdef "GLuint " (parameter "shader"))))
7193 '(*fragment*
7194 (heading "Compiles a shader object")
7195 (heading "Parameters")
7196 (table (% (formatter (asis)))
7197 (entry (% (heading (var "shader")))
7198 (para "Specifies the shader object to be
7199 \t\t compiled.")))
7200 (heading "Description")
7201 (para (code "glCompileShader")
7202 " compiles the source
7203 \tcode strings that have been stored in the shader object
7204 \tspecified by "
7205 (var "shader")
7206 ".")
7207 (para "The compilation status will be stored as part of the
7208 \tshader object's state. This value will be set to\t"
7209 (code "GL_TRUE")
7210 " if the shader was compiled without
7211 \terrors and is ready for use, and "
7212 (code "GL_FALSE")
7213 "
7214 otherwise. It can be queried by calling\t"
7215 (code "glGetShader")
7216 "
7217 with arguments "
7218 (var "shader")
7219 " and\t"
7220 (code "GL_COMPILE_STATUS")
7221 ".")
7222 (para "Compilation of a shader can fail for a number of reasons
7223 \tas specified by the OpenGL Shading Language Specification.
7224 \tWhether or not the compilation was successful, information about
7225 \tthe compilation can be obtained from the shader object's
7226 \tinformation log by calling\t"
7227 (code "glGetShaderInfoLog")
7228 ".")
7229 (heading "Errors")
7230 (para (code "GL_INVALID_VALUE")
7231 " is generated if\t"
7232 (var "shader")
7233 " is not a value generated by
7234 \tOpenGL.")
7235 (para (code "GL_INVALID_OPERATION")
7236 " is generated if\t"
7237 (var "shader")
7238 " is not a shader object.")
7239 (para (code "GL_INVALID_OPERATION")
7240 " is generated if\t"
7241 (code "glCompileShader")
7242 " is executed between the
7243 \texecution of\t"
7244 (code "glBegin")
7245 "
7246 and the corresponding execution of\t"
7247 (code "glEnd")
7248 ".")))
7249
7250 (define-gl-procedure
7251 glCompressedTexImage1D
7252 "glCompressedTexImage1D"
7253 (funcsynopsis
7254 (funcprototype
7255 (funcdef
7256 "void "
7257 (function "glCompressedTexImage1D"))
7258 (paramdef "GLenum " (parameter "target"))
7259 (paramdef "GLint " (parameter "level"))
7260 (paramdef "GLenum " (parameter "internalformat"))
7261 (paramdef "GLsizei " (parameter "width"))
7262 (paramdef "GLint " (parameter "border"))
7263 (paramdef "GLsizei " (parameter "imageSize"))
7264 (paramdef "const GLvoid * " (parameter "data"))))
7265 '(*fragment*
7266 (heading
7267 "specify a one-dimensional texture image in a compressed format")
7268 (heading "Parameters")
7269 (table (% (formatter (asis)))
7270 (entry (% (heading (var "target")))
7271 (para "
7272 Specifies the target texture.
7273 Must be "
7274 (code "GL_TEXTURE_1D")
7275 " or "
7276 (code "GL_PROXY_TEXTURE_1D")
7277 ". "))
7278 (entry (% (heading (var "level")))
7279 (para "
7280 Specifies the level-of-detail number.
7281 Level 0 is the base image level.
7282 Level "
7283 (var "n")
7284 " is the "
7285 (var "n")
7286 "th mipmap reduction image. "))
7287 (entry (% (heading (var "internalformat")))
7288 (para "
7289 Specifies the format of the compressed image data stored at address "
7290 (var "data")
7291 ". "))
7292 (entry (% (heading (var "width")))
7293 (para "
7294 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
7295 (math "2"
7296 "^"
7297 (var "n")
7298 "+"
7299 "2"
7300 "\u2061"
7301 "("
7302 (var "border")
7303 ","
7304 ")")
7305 "
7306 for some integer "
7307 (math (var "n"))
7308 ".
7309 All implementations support texture images that are at least 64 texels wide. The height of the 1D texture image is 1. "))
7310 (entry (% (heading (var "border")))
7311 (para "
7312 Specifies the width of the border. Must be either 0 or 1. "))
7313 (entry (% (heading (var "imageSize")))
7314 (para "
7315 Specifies the number of unsigned bytes of image data starting at the address specified by "
7316 (var "data")
7317 ". "))
7318 (entry (% (heading (var "data")))
7319 (para "
7320 Specifies a pointer to the compressed image data in memory. ")))
7321 (heading "Description")
7322 (para "
7323 Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call "
7324 (code "glEnable")
7325 " and "
7326 (code "glDisable")
7327 " with argument "
7328 (code "GL_TEXTURE_1D")
7329 ". ")
7330 (para (code "glCompressedTexImage1D")
7331 " loads a previously defined, and retrieved, compressed one-dimensional texture image if "
7332 (var "target")
7333 " is "
7334 (code "GL_TEXTURE_1D")
7335 " (see "
7336 (code "glTexImage1D")
7337 "). ")
7338 (para "
7339 If "
7340 (var "target")
7341 " is "
7342 (code "GL_PROXY_TEXTURE_1D")
7343 ", no data is read from "
7344 (var "data")
7345 ", but
7346 all of the texture image state is recalculated, checked for consistency, and checked against the implementation's capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see "
7347 (code "glGetError")
7348 "). To query for an entire mipmap array, use an image array level greater than or equal to 1. ")
7349 (para (var "internalformat")
7350 " must be extension-specified compressed-texture format. When a texture is loaded with "
7351 (code "glTexImage1D")
7352 " using a generic compressed texture format (e.g., "
7353 (code "GL_COMPRESSED_RGB")
7354 ") the GL selects from one of
7355 its extensions supporting compressed textures. In order to load the
7356 compressed texture image using "
7357 (code "glCompressedTexImage1D")
7358 ", query the compressed texture image's size and format using "
7359 (code "glGetTexLevelParameter")
7360 ". ")
7361 (para "
7362 If a non-zero named buffer object is bound to the "
7363 (code "GL_PIXEL_UNPACK_BUFFER")
7364 " target
7365 (see "
7366 (code "glBindBuffer")
7367 ") while a texture image is
7368 specified, "
7369 (var "data")
7370 " is treated as a byte offset into the buffer object's data store. ")
7371 (heading "Errors")
7372 (para (code "GL_INVALID_ENUM")
7373 " is generated if "
7374 (var "internalformat")
7375 " is one of the generic compressed internal formats: "
7376 (code "GL_COMPRESSED_ALPHA")
7377 ", "
7378 (code "GL_COMPRESSED_LUMINANCE")
7379 ", "
7380 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
7381 ", "
7382 (code "GL_COMPRESSED_INTENSITY")
7383 ", "
7384 (code "GL_COMPRESSED_RGB")
7385 ", or "
7386 (code "GL_COMPRESSED_RGBA")
7387 ". ")
7388 (para (code "GL_INVALID_VALUE")
7389 " is generated if "
7390 (var "imageSize")
7391 " is not consistent with
7392 the format, dimensions, and contents of the specified compressed image
7393 data. ")
7394 (para (code "GL_INVALID_OPERATION")
7395 " is generated if parameter combinations are not
7396 supported by the specific compressed internal format as specified in the
7397 specific texture compression extension. ")
7398 (para (code "GL_INVALID_OPERATION")
7399 " is generated if a non-zero buffer object name is bound to the "
7400 (code "GL_PIXEL_UNPACK_BUFFER")
7401 " target and the buffer object's data store is currently mapped. ")
7402 (para (code "GL_INVALID_OPERATION")
7403 " is generated if a non-zero buffer object name is bound to the "
7404 (code "GL_PIXEL_UNPACK_BUFFER")
7405 " target and the data would be unpacked from the buffer
7406 object such that the memory reads required would exceed the data store size. ")
7407 (para (code "GL_INVALID_OPERATION")
7408 " is generated if "
7409 (code "glCompressedTexImage1D")
7410 "
7411 is executed between the execution of "
7412 (code "glBegin")
7413 "
7414 and the corresponding execution of "
7415 (code "glEnd")
7416 ". ")
7417 (para "
7418 Undefined results, including abnormal program termination, are generated if "
7419 (var "data")
7420 " is not encoded in a manner consistent with the extension
7421 specification defining the internal compression format. ")))
7422
7423 (define-gl-procedure
7424 glCompressedTexImage2D
7425 "glCompressedTexImage2D"
7426 (funcsynopsis
7427 (funcprototype
7428 (funcdef
7429 "void "
7430 (function "glCompressedTexImage2D"))
7431 (paramdef "GLenum " (parameter "target"))
7432 (paramdef "GLint " (parameter "level"))
7433 (paramdef "GLenum " (parameter "internalformat"))
7434 (paramdef "GLsizei " (parameter "width"))
7435 (paramdef "GLsizei " (parameter "height"))
7436 (paramdef "GLint " (parameter "border"))
7437 (paramdef "GLsizei " (parameter "imageSize"))
7438 (paramdef "const GLvoid * " (parameter "data"))))
7439 '(*fragment*
7440 (heading
7441 "specify a two-dimensional texture image in a compressed format")
7442 (heading "Parameters")
7443 (table (% (formatter (asis)))
7444 (entry (% (heading (var "target")))
7445 (para "
7446 Specifies the target texture.
7447 Must be "
7448 (code "GL_TEXTURE_2D")
7449 ", "
7450 (code "GL_PROXY_TEXTURE_2D")
7451 ", "
7452 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
7453 ", "
7454 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
7455 ", "
7456 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
7457 ", "
7458 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
7459 ", "
7460 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
7461 ", "
7462 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
7463 ", or "
7464 (code "GL_PROXY_TEXTURE_CUBE_MAP")
7465 ". "))
7466 (entry (% (heading (var "level")))
7467 (para "
7468 Specifies the level-of-detail number.
7469 Level 0 is the base image level.
7470 Level "
7471 (var "n")
7472 " is the "
7473 (var "n")
7474 "th mipmap reduction image. "))
7475 (entry (% (heading (var "internalformat")))
7476 (para "
7477 Specifies the format of the compressed image data stored at address "
7478 (var "data")
7479 ". "))
7480 (entry (% (heading (var "width")))
7481 (para "
7482 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
7483 (math "2"
7484 "^"
7485 (var "n")
7486 "+"
7487 "2"
7488 "\u2061"
7489 "("
7490 (var "border")
7491 ","
7492 ")")
7493 "
7494 for some integer "
7495 (math (var "n"))
7496 ".
7497 All
7498 implementations support 2D texture images that are at least 64 texels
7499 wide and cube-mapped texture images that are at least 16 texels wide. "))
7500 (entry (% (heading (var "height")))
7501 (para "
7502 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
7503 Must be "
7504 (math "2"
7505 "^"
7506 (var "n")
7507 "+"
7508 "2"
7509 "\u2061"
7510 "("
7511 (var "border")
7512 ","
7513 ")")
7514 "
7515 for some integer "
7516 (math (var "n"))
7517 ".
7518 All
7519 implementations support 2D texture images that are at least 64 texels
7520 high and cube-mapped texture images that are at least 16 texels high. "))
7521 (entry (% (heading (var "border")))
7522 (para "
7523 Specifies the width of the border.
7524 Must be either 0 or 1. "))
7525 (entry (% (heading (var "imageSize")))
7526 (para "
7527 Specifies the number of unsigned bytes of image data starting at the
7528 address specified by "
7529 (var "data")
7530 ". "))
7531 (entry (% (heading (var "data")))
7532 (para "
7533 Specifies a pointer to the compressed image data in memory. ")))
7534 (heading "Description")
7535 (para "
7536 Texturing maps a portion of a specified texture image onto each graphical
7537 primitive for which texturing is enabled. To enable and disable
7538 two-dimensional texturing, call "
7539 (code "glEnable")
7540 " and "
7541 (code "glDisable")
7542 " with argument "
7543 (code "GL_TEXTURE_2D")
7544 ". To enable and disable texturing using
7545 cube-mapped textures, call "
7546 (code "glEnable")
7547 " and "
7548 (code "glDisable")
7549 " with argument "
7550 (code "GL_TEXTURE_CUBE_MAP")
7551 ". ")
7552 (para (code "glCompressedTexImage2D")
7553 " loads a previously defined, and retrieved, compressed two-dimensional
7554 texture image if "
7555 (var "target")
7556 " is "
7557 (code "GL_TEXTURE_2D")
7558 " (see "
7559 (code "glTexImage2D")
7560 "). ")
7561 (para "
7562 If "
7563 (var "target")
7564 " is "
7565 (code "GL_PROXY_TEXTURE_2D")
7566 ", no data is read from "
7567 (var "data")
7568 ", but
7569 all of the texture image state is recalculated, checked for consistency,
7570 and checked against the implementation's capabilities. If the
7571 implementation cannot handle a texture of the requested texture size, it
7572 sets all of the image state to 0, but does not generate an error (see "
7573 (code "glGetError")
7574 "). To query for an entire mipmap array, use an image array level
7575 greater than or equal to 1. ")
7576 (para (var "internalformat")
7577 " must be an extension-specified compressed-texture format.
7578 When a texture is loaded with "
7579 (code "glTexImage2D")
7580 " using a generic compressed
7581 texture format (e.g., "
7582 (code "GL_COMPRESSED_RGB")
7583 "), the GL selects from one of
7584 its extensions supporting compressed textures. In order to load the
7585 compressed texture image using "
7586 (code "glCompressedTexImage2D")
7587 ", query the compressed texture image's
7588 size and format using "
7589 (code "glGetTexLevelParameter")
7590 ". ")
7591 (para "
7592 If a non-zero named buffer object is bound to the "
7593 (code "GL_PIXEL_UNPACK_BUFFER")
7594 " target
7595 (see "
7596 (code "glBindBuffer")
7597 ") while a texture image is
7598 specified, "
7599 (var "data")
7600 " is treated as a byte offset into the buffer object's data store. ")
7601 (heading "Errors")
7602 (para (code "GL_INVALID_ENUM")
7603 " is generated if "
7604 (var "internalformat")
7605 " is one of the generic compressed internal formats: "
7606 (code "GL_COMPRESSED_ALPHA")
7607 ", "
7608 (code "GL_COMPRESSED_LUMINANCE")
7609 ", "
7610 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
7611 ", "
7612 (code "GL_COMPRESSED_INTENSITY")
7613 ", "
7614 (code "GL_COMPRESSED_RGB")
7615 ", or "
7616 (code "GL_COMPRESSED_RGBA")
7617 ". ")
7618 (para (code "GL_INVALID_VALUE")
7619 " is generated if "
7620 (var "imageSize")
7621 " is not consistent with
7622 the format, dimensions, and contents of the specified compressed image
7623 data. ")
7624 (para (code "GL_INVALID_OPERATION")
7625 " is generated if parameter combinations are not
7626 supported by the specific compressed internal format as specified in the
7627 specific texture compression extension. ")
7628 (para (code "GL_INVALID_OPERATION")
7629 " is generated if a non-zero buffer object name is bound to the "
7630 (code "GL_PIXEL_UNPACK_BUFFER")
7631 " target and the buffer object's data store is currently mapped. ")
7632 (para (code "GL_INVALID_OPERATION")
7633 " is generated if a non-zero buffer object name is bound to the "
7634 (code "GL_PIXEL_UNPACK_BUFFER")
7635 " target and the data would be unpacked from the buffer
7636 object such that the memory reads required would exceed the data store size. ")
7637 (para (code "GL_INVALID_OPERATION")
7638 " is generated if "
7639 (code "glCompressedTexImage2D")
7640 "
7641 is executed between the execution of "
7642 (code "glBegin")
7643 "
7644 and the corresponding execution of "
7645 (code "glEnd")
7646 ". ")
7647 (para "
7648 Undefined results, including abnormal program termination, are generated if "
7649 (var "data")
7650 " is not encoded in a manner consistent with the extension
7651 specification defining the internal compression format. ")))
7652
7653 (define-gl-procedure
7654 glCompressedTexImage3D
7655 "glCompressedTexImage3D"
7656 (funcsynopsis
7657 (funcprototype
7658 (funcdef
7659 "void "
7660 (function "glCompressedTexImage3D"))
7661 (paramdef "GLenum " (parameter "target"))
7662 (paramdef "GLint " (parameter "level"))
7663 (paramdef "GLenum " (parameter "internalformat"))
7664 (paramdef "GLsizei " (parameter "width"))
7665 (paramdef "GLsizei " (parameter "height"))
7666 (paramdef "GLsizei " (parameter "depth"))
7667 (paramdef "GLint " (parameter "border"))
7668 (paramdef "GLsizei " (parameter "imageSize"))
7669 (paramdef "const GLvoid * " (parameter "data"))))
7670 '(*fragment*
7671 (heading
7672 "specify a three-dimensional texture image in a compressed format")
7673 (heading "Parameters")
7674 (table (% (formatter (asis)))
7675 (entry (% (heading (var "target")))
7676 (para "
7677 Specifies the target texture.
7678 Must be "
7679 (code "GL_TEXTURE_3D")
7680 " or "
7681 (code "GL_PROXY_TEXTURE_3D")
7682 ". "))
7683 (entry (% (heading (var "level")))
7684 (para "
7685 Specifies the level-of-detail number.
7686 Level 0 is the base image level.
7687 Level "
7688 (var "n")
7689 " is the "
7690 (var "n")
7691 "th mipmap reduction image. "))
7692 (entry (% (heading (var "internalformat")))
7693 (para "
7694 Specifies the format of the compressed image data stored at address "
7695 (var "data")
7696 ". "))
7697 (entry (% (heading (var "width")))
7698 (para "
7699 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
7700 (math "2"
7701 "^"
7702 (var "n")
7703 "+"
7704 "2"
7705 "\u2061"
7706 "("
7707 (var "border")
7708 ","
7709 ")")
7710 "
7711 for some integer "
7712 (math (var "n"))
7713 ".
7714 All
7715 implementations support 3D texture images that are at least 16 texels
7716 wide. "))
7717 (entry (% (heading (var "height")))
7718 (para "
7719 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
7720 (math "2"
7721 "^"
7722 (var "n")
7723 "+"
7724 "2"
7725 "\u2061"
7726 "("
7727 (var "border")
7728 ","
7729 ")")
7730 "
7731 for some integer "
7732 (math (var "n"))
7733 ".
7734 All
7735 implementations support 3D texture images that are at least 16 texels
7736 high. "))
7737 (entry (% (heading (var "depth")))
7738 (para "
7739 Specifies the depth of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
7740 (math "2"
7741 "^"
7742 (var "n")
7743 "+"
7744 "2"
7745 "\u2061"
7746 "("
7747 (var "border")
7748 ","
7749 ")")
7750 "
7751 for some integer "
7752 (math (var "n"))
7753 ".
7754 All
7755 implementations support 3D texture images that are at least 16 texels
7756 deep. "))
7757 (entry (% (heading (var "border")))
7758 (para "
7759 Specifies the width of the border.
7760 Must be either 0 or 1. "))
7761 (entry (% (heading (var "imageSize")))
7762 (para "
7763 Specifies the number of unsigned bytes of image data starting at the
7764 address specified by "
7765 (var "data")
7766 ". "))
7767 (entry (% (heading (var "data")))
7768 (para "
7769 Specifies a pointer to the compressed image data in memory. ")))
7770 (heading "Description")
7771 (para "
7772 Texturing maps a portion of a specified texture image onto each graphical
7773 primitive for which texturing is enabled. To enable and disable
7774 three-dimensional texturing, call "
7775 (code "glEnable")
7776 " and "
7777 (code "glDisable")
7778 " with argument "
7779 (code "GL_TEXTURE_3D")
7780 ". ")
7781 (para (code "glCompressedTexImage3D")
7782 " loads a previously defined, and retrieved, compressed three-dimensional
7783 texture image if "
7784 (var "target")
7785 " is "
7786 (code "GL_TEXTURE_3D")
7787 " (see "
7788 (code "glTexImage3D")
7789 "). ")
7790 (para "
7791 If "
7792 (var "target")
7793 " is "
7794 (code "GL_PROXY_TEXTURE_3D")
7795 ", no data is read from "
7796 (var "data")
7797 ", but
7798 all of the texture image state is recalculated, checked for consistency,
7799 and checked against the implementation's capabilities. If the
7800 implementation cannot handle a texture of the requested texture size, it
7801 sets all of the image state to 0, but does not generate an error (see "
7802 (code "glGetError")
7803 "). To query for an entire mipmap array, use an image array level
7804 greater than or equal to 1. ")
7805 (para (var "internalformat")
7806 " must be an extension-specified compressed-texture format.
7807 When a texture is loaded with "
7808 (code "glTexImage2D")
7809 " using a generic compressed
7810 texture format (e.g., "
7811 (code "GL_COMPRESSED_RGB")
7812 "), the GL selects from one of
7813 its extensions supporting compressed textures. In order to load the
7814 compressed texture image using "
7815 (code "glCompressedTexImage3D")
7816 ", query the compressed texture image's
7817 size and format using "
7818 (code "glGetTexLevelParameter")
7819 ". ")
7820 (para "
7821 If a non-zero named buffer object is bound to the "
7822 (code "GL_PIXEL_UNPACK_BUFFER")
7823 " target
7824 (see "
7825 (code "glBindBuffer")
7826 ") while a texture image is
7827 specified, "
7828 (var "data")
7829 " is treated as a byte offset into the buffer object's data store. ")
7830 (heading "Errors")
7831 (para (code "GL_INVALID_ENUM")
7832 " is generated if "
7833 (var "internalformat")
7834 " is one of the generic compressed internal formats: "
7835 (code "GL_COMPRESSED_ALPHA")
7836 ", "
7837 (code "GL_COMPRESSED_LUMINANCE")
7838 ", "
7839 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
7840 ", "
7841 (code "GL_COMPRESSED_INTENSITY")
7842 ", "
7843 (code "GL_COMPRESSED_RGB")
7844 ", or "
7845 (code "GL_COMPRESSED_RGBA")
7846 ". ")
7847 (para (code "GL_INVALID_VALUE")
7848 " is generated if "
7849 (var "imageSize")
7850 " is not consistent with
7851 the format, dimensions, and contents of the specified compressed image data. ")
7852 (para (code "GL_INVALID_OPERATION")
7853 " is generated if parameter combinations are not
7854 supported by the specific compressed internal format as specified in the
7855 specific texture compression extension. ")
7856 (para (code "GL_INVALID_OPERATION")
7857 " is generated if a non-zero buffer object name is bound to the "
7858 (code "GL_PIXEL_UNPACK_BUFFER")
7859 " target and the buffer object's data store is currently mapped. ")
7860 (para (code "GL_INVALID_OPERATION")
7861 " is generated if a non-zero buffer object name is bound to the "
7862 (code "GL_PIXEL_UNPACK_BUFFER")
7863 " target and the data would be unpacked from the buffer
7864 object such that the memory reads required would exceed the data store size. ")
7865 (para (code "GL_INVALID_OPERATION")
7866 " is generated if "
7867 (code "glCompressedTexImage3D")
7868 "
7869 is executed between the execution of "
7870 (code "glBegin")
7871 "
7872 and the corresponding execution of "
7873 (code "glEnd")
7874 ". ")
7875 (para "
7876 Undefined results, including abnormal program termination, are generated if "
7877 (var "data")
7878 " is not encoded in a manner consistent with the extension specification defining the internal compression format. ")))
7879
7880 (define-gl-procedure
7881 glCompressedTexSubImage1D
7882 "glCompressedTexSubImage1D"
7883 (funcsynopsis
7884 (funcprototype
7885 (funcdef
7886 "void "
7887 (function "glCompressedTexSubImage1D"))
7888 (paramdef "GLenum " (parameter "target"))
7889 (paramdef "GLint " (parameter "level"))
7890 (paramdef "GLint " (parameter "xoffset"))
7891 (paramdef "GLsizei " (parameter "width"))
7892 (paramdef "GLenum " (parameter "format"))
7893 (paramdef "GLsizei " (parameter "imageSize"))
7894 (paramdef "const GLvoid * " (parameter "data"))))
7895 '(*fragment*
7896 (heading
7897 "specify a one-dimensional texture subimage in a compressed format")
7898 (heading "Parameters")
7899 (table (% (formatter (asis)))
7900 (entry (% (heading (var "target")))
7901 (para "
7902 Specifies the target texture.
7903 Must be "
7904 (code "GL_TEXTURE_1D")
7905 ". "))
7906 (entry (% (heading (var "level")))
7907 (para "
7908 Specifies the level-of-detail number.
7909 Level 0 is the base image level.
7910 Level "
7911 (var "n")
7912 " is the "
7913 (var "n")
7914 "th mipmap reduction image. "))
7915 (entry (% (heading (var "xoffset")))
7916 (para "
7917 Specifies a texel offset in the x direction within the texture array. "))
7918 (entry (% (heading (var "width")))
7919 (para "
7920 Specifies the width of the texture subimage. "))
7921 (entry (% (heading (var "format")))
7922 (para "
7923 Specifies the format of the compressed image data stored at address "
7924 (var "data")
7925 ". "))
7926 (entry (% (heading (var "imageSize")))
7927 (para "
7928 Specifies the number of unsigned bytes of image data starting at the
7929 address specified by "
7930 (var "data")
7931 ". "))
7932 (entry (% (heading (var "data")))
7933 (para "
7934 Specifies a pointer to the compressed image data in memory. ")))
7935 (heading "Description")
7936 (para "
7937 Texturing maps a portion of a specified texture image onto each graphical
7938 primitive for which texturing is enabled. To enable and disable
7939 one-dimensional texturing, call "
7940 (code "glEnable")
7941 " and "
7942 (code "glDisable")
7943 " with argument "
7944 (code "GL_TEXTURE_1D")
7945 ". ")
7946 (para (code "glCompressedTexSubImage1D")
7947 " redefines a contiguous subregion of an existing one-dimensional
7948 texture image. The texels referenced by "
7949 (var "data")
7950 " replace the portion of the
7951 existing texture array with x indices "
7952 (var "xoffset")
7953 " and "
7954 (math (var "xoffset") "+" (var "width") "-" "1")
7955 ",
7956 inclusive. This region may not include any texels
7957 outside the range of the texture array as it was originally specified. It
7958 is not an error to specify a subtexture with width of 0, but such a
7959 specification has no effect. ")
7960 (para (var "format")
7961 " must be an extension-specified
7962 compressed-texture format. The "
7963 (var "format")
7964 " of the compressed texture
7965 image is selected by the GL implementation that compressed it (see "
7966 (code "glTexImage1D")
7967 "), and should be queried at the time the texture was
7968 compressed with "
7969 (code "glGetTexLevelParameter")
7970 ". ")
7971 (para "
7972 If a non-zero named buffer object is bound to the "
7973 (code "GL_PIXEL_UNPACK_BUFFER")
7974 " target
7975 (see "
7976 (code "glBindBuffer")
7977 ") while a texture image is
7978 specified, "
7979 (var "data")
7980 " is treated as a byte offset into the buffer object's data store. ")
7981 (heading "Errors")
7982 (para (code "GL_INVALID_ENUM")
7983 " is generated if "
7984 (var "format")
7985 " is one of these generic compressed internal formats: "
7986 (code "GL_COMPRESSED_ALPHA")
7987 ", "
7988 (code "GL_COMPRESSED_LUMINANCE")
7989 ", "
7990 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
7991 ", "
7992 (code "GL_COMPRESSED_INTENSITY")
7993 ", "
7994 (code "GL_COMPRESSED_RGB")
7995 ", "
7996 (code "GL_COMPRESSED_RGBA")
7997 ",\t"
7998 (code "GL_COMPRESSED_SLUMINANCE")
7999 ",\t"
8000 (code "GL_COMPRESSED_SLUMINANCE_ALPHA")
8001 ",\t"
8002 (code "GL_COMPRESSED_SRGB")
8003 ",\t"
8004 (code "GL_COMPRESSED_SRGBA")
8005 ", or\t"
8006 (code "GL_COMPRESSED_SRGB_ALPHA")
8007 ". ")
8008 (para (code "GL_INVALID_VALUE")
8009 " is generated if "
8010 (var "imageSize")
8011 " is not consistent with
8012 the format, dimensions, and contents of the specified compressed image
8013 data. ")
8014 (para (code "GL_INVALID_OPERATION")
8015 " is generated if parameter combinations are not
8016 supported by the specific compressed internal format as specified in the
8017 specific texture compression extension. ")
8018 (para (code "GL_INVALID_OPERATION")
8019 " is generated if a non-zero buffer object name is bound to the "
8020 (code "GL_PIXEL_UNPACK_BUFFER")
8021 " target and the buffer object's data store is currently mapped. ")
8022 (para (code "GL_INVALID_OPERATION")
8023 " is generated if a non-zero buffer object name is bound to the "
8024 (code "GL_PIXEL_UNPACK_BUFFER")
8025 " target and the data would be unpacked from the buffer
8026 object such that the memory reads required would exceed the data store size. ")
8027 (para (code "GL_INVALID_OPERATION")
8028 " is generated if "
8029 (code "glCompressedTexSubImage1D")
8030 "
8031 is executed between the execution of "
8032 (code "glBegin")
8033 "
8034 and the corresponding execution of "
8035 (code "glEnd")
8036 ". ")
8037 (para "
8038 Undefined results, including abnormal program termination, are generated if "
8039 (var "data")
8040 " is not encoded in a manner consistent with the extension
8041 specification defining the internal compression format. ")))
8042
8043 (define-gl-procedure
8044 glCompressedTexSubImage2D
8045 "glCompressedTexSubImage2D"
8046 (funcsynopsis
8047 (funcprototype
8048 (funcdef
8049 "void "
8050 (function "glCompressedTexSubImage2D"))
8051 (paramdef "GLenum " (parameter "target"))
8052 (paramdef "GLint " (parameter "level"))
8053 (paramdef "GLint " (parameter "xoffset"))
8054 (paramdef "GLint " (parameter "yoffset"))
8055 (paramdef "GLsizei " (parameter "width"))
8056 (paramdef "GLsizei " (parameter "height"))
8057 (paramdef "GLenum " (parameter "format"))
8058 (paramdef "GLsizei " (parameter "imageSize"))
8059 (paramdef "const GLvoid * " (parameter "data"))))
8060 '(*fragment*
8061 (heading
8062 "specify a two-dimensional texture subimage in a compressed format")
8063 (heading "Parameters")
8064 (table (% (formatter (asis)))
8065 (entry (% (heading (var "target")))
8066 (para "
8067 Specifies the target texture.
8068 Must be "
8069 (code "GL_TEXTURE_2D")
8070 ", "
8071 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
8072 ", "
8073 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
8074 ", "
8075 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
8076 ", "
8077 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
8078 ", "
8079 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
8080 ", or "
8081 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
8082 ". "))
8083 (entry (% (heading (var "level")))
8084 (para "
8085 Specifies the level-of-detail number.
8086 Level 0 is the base image level.
8087 Level "
8088 (var "n")
8089 " is the "
8090 (var "n")
8091 "th mipmap reduction image. "))
8092 (entry (% (heading (var "xoffset")))
8093 (para "
8094 Specifies a texel offset in the x direction within the texture array. "))
8095 (entry (% (heading (var "yoffset")))
8096 (para "
8097 Specifies a texel offset in the y direction within the texture array. "))
8098 (entry (% (heading (var "width")))
8099 (para "
8100 Specifies the width of the texture subimage. "))
8101 (entry (% (heading (var "height")))
8102 (para "
8103 Specifies the height of the texture subimage. "))
8104 (entry (% (heading (var "format")))
8105 (para "
8106 Specifies the format of the compressed image data stored at address "
8107 (var "data")
8108 ". "))
8109 (entry (% (heading (var "imageSize")))
8110 (para "
8111 Specifies the number of unsigned bytes of image data starting at the
8112 address specified by "
8113 (var "data")
8114 ". "))
8115 (entry (% (heading (var "data")))
8116 (para "
8117 Specifies a pointer to the compressed image data in memory. ")))
8118 (heading "Description")
8119 (para "
8120 Texturing maps a portion of a specified texture image onto each graphical
8121 primitive for which texturing is enabled. To enable and disable
8122 two-dimensional texturing, call "
8123 (code "glEnable")
8124 " and "
8125 (code "glDisable")
8126 " with argument "
8127 (code "GL_TEXTURE_2D")
8128 ". To enable and disable texturing using
8129 cube-mapped texture, call "
8130 (code "glEnable")
8131 " and "
8132 (code "glDisable")
8133 " with argument "
8134 (code "GL_TEXTURE_CUBE_MAP")
8135 ". ")
8136 (para (code "glCompressedTexSubImage2D")
8137 " redefines a contiguous subregion of an existing two-dimensional
8138 texture image. The texels referenced by "
8139 (var "data")
8140 " replace the portion of the
8141 existing texture array with x indices "
8142 (var "xoffset")
8143 " and "
8144 (math (var "xoffset") "+" (var "width") "-" "1")
8145 ",
8146 and the y indices "
8147 (var "yoffset")
8148 " and "
8149 (math (var "yoffset") "+" (var "height") "-" "1")
8150 ",
8151 inclusive.
8152 This region may not include any texels
8153 outside the range of the texture array as it was originally specified. It
8154 is not an error to specify a subtexture with width of 0, but such a
8155 specification has no effect. ")
8156 (para (var "format")
8157 " must be an extension-specified
8158 compressed-texture format. The "
8159 (var "format")
8160 " of the compressed texture
8161 image is selected by the GL implementation that compressed it (see "
8162 (code "glTexImage2D")
8163 ") and should be queried at the time the texture was
8164 compressed with "
8165 (code "glGetTexLevelParameter")
8166 ". ")
8167 (para "
8168 If a non-zero named buffer object is bound to the "
8169 (code "GL_PIXEL_UNPACK_BUFFER")
8170 " target
8171 (see "
8172 (code "glBindBuffer")
8173 ") while a texture image is
8174 specified, "
8175 (var "data")
8176 " is treated as a byte offset into the buffer object's data store. ")
8177 (heading "Errors")
8178 (para (code "GL_INVALID_ENUM")
8179 " is generated if "
8180 (var "format")
8181 " is one of these generic compressed internal formats: "
8182 (code "GL_COMPRESSED_ALPHA")
8183 ", "
8184 (code "GL_COMPRESSED_LUMINANCE")
8185 ", "
8186 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
8187 ", "
8188 (code "GL_COMPRESSED_INTENSITY")
8189 ", "
8190 (code "GL_COMPRESSED_RGB")
8191 ", "
8192 (code "GL_COMPRESSED_RGBA")
8193 ",\t"
8194 (code "GL_COMPRESSED_SLUMINANCE")
8195 ",\t"
8196 (code "GL_COMPRESSED_SLUMINANCE_ALPHA")
8197 ",\t"
8198 (code "GL_COMPRESSED_SRGB")
8199 ",\t"
8200 (code "GL_COMPRESSED_SRGBA")
8201 ", or\t"
8202 (code "GL_COMPRESSED_SRGB_ALPHA")
8203 ". ")
8204 (para (code "GL_INVALID_VALUE")
8205 " is generated if "
8206 (var "imageSize")
8207 " is not consistent with
8208 the format, dimensions, and contents of the specified compressed image
8209 data. ")
8210 (para (code "GL_INVALID_OPERATION")
8211 " is generated if parameter combinations are not
8212 supported by the specific compressed internal format as specified in the
8213 specific texture compression extension. ")
8214 (para (code "GL_INVALID_OPERATION")
8215 " is generated if a non-zero buffer object name is bound to the "
8216 (code "GL_PIXEL_UNPACK_BUFFER")
8217 " target and the buffer object's data store is currently mapped. ")
8218 (para (code "GL_INVALID_OPERATION")
8219 " is generated if a non-zero buffer object name is bound to the "
8220 (code "GL_PIXEL_UNPACK_BUFFER")
8221 " target and the data would be unpacked from the buffer
8222 object such that the memory reads required would exceed the data store size. ")
8223 (para (code "GL_INVALID_OPERATION")
8224 " is generated if "
8225 (code "glCompressedTexSubImage2D")
8226 "
8227 is executed between the execution of "
8228 (code "glBegin")
8229 "
8230 and the corresponding execution of "
8231 (code "glEnd")
8232 ". ")
8233 (para "
8234 Undefined results, including abnormal program termination, are generated if "
8235 (var "data")
8236 " is not encoded in a manner consistent with the extension
8237 specification defining the internal compression format. ")))
8238
8239 (define-gl-procedure
8240 glCompressedTexSubImage3D
8241 "glCompressedTexSubImage3D"
8242 (funcsynopsis
8243 (funcprototype
8244 (funcdef
8245 "void "
8246 (function "glCompressedTexSubImage3D"))
8247 (paramdef "GLenum " (parameter "target"))
8248 (paramdef "GLint " (parameter "level"))
8249 (paramdef "GLint " (parameter "xoffset"))
8250 (paramdef "GLint " (parameter "yoffset"))
8251 (paramdef "GLint " (parameter "zoffset"))
8252 (paramdef "GLsizei " (parameter "width"))
8253 (paramdef "GLsizei " (parameter "height"))
8254 (paramdef "GLsizei " (parameter "depth"))
8255 (paramdef "GLenum " (parameter "format"))
8256 (paramdef "GLsizei " (parameter "imageSize"))
8257 (paramdef "const GLvoid * " (parameter "data"))))
8258 '(*fragment*
8259 (heading
8260 "specify a three-dimensional texture subimage in a compressed format")
8261 (heading "Parameters")
8262 (table (% (formatter (asis)))
8263 (entry (% (heading (var "target")))
8264 (para "
8265 Specifies the target texture.
8266 Must be "
8267 (code "GL_TEXTURE_3D")
8268 ". "))
8269 (entry (% (heading (var "level")))
8270 (para "
8271 Specifies the level-of-detail number.
8272 Level 0 is the base image level.
8273 Level "
8274 (var "n")
8275 " is the "
8276 (var "n")
8277 "th mipmap reduction image. "))
8278 (entry (% (heading (var "xoffset")))
8279 (para "
8280 Specifies a texel offset in the x direction within the texture array. "))
8281 (entry (% (heading (var "yoffset")))
8282 (para "
8283 Specifies a texel offset in the y direction within the texture array. "))
8284 (entry (% (heading (var "width")))
8285 (para "
8286 Specifies the width of the texture subimage. "))
8287 (entry (% (heading (var "height")))
8288 (para "
8289 Specifies the height of the texture subimage. "))
8290 (entry (% (heading (var "depth")))
8291 (para "
8292 Specifies the depth of the texture subimage. "))
8293 (entry (% (heading (var "format")))
8294 (para "
8295 Specifies the format of the compressed image data stored at address "
8296 (var "data")
8297 ". "))
8298 (entry (% (heading (var "imageSize")))
8299 (para "
8300 Specifies the number of unsigned bytes of image data starting at the
8301 address specified by "
8302 (var "data")
8303 ". "))
8304 (entry (% (heading (var "data")))
8305 (para "
8306 Specifies a pointer to the compressed image data in memory. ")))
8307 (heading "Description")
8308 (para "
8309 Texturing maps a portion of a specified texture image onto each graphical
8310 primitive for which texturing is enabled. To enable and disable
8311 three-dimensional texturing, call "
8312 (code "glEnable")
8313 " and "
8314 (code "glDisable")
8315 " with argument "
8316 (code "GL_TEXTURE_3D")
8317 ". ")
8318 (para (code "glCompressedTexSubImage3D")
8319 " redefines a contiguous subregion of an existing three-dimensional
8320 texture image. The texels referenced by "
8321 (var "data")
8322 " replace the portion of the
8323 existing texture array with x indices "
8324 (var "xoffset")
8325 " and "
8326 (math (var "xoffset") "+" (var "width") "-" "1")
8327 ",
8328 and the y indices "
8329 (var "yoffset")
8330 " and "
8331 (math (var "yoffset") "+" (var "height") "-" "1")
8332 ",
8333 and the z indices "
8334 (var "zoffset")
8335 " and "
8336 (math (var "zoffset") "+" (var "depth") "-" "1")
8337 ",
8338 inclusive. This region may not include
8339 any texels outside the range of the texture array as it was originally
8340 specified. It is not an error to specify a subtexture with width of 0,
8341 but such a specification has no effect. ")
8342 (para (var "format")
8343 " must be an extension-specified
8344 compressed-texture format. The "
8345 (var "format")
8346 " of the compressed texture
8347 image is selected by the GL implementation that compressed it (see "
8348 (code "glTexImage3D")
8349 ") and should be queried at the time the texture was
8350 compressed with "
8351 (code "glGetTexLevelParameter")
8352 ". ")
8353 (para "
8354 If a non-zero named buffer object is bound to the "
8355 (code "GL_PIXEL_UNPACK_BUFFER")
8356 " target
8357 (see "
8358 (code "glBindBuffer")
8359 ") while a texture image is
8360 specified, "
8361 (var "data")
8362 " is treated as a byte offset into the buffer object's data store. ")
8363 (heading "Errors")
8364 (para (code "GL_INVALID_ENUM")
8365 " is generated if "
8366 (var "format")
8367 " is one of these generic compressed internal formats: "
8368 (code "GL_COMPRESSED_ALPHA")
8369 ", "
8370 (code "GL_COMPRESSED_LUMINANCE")
8371 ", "
8372 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
8373 ", "
8374 (code "GL_COMPRESSED_INTENSITY")
8375 ", "
8376 (code "GL_COMPRESSED_RGB")
8377 ", "
8378 (code "GL_COMPRESSED_RGBA")
8379 ",\t"
8380 (code "GL_COMPRESSED_SLUMINANCE")
8381 ",\t"
8382 (code "GL_COMPRESSED_SLUMINANCE_ALPHA")
8383 ",\t"
8384 (code "GL_COMPRESSED_SRGB")
8385 ",\t"
8386 (code "GL_COMPRESSED_SRGBA")
8387 ", or\t"
8388 (code "GL_COMPRESSED_SRGB_ALPHA")
8389 ". ")
8390 (para (code "GL_INVALID_VALUE")
8391 " is generated if "
8392 (var "imageSize")
8393 " is not consistent with
8394 the format, dimensions, and contents of the specified compressed image
8395 data. ")
8396 (para (code "GL_INVALID_OPERATION")
8397 " is generated if parameter combinations are not
8398 supported by the specific compressed internal format as specified in the
8399 specific texture compression extension. ")
8400 (para (code "GL_INVALID_OPERATION")
8401 " is generated if a non-zero buffer object name is bound to the "
8402 (code "GL_PIXEL_UNPACK_BUFFER")
8403 " target and the buffer object's data store is currently mapped. ")
8404 (para (code "GL_INVALID_OPERATION")
8405 " is generated if a non-zero buffer object name is bound to the "
8406 (code "GL_PIXEL_UNPACK_BUFFER")
8407 " target and the data would be unpacked from the buffer
8408 object such that the memory reads required would exceed the data store size. ")
8409 (para (code "GL_INVALID_OPERATION")
8410 " is generated if "
8411 (code "glCompressedTexSubImage3D")
8412 "
8413 is executed between the execution of "
8414 (code "glBegin")
8415 "
8416 and the corresponding execution of "
8417 (code "glEnd")
8418 ". ")
8419 (para "
8420 Undefined results, including abnormal program termination, are generated if "
8421 (var "data")
8422 " is not encoded in a manner consistent with the extension
8423 specification defining the internal compression format. ")))
8424
8425 (define-gl-procedure
8426 glConvolutionFilter1D
8427 "glConvolutionFilter1D"
8428 (funcsynopsis
8429 (funcprototype
8430 (funcdef
8431 "void "
8432 (function "glConvolutionFilter1D"))
8433 (paramdef "GLenum " (parameter "target"))
8434 (paramdef "GLenum " (parameter "internalformat"))
8435 (paramdef "GLsizei " (parameter "width"))
8436 (paramdef "GLenum " (parameter "format"))
8437 (paramdef "GLenum " (parameter "type"))
8438 (paramdef "const GLvoid * " (parameter "data"))))
8439 '(*fragment*
8440 (heading
8441 "define a one-dimensional convolution filter")
8442 (heading "Parameters")
8443 (table (% (formatter (asis)))
8444 (entry (% (heading (var "target")))
8445 (para "
8446 Must be "
8447 (code "GL_CONVOLUTION_1D")
8448 ". "))
8449 (entry (% (heading (var "internalformat")))
8450 (para "
8451 The internal format of the convolution filter kernel.
8452 The allowable values are "
8453 (code "GL_ALPHA")
8454 ", "
8455 (code "GL_ALPHA4")
8456 ", "
8457 (code "GL_ALPHA8")
8458 ", "
8459 (code "GL_ALPHA12")
8460 ", "
8461 (code "GL_ALPHA16")
8462 ", "
8463 (code "GL_LUMINANCE")
8464 ", "
8465 (code "GL_LUMINANCE4")
8466 ", "
8467 (code "GL_LUMINANCE8")
8468 ", "
8469 (code "GL_LUMINANCE12")
8470 ", "
8471 (code "GL_LUMINANCE16")
8472 ", "
8473 (code "GL_LUMINANCE_ALPHA")
8474 ", "
8475 (code "GL_LUMINANCE4_ALPHA4")
8476 ", "
8477 (code "GL_LUMINANCE6_ALPHA2")
8478 ", "
8479 (code "GL_LUMINANCE8_ALPHA8")
8480 ", "
8481 (code "GL_LUMINANCE12_ALPHA4")
8482 ", "
8483 (code "GL_LUMINANCE12_ALPHA12")
8484 ", "
8485 (code "GL_LUMINANCE16_ALPHA16")
8486 ", "
8487 (code "GL_INTENSITY")
8488 ", "
8489 (code "GL_INTENSITY4")
8490 ", "
8491 (code "GL_INTENSITY8")
8492 ", "
8493 (code "GL_INTENSITY12")
8494 ", "
8495 (code "GL_INTENSITY16")
8496 ", "
8497 (code "GL_R3_G3_B2")
8498 ", "
8499 (code "GL_RGB")
8500 ", "
8501 (code "GL_RGB4")
8502 ", "
8503 (code "GL_RGB5")
8504 ", "
8505 (code "GL_RGB8")
8506 ", "
8507 (code "GL_RGB10")
8508 ", "
8509 (code "GL_RGB12")
8510 ", "
8511 (code "GL_RGB16")
8512 ", "
8513 (code "GL_RGBA")
8514 ", "
8515 (code "GL_RGBA2")
8516 ", "
8517 (code "GL_RGBA4")
8518 ", "
8519 (code "GL_RGB5_A1")
8520 ", "
8521 (code "GL_RGBA8")
8522 ", "
8523 (code "GL_RGB10_A2")
8524 ", "
8525 (code "GL_RGBA12")
8526 ", or "
8527 (code "GL_RGBA16")
8528 ". "))
8529 (entry (% (heading (var "width")))
8530 (para "
8531 The width of the pixel array referenced by "
8532 (var "data")
8533 ". "))
8534 (entry (% (heading (var "format")))
8535 (para "
8536 The format of the pixel data in "
8537 (var "data")
8538 ".
8539 The allowable values are "
8540 (code "GL_ALPHA")
8541 ", "
8542 (code "GL_LUMINANCE")
8543 ", "
8544 (code "GL_LUMINANCE_ALPHA")
8545 ", "
8546 (code "GL_INTENSITY")
8547 ", "
8548 (code "GL_RGB")
8549 ", and "
8550 (code "GL_RGBA")
8551 ". "))
8552 (entry (% (heading (var "type")))
8553 (para "
8554 The type of the pixel data in "
8555 (var "data")
8556 ".
8557 Symbolic constants "
8558 (code "GL_UNSIGNED_BYTE")
8559 ", "
8560 (code "GL_BYTE")
8561 ", "
8562 (code "GL_BITMAP")
8563 ", "
8564 (code "GL_UNSIGNED_SHORT")
8565 ", "
8566 (code "GL_SHORT")
8567 ", "
8568 (code "GL_UNSIGNED_INT")
8569 ", "
8570 (code "GL_INT")
8571 ", "
8572 (code "GL_FLOAT")
8573 ", "
8574 (code "GL_UNSIGNED_BYTE_3_3_2")
8575 ", "
8576 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
8577 ", "
8578 (code "GL_UNSIGNED_SHORT_5_6_5")
8579 ", "
8580 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
8581 ", "
8582 (code "GL_UNSIGNED_SHORT_4_4_4_4")
8583 ", "
8584 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
8585 ", "
8586 (code "GL_UNSIGNED_SHORT_5_5_5_1")
8587 ", "
8588 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
8589 ", "
8590 (code "GL_UNSIGNED_INT_8_8_8_8")
8591 ", "
8592 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
8593 ", "
8594 (code "GL_UNSIGNED_INT_10_10_10_2")
8595 ", and "
8596 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
8597 "
8598 are accepted. "))
8599 (entry (% (heading (var "data")))
8600 (para "
8601 Pointer to a one-dimensional array of pixel data that is processed to
8602 build the convolution filter kernel. ")))
8603 (heading "Description")
8604 (para (code "glConvolutionFilter1D")
8605 " builds a one-dimensional convolution filter kernel from an array of
8606 pixels. ")
8607 (para "
8608 The pixel array specified by "
8609 (var "width")
8610 ", "
8611 (var "format")
8612 ", "
8613 (var "type")
8614 ", and "
8615 (var "data")
8616 "
8617 is extracted from memory and
8618 processed just as if "
8619 (code "glDrawPixels")
8620 " were called, but processing
8621 stops after the final expansion to RGBA is completed. ")
8622 (para "
8623 If a non-zero named buffer object is bound to the "
8624 (code "GL_PIXEL_UNPACK_BUFFER")
8625 " target
8626 (see "
8627 (code "glBindBuffer")
8628 ") while a convolution filter is
8629 specified, "
8630 (var "data")
8631 " is treated as a byte offset into the buffer object's data store. ")
8632 (para "
8633 The R, G, B, and A components of each pixel are next scaled by the four
8634 1D "
8635 (code "GL_CONVOLUTION_FILTER_SCALE")
8636 " parameters and biased by the
8637 four 1D "
8638 (code "GL_CONVOLUTION_FILTER_BIAS")
8639 " parameters.
8640 (The scale and bias parameters are set by "
8641 (code "glConvolutionParameter")
8642 "
8643 using the "
8644 (code "GL_CONVOLUTION_1D")
8645 " target and the names "
8646 (code "GL_CONVOLUTION_FILTER_SCALE")
8647 " and "
8648 (code "GL_CONVOLUTION_FILTER_BIAS")
8649 ".
8650 The parameters themselves are vectors of four values that are applied to red,
8651 green, blue, and alpha, in that order.)
8652 The R, G, B, and A values are not clamped to [0,1] at any time during this
8653 process. ")
8654 (para "
8655 Each pixel is then converted to the internal format specified by "
8656 (var "internalformat")
8657 ".
8658 This conversion simply maps the component values of the pixel (R, G, B,
8659 and A) to the values included in the internal format (red, green, blue,
8660 alpha, luminance, and intensity). The mapping is as follows: ")
8661 (para)
8662 (table (% (formatter (asis)))
8663 (entry (% (heading (strong "Internal Format")))
8664 (para (strong "Red")
8665 ", "
8666 (strong "Green")
8667 ", "
8668 (strong "Blue")
8669 ", "
8670 (strong "Alpha")
8671 ", "
8672 (strong "Luminance")
8673 ", "
8674 (strong "Intensity")))
8675 (entry (% (heading (code "GL_ALPHA")))
8676 (para ", " ", " ", " "
8677 A " ", " ", "))
8678 (entry (% (heading (code "GL_LUMINANCE")))
8679 (para ", " ", " ", " ", " "
8680 R " ", "))
8681 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
8682 (para ", " ", " ", " "
8683 A " ", " "
8684 R " ", "))
8685 (entry (% (heading (code "GL_INTENSITY")))
8686 (para ", " ", " ", " ", " ", " "
8687 R "))
8688 (entry (% (heading (code "GL_RGB")))
8689 (para "
8690 R " ", " "
8691 G " ", " "
8692 B " ", " ", " ", "))
8693 (entry (% (heading (code "GL_RGBA")))
8694 (para "
8695 R "
8696 ", "
8697 "
8698 G "
8699 ", "
8700 "
8701 B "
8702 ", "
8703 "
8704 A "
8705 ", "
8706 ", ")))
8707 (para "
8708 The red, green, blue, alpha, luminance, and/or intensity components of
8709 the resulting pixels are stored in floating-point rather than integer
8710 format.
8711 They form a one-dimensional filter kernel image indexed with coordinate "
8712 (var "i")
8713 " such that "
8714 (var "i")
8715 " starts at 0 and increases from left to right.
8716 Kernel location "
8717 (var "i")
8718 " is derived from the "
8719 (var "i")
8720 "th pixel, counting from 0. ")
8721 (para "
8722 Note that after a convolution is performed, the resulting color
8723 components are also scaled by their corresponding "
8724 (code "GL_POST_CONVOLUTION_c_SCALE")
8725 " parameters and biased by their
8726 corresponding "
8727 (code "GL_POST_CONVOLUTION_c_BIAS")
8728 " parameters (where "
8729 (var "c")
8730 " takes on the values "
8731 (strong "RED")
8732 ", "
8733 (strong "GREEN")
8734 ", "
8735 (strong "BLUE")
8736 ", and "
8737 (strong "ALPHA")
8738 ").
8739 These parameters are set by "
8740 (code "glPixelTransfer")
8741 ". ")
8742 (heading "Errors")
8743 (para (code "GL_INVALID_ENUM")
8744 " is generated if "
8745 (var "target")
8746 " is not "
8747 (code "GL_CONVOLUTION_1D")
8748 ". ")
8749 (para (code "GL_INVALID_ENUM")
8750 " is generated if "
8751 (var "internalformat")
8752 " is not one of the
8753 allowable values. ")
8754 (para (code "GL_INVALID_ENUM")
8755 " is generated if "
8756 (var "format")
8757 " is not one of the allowable
8758 values. ")
8759 (para (code "GL_INVALID_ENUM")
8760 " is generated if "
8761 (var "type")
8762 " is not one of the allowable
8763 values. ")
8764 (para (code "GL_INVALID_VALUE")
8765 " is generated if "
8766 (var "width")
8767 " is less than zero or greater
8768 than the maximum supported value.
8769 This value may be queried with "
8770 (code "glGetConvolutionParameter")
8771 "
8772 using target "
8773 (code "GL_CONVOLUTION_1D")
8774 " and name "
8775 (code "GL_MAX_CONVOLUTION_WIDTH")
8776 ". ")
8777 (para (code "GL_INVALID_OPERATION")
8778 " is generated if "
8779 (var "format")
8780 " is one of "
8781 (code "GL_UNSIGNED_BYTE_3_3_2")
8782 ", "
8783 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
8784 ", "
8785 (code "GL_UNSIGNED_SHORT_5_6_5")
8786 ", or "
8787 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
8788 "
8789 and "
8790 (var "type")
8791 " is not "
8792 (code "GL_RGB")
8793 ". ")
8794 (para (code "GL_INVALID_OPERATION")
8795 " is generated if "
8796 (var "format")
8797 " is one of "
8798 (code "GL_UNSIGNED_SHORT_4_4_4_4")
8799 ", "
8800 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
8801 ", "
8802 (code "GL_UNSIGNED_SHORT_5_5_5_1")
8803 ", "
8804 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
8805 ", "
8806 (code "GL_UNSIGNED_INT_8_8_8_8")
8807 ", "
8808 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
8809 ", "
8810 (code "GL_UNSIGNED_INT_10_10_10_2")
8811 ", or "
8812 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
8813 "
8814 and "
8815 (var "type")
8816 " is neither "
8817 (code "GL_RGBA")
8818 " nor "
8819 (code "GL_BGRA")
8820 ". ")
8821 (para (code "GL_INVALID_OPERATION")
8822 " is generated if a non-zero buffer object name is bound to the "
8823 (code "GL_PIXEL_UNPACK_BUFFER")
8824 " target and the buffer object's data store is currently mapped. ")
8825 (para (code "GL_INVALID_OPERATION")
8826 " is generated if a non-zero buffer object name is bound to the "
8827 (code "GL_PIXEL_UNPACK_BUFFER")
8828 " target and the data would be unpacked from the buffer
8829 object such that the memory reads required would exceed the data store size. ")
8830 (para (code "GL_INVALID_OPERATION")
8831 " is generated if a non-zero buffer object name is bound to the "
8832 (code "GL_PIXEL_UNPACK_BUFFER")
8833 " target and "
8834 (var "data")
8835 " is not evenly divisible
8836 into the number of bytes needed to store in memory a datum indicated by "
8837 (var "type")
8838 ". ")
8839 (para (code "GL_INVALID_OPERATION")
8840 " is generated if "
8841 (code "glConvolutionFilter1D")
8842 " is executed
8843 between the execution of "
8844 (code "glBegin")
8845 " and the corresponding
8846 execution of "
8847 (code "glEnd")
8848 ". ")))
8849
8850 (define-gl-procedure
8851 glConvolutionFilter2D
8852 "glConvolutionFilter2D"
8853 (funcsynopsis
8854 (funcprototype
8855 (funcdef
8856 "void "
8857 (function "glConvolutionFilter2D"))
8858 (paramdef "GLenum " (parameter "target"))
8859 (paramdef "GLenum " (parameter "internalformat"))
8860 (paramdef "GLsizei " (parameter "width"))
8861 (paramdef "GLsizei " (parameter "height"))
8862 (paramdef "GLenum " (parameter "format"))
8863 (paramdef "GLenum " (parameter "type"))
8864 (paramdef "const GLvoid * " (parameter "data"))))
8865 '(*fragment*
8866 (heading
8867 "define a two-dimensional convolution filter")
8868 (heading "Parameters")
8869 (table (% (formatter (asis)))
8870 (entry (% (heading (var "target")))
8871 (para "
8872 Must be "
8873 (code "GL_CONVOLUTION_2D")
8874 ". "))
8875 (entry (% (heading (var "internalformat")))
8876 (para "
8877 The internal format of the convolution filter kernel.
8878 The allowable values are "
8879 (code "GL_ALPHA")
8880 ", "
8881 (code "GL_ALPHA4")
8882 ", "
8883 (code "GL_ALPHA8")
8884 ", "
8885 (code "GL_ALPHA12")
8886 ", "
8887 (code "GL_ALPHA16")
8888 ", "
8889 (code "GL_LUMINANCE")
8890 ", "
8891 (code "GL_LUMINANCE4")
8892 ", "
8893 (code "GL_LUMINANCE8")
8894 ", "
8895 (code "GL_LUMINANCE12")
8896 ", "
8897 (code "GL_LUMINANCE16")
8898 ", "
8899 (code "GL_LUMINANCE_ALPHA")
8900 ", "
8901 (code "GL_LUMINANCE4_ALPHA4")
8902 ", "
8903 (code "GL_LUMINANCE6_ALPHA2")
8904 ", "
8905 (code "GL_LUMINANCE8_ALPHA8")
8906 ", "
8907 (code "GL_LUMINANCE12_ALPHA4")
8908 ", "
8909 (code "GL_LUMINANCE12_ALPHA12")
8910 ", "
8911 (code "GL_LUMINANCE16_ALPHA16")
8912 ", "
8913 (code "GL_INTENSITY")
8914 ", "
8915 (code "GL_INTENSITY4")
8916 ", "
8917 (code "GL_INTENSITY8")
8918 ", "
8919 (code "GL_INTENSITY12")
8920 ", "
8921 (code "GL_INTENSITY16")
8922 ", "
8923 (code "GL_R3_G3_B2")
8924 ", "
8925 (code "GL_RGB")
8926 ", "
8927 (code "GL_RGB4")
8928 ", "
8929 (code "GL_RGB5")
8930 ", "
8931 (code "GL_RGB8")
8932 ", "
8933 (code "GL_RGB10")
8934 ", "
8935 (code "GL_RGB12")
8936 ", "
8937 (code "GL_RGB16")
8938 ", "
8939 (code "GL_RGBA")
8940 ", "
8941 (code "GL_RGBA2")
8942 ", "
8943 (code "GL_RGBA4")
8944 ", "
8945 (code "GL_RGB5_A1")
8946 ", "
8947 (code "GL_RGBA8")
8948 ", "
8949 (code "GL_RGB10_A2")
8950 ", "
8951 (code "GL_RGBA12")
8952 ", or "
8953 (code "GL_RGBA16")
8954 ". "))
8955 (entry (% (heading (var "width")))
8956 (para "
8957 The width of the pixel array referenced by "
8958 (var "data")
8959 ". "))
8960 (entry (% (heading (var "height")))
8961 (para "
8962 The height of the pixel array referenced by "
8963 (var "data")
8964 ". "))
8965 (entry (% (heading (var "format")))
8966 (para "
8967 The format of the pixel data in "
8968 (var "data")
8969 ".
8970 The allowable values are "
8971 (code "GL_RED")
8972 ", "
8973 (code "GL_GREEN")
8974 ", "
8975 (code "GL_BLUE")
8976 ", "
8977 (code "GL_ALPHA")
8978 ", "
8979 (code "GL_RGB")
8980 ", "
8981 (code "GL_BGR")
8982 ", "
8983 (code "GL_RGBA")
8984 ", "
8985 (code "GL_BGRA")
8986 ", "
8987 (code "GL_LUMINANCE")
8988 ", and "
8989 (code "GL_LUMINANCE_ALPHA")
8990 ". "))
8991 (entry (% (heading (var "type")))
8992 (para "
8993 The type of the pixel data in "
8994 (var "data")
8995 ".
8996 Symbolic constants "
8997 (code "GL_UNSIGNED_BYTE")
8998 ", "
8999 (code "GL_BYTE")
9000 ", "
9001 (code "GL_BITMAP")
9002 ", "
9003 (code "GL_UNSIGNED_SHORT")
9004 ", "
9005 (code "GL_SHORT")
9006 ", "
9007 (code "GL_UNSIGNED_INT")
9008 ", "
9009 (code "GL_INT")
9010 ", "
9011 (code "GL_FLOAT")
9012 ", "
9013 (code "GL_UNSIGNED_BYTE_3_3_2")
9014 ", "
9015 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
9016 ", "
9017 (code "GL_UNSIGNED_SHORT_5_6_5")
9018 ", "
9019 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
9020 ", "
9021 (code "GL_UNSIGNED_SHORT_4_4_4_4")
9022 ", "
9023 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
9024 ", "
9025 (code "GL_UNSIGNED_SHORT_5_5_5_1")
9026 ", "
9027 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
9028 ", "
9029 (code "GL_UNSIGNED_INT_8_8_8_8")
9030 ", "
9031 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
9032 ", "
9033 (code "GL_UNSIGNED_INT_10_10_10_2")
9034 ", and "
9035 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
9036 "
9037 are accepted. "))
9038 (entry (% (heading (var "data")))
9039 (para "
9040 Pointer to a two-dimensional array of pixel data that is processed to
9041 build the convolution filter kernel. ")))
9042 (heading "Description")
9043 (para (code "glConvolutionFilter2D")
9044 " builds a two-dimensional convolution filter kernel from an array of
9045 pixels. ")
9046 (para "
9047 The pixel array specified by "
9048 (var "width")
9049 ", "
9050 (var "height")
9051 ", "
9052 (var "format")
9053 ", "
9054 (var "type")
9055 ", and "
9056 (var "data")
9057 " is extracted from memory and processed just as if "
9058 (code "glDrawPixels")
9059 " were called, but processing stops after the final
9060 expansion to RGBA is completed. ")
9061 (para "
9062 If a non-zero named buffer object is bound to the "
9063 (code "GL_PIXEL_UNPACK_BUFFER")
9064 " target
9065 (see "
9066 (code "glBindBuffer")
9067 ") while a convolution filter is
9068 specified, "
9069 (var "data")
9070 " is treated as a byte offset into the buffer object's data store. ")
9071 (para "
9072 The R, G, B, and A components of each pixel are next scaled by the four
9073 2D "
9074 (code "GL_CONVOLUTION_FILTER_SCALE")
9075 " parameters and biased by the
9076 four 2D "
9077 (code "GL_CONVOLUTION_FILTER_BIAS")
9078 " parameters.
9079 (The scale and bias parameters are set by "
9080 (code "glConvolutionParameter")
9081 "
9082 using the "
9083 (code "GL_CONVOLUTION_2D")
9084 " target and the names "
9085 (code "GL_CONVOLUTION_FILTER_SCALE")
9086 " and "
9087 (code "GL_CONVOLUTION_FILTER_BIAS")
9088 ".
9089 The parameters themselves are vectors of four values that are applied to red,
9090 green, blue, and alpha, in that order.)
9091 The R, G, B, and A values are not clamped to [0,1] at any time during this
9092 process. ")
9093 (para "
9094 Each pixel is then converted to the internal format specified by "
9095 (var "internalformat")
9096 ".
9097 This conversion simply maps the component values of the pixel (R, G, B,
9098 and A) to the values included in the internal format (red, green, blue,
9099 alpha, luminance, and intensity). The mapping is as follows: ")
9100 (para)
9101 (table (% (formatter (asis)))
9102 (entry (% (heading (strong "Internal Format")))
9103 (para (strong "Red")
9104 ", "
9105 (strong "Green")
9106 ", "
9107 (strong "Blue")
9108 ", "
9109 (strong "Alpha")
9110 ", "
9111 (strong "Luminance")
9112 ", "
9113 (strong "Intensity")))
9114 (entry (% (heading (code "GL_ALPHA")))
9115 (para ", " ", " ", " "
9116 A " ", " ", "))
9117 (entry (% (heading (code "GL_LUMINANCE")))
9118 (para ", " ", " ", " ", " "
9119 R " ", "))
9120 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
9121 (para ", " ", " ", " "
9122 A " ", " "
9123 R " ", "))
9124 (entry (% (heading (code "GL_INTENSITY")))
9125 (para ", " ", " ", " ", " ", " "
9126 R "))
9127 (entry (% (heading (code "GL_RGB")))
9128 (para "
9129 R " ", " "
9130 G " ", " "
9131 B " ", " ", " ", "))
9132 (entry (% (heading (code "GL_RGBA")))
9133 (para "
9134 R "
9135 ", "
9136 "
9137 G "
9138 ", "
9139 "
9140 B "
9141 ", "
9142 "
9143 A "
9144 ", "
9145 ", ")))
9146 (para "
9147 The red, green, blue, alpha, luminance, and/or intensity components of
9148 the resulting pixels are stored in floating-point rather than integer
9149 format.
9150 They form a two-dimensional filter kernel image indexed with coordinates "
9151 (var "i")
9152 " and "
9153 (var "j")
9154 " such that "
9155 (var "i")
9156 " starts at zero and increases from left
9157 to right, and "
9158 (var "j")
9159 " starts at zero and increases from bottom to top.
9160 Kernel location "
9161 (var "i,j")
9162 " is derived from the "
9163 (var "N")
9164 "th pixel,
9165 where "
9166 (var "N")
9167 " is "
9168 (var "i")
9169 "+"
9170 (var "j")
9171 "*"
9172 (var "width")
9173 ". ")
9174 (para "
9175 Note that after a convolution is performed, the resulting color
9176 components are also scaled by their corresponding "
9177 (code "GL_POST_CONVOLUTION_c_SCALE")
9178 " parameters and biased by their
9179 corresponding "
9180 (code "GL_POST_CONVOLUTION_c_BIAS")
9181 " parameters (where "
9182 (var "c")
9183 " takes on the values "
9184 (strong "RED")
9185 ", "
9186 (strong "GREEN")
9187 ", "
9188 (strong "BLUE")
9189 ", and "
9190 (strong "ALPHA")
9191 ").
9192 These parameters are set by "
9193 (code "glPixelTransfer")
9194 ". ")
9195 (heading "Errors")
9196 (para (code "GL_INVALID_ENUM")
9197 " is generated if "
9198 (var "target")
9199 " is not "
9200 (code "GL_CONVOLUTION_2D")
9201 ". ")
9202 (para (code "GL_INVALID_ENUM")
9203 " is generated if "
9204 (var "internalformat")
9205 " is not one of the
9206 allowable values. ")
9207 (para (code "GL_INVALID_ENUM")
9208 " is generated if "
9209 (var "format")
9210 " is not one of the allowable
9211 values. ")
9212 (para (code "GL_INVALID_ENUM")
9213 " is generated if "
9214 (var "type")
9215 " is not one of the allowable
9216 values. ")
9217 (para (code "GL_INVALID_VALUE")
9218 " is generated if "
9219 (var "width")
9220 " is less than zero or greater
9221 than the maximum supported value.
9222 This value may be queried with "
9223 (code "glGetConvolutionParameter")
9224 "
9225 using target "
9226 (code "GL_CONVOLUTION_2D")
9227 " and name "
9228 (code "GL_MAX_CONVOLUTION_WIDTH")
9229 ". ")
9230 (para (code "GL_INVALID_VALUE")
9231 " is generated if "
9232 (var "height")
9233 " is less than zero or greater
9234 than the maximum supported value.
9235 This value may be queried with "
9236 (code "glGetConvolutionParameter")
9237 "
9238 using target "
9239 (code "GL_CONVOLUTION_2D")
9240 " and name "
9241 (code "GL_MAX_CONVOLUTION_HEIGHT")
9242 ". ")
9243 (para (code "GL_INVALID_OPERATION")
9244 " is generated if "
9245 (var "height")
9246 " is one of "
9247 (code "GL_UNSIGNED_BYTE_3_3_2")
9248 ", "
9249 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
9250 ", "
9251 (code "GL_UNSIGNED_SHORT_5_6_5")
9252 ", or "
9253 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
9254 "
9255 and "
9256 (var "format")
9257 " is not "
9258 (code "GL_RGB")
9259 ". ")
9260 (para (code "GL_INVALID_OPERATION")
9261 " is generated if "
9262 (var "height")
9263 " is one of "
9264 (code "GL_UNSIGNED_SHORT_4_4_4_4")
9265 ", "
9266 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
9267 ", "
9268 (code "GL_UNSIGNED_SHORT_5_5_5_1")
9269 ", "
9270 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
9271 ", "
9272 (code "GL_UNSIGNED_INT_8_8_8_8")
9273 ", "
9274 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
9275 ", "
9276 (code "GL_UNSIGNED_INT_10_10_10_2")
9277 ", or "
9278 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
9279 "
9280 and "
9281 (var "format")
9282 " is neither "
9283 (code "GL_RGBA")
9284 " nor "
9285 (code "GL_BGRA")
9286 ". ")
9287 (para (code "GL_INVALID_OPERATION")
9288 " is generated if a non-zero buffer object name is bound to the "
9289 (code "GL_PIXEL_UNPACK_BUFFER")
9290 " target and the buffer object's data store is currently mapped. ")
9291 (para (code "GL_INVALID_OPERATION")
9292 " is generated if a non-zero buffer object name is bound to the "
9293 (code "GL_PIXEL_UNPACK_BUFFER")
9294 " target and the data would be unpacked from the buffer
9295 object such that the memory reads required would exceed the data store size. ")
9296 (para (code "GL_INVALID_OPERATION")
9297 " is generated if a non-zero buffer object name is bound to the "
9298 (code "GL_PIXEL_UNPACK_BUFFER")
9299 " target and "
9300 (var "data")
9301 " is not evenly divisible
9302 into the number of bytes needed to store in memory a datum indicated by "
9303 (var "type")
9304 ". ")
9305 (para (code "GL_INVALID_OPERATION")
9306 " is generated if "
9307 (code "glConvolutionFilter2D")
9308 " is executed
9309 between the execution of "
9310 (code "glBegin")
9311 " and the corresponding
9312 execution of "
9313 (code "glEnd")
9314 ". ")))
9315
9316 (define-gl-procedure
9317 glConvolutionParameter
9318 "glConvolutionParameter"
9319 (funcsynopsis
9320 (funcprototype
9321 (funcdef
9322 "void "
9323 (function "glConvolutionParameterf"))
9324 (paramdef "GLenum " (parameter "target"))
9325 (paramdef "GLenum " (parameter "pname"))
9326 (paramdef "GLfloat " (parameter "params"))))
9327 '(*fragment*
9328 (heading "set convolution parameters")
9329 (heading "Parameters")
9330 (table (% (formatter (asis)))
9331 (entry (% (heading (var "target")))
9332 (para "
9333 The target for the convolution parameter.
9334 Must be one of "
9335 (code "GL_CONVOLUTION_1D")
9336 ", "
9337 (code "GL_CONVOLUTION_2D")
9338 ", or "
9339 (code "GL_SEPARABLE_2D")
9340 ". "))
9341 (entry (% (heading (var "pname")))
9342 (para "
9343 The parameter to be set.
9344 Must be "
9345 (code "GL_CONVOLUTION_BORDER_MODE")
9346 ". "))
9347 (entry (% (heading (var "params")))
9348 (para "
9349 The parameter value.
9350 Must be one of "
9351 (code "GL_REDUCE")
9352 ", "
9353 (code "GL_CONSTANT_BORDER")
9354 ", "
9355 (code "GL_REPLICATE_BORDER")
9356 ". ")
9357 (para)))
9358 (heading "Description")
9359 (para (code "glConvolutionParameter")
9360 " sets the value of a convolution parameter. ")
9361 (para (var "target")
9362 " selects the convolution filter to be affected: "
9363 (code "GL_CONVOLUTION_1D")
9364 ", "
9365 (code "GL_CONVOLUTION_2D")
9366 ", or "
9367 (code "GL_SEPARABLE_2D")
9368 "
9369 for the 1D, 2D, or separable 2D filter, respectively. ")
9370 (para (var "pname")
9371 " selects the parameter to be changed. "
9372 (code "GL_CONVOLUTION_FILTER_SCALE")
9373 " and "
9374 (code "GL_CONVOLUTION_FILTER_BIAS")
9375 "
9376 affect the definition of the convolution filter kernel; see "
9377 (code "glConvolutionFilter1D")
9378 ", "
9379 (code "glConvolutionFilter2D")
9380 ", and "
9381 (code "glSeparableFilter2D")
9382 " for details.
9383 In these cases, "
9384 (var "params")
9385 "v is an array of four values to be applied to
9386 red, green, blue, and alpha values, respectively. The initial value for "
9387 (code "GL_CONVOLUTION_FILTER_SCALE")
9388 " is (1, 1, 1, 1), and the initial value
9389 for "
9390 (code "GL_CONVOLUTION_FILTER_BIAS")
9391 " is (0, 0, 0, 0). ")
9392 (para "
9393 A "
9394 (var "pname")
9395 " value of "
9396 (code "GL_CONVOLUTION_BORDER_MODE")
9397 " controls the
9398 convolution border mode. The accepted modes are: ")
9399 (table (% (formatter (asis)))
9400 (entry (% (heading (code "GL_REDUCE")))
9401 (para "
9402 The image resulting from convolution is
9403 smaller than the source image.
9404 If the filter width is "
9405 (math (var "Wf"))
9406 "
9407 and height is "
9408 (math (var "Hf"))
9409 ",
9410 and the source image width is "
9411 (math (var "Ws"))
9412 "
9413 and height is "
9414 (math (var "Hs"))
9415 ",
9416 then the convolved image width will be "
9417 (math (var "Ws") "-" (var "Wf") "+" "1")
9418 "
9419 and height
9420 will be "
9421 (math (var "Hs") "-" (var "Hf") "+" "1")
9422 ".
9423 (If this reduction would generate an image with zero or negative width
9424 and/or height, the output is simply null, with no error generated.)
9425 The coordinates of the image resulting from convolution are zero
9426 through "
9427 (math (var "Ws") "-" (var "Wf"))
9428 "
9429 in width and zero through "
9430 (math (var "Hs") "-" (var "Hf"))
9431 "
9432 in
9433 height. "))
9434 (entry (% (heading (code "GL_CONSTANT_BORDER")))
9435 (para "
9436 The image resulting from convolution is the same size as the source image, and
9437 processed as if the source image were surrounded by pixels with their color
9438 specified by the "
9439 (code "GL_CONVOLUTION_BORDER_COLOR")
9440 ". "))
9441 (entry (% (heading (code "GL_REPLICATE_BORDER")))
9442 (para "
9443 The image resulting from convolution is the same size as the source image, and
9444 processed as if the outermost pixel on the border of the source image were
9445 replicated. ")))
9446 (heading "Errors")
9447 (para (code "GL_INVALID_ENUM")
9448 " is generated if "
9449 (var "target")
9450 " is not one of the allowable
9451 values. ")
9452 (para (code "GL_INVALID_ENUM")
9453 " is generated if "
9454 (var "pname")
9455 " is not one of the allowable
9456 values. ")
9457 (para (code "GL_INVALID_ENUM")
9458 " is generated if "
9459 (var "pname")
9460 " is "
9461 (code "GL_CONVOLUTION_BORDER_MODE")
9462 " and "
9463 (var "params")
9464 " is not one of "
9465 (code "GL_REDUCE")
9466 ", "
9467 (code "GL_CONSTANT_BORDER")
9468 ", or "
9469 (code "GL_REPLICATE_BORDER")
9470 ". ")
9471 (para (code "GL_INVALID_OPERATION")
9472 " is generated if "
9473 (code "glConvolutionParameter")
9474 " is executed
9475 between the execution of "
9476 (code "glBegin")
9477 " and the corresponding
9478 execution of "
9479 (code "glEnd")
9480 ". ")))
9481
9482 (define-gl-procedure
9483 glCopyColorSubTable
9484 "glCopyColorSubTable"
9485 (funcsynopsis
9486 (funcprototype
9487 (funcdef
9488 "void "
9489 (function "glCopyColorSubTable"))
9490 (paramdef "GLenum " (parameter "target"))
9491 (paramdef "GLsizei " (parameter "start"))
9492 (paramdef "GLint " (parameter "x"))
9493 (paramdef "GLint " (parameter "y"))
9494 (paramdef "GLsizei " (parameter "width"))))
9495 '(*fragment*
9496 (heading "respecify a portion of a color table")
9497 (heading "Parameters")
9498 (table (% (formatter (asis)))
9499 (entry (% (heading (var "target")))
9500 (para "
9501 Must be one of "
9502 (code "GL_COLOR_TABLE")
9503 ", "
9504 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
9505 ", or "
9506 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
9507 ". "))
9508 (entry (% (heading (var "start")))
9509 (para "
9510 The starting index of the portion of the color table to be replaced. "))
9511 (entry (% (heading (var "x")))
9512 (itemx (var "y"))
9513 (para "
9514 The window coordinates of the left corner of the row of pixels to be
9515 copied. "))
9516 (entry (% (heading (var "width")))
9517 (para "
9518 The number of table entries to replace. ")))
9519 (heading "Description")
9520 (para (code "glCopyColorSubTable")
9521 " is used to respecify a contiguous portion of a color table previously
9522 defined using "
9523 (code "glColorTable")
9524 ". The pixels copied from the framebuffer
9525 replace the portion of the existing table from indices "
9526 (var "start")
9527 " to "
9528 (math (var "start") "+" (var "x") "-" "1")
9529 ",
9530 inclusive. This region may not include any
9531 entries outside the range of the color table, as was originally specified.
9532 It is not an error to specify a subtexture with width of 0, but such a
9533 specification has no effect. ")
9534 (heading "Errors")
9535 (para (code "GL_INVALID_VALUE")
9536 " is generated if "
9537 (var "target")
9538 " is not a previously defined
9539 color table. ")
9540 (para (code "GL_INVALID_VALUE")
9541 " is generated if "
9542 (var "target")
9543 " is not one of the allowable
9544 values. ")
9545 (para (code "GL_INVALID_VALUE")
9546 " is generated if "
9547 (math (var "start")
9548 "+"
9549 (var "x")
9550 ">"
9551 (var "width"))
9552 ". ")
9553 (para (code "GL_INVALID_OPERATION")
9554 " is generated if "
9555 (code "glCopyColorSubTable")
9556 " is executed
9557 between the execution of "
9558 (code "glBegin")
9559 " and the corresponding
9560 execution of "
9561 (code "glEnd")
9562 ". ")))
9563
9564 (define-gl-procedure
9565 glCopyColorTable
9566 "glCopyColorTable"
9567 (funcsynopsis
9568 (funcprototype
9569 (funcdef "void " (function "glCopyColorTable"))
9570 (paramdef "GLenum " (parameter "target"))
9571 (paramdef "GLenum " (parameter "internalformat"))
9572 (paramdef "GLint " (parameter "x"))
9573 (paramdef "GLint " (parameter "y"))
9574 (paramdef "GLsizei " (parameter "width"))))
9575 '(*fragment*
9576 (heading "copy pixels into a color table")
9577 (heading "Parameters")
9578 (table (% (formatter (asis)))
9579 (entry (% (heading (var "target")))
9580 (para "
9581 The color table target. Must be "
9582 (code "GL_COLOR_TABLE")
9583 ", "
9584 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
9585 ",
9586 or "
9587 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
9588 ". "))
9589 (entry (% (heading (var "internalformat")))
9590 (para "
9591 The internal storage format of the texture image.
9592 Must be one of the following symbolic constants: "
9593 (code "GL_ALPHA")
9594 ", "
9595 (code "GL_ALPHA4")
9596 ", "
9597 (code "GL_ALPHA8")
9598 ", "
9599 (code "GL_ALPHA12")
9600 ", "
9601 (code "GL_ALPHA16")
9602 ", "
9603 (code "GL_LUMINANCE")
9604 ", "
9605 (code "GL_LUMINANCE4")
9606 ", "
9607 (code "GL_LUMINANCE8")
9608 ", "
9609 (code "GL_LUMINANCE12")
9610 ", "
9611 (code "GL_LUMINANCE16")
9612 ", "
9613 (code "GL_LUMINANCE_ALPHA")
9614 ", "
9615 (code "GL_LUMINANCE4_ALPHA4")
9616 ", "
9617 (code "GL_LUMINANCE6_ALPHA2")
9618 ", "
9619 (code "GL_LUMINANCE8_ALPHA8")
9620 ", "
9621 (code "GL_LUMINANCE12_ALPHA4")
9622 ", "
9623 (code "GL_LUMINANCE12_ALPHA12")
9624 ", "
9625 (code "GL_LUMINANCE16_ALPHA16")
9626 ", "
9627 (code "GL_INTENSITY")
9628 ", "
9629 (code "GL_INTENSITY4")
9630 ", "
9631 (code "GL_INTENSITY8")
9632 ", "
9633 (code "GL_INTENSITY12")
9634 ", "
9635 (code "GL_INTENSITY16")
9636 ", "
9637 (code "GL_R3_G3_B2")
9638 ", "
9639 (code "GL_RGB")
9640 ", "
9641 (code "GL_RGB4")
9642 ", "
9643 (code "GL_RGB5")
9644 ", "
9645 (code "GL_RGB8")
9646 ", "
9647 (code "GL_RGB10")
9648 ", "
9649 (code "GL_RGB12")
9650 ", "
9651 (code "GL_RGB16")
9652 ", "
9653 (code "GL_RGBA")
9654 ", "
9655 (code "GL_RGBA2")
9656 ", "
9657 (code "GL_RGBA4")
9658 ", "
9659 (code "GL_RGB5_A1")
9660 ", "
9661 (code "GL_RGBA8")
9662 ", "
9663 (code "GL_RGB10_A2")
9664 ", "
9665 (code "GL_RGBA12")
9666 ", or "
9667 (code "GL_RGBA16")
9668 ". "))
9669 (entry (% (heading (var "x")))
9670 (para "
9671 The x coordinate of the lower-left corner of the pixel rectangle
9672 to be transferred to the color table. "))
9673 (entry (% (heading (var "y")))
9674 (para "
9675 The y coordinate of the lower-left corner of the pixel rectangle
9676 to be transferred to the color table. "))
9677 (entry (% (heading (var "width")))
9678 (para "
9679 The width of the pixel rectangle. ")))
9680 (heading "Description")
9681 (para (code "glCopyColorTable")
9682 " loads a color table with pixels from the current "
9683 (code "GL_READ_BUFFER")
9684 " (rather than from main memory, as is the case for "
9685 (code "glColorTable")
9686 "). ")
9687 (para "
9688 The screen-aligned pixel rectangle with lower-left corner at ("
9689 (var "x")
9690 ",\\ "
9691 (var "y")
9692 ")
9693 having width "
9694 (var "width")
9695 " and height 1
9696 is loaded into the color table. If any pixels within
9697 this region are outside the window that is associated with the GL
9698 context, the values obtained for those pixels are undefined. ")
9699 (para "
9700 The pixels in the rectangle are processed just as if "
9701 (code "glReadPixels")
9702 " were called, with "
9703 (var "internalformat")
9704 " set to RGBA,
9705 but processing stops after the final conversion to RGBA. ")
9706 (para "
9707 The four scale parameters and the four bias parameters that are defined
9708 for the table are then used to scale and bias the R, G, B, and A components
9709 of each pixel. The scale and bias parameters are set by calling "
9710 (code "glColorTableParameter")
9711 ". ")
9712 (para "
9713 Next, the R, G, B, and A values are clamped to the range "
9714 (math "[" "0" "," "1" "]")
9715 ".
9716 Each pixel is then converted to the internal format specified by "
9717 (var "internalformat")
9718 ". This conversion simply maps the component values of the pixel (R, G, B,
9719 and A) to the values included in the internal format (red, green, blue,
9720 alpha, luminance, and intensity). The mapping is as follows: ")
9721 (para)
9722 (table (% (formatter (asis)))
9723 (entry (% (heading (strong "Internal Format")))
9724 (para (strong "Red")
9725 ", "
9726 (strong "Green")
9727 ", "
9728 (strong "Blue")
9729 ", "
9730 (strong "Alpha")
9731 ", "
9732 (strong "Luminance")
9733 ", "
9734 (strong "Intensity")))
9735 (entry (% (heading (code "GL_ALPHA")))
9736 (para ", " ", " ", " "
9737 A " ", " ", "))
9738 (entry (% (heading (code "GL_LUMINANCE")))
9739 (para ", " ", " ", " ", " "
9740 R " ", "))
9741 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
9742 (para ", " ", " ", " "
9743 A " ", " "
9744 R " ", "))
9745 (entry (% (heading (code "GL_INTENSITY")))
9746 (para ", " ", " ", " ", " ", " "
9747 R "))
9748 (entry (% (heading (code "GL_RGB")))
9749 (para "
9750 R " ", " "
9751 G " ", " "
9752 B " ", " ", " ", "))
9753 (entry (% (heading (code "GL_RGBA")))
9754 (para "
9755 R "
9756 ", "
9757 "
9758 G "
9759 ", "
9760 "
9761 B "
9762 ", "
9763 "
9764 A "
9765 ", "
9766 ", ")))
9767 (para "
9768 Finally, the red, green, blue, alpha, luminance, and/or intensity components of
9769 the resulting pixels are stored in the color table.
9770 They form a one-dimensional table with indices in the range "
9771 (math "[" "0" "," (var "width") "-" "1" "]")
9772 ". ")
9773 (para)
9774 (heading "Errors")
9775 (para (code "GL_INVALID_ENUM")
9776 " is generated when "
9777 (var "target")
9778 " is not one of the
9779 allowable values. ")
9780 (para (code "GL_INVALID_VALUE")
9781 " is generated if "
9782 (var "width")
9783 " is less than zero. ")
9784 (para (code "GL_INVALID_VALUE")
9785 " is generated if "
9786 (var "internalformat")
9787 " is not one of the
9788 allowable values. ")
9789 (para (code "GL_TABLE_TOO_LARGE")
9790 " is generated if the requested color table
9791 is too large to be supported by the implementation. ")
9792 (para (code "GL_INVALID_OPERATION")
9793 " is generated if "
9794 (code "glCopyColorTable")
9795 " is executed
9796 between the execution of "
9797 (code "glBegin")
9798 " and the corresponding
9799 execution of "
9800 (code "glEnd")
9801 ". ")))
9802
9803 (define-gl-procedure
9804 glCopyConvolutionFilter1D
9805 "glCopyConvolutionFilter1D"
9806 (funcsynopsis
9807 (funcprototype
9808 (funcdef
9809 "void "
9810 (function "glCopyConvolutionFilter1D"))
9811 (paramdef "GLenum " (parameter "target"))
9812 (paramdef "GLenum " (parameter "internalformat"))
9813 (paramdef "GLint " (parameter "x"))
9814 (paramdef "GLint " (parameter "y"))
9815 (paramdef "GLsizei " (parameter "width"))))
9816 '(*fragment*
9817 (heading
9818 "copy pixels into a one-dimensional convolution filter")
9819 (heading "Parameters")
9820 (table (% (formatter (asis)))
9821 (entry (% (heading (var "target")))
9822 (para "
9823 Must be "
9824 (code "GL_CONVOLUTION_1D")
9825 ". "))
9826 (entry (% (heading (var "internalformat")))
9827 (para "
9828 The internal format of the convolution filter kernel.
9829 The allowable values are "
9830 (code "GL_ALPHA")
9831 ", "
9832 (code "GL_ALPHA4")
9833 ", "
9834 (code "GL_ALPHA8")
9835 ", "
9836 (code "GL_ALPHA12")
9837 ", "
9838 (code "GL_ALPHA16")
9839 ", "
9840 (code "GL_LUMINANCE")
9841 ", "
9842 (code "GL_LUMINANCE4")
9843 ", "
9844 (code "GL_LUMINANCE8")
9845 ", "
9846 (code "GL_LUMINANCE12")
9847 ", "
9848 (code "GL_LUMINANCE16")
9849 ", "
9850 (code "GL_LUMINANCE_ALPHA")
9851 ", "
9852 (code "GL_LUMINANCE4_ALPHA4")
9853 ", "
9854 (code "GL_LUMINANCE6_ALPHA2")
9855 ", "
9856 (code "GL_LUMINANCE8_ALPHA8")
9857 ", "
9858 (code "GL_LUMINANCE12_ALPHA4")
9859 ", "
9860 (code "GL_LUMINANCE12_ALPHA12")
9861 ", "
9862 (code "GL_LUMINANCE16_ALPHA16")
9863 ", "
9864 (code "GL_INTENSITY")
9865 ", "
9866 (code "GL_INTENSITY4")
9867 ", "
9868 (code "GL_INTENSITY8")
9869 ", "
9870 (code "GL_INTENSITY12")
9871 ", "
9872 (code "GL_INTENSITY16")
9873 ", "
9874 (code "GL_R3_G3_B2")
9875 ", "
9876 (code "GL_RGB")
9877 ", "
9878 (code "GL_RGB4")
9879 ", "
9880 (code "GL_RGB5")
9881 ", "
9882 (code "GL_RGB8")
9883 ", "
9884 (code "GL_RGB10")
9885 ", "
9886 (code "GL_RGB12")
9887 ", "
9888 (code "GL_RGB16")
9889 ", "
9890 (code "GL_RGBA")
9891 ", "
9892 (code "GL_RGBA2")
9893 ", "
9894 (code "GL_RGBA4")
9895 ", "
9896 (code "GL_RGB5_A1")
9897 ", "
9898 (code "GL_RGBA8")
9899 ", "
9900 (code "GL_RGB10_A2")
9901 ", "
9902 (code "GL_RGBA12")
9903 ", or "
9904 (code "GL_RGBA16")
9905 ". "))
9906 (entry (% (heading (var "x")))
9907 (itemx (var "y"))
9908 (para "
9909 The window space coordinates of the lower-left coordinate of the
9910 pixel array to copy. "))
9911 (entry (% (heading (var "width")))
9912 (para "
9913 The width of the pixel array to copy. ")))
9914 (heading "Description")
9915 (para (code "glCopyConvolutionFilter1D")
9916 " defines a one-dimensional convolution filter kernel with pixels
9917 from the current "
9918 (code "GL_READ_BUFFER")
9919 " (rather than from main memory,
9920 as is the case for "
9921 (code "glConvolutionFilter1D")
9922 "). ")
9923 (para "
9924 The screen-aligned pixel rectangle with lower-left corner at ("
9925 (var "x")
9926 ",\\ "
9927 (var "y")
9928 "),
9929 width "
9930 (var "width")
9931 " and height 1 is used to define
9932 the convolution filter. If any pixels within this region are
9933 outside the window that is associated with the GL context, the
9934 values obtained for those pixels are undefined. ")
9935 (para "
9936 The pixels in the rectangle are processed exactly as if "
9937 (code "glReadPixels")
9938 "
9939 had been called with "
9940 (var "format")
9941 "
9942 set to RGBA, but the process stops just before final conversion.
9943 The R, G, B, and A components of each pixel are next scaled by the four
9944 1D "
9945 (code "GL_CONVOLUTION_FILTER_SCALE")
9946 " parameters and biased by the
9947 four 1D "
9948 (code "GL_CONVOLUTION_FILTER_BIAS")
9949 " parameters.
9950 (The scale and bias parameters are set by "
9951 (code "glConvolutionParameter")
9952 "
9953 using the "
9954 (code "GL_CONVOLUTION_1D")
9955 " target and the names "
9956 (code "GL_CONVOLUTION_FILTER_SCALE")
9957 " and "
9958 (code "GL_CONVOLUTION_FILTER_BIAS")
9959 ".
9960 The parameters themselves are vectors of four values that are applied to red,
9961 green, blue, and alpha, in that order.)
9962 The R, G, B, and A values are not clamped to [0,1] at any time during this
9963 process. ")
9964 (para "
9965 Each pixel is then converted to the internal format specified by "
9966 (var "internalformat")
9967 ".
9968 This conversion simply maps the component values of the pixel (R, G, B,
9969 and A) to the values included in the internal format (red, green, blue,
9970 alpha, luminance, and intensity). The mapping is as follows: ")
9971 (para)
9972 (table (% (formatter (asis)))
9973 (entry (% (heading (strong "Internal Format")))
9974 (para (strong "Red")
9975 ", "
9976 (strong "Green")
9977 ", "
9978 (strong "Blue")
9979 ", "
9980 (strong "Alpha")
9981 ", "
9982 (strong "Luminance")
9983 ", "
9984 (strong "Intensity")))
9985 (entry (% (heading (code "GL_ALPHA")))
9986 (para ", " ", " ", " "
9987 A " ", " ", "))
9988 (entry (% (heading (code "GL_LUMINANCE")))
9989 (para ", " ", " ", " ", " "
9990 R " ", "))
9991 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
9992 (para ", " ", " ", " "
9993 A " ", " "
9994 R " ", "))
9995 (entry (% (heading (code "GL_INTENSITY")))
9996 (para ", " ", " ", " ", " ", " "
9997 R "))
9998 (entry (% (heading (code "GL_RGB")))
9999 (para "
10000 R " ", " "
10001 G " ", " "
10002 B " ", " ", " ", "))
10003 (entry (% (heading (code "GL_RGBA")))
10004 (para "
10005 R "
10006 ", "
10007 "
10008 G "
10009 ", "
10010 "
10011 B "
10012 ", "
10013 "
10014 A "
10015 ", "
10016 ", ")))
10017 (para "
10018 The red, green, blue, alpha, luminance, and/or intensity components of
10019 the resulting pixels are stored in floating-point rather than integer
10020 format. ")
10021 (para "
10022 Pixel ordering is such that lower x screen coordinates correspond to
10023 lower "
10024 (var "i")
10025 " filter image coordinates. ")
10026 (para "
10027 Note that after a convolution is performed, the resulting color
10028 components are also scaled by their corresponding "
10029 (code "GL_POST_CONVOLUTION_c_SCALE")
10030 " parameters and biased by their
10031 corresponding "
10032 (code "GL_POST_CONVOLUTION_c_BIAS")
10033 " parameters (where "
10034 (var "c")
10035 " takes on the values "
10036 (strong "RED")
10037 ", "
10038 (strong "GREEN")
10039 ", "
10040 (strong "BLUE")
10041 ", and "
10042 (strong "ALPHA")
10043 ").
10044 These parameters are set by "
10045 (code "glPixelTransfer")
10046 ". ")
10047 (heading "Errors")
10048 (para (code "GL_INVALID_ENUM")
10049 " is generated if "
10050 (var "target")
10051 " is not "
10052 (code "GL_CONVOLUTION_1D")
10053 ". ")
10054 (para (code "GL_INVALID_ENUM")
10055 " is generated if "
10056 (var "internalformat")
10057 " is not one of the
10058 allowable values. ")
10059 (para (code "GL_INVALID_VALUE")
10060 " is generated if "
10061 (var "width")
10062 " is less than zero or greater
10063 than the maximum supported value.
10064 This value may be queried with "
10065 (code "glGetConvolutionParameter")
10066 "
10067 using target "
10068 (code "GL_CONVOLUTION_1D")
10069 " and name "
10070 (code "GL_MAX_CONVOLUTION_WIDTH")
10071 ". ")
10072 (para (code "GL_INVALID_OPERATION")
10073 " is generated if "
10074 (code "glCopyConvolutionFilter1D")
10075 " is executed
10076 between the execution of "
10077 (code "glBegin")
10078 " and the corresponding
10079 execution of "
10080 (code "glEnd")
10081 ". ")))
10082
10083 (define-gl-procedure
10084 glCopyConvolutionFilter2D
10085 "glCopyConvolutionFilter2D"
10086 (funcsynopsis
10087 (funcprototype
10088 (funcdef
10089 "void "
10090 (function "glCopyConvolutionFilter2D"))
10091 (paramdef "GLenum " (parameter "target"))
10092 (paramdef "GLenum " (parameter "internalformat"))
10093 (paramdef "GLint " (parameter "x"))
10094 (paramdef "GLint " (parameter "y"))
10095 (paramdef "GLsizei " (parameter "width"))
10096 (paramdef "GLsizei " (parameter "height"))))
10097 '(*fragment*
10098 (heading
10099 "copy pixels into a two-dimensional convolution filter")
10100 (heading "Parameters")
10101 (table (% (formatter (asis)))
10102 (entry (% (heading (var "target")))
10103 (para "
10104 Must be "
10105 (code "GL_CONVOLUTION_2D")
10106 ". "))
10107 (entry (% (heading (var "internalformat")))
10108 (para "
10109 The internal format of the convolution filter kernel.
10110 The allowable values are "
10111 (code "GL_ALPHA")
10112 ", "
10113 (code "GL_ALPHA4")
10114 ", "
10115 (code "GL_ALPHA8")
10116 ", "
10117 (code "GL_ALPHA12")
10118 ", "
10119 (code "GL_ALPHA16")
10120 ", "
10121 (code "GL_LUMINANCE")
10122 ", "
10123 (code "GL_LUMINANCE4")
10124 ", "
10125 (code "GL_LUMINANCE8")
10126 ", "
10127 (code "GL_LUMINANCE12")
10128 ", "
10129 (code "GL_LUMINANCE16")
10130 ", "
10131 (code "GL_LUMINANCE_ALPHA")
10132 ", "
10133 (code "GL_LUMINANCE4_ALPHA4")
10134 ", "
10135 (code "GL_LUMINANCE6_ALPHA2")
10136 ", "
10137 (code "GL_LUMINANCE8_ALPHA8")
10138 ", "
10139 (code "GL_LUMINANCE12_ALPHA4")
10140 ", "
10141 (code "GL_LUMINANCE12_ALPHA12")
10142 ", "
10143 (code "GL_LUMINANCE16_ALPHA16")
10144 ", "
10145 (code "GL_INTENSITY")
10146 ", "
10147 (code "GL_INTENSITY4")
10148 ", "
10149 (code "GL_INTENSITY8")
10150 ", "
10151 (code "GL_INTENSITY12")
10152 ", "
10153 (code "GL_INTENSITY16")
10154 ", "
10155 (code "GL_R3_G3_B2")
10156 ", "
10157 (code "GL_RGB")
10158 ", "
10159 (code "GL_RGB4")
10160 ", "
10161 (code "GL_RGB5")
10162 ", "
10163 (code "GL_RGB8")
10164 ", "
10165 (code "GL_RGB10")
10166 ", "
10167 (code "GL_RGB12")
10168 ", "
10169 (code "GL_RGB16")
10170 ", "
10171 (code "GL_RGBA")
10172 ", "
10173 (code "GL_RGBA2")
10174 ", "
10175 (code "GL_RGBA4")
10176 ", "
10177 (code "GL_RGB5_A1")
10178 ", "
10179 (code "GL_RGBA8")
10180 ", "
10181 (code "GL_RGB10_A2")
10182 ", "
10183 (code "GL_RGBA12")
10184 ", or "
10185 (code "GL_RGBA16")
10186 ". "))
10187 (entry (% (heading (var "x")))
10188 (itemx (var "y"))
10189 (para "
10190 The window space coordinates of the lower-left coordinate of the
10191 pixel array to copy. "))
10192 (entry (% (heading (var "width")))
10193 (para "
10194 The width of the pixel array to copy. "))
10195 (entry (% (heading (var "height")))
10196 (para "
10197 The height of the pixel array to copy. ")))
10198 (heading "Description")
10199 (para (code "glCopyConvolutionFilter2D")
10200 " defines a two-dimensional convolution filter kernel with pixels
10201 from the current "
10202 (code "GL_READ_BUFFER")
10203 " (rather than from main memory,
10204 as is the case for "
10205 (code "glConvolutionFilter2D")
10206 "). ")
10207 (para "
10208 The screen-aligned pixel rectangle with lower-left corner at ("
10209 (var "x")
10210 ",\\ "
10211 (var "y")
10212 "),
10213 width "
10214 (var "width")
10215 " and height "
10216 (var "height")
10217 "
10218 is used to define the convolution filter. If any pixels within this
10219 region are
10220 outside the window that is associated with the GL context, the
10221 values obtained for those pixels are undefined. ")
10222 (para "
10223 The pixels in the rectangle are processed
10224 exactly as if "
10225 (code "glReadPixels")
10226 " had been called with "
10227 (var "format")
10228 "
10229 set to RGBA, but the process stops just before final conversion.
10230 The R, G, B, and A components of each pixel are next scaled by the four
10231 2D "
10232 (code "GL_CONVOLUTION_FILTER_SCALE")
10233 " parameters and biased by the
10234 four 2D "
10235 (code "GL_CONVOLUTION_FILTER_BIAS")
10236 " parameters.
10237 (The scale and bias parameters are set by "
10238 (code "glConvolutionParameter")
10239 "
10240 using the "
10241 (code "GL_CONVOLUTION_2D")
10242 " target and the names "
10243 (code "GL_CONVOLUTION_FILTER_SCALE")
10244 " and "
10245 (code "GL_CONVOLUTION_FILTER_BIAS")
10246 ".
10247 The parameters themselves are vectors of four values that are applied to red,
10248 green, blue, and alpha, in that order.)
10249 The R, G, B, and A values are not clamped to [0,1] at any time during this
10250 process. ")
10251 (para "
10252 Each pixel is then converted to the internal format specified by "
10253 (var "internalformat")
10254 ".
10255 This conversion simply maps the component values of the pixel (R, G, B,
10256 and A) to the values included in the internal format (red, green, blue,
10257 alpha, luminance, and intensity). The mapping is as follows: ")
10258 (para)
10259 (table (% (formatter (asis)))
10260 (entry (% (heading (strong "Internal Format")))
10261 (para (strong "Red")
10262 ", "
10263 (strong "Green")
10264 ", "
10265 (strong "Blue")
10266 ", "
10267 (strong "Alpha")
10268 ", "
10269 (strong "Luminance")
10270 ", "
10271 (strong "Intensity")))
10272 (entry (% (heading (code "GL_ALPHA")))
10273 (para ", " ", " ", " "
10274 A " ", " ", "))
10275 (entry (% (heading (code "GL_LUMINANCE")))
10276 (para ", " ", " ", " ", " "
10277 R " ", "))
10278 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
10279 (para ", " ", " ", " "
10280 A " ", " "
10281 R " ", "))
10282 (entry (% (heading (code "GL_INTENSITY")))
10283 (para ", " ", " ", " ", " ", " "
10284 R "))
10285 (entry (% (heading (code "GL_RGB")))
10286 (para "
10287 R " ", " "
10288 G " ", " "
10289 B " ", " ", " ", "))
10290 (entry (% (heading (code "GL_RGBA")))
10291 (para "
10292 R "
10293 ", "
10294 "
10295 G "
10296 ", "
10297 "
10298 B "
10299 ", "
10300 "
10301 A "
10302 ", "
10303 ", ")))
10304 (para "
10305 The red, green, blue, alpha, luminance, and/or intensity components of
10306 the resulting pixels are stored in floating-point rather than integer
10307 format. ")
10308 (para "
10309 Pixel ordering is such that lower x screen coordinates correspond to
10310 lower "
10311 (var "i")
10312 " filter image coordinates, and lower y screen coordinates
10313 correspond to lower "
10314 (var "j")
10315 " filter image coordinates. ")
10316 (para "
10317 Note that after a convolution is performed, the resulting color
10318 components are also scaled by their corresponding "
10319 (code "GL_POST_CONVOLUTION_c_SCALE")
10320 " parameters and biased by their
10321 corresponding "
10322 (code "GL_POST_CONVOLUTION_c_BIAS")
10323 " parameters (where "
10324 (var "c")
10325 " takes on the values "
10326 (strong "RED")
10327 ", "
10328 (strong "GREEN")
10329 ", "
10330 (strong "BLUE")
10331 ", and "
10332 (strong "ALPHA")
10333 ").
10334 These parameters are set by "
10335 (code "glPixelTransfer")
10336 ". ")
10337 (heading "Errors")
10338 (para (code "GL_INVALID_ENUM")
10339 " is generated if "
10340 (var "target")
10341 " is not "
10342 (code "GL_CONVOLUTION_2D")
10343 ". ")
10344 (para (code "GL_INVALID_ENUM")
10345 " is generated if "
10346 (var "internalformat")
10347 " is not one of the
10348 allowable values. ")
10349 (para (code "GL_INVALID_VALUE")
10350 " is generated if "
10351 (var "width")
10352 " is less than zero or greater
10353 than the maximum supported value.
10354 This value may be queried with "
10355 (code "glGetConvolutionParameter")
10356 "
10357 using target "
10358 (code "GL_CONVOLUTION_2D")
10359 " and name "
10360 (code "GL_MAX_CONVOLUTION_WIDTH")
10361 ". ")
10362 (para (code "GL_INVALID_VALUE")
10363 " is generated if "
10364 (var "height")
10365 " is less than zero or greater
10366 than the maximum supported value.
10367 This value may be queried with "
10368 (code "glGetConvolutionParameter")
10369 "
10370 using target "
10371 (code "GL_CONVOLUTION_2D")
10372 " and name "
10373 (code "GL_MAX_CONVOLUTION_HEIGHT")
10374 ". ")
10375 (para (code "GL_INVALID_OPERATION")
10376 " is generated if "
10377 (code "glCopyConvolutionFilter2D")
10378 " is executed
10379 between the execution of "
10380 (code "glBegin")
10381 " and the corresponding
10382 execution of "
10383 (code "glEnd")
10384 ". ")))
10385
10386 (define-gl-procedure
10387 glCopyPixels
10388 "glCopyPixels"
10389 (funcsynopsis
10390 (funcprototype
10391 (funcdef "void " (function "glCopyPixels"))
10392 (paramdef "GLint " (parameter "x"))
10393 (paramdef "GLint " (parameter "y"))
10394 (paramdef "GLsizei " (parameter "width"))
10395 (paramdef "GLsizei " (parameter "height"))
10396 (paramdef "GLenum " (parameter "type"))))
10397 '(*fragment*
10398 (heading "copy pixels in the frame buffer")
10399 (heading "Parameters")
10400 (table (% (formatter (asis)))
10401 (entry (% (heading (var "x")))
10402 (itemx (var "y"))
10403 (para "
10404 Specify the window coordinates of the lower left corner
10405 of the rectangular region of pixels to be copied. "))
10406 (entry (% (heading (var "width")))
10407 (itemx (var "height"))
10408 (para "
10409 Specify the dimensions of the rectangular region of pixels to be copied.
10410 Both must be nonnegative. "))
10411 (entry (% (heading (var "type")))
10412 (para "
10413 Specifies whether color values,
10414 depth values,
10415 or stencil values are to be copied.
10416 Symbolic constants "
10417 (code "GL_COLOR")
10418 ", "
10419 (code "GL_DEPTH")
10420 ",
10421 and "
10422 (code "GL_STENCIL")
10423 " are accepted. ")))
10424 (heading "Description")
10425 (para (code "glCopyPixels")
10426 " copies a screen-aligned rectangle of pixels
10427 from the specified frame buffer location to a region relative to the
10428 current raster position.
10429 Its operation is well defined only if the entire pixel source region
10430 is within the exposed portion of the window.
10431 Results of copies from outside the window,
10432 or from regions of the window that are not exposed,
10433 are hardware dependent and undefined. ")
10434 (para (var "x")
10435 " and "
10436 (var "y")
10437 " specify the window coordinates of
10438 the lower left corner of the rectangular region to be copied. "
10439 (var "width")
10440 " and "
10441 (var "height")
10442 " specify the dimensions of the
10443 rectangular region to be copied.
10444 Both "
10445 (var "width")
10446 " and "
10447 (var "height")
10448 " must not be negative. ")
10449 (para "
10450 Several parameters control the processing of the pixel data
10451 while it is being copied.
10452 These parameters are set with three commands: "
10453 (code "glPixelTransfer")
10454 ", "
10455 (code "glPixelMap")
10456 ", and "
10457 (code "glPixelZoom")
10458 ".
10459 This reference page describes the effects on "
10460 (code "glCopyPixels")
10461 " of most,
10462 but not all, of the parameters specified by these three commands. ")
10463 (para (code "glCopyPixels")
10464 " copies values from each pixel with the lower left-hand corner at "
10465 (math "("
10466 (var "x")
10467 "+"
10468 (var "i")
10469 ","
10470 (var "y")
10471 "+"
10472 (var "j")
10473 ")")
10474 "
10475 for "
10476 (math "0" "<=" (var "i") "<" (var "width"))
10477 "
10478 and "
10479 (math "0" "<=" (var "j") "<" (var "height"))
10480 ".
10481 This pixel is said to be the "
10482 (math (var "i"))
10483 "th
10484 pixel in the "
10485 (math (var "j"))
10486 "th
10487 row.
10488 Pixels are copied in row order from the lowest to the highest row,
10489 left to right in each row. ")
10490 (para (var "type")
10491 " specifies whether color, depth, or stencil data is to be copied.
10492 The details of the transfer for each data type are as follows: ")
10493 (table (% (formatter (asis)))
10494 (entry (% (heading (code "GL_COLOR")))
10495 (para "
10496 Indices or RGBA colors are read from the buffer currently specified as the
10497 read source buffer (see "
10498 (code "glReadBuffer")
10499 ").
10500 If the GL is in color index mode,
10501 each index that is read from this buffer is converted
10502 to a fixed-point format with an unspecified
10503 number of bits to the right of the binary point.
10504 Each index is then shifted left by "
10505 (code "GL_INDEX_SHIFT")
10506 " bits,
10507 and added to "
10508 (code "GL_INDEX_OFFSET")
10509 ".
10510 If "
10511 (code "GL_INDEX_SHIFT")
10512 " is negative,
10513 the shift is to the right.
10514 In either case, zero bits fill otherwise unspecified bit locations in the
10515 result.
10516 If "
10517 (code "GL_MAP_COLOR")
10518 " is true,
10519 the index is replaced with the value that it references in lookup table "
10520 (code "GL_PIXEL_MAP_I_TO_I")
10521 ".
10522 Whether the lookup replacement of the index is done or not,
10523 the integer part of the index is then ANDed with "
10524 (math "2" "^" (var "b") "-" "1")
10525 ",
10526 where "
10527 (math (var "b"))
10528 "
10529 is the number of bits in a color index buffer. ")
10530 (para "
10531 If the GL is in RGBA mode,
10532 the red, green, blue, and alpha components of each pixel that is read
10533 are converted to an internal floating-point format with unspecified
10534 precision.
10535 The conversion maps the largest representable component value to 1.0,
10536 and component value 0 to 0.0.
10537 The resulting floating-point color values are then multiplied
10538 by "
10539 (code "GL_c_SCALE")
10540 " and added to "
10541 (code "GL_c_BIAS")
10542 ",
10543 where "
10544 (var "c")
10545 " is RED, GREEN, BLUE, and ALPHA
10546 for the respective color components.
10547 The results are clamped to the range [0,1].
10548 If "
10549 (code "GL_MAP_COLOR")
10550 " is true,
10551 each color component is scaled by the size of lookup table "
10552 (code "GL_PIXEL_MAP_c_TO_c")
10553 ",
10554 then replaced by the value that it references in that table. "
10555 (var "c")
10556 " is R, G, B, or A. ")
10557 (para "
10558 If the "
10559 (code "ARB_imaging")
10560 " extension is supported, the color values may
10561 be
10562 additionally processed by color-table lookups, color-matrix
10563 transformations, and convolution filters. ")
10564 (para "
10565 The GL then converts the resulting indices or RGBA colors to fragments
10566 by attaching the current raster position "
10567 (var "z")
10568 " coordinate and
10569 texture coordinates to each pixel,
10570 then assigning window coordinates "
10571 (math "("
10572 (var "x")
10573 "_"
10574 (var "r")
10575 "+"
10576 (var "i")
10577 ","
10578 (var "y")
10579 "_"
10580 (var "r")
10581 "+"
10582 (var "j")
10583 ")")
10584 ",
10585 where "
10586 (math "("
10587 (var "x")
10588 "_"
10589 (var "r")
10590 ","
10591 (var "y")
10592 "_"
10593 (var "r")
10594 ")")
10595 "
10596 is the current raster position,
10597 and the pixel was the "
10598 (math (var "i"))
10599 "th
10600 pixel in the "
10601 (math (var "j"))
10602 "th
10603 row.
10604 These pixel fragments are then treated just like the fragments generated by
10605 rasterizing points, lines, or polygons.
10606 Texture mapping,
10607 fog,
10608 and all the fragment operations are applied before the fragments are written
10609 to the frame buffer. "))
10610 (entry (% (heading (code "GL_DEPTH")))
10611 (para "
10612 Depth values are read from the depth buffer and
10613 converted directly to an internal floating-point format
10614 with unspecified precision.
10615 The resulting floating-point depth value is then multiplied
10616 by "
10617 (code "GL_DEPTH_SCALE")
10618 " and added to "
10619 (code "GL_DEPTH_BIAS")
10620 ".
10621 The result is clamped to the range [0,1]. ")
10622 (para "
10623 The GL then converts the resulting depth components to fragments
10624 by attaching the current raster position color or color index and
10625 texture coordinates to each pixel,
10626 then assigning window coordinates "
10627 (math "("
10628 (var "x")
10629 "_"
10630 (var "r")
10631 "+"
10632 (var "i")
10633 ","
10634 (var "y")
10635 "_"
10636 (var "r")
10637 "+"
10638 (var "j")
10639 ")")
10640 ",
10641 where "
10642 (math "("
10643 (var "x")
10644 "_"
10645 (var "r")
10646 ","
10647 (var "y")
10648 "_"
10649 (var "r")
10650 ")")
10651 "
10652 is the current raster position,
10653 and the pixel was the "
10654 (math (var "i"))
10655 "th
10656 pixel in the "
10657 (math (var "j"))
10658 "th
10659 row.
10660 These pixel fragments are then treated just like the fragments generated by
10661 rasterizing points, lines, or polygons.
10662 Texture mapping,
10663 fog,
10664 and all the fragment operations are applied before the fragments are written
10665 to the frame buffer. "))
10666 (entry (% (heading (code "GL_STENCIL")))
10667 (para "
10668 Stencil indices are read from the stencil buffer and
10669 converted to an internal fixed-point format
10670 with an unspecified number of bits to the right of the binary point.
10671 Each fixed-point index is then shifted left by "
10672 (code "GL_INDEX_SHIFT")
10673 " bits,
10674 and added to "
10675 (code "GL_INDEX_OFFSET")
10676 ".
10677 If "
10678 (code "GL_INDEX_SHIFT")
10679 " is negative,
10680 the shift is to the right.
10681 In either case, zero bits fill otherwise unspecified bit locations in the
10682 result.
10683 If "
10684 (code "GL_MAP_STENCIL")
10685 " is true,
10686 the index is replaced with the value that it references in lookup table "
10687 (code "GL_PIXEL_MAP_S_TO_S")
10688 ".
10689 Whether the lookup replacement of the index is done or not,
10690 the integer part of the index is then ANDed with "
10691 (math "2" "^" (var "b") "-" "1")
10692 ",
10693 where "
10694 (math (var "b"))
10695 "
10696 is the number of bits in the stencil buffer.
10697 The resulting stencil indices are then written to the stencil buffer
10698 such that the index read from the "
10699 (math (var "i"))
10700 "th
10701 location of the "
10702 (math (var "j"))
10703 "th
10704 row
10705 is written to location "
10706 (math "("
10707 (var "x")
10708 "_"
10709 (var "r")
10710 "+"
10711 (var "i")
10712 ","
10713 (var "y")
10714 "_"
10715 (var "r")
10716 "+"
10717 (var "j")
10718 ")")
10719 ",
10720 where "
10721 (math "("
10722 (var "x")
10723 "_"
10724 (var "r")
10725 ","
10726 (var "y")
10727 "_"
10728 (var "r")
10729 ")")
10730 "
10731 is the current raster position.
10732 Only the pixel ownership test,
10733 the scissor test,
10734 and the stencil writemask affect these write operations. ")))
10735 (para "
10736 The rasterization described thus far assumes pixel zoom factors of 1.0.
10737 If "
10738 (code "glPixelZoom")
10739 " is used to change the "
10740 (math (var "x"))
10741 "
10742 and "
10743 (math (var "y"))
10744 "
10745 pixel zoom factors,
10746 pixels are converted to fragments as follows.
10747 If "
10748 (math "("
10749 (var "x")
10750 "_"
10751 (var "r")
10752 ","
10753 (var "y")
10754 "_"
10755 (var "r")
10756 ")")
10757 "
10758 is the current raster position,
10759 and a given pixel is in the "
10760 (math (var "i"))
10761 "th
10762 location in the "
10763 (math (var "j"))
10764 "th
10765 row of the source
10766 pixel rectangle,
10767 then fragments are generated for pixels whose centers are in the rectangle
10768 with corners at ")
10769 (para (math "("
10770 (var "x")
10771 "_"
10772 (var "r")
10773 "+"
10774 (var "zoom")
10775 "_"
10776 (var "x")
10777 ","
10778 "\u2062"
10779 (var "i")
10780 ","
10781 (var "y")
10782 "_"
10783 (var "r")
10784 "+"
10785 (var "zoom")
10786 "_"
10787 (var "y")
10788 ","
10789 "\u2062"
10790 (var "j")
10791 ")"))
10792 (para "
10793 and ")
10794 (para (math "("
10795 (var "x")
10796 "_"
10797 (var "r")
10798 "+"
10799 (var "zoom")
10800 "_"
10801 (var "x")
10802 ","
10803 "\u2061"
10804 "("
10805 (var "i")
10806 "+"
10807 "1"
10808 ","
10809 ")"
10810 ","
10811 (var "y")
10812 "_"
10813 (var "r")
10814 "+"
10815 (var "zoom")
10816 "_"
10817 (var "y")
10818 ","
10819 "\u2061"
10820 "("
10821 (var "j")
10822 "+"
10823 "1"
10824 ","
10825 ")"
10826 ")"))
10827 (para "
10828 where "
10829 (math (var "zoom") "_" (var "x"))
10830 "
10831 is the value of "
10832 (code "GL_ZOOM_X")
10833 " and "
10834 (math (var "zoom") "_" (var "y"))
10835 "
10836 is the value of "
10837 (code "GL_ZOOM_Y")
10838 ". ")
10839 (heading "Errors")
10840 (para (code "GL_INVALID_ENUM")
10841 " is generated if "
10842 (var "type")
10843 " is not an accepted value. ")
10844 (para (code "GL_INVALID_VALUE")
10845 " is generated if either "
10846 (var "width")
10847 " or "
10848 (var "height")
10849 " is negative. ")
10850 (para (code "GL_INVALID_OPERATION")
10851 " is generated if "
10852 (var "type")
10853 " is "
10854 (code "GL_DEPTH")
10855 "
10856 and there is no depth buffer. ")
10857 (para (code "GL_INVALID_OPERATION")
10858 " is generated if "
10859 (var "type")
10860 " is "
10861 (code "GL_STENCIL")
10862 "
10863 and there is no stencil buffer. ")
10864 (para (code "GL_INVALID_OPERATION")
10865 " is generated if "
10866 (code "glCopyPixels")
10867 "
10868 is executed between the execution of "
10869 (code "glBegin")
10870 "
10871 and the corresponding execution of "
10872 (code "glEnd")
10873 ". ")))
10874
10875 (define-gl-procedure
10876 glCopyTexImage1D
10877 "glCopyTexImage1D"
10878 (funcsynopsis
10879 (funcprototype
10880 (funcdef "void " (function "glCopyTexImage1D"))
10881 (paramdef "GLenum " (parameter "target"))
10882 (paramdef "GLint " (parameter "level"))
10883 (paramdef "GLenum " (parameter "internalformat"))
10884 (paramdef "GLint " (parameter "x"))
10885 (paramdef "GLint " (parameter "y"))
10886 (paramdef "GLsizei " (parameter "width"))
10887 (paramdef "GLint " (parameter "border"))))
10888 '(*fragment*
10889 (heading "copy pixels into a 1D texture image")
10890 (heading "Parameters")
10891 (table (% (formatter (asis)))
10892 (entry (% (heading (var "target")))
10893 (para "
10894 Specifies the target texture.
10895 Must be "
10896 (code "GL_TEXTURE_1D")
10897 ". "))
10898 (entry (% (heading (var "level")))
10899 (para "
10900 Specifies the level-of-detail number.
10901 Level 0 is the base image level.
10902 Level "
10903 (var "n")
10904 " is the "
10905 (var "n")
10906 "th mipmap reduction image. "))
10907 (entry (% (heading (var "internalformat")))
10908 (para "
10909 Specifies the internal format of the texture.
10910 Must be one of the following symbolic constants: "
10911 (code "GL_ALPHA")
10912 ", "
10913 (code "GL_ALPHA4")
10914 ", "
10915 (code "GL_ALPHA8")
10916 ", "
10917 (code "GL_ALPHA12")
10918 ", "
10919 (code "GL_ALPHA16")
10920 ", "
10921 (code "GL_COMPRESSED_ALPHA")
10922 ", "
10923 (code "GL_COMPRESSED_LUMINANCE")
10924 ", "
10925 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
10926 ", "
10927 (code "GL_COMPRESSED_INTENSITY")
10928 ", "
10929 (code "GL_COMPRESSED_RGB")
10930 ", "
10931 (code "GL_COMPRESSED_RGBA")
10932 ", "
10933 (code "GL_DEPTH_COMPONENT")
10934 ", "
10935 (code "GL_DEPTH_COMPONENT16")
10936 ", "
10937 (code "GL_DEPTH_COMPONENT24")
10938 ", "
10939 (code "GL_DEPTH_COMPONENT32")
10940 ", "
10941 (code "GL_LUMINANCE")
10942 ", "
10943 (code "GL_LUMINANCE4")
10944 ", "
10945 (code "GL_LUMINANCE8")
10946 ", "
10947 (code "GL_LUMINANCE12")
10948 ", "
10949 (code "GL_LUMINANCE16")
10950 ", "
10951 (code "GL_LUMINANCE_ALPHA")
10952 ", "
10953 (code "GL_LUMINANCE4_ALPHA4")
10954 ", "
10955 (code "GL_LUMINANCE6_ALPHA2")
10956 ", "
10957 (code "GL_LUMINANCE8_ALPHA8")
10958 ", "
10959 (code "GL_LUMINANCE12_ALPHA4")
10960 ", "
10961 (code "GL_LUMINANCE12_ALPHA12")
10962 ", "
10963 (code "GL_LUMINANCE16_ALPHA16")
10964 ", "
10965 (code "GL_INTENSITY")
10966 ", "
10967 (code "GL_INTENSITY4")
10968 ", "
10969 (code "GL_INTENSITY8")
10970 ", "
10971 (code "GL_INTENSITY12")
10972 ", "
10973 (code "GL_INTENSITY16")
10974 ", "
10975 (code "GL_RGB")
10976 ", "
10977 (code "GL_R3_G3_B2")
10978 ", "
10979 (code "GL_RGB4")
10980 ", "
10981 (code "GL_RGB5")
10982 ", "
10983 (code "GL_RGB8")
10984 ", "
10985 (code "GL_RGB10")
10986 ", "
10987 (code "GL_RGB12")
10988 ", "
10989 (code "GL_RGB16")
10990 ", "
10991 (code "GL_RGBA")
10992 ", "
10993 (code "GL_RGBA2")
10994 ", "
10995 (code "GL_RGBA4")
10996 ", "
10997 (code "GL_RGB5_A1")
10998 ", "
10999 (code "GL_RGBA8")
11000 ", "
11001 (code "GL_RGB10_A2")
11002 ", "
11003 (code "GL_RGBA12")
11004 ", "
11005 (code "GL_RGBA16")
11006 ", "
11007 (code "GL_SLUMINANCE")
11008 ", "
11009 (code "GL_SLUMINANCE8")
11010 ", "
11011 (code "GL_SLUMINANCE_ALPHA")
11012 ", "
11013 (code "GL_SLUMINANCE8_ALPHA8")
11014 ", "
11015 (code "GL_SRGB")
11016 ", "
11017 (code "GL_SRGB8")
11018 ", "
11019 (code "GL_SRGB_ALPHA")
11020 ", or "
11021 (code "GL_SRGB8_ALPHA8")
11022 ". "))
11023 (entry (% (heading (var "x")))
11024 (itemx (var "y"))
11025 (para "
11026 Specify the window coordinates of the left corner
11027 of the row of pixels to be copied. "))
11028 (entry (% (heading (var "width")))
11029 (para "
11030 Specifies the width of the texture image.
11031 Must be 0 or "
11032 (math "2"
11033 "^"
11034 (var "n")
11035 "+"
11036 "2"
11037 "\u2061"
11038 "("
11039 (var "border")
11040 ","
11041 ")")
11042 "
11043 for some integer "
11044 (math (var "n"))
11045 ".
11046 The height of the texture image is 1. "))
11047 (entry (% (heading (var "border")))
11048 (para "
11049 Specifies the width of the border.
11050 Must be either 0 or 1. ")))
11051 (heading "Description")
11052 (para (code "glCopyTexImage1D")
11053 " defines a one-dimensional texture image with pixels from the current "
11054 (code "GL_READ_BUFFER")
11055 ". ")
11056 (para "
11057 The screen-aligned pixel row with left corner at "
11058 (math "(" (var "x") "," (var "y") ")")
11059 "
11060 and with a length of "
11061 (math (var "width")
11062 "+"
11063 "2"
11064 "\u2061"
11065 "("
11066 (var "border")
11067 ","
11068 ")")
11069 "
11070 defines the texture array
11071 at the mipmap level specified by "
11072 (var "level")
11073 ". "
11074 (var "internalformat")
11075 " specifies the internal format of the texture array. ")
11076 (para "
11077 The pixels in the row are processed exactly as if "
11078 (code "glCopyPixels")
11079 " had been called, but the process stops just before
11080 final conversion.
11081 At this point all pixel component values are clamped to the range "
11082 (math "[" "0" "," "1" "]")
11083 "
11084 and then converted to the texture's internal format for storage in the texel
11085 array. ")
11086 (para "
11087 Pixel ordering is such that lower "
11088 (math (var "x"))
11089 "
11090 screen coordinates correspond to
11091 lower texture coordinates. ")
11092 (para "
11093 If any of the pixels within the specified row of the current "
11094 (code "GL_READ_BUFFER")
11095 " are outside the window associated with the current
11096 rendering context, then the values obtained for those pixels are undefined. ")
11097 (para (code "glCopyTexImage1D")
11098 " defines a one-dimensional texture image with pixels from the current "
11099 (code "GL_READ_BUFFER")
11100 ". ")
11101 (para "
11102 When "
11103 (var "internalformat")
11104 " is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the "
11105 (code "glPixelMap")
11106 " function can be used to accomplish the conversion. ")
11107 (heading "Errors")
11108 (para (code "GL_INVALID_ENUM")
11109 " is generated if "
11110 (var "target")
11111 " is not one of the allowable values. ")
11112 (para (code "GL_INVALID_VALUE")
11113 " is generated if "
11114 (var "level")
11115 " is less than 0. ")
11116 (para (code "GL_INVALID_VALUE")
11117 " may be generated if "
11118 (var "level")
11119 " is greater
11120 than "
11121 (math (var "log") "_" "2" "\u2062" (var "max"))
11122 ",
11123 where "
11124 (math (var "max"))
11125 "
11126 is the returned value of "
11127 (code "GL_MAX_TEXTURE_SIZE")
11128 ". ")
11129 (para (code "GL_INVALID_VALUE")
11130 " is generated if "
11131 (var "internalformat")
11132 " is not an allowable value. ")
11133 (para (code "GL_INVALID_VALUE")
11134 " is generated if "
11135 (var "width")
11136 " is less than 0 or greater than
11137 2 + "
11138 (code "GL_MAX_TEXTURE_SIZE")
11139 ". ")
11140 (para (code "GL_INVALID_VALUE")
11141 " is generated if non-power-of-two textures are not supported and the "
11142 (var "width")
11143 " cannot be represented as "
11144 (math "2"
11145 "^"
11146 (var "n")
11147 "+"
11148 "2"
11149 "\u2061"
11150 "("
11151 (var "border")
11152 ","
11153 ")")
11154 "
11155 for some integer value of "
11156 (var "n")
11157 ". ")
11158 (para (code "GL_INVALID_VALUE")
11159 " is generated if "
11160 (var "border")
11161 " is not 0 or 1. ")
11162 (para (code "GL_INVALID_OPERATION")
11163 " is generated if "
11164 (code "glCopyTexImage1D")
11165 " is executed between the execution of "
11166 (code "glBegin")
11167 " and the corresponding execution of "
11168 (code "glEnd")
11169 ". ")
11170 (para (code "GL_INVALID_OPERATION")
11171 " is generated if "
11172 (var "internalformat")
11173 " is "
11174 (code "GL_DEPTH_COMPONENT")
11175 ", "
11176 (code "GL_DEPTH_COMPONENT16")
11177 ", "
11178 (code "GL_DEPTH_COMPONENT24")
11179 ", or "
11180 (code "GL_DEPTH_COMPONENT32")
11181 " and there is no depth
11182 buffer. ")))
11183
11184 (define-gl-procedure
11185 glCopyTexImage2D
11186 "glCopyTexImage2D"
11187 (funcsynopsis
11188 (funcprototype
11189 (funcdef "void " (function "glCopyTexImage2D"))
11190 (paramdef "GLenum " (parameter "target"))
11191 (paramdef "GLint " (parameter "level"))
11192 (paramdef "GLenum " (parameter "internalformat"))
11193 (paramdef "GLint " (parameter "x"))
11194 (paramdef "GLint " (parameter "y"))
11195 (paramdef "GLsizei " (parameter "width"))
11196 (paramdef "GLsizei " (parameter "height"))
11197 (paramdef "GLint " (parameter "border"))))
11198 '(*fragment*
11199 (heading "copy pixels into a 2D texture image")
11200 (heading "Parameters")
11201 (table (% (formatter (asis)))
11202 (entry (% (heading (var "target")))
11203 (para "
11204 Specifies the target texture.
11205 Must be "
11206 (code "GL_TEXTURE_2D")
11207 ", "
11208 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
11209 ", "
11210 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
11211 ", "
11212 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
11213 ", "
11214 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
11215 ", "
11216 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
11217 ", or "
11218 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
11219 ". "))
11220 (entry (% (heading (var "level")))
11221 (para "
11222 Specifies the level-of-detail number.
11223 Level 0 is the base image level.
11224 Level "
11225 (var "n")
11226 " is the "
11227 (var "n")
11228 "th mipmap reduction image. "))
11229 (entry (% (heading (var "internalformat")))
11230 (para "
11231 Specifies the internal format of the texture.
11232 Must be one of the following symbolic constants: "
11233 (code "GL_ALPHA")
11234 ", "
11235 (code "GL_ALPHA4")
11236 ", "
11237 (code "GL_ALPHA8")
11238 ", "
11239 (code "GL_ALPHA12")
11240 ", "
11241 (code "GL_ALPHA16")
11242 ", "
11243 (code "GL_COMPRESSED_ALPHA")
11244 ", "
11245 (code "GL_COMPRESSED_LUMINANCE")
11246 ", "
11247 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
11248 ", "
11249 (code "GL_COMPRESSED_INTENSITY")
11250 ", "
11251 (code "GL_COMPRESSED_RGB")
11252 ", "
11253 (code "GL_COMPRESSED_RGBA")
11254 ", "
11255 (code "GL_DEPTH_COMPONENT")
11256 ", "
11257 (code "GL_DEPTH_COMPONENT16")
11258 ", "
11259 (code "GL_DEPTH_COMPONENT24")
11260 ", "
11261 (code "GL_DEPTH_COMPONENT32")
11262 ", "
11263 (code "GL_LUMINANCE")
11264 ", "
11265 (code "GL_LUMINANCE4")
11266 ", "
11267 (code "GL_LUMINANCE8")
11268 ", "
11269 (code "GL_LUMINANCE12")
11270 ", "
11271 (code "GL_LUMINANCE16")
11272 ", "
11273 (code "GL_LUMINANCE_ALPHA")
11274 ", "
11275 (code "GL_LUMINANCE4_ALPHA4")
11276 ", "
11277 (code "GL_LUMINANCE6_ALPHA2")
11278 ", "
11279 (code "GL_LUMINANCE8_ALPHA8")
11280 ", "
11281 (code "GL_LUMINANCE12_ALPHA4")
11282 ", "
11283 (code "GL_LUMINANCE12_ALPHA12")
11284 ", "
11285 (code "GL_LUMINANCE16_ALPHA16")
11286 ", "
11287 (code "GL_INTENSITY")
11288 ", "
11289 (code "GL_INTENSITY4")
11290 ", "
11291 (code "GL_INTENSITY8")
11292 ", "
11293 (code "GL_INTENSITY12")
11294 ", "
11295 (code "GL_INTENSITY16")
11296 ", "
11297 (code "GL_RGB")
11298 ", "
11299 (code "GL_R3_G3_B2")
11300 ", "
11301 (code "GL_RGB4")
11302 ", "
11303 (code "GL_RGB5")
11304 ", "
11305 (code "GL_RGB8")
11306 ", "
11307 (code "GL_RGB10")
11308 ", "
11309 (code "GL_RGB12")
11310 ", "
11311 (code "GL_RGB16")
11312 ", "
11313 (code "GL_RGBA")
11314 ", "
11315 (code "GL_RGBA2")
11316 ", "
11317 (code "GL_RGBA4")
11318 ", "
11319 (code "GL_RGB5_A1")
11320 ", "
11321 (code "GL_RGBA8")
11322 ", "
11323 (code "GL_RGB10_A2")
11324 ", "
11325 (code "GL_RGBA12")
11326 ", "
11327 (code "GL_RGBA16")
11328 ", "
11329 (code "GL_SLUMINANCE")
11330 ", "
11331 (code "GL_SLUMINANCE8")
11332 ", "
11333 (code "GL_SLUMINANCE_ALPHA")
11334 ", "
11335 (code "GL_SLUMINANCE8_ALPHA8")
11336 ", "
11337 (code "GL_SRGB")
11338 ", "
11339 (code "GL_SRGB8")
11340 ", "
11341 (code "GL_SRGB_ALPHA")
11342 ", or "
11343 (code "GL_SRGB8_ALPHA8")
11344 ". "))
11345 (entry (% (heading (var "x")))
11346 (itemx (var "y"))
11347 (para "
11348 Specify the window coordinates of the lower left corner
11349 of the rectangular region of pixels to be copied. "))
11350 (entry (% (heading (var "width")))
11351 (para "
11352 Specifies the width of the texture image.
11353 Must be 0 or "
11354 (math "2"
11355 "^"
11356 (var "n")
11357 "+"
11358 "2"
11359 "\u2061"
11360 "("
11361 (var "border")
11362 ","
11363 ")")
11364 "
11365 for some integer "
11366 (math (var "n"))
11367 ". "))
11368 (entry (% (heading (var "height")))
11369 (para "
11370 Specifies the height of the texture image.
11371 Must be 0 or "
11372 (math "2"
11373 "^"
11374 (var "m")
11375 "+"
11376 "2"
11377 "\u2061"
11378 "("
11379 (var "border")
11380 ","
11381 ")")
11382 "
11383 for some integer "
11384 (math (var "m"))
11385 ". "))
11386 (entry (% (heading (var "border")))
11387 (para "
11388 Specifies the width of the border.
11389 Must be either 0 or 1. ")))
11390 (heading "Description")
11391 (para (code "glCopyTexImage2D")
11392 " defines a two-dimensional texture image, or cube-map texture image
11393 with pixels from the current "
11394 (code "GL_READ_BUFFER")
11395 ". ")
11396 (para "
11397 The screen-aligned pixel rectangle with lower left corner at ("
11398 (var "x")
11399 ", "
11400 (var "y")
11401 ") and with a width of "
11402 (math (var "width")
11403 "+"
11404 "2"
11405 "\u2061"
11406 "("
11407 (var "border")
11408 ","
11409 ")")
11410 "
11411 and a height of "
11412 (math (var "height")
11413 "+"
11414 "2"
11415 "\u2061"
11416 "("
11417 (var "border")
11418 ","
11419 ")")
11420 "
11421 defines the texture array
11422 at the mipmap level specified by "
11423 (var "level")
11424 ". "
11425 (var "internalformat")
11426 " specifies the internal format of the texture array. ")
11427 (para "
11428 The pixels in the rectangle are processed exactly as if "
11429 (code "glCopyPixels")
11430 " had been called, but the process stops just before
11431 final conversion.
11432 At this point all pixel component values are clamped to the range "
11433 (math "[" "0" "," "1" "]")
11434 "
11435 and then converted to the texture's internal format for storage in the texel
11436 array. ")
11437 (para "
11438 Pixel ordering is such that lower "
11439 (math (var "x"))
11440 "
11441 and "
11442 (math (var "y"))
11443 "
11444 screen coordinates correspond to
11445 lower "
11446 (math (var "s"))
11447 "
11448 and "
11449 (math (var "t"))
11450 "
11451 texture coordinates. ")
11452 (para "
11453 If any of the pixels within the specified rectangle of the current "
11454 (code "GL_READ_BUFFER")
11455 " are outside the window associated with the current
11456 rendering context, then the values obtained for those pixels are undefined. ")
11457 (para "
11458 When "
11459 (var "internalformat")
11460 " is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. In this case, the "
11461 (code "glPixelMap")
11462 " function can be used to accomplish the conversion. ")
11463 (heading "Errors")
11464 (para (code "GL_INVALID_ENUM")
11465 " is generated if "
11466 (var "target")
11467 " is not "
11468 (code "GL_TEXTURE_2D")
11469 ", "
11470 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
11471 ", "
11472 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
11473 ", "
11474 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
11475 ", "
11476 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
11477 ", "
11478 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
11479 ", or "
11480 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
11481 ". ")
11482 (para (code "GL_INVALID_VALUE")
11483 " is generated if "
11484 (var "level")
11485 " is less than 0. ")
11486 (para (code "GL_INVALID_VALUE")
11487 " may be generated if "
11488 (var "level")
11489 " is greater
11490 than "
11491 (math (var "log") "_" "2" "\u2062" (var "max"))
11492 ",
11493 where "
11494 (math (var "max"))
11495 "
11496 is the returned value of "
11497 (code "GL_MAX_TEXTURE_SIZE")
11498 ". ")
11499 (para (code "GL_INVALID_VALUE")
11500 " is generated if "
11501 (var "width")
11502 " is less than 0
11503 or greater than
11504 2 + "
11505 (code "GL_MAX_TEXTURE_SIZE")
11506 ". ")
11507 (para (code "GL_INVALID_VALUE")
11508 " is generated if non-power-of-two textures are not supported and the "
11509 (var "width")
11510 " or "
11511 (var "depth")
11512 " cannot be represented as "
11513 (math "2"
11514 "^"
11515 (var "k")
11516 "+"
11517 "2"
11518 "\u2061"
11519 "("
11520 (var "border")
11521 ","
11522 ")")
11523 "
11524 for some integer "
11525 (math (var "k"))
11526 ". ")
11527 (para (code "GL_INVALID_VALUE")
11528 " is generated if "
11529 (var "border")
11530 " is not 0 or 1. ")
11531 (para (code "GL_INVALID_VALUE")
11532 " is generated if "
11533 (var "internalformat")
11534 " is not an
11535 accepted format. ")
11536 (para (code "GL_INVALID_OPERATION")
11537 " is generated if "
11538 (code "glCopyTexImage2D")
11539 " is executed
11540 between the execution of "
11541 (code "glBegin")
11542 " and the corresponding
11543 execution of "
11544 (code "glEnd")
11545 ". ")
11546 (para (code "GL_INVALID_OPERATION")
11547 " is generated if "
11548 (var "internalformat")
11549 " is "
11550 (code "GL_DEPTH_COMPONENT")
11551 ", "
11552 (code "GL_DEPTH_COMPONENT16")
11553 ", "
11554 (code "GL_DEPTH_COMPONENT24")
11555 ", or "
11556 (code "GL_DEPTH_COMPONENT32")
11557 " and there is no depth
11558 buffer. ")))
11559
11560 (define-gl-procedure
11561 glCopyTexSubImage1D
11562 "glCopyTexSubImage1D"
11563 (funcsynopsis
11564 (funcprototype
11565 (funcdef
11566 "void "
11567 (function "glCopyTexSubImage1D"))
11568 (paramdef "GLenum " (parameter "target"))
11569 (paramdef "GLint " (parameter "level"))
11570 (paramdef "GLint " (parameter "xoffset"))
11571 (paramdef "GLint " (parameter "x"))
11572 (paramdef "GLint " (parameter "y"))
11573 (paramdef "GLsizei " (parameter "width"))))
11574 '(*fragment*
11575 (heading
11576 "copy a one-dimensional texture subimage")
11577 (heading "Parameters")
11578 (table (% (formatter (asis)))
11579 (entry (% (heading (var "target")))
11580 (para "
11581 Specifies the target texture.
11582 Must be "
11583 (code "GL_TEXTURE_1D")
11584 ". "))
11585 (entry (% (heading (var "level")))
11586 (para "
11587 Specifies the level-of-detail number.
11588 Level 0 is the base image level.
11589 Level "
11590 (var "n")
11591 " is the "
11592 (var "n")
11593 "th mipmap reduction image. "))
11594 (entry (% (heading (var "xoffset")))
11595 (para "
11596 Specifies the texel offset within the texture array. "))
11597 (entry (% (heading (var "x")))
11598 (itemx (var "y"))
11599 (para "
11600 Specify the window coordinates of the left corner
11601 of the row of pixels to be copied. "))
11602 (entry (% (heading (var "width")))
11603 (para "
11604 Specifies the width of the texture subimage. ")))
11605 (heading "Description")
11606 (para (code "glCopyTexSubImage1D")
11607 " replaces a portion of a one-dimensional
11608 texture image with pixels from the current "
11609 (code "GL_READ_BUFFER")
11610 " (rather
11611 than from main memory, as is the case for "
11612 (code "glTexSubImage1D")
11613 "). ")
11614 (para "
11615 The screen-aligned pixel row with left corner at ("
11616 (var "x")
11617 ",\\ "
11618 (var "y")
11619 "), and with
11620 length "
11621 (var "width")
11622 " replaces the portion of the
11623 texture array with x indices "
11624 (var "xoffset")
11625 " through "
11626 (math (var "xoffset") "+" (var "width") "-" "1")
11627 ",
11628 inclusive. The destination in the texture array may not
11629 include any texels outside the texture array as it was
11630 originally specified. ")
11631 (para "
11632 The pixels in the row are processed exactly as if "
11633 (code "glCopyPixels")
11634 " had been called, but the process stops just before
11635 final conversion.
11636 At this point, all pixel component values are clamped to the range "
11637 (math "[" "0" "," "1" "]")
11638 "
11639 and then converted to the texture's internal format for storage in the texel
11640 array. ")
11641 (para "
11642 It is not an error to specify a subtexture with zero width, but
11643 such a specification has no effect.
11644 If any of the pixels within the specified row of the current "
11645 (code "GL_READ_BUFFER")
11646 " are outside the read window associated with the current
11647 rendering context, then the values obtained for those pixels are undefined. ")
11648 (para "
11649 No change is made to the "
11650 (var "internalformat")
11651 ", "
11652 (var "width")
11653 ",
11654 or "
11655 (var "border")
11656 " parameters of the specified texture
11657 array or to texel values outside the specified subregion. ")
11658 (heading "Errors")
11659 (para (code "GL_INVALID_ENUM")
11660 " is generated if /"
11661 (var "target")
11662 " is not "
11663 (code "GL_TEXTURE_1D")
11664 ". ")
11665 (para (code "GL_INVALID_OPERATION")
11666 " is generated if the texture array has not
11667 been defined by a previous "
11668 (code "glTexImage1D")
11669 " or "
11670 (code "glCopyTexImage1D")
11671 " operation. ")
11672 (para (code "GL_INVALID_VALUE")
11673 " is generated if "
11674 (var "level")
11675 " is less than 0. ")
11676 (para (code "GL_INVALID_VALUE")
11677 " may be generated if "
11678 (math (var "level")
11679 ">"
11680 (var "log")
11681 "_"
11682 "2"
11683 "\u2061"
11684 "("
11685 (var "max")
11686 ","
11687 ")")
11688 ",
11689 where "
11690 (var "max")
11691 " is the returned value of "
11692 (code "GL_MAX_TEXTURE_SIZE")
11693 ". ")
11694 (para (code "GL_INVALID_VALUE")
11695 " is generated if "
11696 (math (var "xoffset") "<" "-" (var "b"))
11697 ",
11698 or "
11699 (math "("
11700 (var "xoffset")
11701 "+"
11702 (var "width")
11703 ","
11704 ")"
11705 ">"
11706 "("
11707 (var "w")
11708 "-"
11709 (var "b")
11710 ","
11711 ")")
11712 ",
11713 where "
11714 (math (var "w"))
11715 "
11716 is the "
11717 (code "GL_TEXTURE_WIDTH")
11718 " and "
11719 (math (var "b"))
11720 "
11721 is the "
11722 (code "GL_TEXTURE_BORDER")
11723 "
11724 of the texture image being modified.
11725 Note that "
11726 (math (var "w"))
11727 "
11728 includes twice the border width. ")
11729 (para)))
11730
11731 (define-gl-procedure
11732 glCopyTexSubImage2D
11733 "glCopyTexSubImage2D"
11734 (funcsynopsis
11735 (funcprototype
11736 (funcdef
11737 "void "
11738 (function "glCopyTexSubImage2D"))
11739 (paramdef "GLenum " (parameter "target"))
11740 (paramdef "GLint " (parameter "level"))
11741 (paramdef "GLint " (parameter "xoffset"))
11742 (paramdef "GLint " (parameter "yoffset"))
11743 (paramdef "GLint " (parameter "x"))
11744 (paramdef "GLint " (parameter "y"))
11745 (paramdef "GLsizei " (parameter "width"))
11746 (paramdef "GLsizei " (parameter "height"))))
11747 '(*fragment*
11748 (heading
11749 "copy a two-dimensional texture subimage")
11750 (heading "Parameters")
11751 (table (% (formatter (asis)))
11752 (entry (% (heading (var "target")))
11753 (para "
11754 Specifies the target texture.
11755 Must be "
11756 (code "GL_TEXTURE_2D")
11757 ", "
11758 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
11759 ", "
11760 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
11761 ", "
11762 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
11763 ", "
11764 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
11765 ", "
11766 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
11767 ", or "
11768 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
11769 ". "))
11770 (entry (% (heading (var "level")))
11771 (para "
11772 Specifies the level-of-detail number.
11773 Level 0 is the base image level.
11774 Level "
11775 (var "n")
11776 " is the "
11777 (var "n")
11778 "th mipmap reduction image. "))
11779 (entry (% (heading (var "xoffset")))
11780 (para "
11781 Specifies a texel offset in the x direction within the texture array. "))
11782 (entry (% (heading (var "yoffset")))
11783 (para "
11784 Specifies a texel offset in the y direction within the texture array. "))
11785 (entry (% (heading (var "x")))
11786 (itemx (var "y"))
11787 (para "
11788 Specify the window coordinates of the lower left corner
11789 of the rectangular region of pixels to be copied. "))
11790 (entry (% (heading (var "width")))
11791 (para "
11792 Specifies the width of the texture subimage. "))
11793 (entry (% (heading (var "height")))
11794 (para "
11795 Specifies the height of the texture subimage. ")))
11796 (heading "Description")
11797 (para (code "glCopyTexSubImage2D")
11798 " replaces a rectangular portion of a two-dimensional texture image or
11799 cube-map texture image with pixels from the current "
11800 (code "GL_READ_BUFFER")
11801 "
11802 (rather than from main memory, as is the case for "
11803 (code "glTexSubImage2D")
11804 "). ")
11805 (para "
11806 The screen-aligned pixel rectangle with lower left corner at "
11807 (math "(" (var "x") "," (var "y") ")")
11808 "
11809 and with
11810 width "
11811 (var "width")
11812 " and height "
11813 (var "height")
11814 " replaces the portion of the
11815 texture array with x indices "
11816 (var "xoffset")
11817 " through "
11818 (math (var "xoffset") "+" (var "width") "-" "1")
11819 ",
11820 inclusive, and y indices "
11821 (var "yoffset")
11822 " through "
11823 (math (var "yoffset") "+" (var "height") "-" "1")
11824 ",
11825 inclusive, at the mipmap level specified by "
11826 (var "level")
11827 ". ")
11828 (para "
11829 The pixels in the rectangle are processed exactly as if "
11830 (code "glCopyPixels")
11831 " had been called, but the process stops just before
11832 final conversion.
11833 At this point, all pixel component values are clamped to the range "
11834 (math "[" "0" "," "1" "]")
11835 "
11836 and then converted to the texture's internal format for storage in the texel
11837 array. ")
11838 (para "
11839 The destination rectangle in the texture array may not include any texels
11840 outside the texture array as it was originally specified.
11841 It is not an error to specify a subtexture with zero width or height, but
11842 such a specification has no effect. ")
11843 (para "
11844 If any of the pixels within the specified rectangle of the current "
11845 (code "GL_READ_BUFFER")
11846 " are outside the read window associated with the current
11847 rendering context, then the values obtained for those pixels are undefined. ")
11848 (para "
11849 No change is made to the "
11850 (var "internalformat")
11851 ", "
11852 (var "width")
11853 ", "
11854 (var "height")
11855 ", or "
11856 (var "border")
11857 " parameters of the specified texture
11858 array or to texel values outside the specified subregion. ")
11859 (heading "Errors")
11860 (para (code "GL_INVALID_ENUM")
11861 " is generated if "
11862 (var "target")
11863 " is not "
11864 (code "GL_TEXTURE_2D")
11865 ", "
11866 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
11867 ", "
11868 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
11869 ", "
11870 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
11871 ", "
11872 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
11873 ", "
11874 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
11875 ", or "
11876 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
11877 ". ")
11878 (para (code "GL_INVALID_OPERATION")
11879 " is generated if the texture array has not been
11880 defined by a previous "
11881 (code "glTexImage2D")
11882 " or "
11883 (code "glCopyTexImage2D")
11884 " operation. ")
11885 (para (code "GL_INVALID_VALUE")
11886 " is generated if "
11887 (var "level")
11888 " is less than 0. ")
11889 (para (code "GL_INVALID_VALUE")
11890 " may be generated if "
11891 (math (var "level")
11892 ">"
11893 (var "log")
11894 "_"
11895 "2"
11896 "\u2061"
11897 "("
11898 (var "max")
11899 ","
11900 ")")
11901 ",
11902 where "
11903 (math (var "max"))
11904 "
11905 is the returned value of "
11906 (code "GL_MAX_TEXTURE_SIZE")
11907 ". ")
11908 (para (code "GL_INVALID_VALUE")
11909 " is generated if "
11910 (math (var "xoffset") "<" "-" (var "b"))
11911 ", "
11912 (math "("
11913 (var "xoffset")
11914 "+"
11915 (var "width")
11916 ","
11917 ")"
11918 ">"
11919 "("
11920 (var "w")
11921 "-"
11922 (var "b")
11923 ","
11924 ")")
11925 ", "
11926 (math (var "yoffset") "<" "-" (var "b"))
11927 ",
11928 or "
11929 (math "("
11930 (var "yoffset")
11931 "+"
11932 (var "height")
11933 ","
11934 ")"
11935 ">"
11936 "("
11937 (var "h")
11938 "-"
11939 (var "b")
11940 ","
11941 ")")
11942 ",
11943 where "
11944 (math (var "w"))
11945 "
11946 is the "
11947 (code "GL_TEXTURE_WIDTH")
11948 ", "
11949 (math (var "h"))
11950 "
11951 is the "
11952 (code "GL_TEXTURE_HEIGHT")
11953 ",
11954 and "
11955 (math (var "b"))
11956 "
11957 is the "
11958 (code "GL_TEXTURE_BORDER")
11959 "
11960 of the texture image being modified.
11961 Note that "
11962 (math (var "w"))
11963 "
11964 and "
11965 (math (var "h"))
11966 "
11967 include twice the border width. ")
11968 (para (code "GL_INVALID_OPERATION")
11969 " is generated if "
11970 (code "glCopyTexSubImage2D")
11971 " is executed
11972 between the execution of "
11973 (code "glBegin")
11974 " and the corresponding
11975 execution of "
11976 (code "glEnd")
11977 ". ")))
11978
11979 (define-gl-procedure
11980 glCopyTexSubImage3D
11981 "glCopyTexSubImage3D"
11982 (funcsynopsis
11983 (funcprototype
11984 (funcdef
11985 "void "
11986 (function "glCopyTexSubImage3D"))
11987 (paramdef "GLenum " (parameter "target"))
11988 (paramdef "GLint " (parameter "level"))
11989 (paramdef "GLint " (parameter "xoffset"))
11990 (paramdef "GLint " (parameter "yoffset"))
11991 (paramdef "GLint " (parameter "zoffset"))
11992 (paramdef "GLint " (parameter "x"))
11993 (paramdef "GLint " (parameter "y"))
11994 (paramdef "GLsizei " (parameter "width"))
11995 (paramdef "GLsizei " (parameter "height"))))
11996 '(*fragment*
11997 (heading
11998 "copy a three-dimensional texture subimage")
11999 (heading "Parameters")
12000 (table (% (formatter (asis)))
12001 (entry (% (heading (var "target")))
12002 (para "
12003 Specifies the target texture.
12004 Must be "
12005 (code "GL_TEXTURE_3D")))
12006 (entry (% (heading (var "level")))
12007 (para "
12008 Specifies the level-of-detail number.
12009 Level 0 is the base image level.
12010 Level "
12011 (var "n")
12012 " is the "
12013 (var "n")
12014 "th mipmap reduction image. "))
12015 (entry (% (heading (var "xoffset")))
12016 (para "
12017 Specifies a texel offset in the x direction within the texture array. "))
12018 (entry (% (heading (var "yoffset")))
12019 (para "
12020 Specifies a texel offset in the y direction within the texture array. "))
12021 (entry (% (heading (var "zoffset")))
12022 (para "
12023 Specifies a texel offset in the z direction within the texture array. "))
12024 (entry (% (heading (var "x")))
12025 (itemx (var "y"))
12026 (para "
12027 Specify the window coordinates of the lower left corner
12028 of the rectangular region of pixels to be copied. "))
12029 (entry (% (heading (var "width")))
12030 (para "
12031 Specifies the width of the texture subimage. "))
12032 (entry (% (heading (var "height")))
12033 (para "
12034 Specifies the height of the texture subimage. ")))
12035 (heading "Description")
12036 (para (code "glCopyTexSubImage3D")
12037 " replaces a rectangular portion of a three-dimensional
12038 texture image with pixels from the current "
12039 (code "GL_READ_BUFFER")
12040 " (rather
12041 than from main memory, as is the case for "
12042 (code "glTexSubImage3D")
12043 "). ")
12044 (para "
12045 The screen-aligned pixel rectangle with lower left corner at
12046 ("
12047 (var "x")
12048 ",\\ "
12049 (var "y")
12050 ") and with
12051 width "
12052 (var "width")
12053 " and height "
12054 (var "height")
12055 " replaces the portion of the
12056 texture array with x indices "
12057 (var "xoffset")
12058 " through "
12059 (math (var "xoffset") "+" (var "width") "-" "1")
12060 ",
12061 inclusive, and y indices "
12062 (var "yoffset")
12063 " through "
12064 (math (var "yoffset") "+" (var "height") "-" "1")
12065 ",
12066 inclusive, at z index "
12067 (var "zoffset")
12068 " and at the mipmap level specified by "
12069 (var "level")
12070 ". ")
12071 (para "
12072 The pixels in the rectangle are processed exactly as if "
12073 (code "glCopyPixels")
12074 " had been called, but the process stops just before
12075 final conversion.
12076 At this point, all pixel component values are clamped to the range "
12077 (math "[" "0" "," "1" "]")
12078 "
12079 and then converted to the texture's internal format for storage in the texel
12080 array. ")
12081 (para "
12082 The destination rectangle in the texture array may not include any texels
12083 outside the texture array as it was originally specified.
12084 It is not an error to specify a subtexture with zero width or height, but
12085 such a specification has no effect. ")
12086 (para "
12087 If any of the pixels within the specified rectangle of the current "
12088 (code "GL_READ_BUFFER")
12089 " are outside the read window associated with the current
12090 rendering context, then the values obtained for those pixels are undefined. ")
12091 (para "
12092 No change is made to the "
12093 (var "internalformat")
12094 ", "
12095 (var "width")
12096 ", "
12097 (var "height")
12098 ", "
12099 (var "depth")
12100 ", or "
12101 (var "border")
12102 " parameters of the specified texture
12103 array or to texel values outside the specified subregion. ")
12104 (heading "Errors")
12105 (para (code "GL_INVALID_ENUM")
12106 " is generated if /"
12107 (var "target")
12108 " is not "
12109 (code "GL_TEXTURE_3D")
12110 ". ")
12111 (para (code "GL_INVALID_OPERATION")
12112 " is generated if the texture array has not
12113 been defined by a previous "
12114 (code "glTexImage3D")
12115 " operation. ")
12116 (para (code "GL_INVALID_VALUE")
12117 " is generated if "
12118 (var "level")
12119 " is less than 0. ")
12120 (para (code "GL_INVALID_VALUE")
12121 " may be generated if "
12122 (math (var "level")
12123 ">"
12124 (var "log")
12125 "_"
12126 "2"
12127 "\u2061"
12128 "("
12129 (var "max")
12130 ","
12131 ")")
12132 ",
12133 where "
12134 (math (var "max"))
12135 "
12136 is the returned value of "
12137 (code "GL_MAX_3D_TEXTURE_SIZE")
12138 ". ")
12139 (para (code "GL_INVALID_VALUE")
12140 " is generated if "
12141 (math (var "xoffset") "<" "-" (var "b"))
12142 ", "
12143 (math "("
12144 (var "xoffset")
12145 "+"
12146 (var "width")
12147 ","
12148 ")"
12149 ">"
12150 "("
12151 (var "w")
12152 "-"
12153 (var "b")
12154 ","
12155 ")")
12156 ", "
12157 (math (var "yoffset") "<" "-" (var "b"))
12158 ", "
12159 (math "("
12160 (var "yoffset")
12161 "+"
12162 (var "height")
12163 ","
12164 ")"
12165 ">"
12166 "("
12167 (var "h")
12168 "-"
12169 (var "b")
12170 ","
12171 ")")
12172 ", "
12173 (math (var "zoffset") "<" "-" (var "b"))
12174 ",
12175 or "
12176 (math "("
12177 (var "zoffset")
12178 "+"
12179 "1"
12180 ","
12181 ")"
12182 ">"
12183 "("
12184 (var "d")
12185 "-"
12186 (var "b")
12187 ","
12188 ")")
12189 ",
12190 where "
12191 (math (var "w"))
12192 "
12193 is the "
12194 (code "GL_TEXTURE_WIDTH")
12195 ", "
12196 (math (var "h"))
12197 "
12198 is the "
12199 (code "GL_TEXTURE_HEIGHT")
12200 ", "
12201 (math (var "d"))
12202 "
12203 is the "
12204 (code "GL_TEXTURE_DEPTH")
12205 ",
12206 and "
12207 (math (var "b"))
12208 "
12209 is the "
12210 (code "GL_TEXTURE_BORDER")
12211 "
12212 of the texture image being modified.
12213 Note that "
12214 (math (var "w"))
12215 ", "
12216 (math (var "h"))
12217 ",
12218 and "
12219 (math (var "d"))
12220 "
12221 include twice the border width. ")
12222 (para (code "GL_INVALID_OPERATION")
12223 " is generated if "
12224 (code "glCopyTexSubImage3D")
12225 " is executed
12226 between the execution of "
12227 (code "glBegin")
12228 " and the corresponding
12229 execution of "
12230 (code "glEnd")
12231 ". ")))
12232
12233 (define-gl-procedure
12234 glCreateProgram
12235 "glCreateProgram"
12236 (funcsynopsis
12237 (funcprototype
12238 (funcdef "GLuint " (function "glCreateProgram"))
12239 (paramdef (parameter "void"))))
12240 '(*fragment*
12241 (heading "Creates a program object")
12242 (heading "Description")
12243 (para (code "glCreateProgram")
12244 " creates an empty
12245 \tprogram object and returns a non-zero value by which it can be
12246 \treferenced. A program object is an object to which shader
12247 \tobjects can be attached. This provides a mechanism to specify
12248 \tthe shader objects that will be linked to create a program. It
12249 \talso provides a means for checking the compatibility of the
12250 \tshaders that will be used to create a program (for instance,
12251 \tchecking the compatibility between a vertex shader and a
12252 \tfragment shader). When no longer needed as part of a program
12253 \tobject, shader objects can be detached.")
12254 (para "One or more executables are created in a program object by
12255 \tsuccessfully attaching shader objects to it with\t"
12256 (code "glAttachShader")
12257 ",
12258 \tsuccessfully compiling the shader objects with\t"
12259 (code "glCompileShader")
12260 ",
12261 \tand successfully linking the program object with\t"
12262 (code "glLinkProgram")
12263 ".
12264 \tThese executables are made part of current state when\t"
12265 (code "glUseProgram")
12266 "
12267 is called. Program objects can be deleted by calling\t"
12268 (code "glDeleteProgram")
12269 ".
12270 \tThe memory associated with the program object will be deleted
12271 \twhen it is no longer part of current rendering state for any
12272 \tcontext.")
12273 (heading "Errors")
12274 (para "This function returns 0 if an error occurs creating the program object.")
12275 (para (code "GL_INVALID_OPERATION")
12276 " is generated if\t"
12277 (code "glCreateProgram")
12278 " is executed between the
12279 \texecution of\t"
12280 (code "glBegin")
12281 "
12282 and the corresponding execution of\t"
12283 (code "glEnd")
12284 ".")))
12285
12286 (define-gl-procedure
12287 glCreateShader
12288 "glCreateShader"
12289 (funcsynopsis
12290 (funcprototype
12291 (funcdef "GLuint " (function "glCreateShader"))
12292 (paramdef "GLenum " (parameter "shaderType"))))
12293 '(*fragment*
12294 (heading "Creates a shader object")
12295 (heading "Parameters")
12296 (table (% (formatter (asis)))
12297 (entry (% (heading (var "shaderType")))
12298 (para "Specifies the type of shader to be created.
12299 \t\t Must be either "
12300 (code "GL_VERTEX_SHADER")
12301 "
12302 or "
12303 (code "GL_FRAGMENT_SHADER")
12304 ".")))
12305 (heading "Description")
12306 (para (code "glCreateShader")
12307 " creates an empty
12308 \tshader object and returns a non-zero value by which it can be
12309 \treferenced. A shader object is used to maintain the source code
12310 \tstrings that define a shader. "
12311 (var "shaderType")
12312 "
12313 indicates the type of shader to be created. Two types of shaders
12314 \tare supported. A shader of type\t"
12315 (code "GL_VERTEX_SHADER")
12316 " is a shader that is
12317 \tintended to run on the programmable vertex processor and replace
12318 \tthe fixed functionality vertex processing in OpenGL. A shader of
12319 \ttype "
12320 (code "GL_FRAGMENT_SHADER")
12321 " is a shader that is
12322 \tintended to run on the programmable fragment processor and
12323 \treplace the fixed functionality fragment processing in
12324 \tOpenGL.")
12325 (para "When created, a shader object's\t"
12326 (code "GL_SHADER_TYPE")
12327 " parameter is set to either\t"
12328 (code "GL_VERTEX_SHADER")
12329 " or\t"
12330 (code "GL_FRAGMENT_SHADER")
12331 ", depending on the value
12332 \tof "
12333 (var "shaderType")
12334 ".")
12335 (heading "Errors")
12336 (para "This function returns 0 if an error occurs creating the
12337 \tshader object.")
12338 (para (code "GL_INVALID_ENUM")
12339 " is generated if\t"
12340 (var "shaderType")
12341 " is not an accepted value.")
12342 (para (code "GL_INVALID_OPERATION")
12343 " is generated if\t"
12344 (code "glCreateShader")
12345 " is executed between the
12346 \texecution of\t"
12347 (code "glBegin")
12348 "
12349 and the corresponding execution of\t"
12350 (code "glEnd")
12351 ".")))
12352
12353 (define-gl-procedure
12354 glCullFace
12355 "glCullFace"
12356 (funcsynopsis
12357 (funcprototype
12358 (funcdef "void " (function "glCullFace"))
12359 (paramdef "GLenum " (parameter "mode"))))
12360 '(*fragment*
12361 (heading
12362 "specify whether front- or back-facing facets can be culled")
12363 (heading "Parameters")
12364 (table (% (formatter (asis)))
12365 (entry (% (heading (var "mode")))
12366 (para "
12367 Specifies whether front- or back-facing facets are candidates for culling.
12368 Symbolic constants "
12369 (code "GL_FRONT")
12370 ", "
12371 (code "GL_BACK")
12372 ", and "
12373 (code "GL_FRONT_AND_BACK")
12374 " are accepted.
12375 The initial value is "
12376 (code "GL_BACK")
12377 ". ")))
12378 (heading "Description")
12379 (para (code "glCullFace")
12380 " specifies whether front- or back-facing facets are culled
12381 (as specified by "
12382 (var "mode")
12383 ") when facet culling is enabled. Facet
12384 culling is initially disabled.
12385 To enable and disable facet culling, call the "
12386 (code "glEnable")
12387 " and "
12388 (code "glDisable")
12389 " commands
12390 with the argument "
12391 (code "GL_CULL_FACE")
12392 ".
12393 Facets include triangles,
12394 quadrilaterals,
12395 polygons, and
12396 rectangles. ")
12397 (para (code "glFrontFace")
12398 " specifies which of the clockwise and counterclockwise facets
12399 are front-facing and back-facing.
12400 See "
12401 (code "glFrontFace")
12402 ". ")
12403 (heading "Errors")
12404 (para (code "GL_INVALID_ENUM")
12405 " is generated if "
12406 (var "mode")
12407 " is not an accepted value. ")
12408 (para (code "GL_INVALID_OPERATION")
12409 " is generated if "
12410 (code "glCullFace")
12411 "
12412 is executed between the execution of "
12413 (code "glBegin")
12414 "
12415 and the corresponding execution of "
12416 (code "glEnd")
12417 ". ")))
12418
12419 (define-gl-procedure
12420 glDeleteBuffers
12421 "glDeleteBuffers"
12422 (funcsynopsis
12423 (funcprototype
12424 (funcdef "void " (function "glDeleteBuffers"))
12425 (paramdef "GLsizei " (parameter "n"))
12426 (paramdef
12427 "const GLuint * "
12428 (parameter "buffers"))))
12429 '(*fragment*
12430 (heading "delete named buffer objects")
12431 (heading "Parameters")
12432 (table (% (formatter (asis)))
12433 (entry (% (heading (var "n")))
12434 (para "
12435 Specifies the number of buffer objects to be deleted. "))
12436 (entry (% (heading (var "buffers")))
12437 (para "
12438 Specifies an array of buffer objects to be deleted. ")))
12439 (heading "Description")
12440 (para (code "glDeleteBuffers")
12441 " deletes "
12442 (var "n")
12443 " buffer objects named by the elements of the array "
12444 (var "buffers")
12445 ".
12446 After a buffer object is deleted, it has no contents,
12447 and its name is free for reuse (for example by "
12448 (code "glGenBuffers")
12449 ").
12450 If a buffer object that is currently bound is deleted, the binding reverts
12451 to 0 (the absence of any buffer object, which reverts to client memory usage). ")
12452 (para (code "glDeleteBuffers")
12453 " silently ignores 0's and names that do not correspond to
12454 existing buffer objects. ")
12455 (heading "Errors")
12456 (para (code "GL_INVALID_VALUE")
12457 " is generated if "
12458 (var "n")
12459 " is negative. ")
12460 (para (code "GL_INVALID_OPERATION")
12461 " is generated if "
12462 (code "glDeleteBuffers")
12463 " is executed
12464 between the execution of "
12465 (code "glBegin")
12466 " and the corresponding
12467 execution of "
12468 (code "glEnd")
12469 ". ")))
12470
12471 (define-gl-procedure
12472 glDeleteLists
12473 "glDeleteLists"
12474 (funcsynopsis
12475 (funcprototype
12476 (funcdef "void " (function "glDeleteLists"))
12477 (paramdef "GLuint " (parameter "list"))
12478 (paramdef "GLsizei " (parameter "range"))))
12479 '(*fragment*
12480 (heading
12481 "delete a contiguous group of display lists")
12482 (heading "Parameters")
12483 (table (% (formatter (asis)))
12484 (entry (% (heading (var "list")))
12485 (para "
12486 Specifies the integer name of the first display list to delete. "))
12487 (entry (% (heading (var "range")))
12488 (para "
12489 Specifies the number of display lists to delete. ")))
12490 (heading "Description")
12491 (para (code "glDeleteLists")
12492 " causes a contiguous group of display lists to be deleted. "
12493 (var "list")
12494 " is the name of the first display list to be deleted,
12495 and "
12496 (var "range")
12497 " is the number of display lists to delete.
12498 All display lists "
12499 (math (var "d"))
12500 "
12501 with "
12502 (math (var "list")
12503 "<="
12504 (var "d")
12505 "<="
12506 (var "list")
12507 "+"
12508 (var "range")
12509 "-"
12510 "1")
12511 "
12512 are deleted. ")
12513 (para "
12514 All storage locations allocated to the specified display lists are freed,
12515 and the names are available for reuse at a later time.
12516 Names within the range that do not have an associated display list are ignored.
12517 If "
12518 (var "range")
12519 " is 0, nothing happens. ")
12520 (heading "Errors")
12521 (para (code "GL_INVALID_VALUE")
12522 " is generated if "
12523 (var "range")
12524 " is negative. ")
12525 (para (code "GL_INVALID_OPERATION")
12526 " is generated if "
12527 (code "glDeleteLists")
12528 "
12529 is executed between the execution of "
12530 (code "glBegin")
12531 "
12532 and the corresponding execution of "
12533 (code "glEnd")
12534 ". ")))
12535
12536 (define-gl-procedure
12537 glDeleteProgram
12538 "glDeleteProgram"
12539 (funcsynopsis
12540 (funcprototype
12541 (funcdef "void " (function "glDeleteProgram"))
12542 (paramdef "GLuint " (parameter "program"))))
12543 '(*fragment*
12544 (heading "Deletes a program object")
12545 (heading "Parameters")
12546 (table (% (formatter (asis)))
12547 (entry (% (heading (var "program")))
12548 (para "Specifies the program object to be
12549 \t\t deleted.")))
12550 (heading "Description")
12551 (para (code "glDeleteProgram")
12552 " frees the memory and
12553 \tinvalidates the name associated with the program object
12554 \tspecified by "
12555 (var "program.")
12556 " This command
12557 \teffectively undoes the effects of a call to\t"
12558 (code "glCreateProgram")
12559 ".")
12560 (para "If a program object is in use as part of current rendering
12561 \tstate, it will be flagged for deletion, but it will not be
12562 \tdeleted until it is no longer part of current state for any
12563 \trendering context. If a program object to be deleted has shader
12564 \tobjects attached to it, those shader objects will be
12565 \tautomatically detached but not deleted unless they have already
12566 \tbeen flagged for deletion by a previous call to\t"
12567 (code "glDeleteShader")
12568 ".
12569 \tA value of 0 for "
12570 (var "program")
12571 " will be silently
12572 \tignored.")
12573 (para "To determine whether a program object has been flagged for
12574 \tdeletion, call\t"
12575 (code "glGetProgram")
12576 "
12577 with arguments "
12578 (var "program")
12579 " and\t"
12580 (code "GL_DELETE_STATUS")
12581 ".")
12582 (heading "Errors")
12583 (para (code "GL_INVALID_VALUE")
12584 " is generated if\t"
12585 (var "program")
12586 " is not a value generated by
12587 \tOpenGL.")
12588 (para (code "GL_INVALID_OPERATION")
12589 " is generated if\t"
12590 (code "glDeleteProgram")
12591 " is executed between the
12592 \texecution of\t"
12593 (code "glBegin")
12594 "
12595 and the corresponding execution of\t"
12596 (code "glEnd")
12597 ".")))
12598
12599 (define-gl-procedure
12600 glDeleteQueries
12601 "glDeleteQueries"
12602 (funcsynopsis
12603 (funcprototype
12604 (funcdef "void " (function "glDeleteQueries"))
12605 (paramdef "GLsizei " (parameter "n"))
12606 (paramdef "const GLuint * " (parameter "ids"))))
12607 '(*fragment*
12608 (heading "delete named query objects")
12609 (heading "Parameters")
12610 (table (% (formatter (asis)))
12611 (entry (% (heading (var "n")))
12612 (para "
12613 Specifies the number of query objects to be deleted. "))
12614 (entry (% (heading (var "ids")))
12615 (para "
12616 Specifies an array of query objects to be deleted. ")))
12617 (heading "Description")
12618 (para (code "glDeleteQueries")
12619 " deletes "
12620 (var "n")
12621 " query objects named by the elements of the array "
12622 (var "ids")
12623 ".
12624 After a query object is deleted, it has no contents,
12625 and its name is free for reuse (for example by "
12626 (code "glGenQueries")
12627 "). ")
12628 (para (code "glDeleteQueries")
12629 " silently ignores 0's and names that do not correspond to
12630 existing query objects. ")
12631 (heading "Errors")
12632 (para (code "GL_INVALID_VALUE")
12633 " is generated if "
12634 (var "n")
12635 " is negative. ")
12636 (para (code "GL_INVALID_OPERATION")
12637 " is generated if "
12638 (code "glDeleteQueries")
12639 " is executed
12640 between the execution of "
12641 (code "glBegin")
12642 " and the corresponding
12643 execution of "
12644 (code "glEnd")
12645 ". ")))
12646
12647 (define-gl-procedure
12648 glDeleteShader
12649 "glDeleteShader"
12650 (funcsynopsis
12651 (funcprototype
12652 (funcdef "void " (function "glDeleteShader"))
12653 (paramdef "GLuint " (parameter "shader"))))
12654 '(*fragment*
12655 (heading "Deletes a shader object")
12656 (heading "Parameters")
12657 (table (% (formatter (asis)))
12658 (entry (% (heading (var "shader")))
12659 (para "Specifies the shader object to be deleted.")))
12660 (heading "Description")
12661 (para (code "glDeleteShader")
12662 " frees the memory and
12663 \tinvalidates the name associated with the shader object specified
12664 \tby "
12665 (var "shader")
12666 ". This command effectively
12667 \tundoes the effects of a call to\t"
12668 (code "glCreateShader")
12669 ".")
12670 (para "If a shader object to be deleted is attached to a program
12671 \tobject, it will be flagged for deletion, but it will not be
12672 \tdeleted until it is no longer attached to any program object,
12673 \tfor any rendering context (i.e., it must be detached from
12674 \twherever it was attached before it will be deleted). A value of
12675 \t0 for "
12676 (var "shader")
12677 " will be silently
12678 \tignored.")
12679 (para "To determine whether an object has been flagged for
12680 \tdeletion, call\t"
12681 (code "glGetShader")
12682 "
12683 with arguments "
12684 (var "shader")
12685 " and\t"
12686 (code "GL_DELETE_STATUS")
12687 ".")
12688 (heading "Errors")
12689 (para (code "GL_INVALID_VALUE")
12690 " is generated if\t"
12691 (var "shader")
12692 " is not a value generated by
12693 \tOpenGL.")
12694 (para (code "GL_INVALID_OPERATION")
12695 " is generated if\t"
12696 (code "glDeleteShader")
12697 " is executed between the
12698 \texecution of\t"
12699 (code "glBegin")
12700 "
12701 and the corresponding execution of\t"
12702 (code "glEnd")
12703 ".")))
12704
12705 (define-gl-procedure
12706 glDeleteTextures
12707 "glDeleteTextures"
12708 (funcsynopsis
12709 (funcprototype
12710 (funcdef "void " (function "glDeleteTextures"))
12711 (paramdef "GLsizei " (parameter "n"))
12712 (paramdef
12713 "const GLuint * "
12714 (parameter "textures"))))
12715 '(*fragment*
12716 (heading "delete named textures")
12717 (heading "Parameters")
12718 (table (% (formatter (asis)))
12719 (entry (% (heading (var "n")))
12720 (para "
12721 Specifies the number of textures to be deleted. "))
12722 (entry (% (heading (var "textures")))
12723 (para "
12724 Specifies an array of textures to be deleted. ")))
12725 (heading "Description")
12726 (para (code "glDeleteTextures")
12727 " deletes "
12728 (var "n")
12729 " textures named by the elements of the array "
12730 (var "textures")
12731 ".
12732 After a texture is deleted, it has no contents or dimensionality,
12733 and its name is free for reuse (for example by "
12734 (code "glGenTextures")
12735 ").
12736 If a texture that is currently bound is deleted, the binding reverts
12737 to 0 (the default texture). ")
12738 (para (code "glDeleteTextures")
12739 " silently ignores 0's and names that do not correspond to
12740 existing textures. ")
12741 (heading "Errors")
12742 (para (code "GL_INVALID_VALUE")
12743 " is generated if "
12744 (var "n")
12745 " is negative. ")
12746 (para (code "GL_INVALID_OPERATION")
12747 " is generated if "
12748 (code "glDeleteTextures")
12749 " is executed
12750 between the execution of "
12751 (code "glBegin")
12752 " and the corresponding
12753 execution of "
12754 (code "glEnd")
12755 ". ")))
12756
12757 (define-gl-procedure
12758 glDepthFunc
12759 "glDepthFunc"
12760 (funcsynopsis
12761 (funcprototype
12762 (funcdef "void " (function "glDepthFunc"))
12763 (paramdef "GLenum " (parameter "func"))))
12764 '(*fragment*
12765 (heading
12766 "specify the value used for depth buffer comparisons")
12767 (heading "Parameters")
12768 (table (% (formatter (asis)))
12769 (entry (% (heading (var "func")))
12770 (para "
12771 Specifies the depth comparison function.
12772 Symbolic constants "
12773 (code "GL_NEVER")
12774 ", "
12775 (code "GL_LESS")
12776 ", "
12777 (code "GL_EQUAL")
12778 ", "
12779 (code "GL_LEQUAL")
12780 ", "
12781 (code "GL_GREATER")
12782 ", "
12783 (code "GL_NOTEQUAL")
12784 ", "
12785 (code "GL_GEQUAL")
12786 ", and "
12787 (code "GL_ALWAYS")
12788 " are accepted.
12789 The initial value is "
12790 (code "GL_LESS")
12791 ". ")))
12792 (heading "Description")
12793 (para (code "glDepthFunc")
12794 " specifies the function used to compare each incoming pixel depth value
12795 with the depth value present in the depth buffer.
12796 The comparison is performed only if depth testing is enabled.
12797 (See "
12798 (code "glEnable")
12799 " and "
12800 (code "glDisable")
12801 " of "
12802 (code "GL_DEPTH_TEST")
12803 ".) ")
12804 (para (var "func")
12805 " specifies the conditions under which the pixel will be drawn.
12806 The comparison functions are as follows: ")
12807 (table (% (formatter (asis)))
12808 (entry (% (heading (code "GL_NEVER")))
12809 (para "
12810 Never passes. "))
12811 (entry (% (heading (code "GL_LESS")))
12812 (para "
12813 Passes if the incoming depth value is less than the stored depth value. "))
12814 (entry (% (heading (code "GL_EQUAL")))
12815 (para "
12816 Passes if the incoming depth value is equal to the stored depth value. "))
12817 (entry (% (heading (code "GL_LEQUAL")))
12818 (para "
12819 Passes if the incoming depth value is less than or equal to
12820 the stored depth value. "))
12821 (entry (% (heading (code "GL_GREATER")))
12822 (para "
12823 Passes if the incoming depth value is greater than the stored depth value. "))
12824 (entry (% (heading (code "GL_NOTEQUAL")))
12825 (para "
12826 Passes if the incoming depth value is not equal to the stored depth value. "))
12827 (entry (% (heading (code "GL_GEQUAL")))
12828 (para "
12829 Passes if the incoming depth value is greater than or equal to
12830 the stored depth value. "))
12831 (entry (% (heading (code "GL_ALWAYS")))
12832 (para "
12833 Always passes. ")))
12834 (para "
12835 The initial value of "
12836 (var "func")
12837 " is "
12838 (code "GL_LESS")
12839 ".
12840 Initially, depth testing is disabled. If depth testing is disabled or if no
12841 depth buffer exists, it is as if the depth test always passes. ")
12842 (heading "Errors")
12843 (para (code "GL_INVALID_ENUM")
12844 " is generated if "
12845 (var "func")
12846 " is not an accepted value. ")
12847 (para (code "GL_INVALID_OPERATION")
12848 " is generated if "
12849 (code "glDepthFunc")
12850 "
12851 is executed between the execution of "
12852 (code "glBegin")
12853 "
12854 and the corresponding execution of "
12855 (code "glEnd")
12856 ". ")))
12857
12858 (define-gl-procedure
12859 glDepthMask
12860 "glDepthMask"
12861 (funcsynopsis
12862 (funcprototype
12863 (funcdef "void " (function "glDepthMask"))
12864 (paramdef "GLboolean " (parameter "flag"))))
12865 '(*fragment*
12866 (heading
12867 "enable or disable writing into the depth buffer")
12868 (heading "Parameters")
12869 (table (% (formatter (asis)))
12870 (entry (% (heading (var "flag")))
12871 (para "
12872 Specifies whether the depth buffer is enabled for writing.
12873 If "
12874 (var "flag")
12875 " is "
12876 (code "GL_FALSE")
12877 ",
12878 depth buffer writing is disabled.
12879 Otherwise, it is enabled.
12880 Initially, depth buffer writing is enabled. ")))
12881 (heading "Description")
12882 (para (code "glDepthMask")
12883 " specifies whether the depth buffer is enabled for writing.
12884 If "
12885 (var "flag")
12886 " is "
12887 (code "GL_FALSE")
12888 ",
12889 depth buffer writing is disabled.
12890 Otherwise, it is enabled.
12891 Initially, depth buffer writing is enabled. ")
12892 (heading "Errors")
12893 (para (code "GL_INVALID_OPERATION")
12894 " is generated if "
12895 (code "glDepthMask")
12896 "
12897 is executed between the execution of "
12898 (code "glBegin")
12899 "
12900 and the corresponding execution of "
12901 (code "glEnd")
12902 ". ")))
12903
12904 (define-gl-procedure
12905 glDepthRange
12906 "glDepthRange"
12907 (funcsynopsis
12908 (funcprototype
12909 (funcdef "void " (function "glDepthRange"))
12910 (paramdef "GLclampd " (parameter "nearVal"))
12911 (paramdef "GLclampd " (parameter "farVal"))))
12912 '(*fragment*
12913 (heading
12914 "specify mapping of depth values from normalized device coordinates to window coordinates")
12915 (heading "Parameters")
12916 (table (% (formatter (asis)))
12917 (entry (% (heading (var "nearVal")))
12918 (para "
12919 Specifies the mapping of the near clipping plane to window coordinates.
12920 The initial value is 0. "))
12921 (entry (% (heading (var "farVal")))
12922 (para "
12923 Specifies the mapping of the far clipping plane to window coordinates.
12924 The initial value is 1. ")))
12925 (heading "Description")
12926 (para "
12927 After clipping and division by "
12928 (var "w")
12929 ",
12930 depth coordinates range from "
12931 (math "-1")
12932 "
12933 to 1,
12934 corresponding to the near and far clipping planes. "
12935 (code "glDepthRange")
12936 " specifies a linear mapping of the normalized depth coordinates
12937 in this range to window depth coordinates.
12938 Regardless of the actual depth buffer implementation,
12939 window coordinate depth values are treated as though they range
12940 from 0 through 1 (like color components).
12941 Thus,
12942 the values accepted by "
12943 (code "glDepthRange")
12944 " are both clamped to this range
12945 before they are accepted. ")
12946 (para "
12947 The setting of (0,1) maps the near plane to 0 and
12948 the far plane to 1.
12949 With this mapping,
12950 the depth buffer range is fully utilized. ")
12951 (heading "Errors")
12952 (para (code "GL_INVALID_OPERATION")
12953 " is generated if "
12954 (code "glDepthRange")
12955 "
12956 is executed between the execution of "
12957 (code "glBegin")
12958 "
12959 and the corresponding execution of "
12960 (code "glEnd")
12961 ". ")))
12962
12963 (define-gl-procedure
12964 glDetachShader
12965 "glDetachShader"
12966 (funcsynopsis
12967 (funcprototype
12968 (funcdef "void " (function "glDetachShader"))
12969 (paramdef "GLuint " (parameter "program"))
12970 (paramdef "GLuint " (parameter "shader"))))
12971 '(*fragment*
12972 (heading
12973 "Detaches a shader object from a program object to which it is attached")
12974 (heading "Parameters")
12975 (table (% (formatter (asis)))
12976 (entry (% (heading (var "program")))
12977 (para "Specifies the program object from which to
12978 \t\t detach the shader object."))
12979 (entry (% (heading (var "shader")))
12980 (para "Specifies the shader object to be
12981 \t\t detached.")))
12982 (heading "Description")
12983 (para (code "glDetachShader")
12984 " detaches the shader
12985 \tobject specified by "
12986 (var "shader")
12987 " from the
12988 \tprogram object specified by "
12989 (var "program")
12990 ". This
12991 \tcommand can be used to undo the effect of the command\t"
12992 (code "glAttachShader")
12993 ".")
12994 (para "If "
12995 (var "shader")
12996 " has already been flagged
12997 \tfor deletion by a call to\t"
12998 (code "glDeleteShader")
12999 "
13000 and it is not attached to any other program object, it will be
13001 \tdeleted after it has been detached.")
13002 (heading "Errors")
13003 (para (code "GL_INVALID_VALUE")
13004 " is generated if either\t"
13005 (var "program")
13006 " or "
13007 (var "shader")
13008 "
13009 is a value that was not generated by OpenGL.")
13010 (para (code "GL_INVALID_OPERATION")
13011 " is generated if\t"
13012 (var "program")
13013 " is not a program object.")
13014 (para (code "GL_INVALID_OPERATION")
13015 " is generated if\t"
13016 (var "shader")
13017 " is not a shader object.")
13018 (para (code "GL_INVALID_OPERATION")
13019 " is generated if\t"
13020 (var "shader")
13021 " is not attached to\t"
13022 (var "program")
13023 ".")
13024 (para (code "GL_INVALID_OPERATION")
13025 " is generated if\t"
13026 (code "glDetachShader")
13027 " is executed between the
13028 \texecution of\t"
13029 (code "glBegin")
13030 "
13031 and the corresponding execution of\t"
13032 (code "glEnd")
13033 ".")))
13034
13035 (define-gl-procedure
13036 glDrawArrays
13037 "glDrawArrays"
13038 (funcsynopsis
13039 (funcprototype
13040 (funcdef "void " (function "glDrawArrays"))
13041 (paramdef "GLenum " (parameter "mode"))
13042 (paramdef "GLint " (parameter "first"))
13043 (paramdef "GLsizei " (parameter "count"))))
13044 '(*fragment*
13045 (heading "render primitives from array data")
13046 (heading "Parameters")
13047 (table (% (formatter (asis)))
13048 (entry (% (heading (var "mode")))
13049 (para "
13050 Specifies what kind of primitives to render.
13051 Symbolic constants "
13052 (code "GL_POINTS")
13053 ", "
13054 (code "GL_LINE_STRIP")
13055 ", "
13056 (code "GL_LINE_LOOP")
13057 ", "
13058 (code "GL_LINES")
13059 ", "
13060 (code "GL_TRIANGLE_STRIP")
13061 ", "
13062 (code "GL_TRIANGLE_FAN")
13063 ", "
13064 (code "GL_TRIANGLES")
13065 ", "
13066 (code "GL_QUAD_STRIP")
13067 ", "
13068 (code "GL_QUADS")
13069 ",
13070 and "
13071 (code "GL_POLYGON")
13072 " are accepted. "))
13073 (entry (% (heading (var "first")))
13074 (para "
13075 Specifies the starting index in the enabled arrays. "))
13076 (entry (% (heading (var "count")))
13077 (para "
13078 Specifies the number of indices to be rendered. ")))
13079 (heading "Description")
13080 (para (code "glDrawArrays")
13081 " specifies multiple geometric primitives
13082 with very few subroutine calls. Instead of calling a GL procedure
13083 to pass each individual vertex, normal, texture coordinate, edge
13084 flag, or color, you can prespecify
13085 separate arrays of vertices, normals, and colors and use them to
13086 construct a sequence of primitives with a single
13087 call to "
13088 (code "glDrawArrays")
13089 ". ")
13090 (para "
13091 When "
13092 (code "glDrawArrays")
13093 " is called, it uses "
13094 (var "count")
13095 " sequential elements from each
13096 enabled array to construct a sequence of geometric primitives,
13097 beginning with element "
13098 (var "first")
13099 ". "
13100 (var "mode")
13101 " specifies what kind of
13102 primitives are constructed and how the array elements
13103 construct those primitives. If "
13104 (code "GL_VERTEX_ARRAY")
13105 " is not enabled, no
13106 geometric primitives are generated. ")
13107 (para "
13108 Vertex attributes that are modified by "
13109 (code "glDrawArrays")
13110 " have an
13111 unspecified value after "
13112 (code "glDrawArrays")
13113 " returns. For example, if "
13114 (code "GL_COLOR_ARRAY")
13115 " is enabled, the value of the current color is
13116 undefined after "
13117 (code "glDrawArrays")
13118 " executes. Attributes that aren't
13119 modified remain well defined. ")
13120 (heading "Errors")
13121 (para (code "GL_INVALID_ENUM")
13122 " is generated if "
13123 (var "mode")
13124 " is not an accepted value. ")
13125 (para (code "GL_INVALID_VALUE")
13126 " is generated if "
13127 (var "count")
13128 " is negative. ")
13129 (para (code "GL_INVALID_OPERATION")
13130 " is generated if a non-zero buffer object name is bound to an
13131 enabled array and the buffer object's data store is currently mapped. ")
13132 (para (code "GL_INVALID_OPERATION")
13133 " is generated if "
13134 (code "glDrawArrays")
13135 " is executed between
13136 the execution of "
13137 (code "glBegin")
13138 " and the corresponding "
13139 (code "glEnd")
13140 ". ")))
13141
13142 (define-gl-procedure
13143 glDrawBuffers
13144 "glDrawBuffers"
13145 (funcsynopsis
13146 (funcprototype
13147 (funcdef "void " (function "glDrawBuffers"))
13148 (paramdef "GLsizei " (parameter "n"))
13149 (paramdef "const GLenum *" (parameter "bufs"))))
13150 '(*fragment*
13151 (heading
13152 "Specifies a list of color buffers to be drawn into")
13153 (heading "Parameters")
13154 (table (% (formatter (asis)))
13155 (entry (% (heading (var "n")))
13156 (para "Specifies the number of buffers in "
13157 (var "bufs")
13158 "."))
13159 (entry (% (heading (var "bufs")))
13160 (para "Points to an array of symbolic constants
13161 \t\t specifying the buffers into which fragment colors or
13162 \t\t data values will be written.")))
13163 (heading "Description")
13164 (para (code "glDrawBuffers")
13165 " defines an array of
13166 \tbuffers into which fragment color values or fragment data will
13167 \tbe written. If no fragment shader is active, rendering
13168 \toperations will generate only one fragment color per fragment
13169 \tand it will be written into each of the buffers specified by\t"
13170 (var "bufs")
13171 ". If a fragment shader is active and
13172 \tit writes a value to the output variable\t"
13173 (code "gl_FragColor")
13174 ", then that value will be
13175 \twritten into each of the buffers specified by\t"
13176 (var "bufs")
13177 ". If a fragment shader is active and
13178 \tit writes a value to one or more elements of the output array
13179 \tvariable "
13180 (code "gl_FragData[]")
13181 ", then the value of\t"
13182 (code "gl_FragData[0] ")
13183 " will be written into the
13184 \tfirst buffer specified by "
13185 (var "bufs")
13186 ", the value
13187 \tof "
13188 (code "gl_FragData[1] ")
13189 " will be written into the
13190 \tsecond buffer specified by "
13191 (var "bufs")
13192 ", and so
13193 \ton up to "
13194 (code "gl_FragData[n-1]")
13195 ". The draw buffer
13196 \tused for "
13197 (code "gl_FragData[n]")
13198 " and beyond is
13199 \timplicitly set to be "
13200 (code "GL_NONE")
13201 ".")
13202 (para "The symbolic constants contained in\t"
13203 (var "bufs")
13204 " may be any of the following:")
13205 (table (% (formatter (asis)))
13206 (entry (% (heading (code "GL_NONE")))
13207 (para "The fragment color/data value is not written into
13208 \t\t any color buffer."))
13209 (entry (% (heading (code "GL_FRONT_LEFT")))
13210 (para "The fragment color/data value is written into the
13211 \t\t front left color buffer."))
13212 (entry (% (heading (code "GL_FRONT_RIGHT")))
13213 (para "The fragment color/data value is written into the
13214 \t\t front right color buffer."))
13215 (entry (% (heading (code "GL_BACK_LEFT")))
13216 (para "The fragment color/data value is written into the
13217 \t\t back left color buffer."))
13218 (entry (% (heading (code "GL_BACK_RIGHT")))
13219 (para "The fragment color/data value is written into the
13220 \t\t back right color buffer."))
13221 (entry (% (heading (code "GL_AUXi")))
13222 (para "The fragment color/data value is written into
13223 \t\t auxiliary buffer "
13224 (code "i")
13225 ".")))
13226 (para "Except for "
13227 (code "GL_NONE")
13228 ", the preceding
13229 \tsymbolic constants may not appear more than once in\t"
13230 (var "bufs")
13231 ". The maximum number of draw buffers
13232 \tsupported is implementation dependent and can be queried by
13233 \tcalling\t"
13234 (code "glGet")
13235 "
13236 with the argument "
13237 (code "GL_MAX_DRAW_BUFFERS")
13238 ". The
13239 \tnumber of auxiliary buffers can be queried by calling\t"
13240 (code "glGet")
13241 "
13242 with the argument "
13243 (code "GL_AUX_BUFFERS")
13244 ".")
13245 (heading "Errors")
13246 (para (code "GL_INVALID_ENUM")
13247 " is generated if one of the
13248 \tvalues in "
13249 (var "bufs")
13250 " is not an accepted
13251 \tvalue.")
13252 (para (code "GL_INVALID_ENUM")
13253 " is generated if\t"
13254 (var "n")
13255 " is less than 0.")
13256 (para (code "GL_INVALID_OPERATION")
13257 " is generated if a
13258 \tsymbolic constant other than "
13259 (code "GL_NONE")
13260 "
13261 appears more than once in "
13262 (var "bufs")
13263 ".")
13264 (para (code "GL_INVALID_OPERATION")
13265 " is generated if any of
13266 \tthe entries in "
13267 (var "bufs")
13268 " (other than\t"
13269 (code "GL_NONE")
13270 " ) indicates a color buffer that
13271 \tdoes not exist in the current GL context.")
13272 (para (code "GL_INVALID_VALUE")
13273 " is generated if\t"
13274 (var "n")
13275 " is greater than\t"
13276 (code "GL_MAX_DRAW_BUFFERS")
13277 ".")
13278 (para (code "GL_INVALID_OPERATION")
13279 " is generated if\t"
13280 (code "glDrawBuffers")
13281 " is executed between the
13282 \texecution of\t"
13283 (code "glBegin")
13284 "
13285 and the corresponding execution of\t"
13286 (code "glEnd")
13287 ".")))
13288
13289 (define-gl-procedure
13290 glDrawBuffer
13291 "glDrawBuffer"
13292 (funcsynopsis
13293 (funcprototype
13294 (funcdef "void " (function "glDrawBuffer"))
13295 (paramdef "GLenum " (parameter "mode"))))
13296 '(*fragment*
13297 (heading
13298 "specify which color buffers are to be drawn into")
13299 (heading "Parameters")
13300 (table (% (formatter (asis)))
13301 (entry (% (heading (var "mode")))
13302 (para "
13303 Specifies up to four color buffers to be drawn into.
13304 Symbolic constants "
13305 (code "GL_NONE")
13306 ", "
13307 (code "GL_FRONT_LEFT")
13308 ", "
13309 (code "GL_FRONT_RIGHT")
13310 ", "
13311 (code "GL_BACK_LEFT")
13312 ", "
13313 (code "GL_BACK_RIGHT")
13314 ", "
13315 (code "GL_FRONT")
13316 ", "
13317 (code "GL_BACK")
13318 ", "
13319 (code "GL_LEFT")
13320 ", "
13321 (code "GL_RIGHT")
13322 ", "
13323 (code "GL_FRONT_AND_BACK")
13324 ", and "
13325 (code "GL_AUX")
13326 (var "i")
13327 ",
13328 where "
13329 (var "i")
13330 " is between 0 and the value of "
13331 (code "GL_AUX_BUFFERS")
13332 " minus 1,
13333 are accepted. ("
13334 (code "GL_AUX_BUFFERS")
13335 " is not the upper limit; use "
13336 (code "glGet")
13337 "
13338 to query the number of available aux buffers.)
13339 The initial value is "
13340 (code "GL_FRONT")
13341 " for single-buffered contexts,
13342 and "
13343 (code "GL_BACK")
13344 " for double-buffered contexts. ")))
13345 (heading "Description")
13346 (para "
13347 When colors are written to the frame buffer,
13348 they are written into the color buffers specified by "
13349 (code "glDrawBuffer")
13350 ".
13351 The specifications are as follows: ")
13352 (table (% (formatter (asis)))
13353 (entry (% (heading (code "GL_NONE")))
13354 (para "
13355 No color buffers are written. "))
13356 (entry (% (heading (code "GL_FRONT_LEFT")))
13357 (para "
13358 Only the front left color buffer is written. "))
13359 (entry (% (heading (code "GL_FRONT_RIGHT")))
13360 (para "
13361 Only the front right color buffer is written. "))
13362 (entry (% (heading (code "GL_BACK_LEFT")))
13363 (para "
13364 Only the back left color buffer is written. "))
13365 (entry (% (heading (code "GL_BACK_RIGHT")))
13366 (para "
13367 Only the back right color buffer is written. "))
13368 (entry (% (heading (code "GL_FRONT")))
13369 (para "
13370 Only the front left and front right color buffers are written.
13371 If there is no front right color buffer,
13372 only the front left color buffer is written. "))
13373 (entry (% (heading (code "GL_BACK")))
13374 (para "
13375 Only the back left and back right color buffers are written.
13376 If there is no back right color buffer,
13377 only the back left color buffer is written. "))
13378 (entry (% (heading (code "GL_LEFT")))
13379 (para "
13380 Only the front left and back left color buffers are written.
13381 If there is no back left color buffer,
13382 only the front left color buffer is written. "))
13383 (entry (% (heading (code "GL_RIGHT")))
13384 (para "
13385 Only the front right and back right color buffers are written.
13386 If there is no back right color buffer,
13387 only the front right color buffer is written. "))
13388 (entry (% (heading (code "GL_FRONT_AND_BACK")))
13389 (para "
13390 All the front and back color buffers
13391 (front left, front right, back left, back right)
13392 are written.
13393 If there are no back color buffers,
13394 only the front left and front right color buffers are written.
13395 If there are no right color buffers,
13396 only the front left and back left color buffers are written.
13397 If there are no right or back color buffers,
13398 only the front left color buffer is written. "))
13399 (entry (% (heading (code "GL_AUX") (var "i")))
13400 (para "
13401 Only auxiliary color buffer "
13402 (var "i")
13403 " is written. ")))
13404 (para "
13405 If more than one color buffer is selected for drawing,
13406 then blending or logical operations are computed and applied independently
13407 for each color buffer and can produce different results in each buffer. ")
13408 (para "
13409 Monoscopic contexts include only "
13410 (var "left")
13411 "
13412 buffers, and stereoscopic contexts include both "
13413 (var "left")
13414 "
13415 and "
13416 (var "right")
13417 "
13418 buffers.
13419 Likewise, single-buffered contexts include only "
13420 (var "front")
13421 "
13422 buffers, and double-buffered contexts include both "
13423 (var "front")
13424 "
13425 and "
13426 (var "back")
13427 "
13428 buffers.
13429 The context is selected at GL initialization. ")
13430 (heading "Errors")
13431 (para (code "GL_INVALID_ENUM")
13432 " is generated if "
13433 (var "mode")
13434 " is not an accepted value. ")
13435 (para (code "GL_INVALID_OPERATION")
13436 " is generated if none of the buffers indicated
13437 by "
13438 (var "mode")
13439 " exists. ")
13440 (para (code "GL_INVALID_OPERATION")
13441 " is generated if "
13442 (code "glDrawBuffer")
13443 "
13444 is executed between the execution of "
13445 (code "glBegin")
13446 "
13447 and the corresponding execution of "
13448 (code "glEnd")
13449 ". ")))
13450
13451 (define-gl-procedure
13452 glDrawElements
13453 "glDrawElements"
13454 (funcsynopsis
13455 (funcprototype
13456 (funcdef "void " (function "glDrawElements"))
13457 (paramdef "GLenum " (parameter "mode"))
13458 (paramdef "GLsizei " (parameter "count"))
13459 (paramdef "GLenum " (parameter "type"))
13460 (paramdef
13461 "const GLvoid * "
13462 (parameter "indices"))))
13463 '(*fragment*
13464 (heading "render primitives from array data")
13465 (heading "Parameters")
13466 (table (% (formatter (asis)))
13467 (entry (% (heading (var "mode")))
13468 (para "
13469 Specifies what kind of primitives to render.
13470 Symbolic constants "
13471 (code "GL_POINTS")
13472 ", "
13473 (code "GL_LINE_STRIP")
13474 ", "
13475 (code "GL_LINE_LOOP")
13476 ", "
13477 (code "GL_LINES")
13478 ", "
13479 (code "GL_TRIANGLE_STRIP")
13480 ", "
13481 (code "GL_TRIANGLE_FAN")
13482 ", "
13483 (code "GL_TRIANGLES")
13484 ", "
13485 (code "GL_QUAD_STRIP")
13486 ", "
13487 (code "GL_QUADS")
13488 ",
13489 and "
13490 (code "GL_POLYGON")
13491 " are accepted. "))
13492 (entry (% (heading (var "count")))
13493 (para "
13494 Specifies the number of elements to be rendered. "))
13495 (entry (% (heading (var "type")))
13496 (para "
13497 Specifies the type of the values in "
13498 (var "indices")
13499 ". Must be one of "
13500 (code "GL_UNSIGNED_BYTE")
13501 ", "
13502 (code "GL_UNSIGNED_SHORT")
13503 ", or "
13504 (code "GL_UNSIGNED_INT")
13505 ". "))
13506 (entry (% (heading (var "indices")))
13507 (para "
13508 Specifies a pointer to the location where the indices are stored. ")))
13509 (heading "Description")
13510 (para (code "glDrawElements")
13511 " specifies multiple geometric primitives
13512 with very few subroutine calls. Instead of calling a GL function
13513 to pass each individual vertex, normal, texture coordinate, edge
13514 flag, or color, you can prespecify
13515 separate arrays of vertices, normals, and so on, and use them to
13516 construct a sequence of primitives with a single
13517 call to "
13518 (code "glDrawElements")
13519 ". ")
13520 (para "
13521 When "
13522 (code "glDrawElements")
13523 " is called, it uses "
13524 (var "count")
13525 " sequential elements from an
13526 enabled array, starting at "
13527 (var "indices")
13528 " to construct a sequence of
13529 geometric primitives. "
13530 (var "mode")
13531 " specifies what kind of primitives are
13532 constructed and how the array elements construct these primitives. If
13533 more than one array is enabled, each is used. If "
13534 (code "GL_VERTEX_ARRAY")
13535 " is not enabled, no geometric primitives are
13536 constructed. ")
13537 (para "
13538 Vertex attributes that are modified by "
13539 (code "glDrawElements")
13540 " have an
13541 unspecified value after "
13542 (code "glDrawElements")
13543 " returns. For example, if "
13544 (code "GL_COLOR_ARRAY")
13545 " is enabled, the value of the current color is
13546 undefined after "
13547 (code "glDrawElements")
13548 " executes. Attributes that aren't
13549 modified maintain their previous values. ")
13550 (heading "Errors")
13551 (para (code "GL_INVALID_ENUM")
13552 " is generated if "
13553 (var "mode")
13554 " is not an accepted value. ")
13555 (para (code "GL_INVALID_VALUE")
13556 " is generated if "
13557 (var "count")
13558 " is negative. ")
13559 (para (code "GL_INVALID_OPERATION")
13560 " is generated if a non-zero buffer object name is bound to an
13561 enabled array or the element array and the buffer object's data store is currently mapped. ")
13562 (para (code "GL_INVALID_OPERATION")
13563 " is generated if "
13564 (code "glDrawElements")
13565 " is executed between
13566 the execution of "
13567 (code "glBegin")
13568 " and the corresponding "
13569 (code "glEnd")
13570 ". ")))
13571
13572 (define-gl-procedure
13573 glDrawPixels
13574 "glDrawPixels"
13575 (funcsynopsis
13576 (funcprototype
13577 (funcdef "void " (function "glDrawPixels"))
13578 (paramdef "GLsizei " (parameter "width"))
13579 (paramdef "GLsizei " (parameter "height"))
13580 (paramdef "GLenum " (parameter "format"))
13581 (paramdef "GLenum " (parameter "type"))
13582 (paramdef "const GLvoid * " (parameter "data"))))
13583 '(*fragment*
13584 (heading
13585 "write a block of pixels to the frame buffer")
13586 (heading "Parameters")
13587 (table (% (formatter (asis)))
13588 (entry (% (heading (var "width")))
13589 (itemx (var "height"))
13590 (para "
13591 Specify the dimensions of the pixel rectangle to be written
13592 into the frame buffer. "))
13593 (entry (% (heading (var "format")))
13594 (para "
13595 Specifies the format of the pixel data.
13596 Symbolic constants "
13597 (code "GL_COLOR_INDEX")
13598 ", "
13599 (code "GL_STENCIL_INDEX")
13600 ", "
13601 (code "GL_DEPTH_COMPONENT")
13602 ", "
13603 (code "GL_RGB")
13604 ", "
13605 (code "GL_BGR")
13606 ", "
13607 (code "GL_RGBA")
13608 ", "
13609 (code "GL_BGRA")
13610 ", "
13611 (code "GL_RED")
13612 ", "
13613 (code "GL_GREEN")
13614 ", "
13615 (code "GL_BLUE")
13616 ", "
13617 (code "GL_ALPHA")
13618 ", "
13619 (code "GL_LUMINANCE")
13620 ", and "
13621 (code "GL_LUMINANCE_ALPHA")
13622 " are accepted. "))
13623 (entry (% (heading (var "type")))
13624 (para "
13625 Specifies the data type for "
13626 (var "data")
13627 ".
13628 Symbolic constants "
13629 (code "GL_UNSIGNED_BYTE")
13630 ", "
13631 (code "GL_BYTE")
13632 ", "
13633 (code "GL_BITMAP")
13634 ", "
13635 (code "GL_UNSIGNED_SHORT")
13636 ", "
13637 (code "GL_SHORT")
13638 ", "
13639 (code "GL_UNSIGNED_INT")
13640 ", "
13641 (code "GL_INT")
13642 ", "
13643 (code "GL_FLOAT")
13644 ", "
13645 (code "GL_UNSIGNED_BYTE_3_3_2")
13646 ", "
13647 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
13648 ", "
13649 (code "GL_UNSIGNED_SHORT_5_6_5")
13650 ", "
13651 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
13652 ", "
13653 (code "GL_UNSIGNED_SHORT_4_4_4_4")
13654 ", "
13655 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
13656 ", "
13657 (code "GL_UNSIGNED_SHORT_5_5_5_1")
13658 ", "
13659 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
13660 ", "
13661 (code "GL_UNSIGNED_INT_8_8_8_8")
13662 ", "
13663 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
13664 ", "
13665 (code "GL_UNSIGNED_INT_10_10_10_2")
13666 ", and "
13667 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
13668 "
13669 are accepted. "))
13670 (entry (% (heading (var "data")))
13671 (para "
13672 Specifies a pointer to the pixel data. ")))
13673 (heading "Description")
13674 (para (code "glDrawPixels")
13675 " reads pixel data from memory and writes it into the frame buffer
13676 relative to the current raster position, provided that the raster
13677 position is valid. Use "
13678 (code "glRasterPos")
13679 " or "
13680 (code "glWindowPos")
13681 " to set the current raster position; use "
13682 (code "glGet")
13683 " with argument "
13684 (code "GL_CURRENT_RASTER_POSITION_VALID")
13685 "
13686 to determine if the specified raster position is valid, and "
13687 (code "glGet")
13688 " with argument "
13689 (code "GL_CURRENT_RASTER_POSITION")
13690 "
13691 to query the raster position. ")
13692 (para "
13693 Several parameters define the encoding of pixel data in memory
13694 and control the processing of the pixel data
13695 before it is placed in the frame buffer.
13696 These parameters are set with four commands: "
13697 (code "glPixelStore")
13698 ", "
13699 (code "glPixelTransfer")
13700 ", "
13701 (code "glPixelMap")
13702 ", and "
13703 (code "glPixelZoom")
13704 ".
13705 This reference page describes the effects on "
13706 (code "glDrawPixels")
13707 " of many,
13708 but not all, of the parameters specified by these four commands. ")
13709 (para "
13710 Data is read from "
13711 (var "data")
13712 " as a sequence of signed or unsigned bytes,
13713 signed or unsigned shorts, signed or unsigned integers, or
13714 single-precision floating-point values, depending on "
13715 (var "type")
13716 ".
13717 When "
13718 (var "type")
13719 " is one of "
13720 (code "GL_UNSIGNED_BYTE")
13721 ", "
13722 (code "GL_BYTE")
13723 ", "
13724 (code "GL_UNSIGNED_SHORT")
13725 ", "
13726 (code "GL_SHORT")
13727 ", "
13728 (code "GL_UNSIGNED_INT")
13729 ", "
13730 (code "GL_INT")
13731 ", or "
13732 (code "GL_FLOAT")
13733 " each of these bytes, shorts, integers, or
13734 floating-point values is interpreted as one color or depth component, or
13735 one index, depending on "
13736 (var "format")
13737 ".
13738 When "
13739 (var "type")
13740 " is one of "
13741 (code "GL_UNSIGNED_BYTE_3_3_2")
13742 ", "
13743 (code "GL_UNSIGNED_SHORT_5_6_5")
13744 ", "
13745 (code "GL_UNSIGNED_SHORT_4_4_4_4")
13746 ", "
13747 (code "GL_UNSIGNED_SHORT_5_5_5_1")
13748 ", "
13749 (code "GL_UNSIGNED_INT_8_8_8_8")
13750 ", or "
13751 (code "GL_UNSIGNED_INT_10_10_10_2")
13752 ", each unsigned value is interpreted as
13753 containing all the components for a single pixel, with the color
13754 components arranged according to "
13755 (var "format")
13756 ".
13757 When "
13758 (var "type")
13759 " is one of "
13760 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
13761 ", "
13762 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
13763 ", "
13764 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
13765 ", "
13766 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
13767 ", "
13768 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
13769 ", or "
13770 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
13771 ", each unsigned value is interpreted
13772 as containing all color components, specified by "
13773 (var "format")
13774 ", for a single
13775 pixel in a reversed order. Indices are always treated individually.
13776 Color components are treated as groups of one, two, three, or four
13777 values, again based on "
13778 (var "format")
13779 ". Both individual indices and groups of
13780 components are referred to as pixels.
13781 If "
13782 (var "type")
13783 " is "
13784 (code "GL_BITMAP")
13785 ", the data must be unsigned bytes, and "
13786 (var "format")
13787 " must be either "
13788 (code "GL_COLOR_INDEX")
13789 " or "
13790 (code "GL_STENCIL_INDEX")
13791 ".
13792 Each unsigned byte is treated as eight 1-bit pixels, with bit ordering
13793 determined by "
13794 (code "GL_UNPACK_LSB_FIRST")
13795 " (see "
13796 (code "glPixelStore")
13797 "). ")
13798 (para (math (var "width") "×" (var "height"))
13799 "
13800 pixels are read from memory,
13801 starting at location "
13802 (var "data")
13803 ".
13804 By default, these pixels are taken from adjacent memory locations,
13805 except that after all "
13806 (var "width")
13807 " pixels are read,
13808 the read pointer is advanced to the next four-byte boundary.
13809 The four-byte row alignment is specified by "
13810 (code "glPixelStore")
13811 " with
13812 argument "
13813 (code "GL_UNPACK_ALIGNMENT")
13814 ",
13815 and it can be set to one, two, four, or eight bytes.
13816 Other pixel store parameters specify different read pointer advancements,
13817 both before the first pixel is read
13818 and after all "
13819 (var "width")
13820 " pixels are read.
13821 See the "
13822 (code "glPixelStore")
13823 " reference page for details on these options. ")
13824 (para "
13825 If a non-zero named buffer object is bound to the "
13826 (code "GL_PIXEL_UNPACK_BUFFER")
13827 " target
13828 (see "
13829 (code "glBindBuffer")
13830 ") while a block of pixels is
13831 specified, "
13832 (var "data")
13833 " is treated as a byte offset into the buffer object's data store. ")
13834 (para "
13835 The "
13836 (math (var "width") "×" (var "height"))
13837 "
13838 pixels that are read from memory are
13839 each operated on in the same way,
13840 based on the values of several parameters specified by "
13841 (code "glPixelTransfer")
13842 "
13843 and "
13844 (code "glPixelMap")
13845 ".
13846 The details of these operations,
13847 as well as the target buffer into which the pixels are drawn,
13848 are specific to the format of the pixels,
13849 as specified by "
13850 (var "format")
13851 ". "
13852 (var "format")
13853 " can assume one of 13 symbolic values: ")
13854 (table (% (formatter (asis)))
13855 (entry (% (heading (code "GL_COLOR_INDEX")))
13856 (para "
13857 Each pixel is a single value,
13858 a color index.
13859 It is converted to fixed-point format,
13860 with an unspecified number of bits to the right of the binary point,
13861 regardless of the memory data type.
13862 Floating-point values convert to true fixed-point values.
13863 Signed and unsigned integer data is converted with all fraction bits
13864 set to 0.
13865 Bitmap data convert to either 0 or 1. ")
13866 (para "
13867 Each fixed-point index is then shifted left by "
13868 (code "GL_INDEX_SHIFT")
13869 " bits
13870 and added to "
13871 (code "GL_INDEX_OFFSET")
13872 ".
13873 If "
13874 (code "GL_INDEX_SHIFT")
13875 " is negative,
13876 the shift is to the right.
13877 In either case, zero bits fill otherwise unspecified bit locations in the
13878 result. ")
13879 (para "
13880 If the GL is in RGBA mode,
13881 the resulting index is converted to an RGBA pixel
13882 with the help of the "
13883 (code "GL_PIXEL_MAP_I_TO_R")
13884 ", "
13885 (code "GL_PIXEL_MAP_I_TO_G")
13886 ", "
13887 (code "GL_PIXEL_MAP_I_TO_B")
13888 ",
13889 and "
13890 (code "GL_PIXEL_MAP_I_TO_A")
13891 " tables.
13892 If the GL is in color index mode,
13893 and if "
13894 (code "GL_MAP_COLOR")
13895 " is true,
13896 the index is replaced with the value that it references in lookup table "
13897 (code "GL_PIXEL_MAP_I_TO_I")
13898 ".
13899 Whether the lookup replacement of the index is done or not,
13900 the integer part of the index is then ANDed with "
13901 (math "2" "^" (var "b") "-" "1")
13902 ",
13903 where "
13904 (math (var "b"))
13905 "
13906 is the number of bits in a color index buffer. ")
13907 (para "
13908 The GL then converts the resulting indices or RGBA colors to fragments
13909 by attaching the current raster position "
13910 (var "z")
13911 " coordinate and
13912 texture coordinates to each pixel,
13913 then assigning "
13914 (math (var "x"))
13915 "
13916 and "
13917 (math (var "y"))
13918 "
13919 window coordinates to the "
13920 (math (var "n"))
13921 "th
13922 fragment such that "
13923 (math (var "x")
13924 "_"
13925 (var "n")
13926 "="
13927 (var "x")
13928 "_"
13929 (var "r")
13930 "+"
13931 (var "n")
13932 "%"
13933 (var "width"))
13934 (para (math (var "y")
13935 "_"
13936 (var "n")
13937 "="
13938 (var "y")
13939 "_"
13940 (var "r")
13941 "+"
13942 "⌊"
13943 (var "n")
13944 "/"
13945 (var "width")
13946 ","
13947 "⌋"))
13948 (para))
13949 (para "
13950 where "
13951 (math "("
13952 (var "x")
13953 "_"
13954 (var "r")
13955 ","
13956 (var "y")
13957 "_"
13958 (var "r")
13959 ")")
13960 "
13961 is the current raster position.
13962 These pixel fragments are then treated just like the fragments generated by
13963 rasterizing points, lines, or polygons.
13964 Texture mapping,
13965 fog,
13966 and all the fragment operations are applied before the fragments are written
13967 to the frame buffer. "))
13968 (entry (% (heading (code "GL_STENCIL_INDEX")))
13969 (para "
13970 Each pixel is a single value,
13971 a stencil index.
13972 It is converted to fixed-point format,
13973 with an unspecified number of bits to the right of the binary point,
13974 regardless of the memory data type.
13975 Floating-point values convert to true fixed-point values.
13976 Signed and unsigned integer data is converted with all fraction bits
13977 set to 0.
13978 Bitmap data convert to either 0 or 1. ")
13979 (para "
13980 Each fixed-point index is then shifted left by "
13981 (code "GL_INDEX_SHIFT")
13982 " bits,
13983 and added to "
13984 (code "GL_INDEX_OFFSET")
13985 ".
13986 If "
13987 (code "GL_INDEX_SHIFT")
13988 " is negative,
13989 the shift is to the right.
13990 In either case, zero bits fill otherwise unspecified bit locations in the
13991 result.
13992 If "
13993 (code "GL_MAP_STENCIL")
13994 " is true,
13995 the index is replaced with the value that it references in lookup table "
13996 (code "GL_PIXEL_MAP_S_TO_S")
13997 ".
13998 Whether the lookup replacement of the index is done or not,
13999 the integer part of the index is then ANDed with "
14000 (math "2" "^" (var "b") "-" "1")
14001 ",
14002 where "
14003 (math (var "b"))
14004 "
14005 is the number of bits in the stencil buffer.
14006 The resulting stencil indices are then written to the stencil buffer
14007 such that the "
14008 (math (var "n"))
14009 "th
14010 index is written to location ")
14011 (para (math (var "x")
14012 "_"
14013 (var "n")
14014 "="
14015 (var "x")
14016 "_"
14017 (var "r")
14018 "+"
14019 (var "n")
14020 "%"
14021 (var "width"))
14022 (para (math (var "y")
14023 "_"
14024 (var "n")
14025 "="
14026 (var "y")
14027 "_"
14028 (var "r")
14029 "+"
14030 "⌊"
14031 (var "n")
14032 "/"
14033 (var "width")
14034 ","
14035 "⌋")))
14036 (para "
14037 where "
14038 (math "("
14039 (var "x")
14040 "_"
14041 (var "r")
14042 ","
14043 (var "y")
14044 "_"
14045 (var "r")
14046 ")")
14047 "
14048 is the current raster position.
14049 Only the pixel ownership test,
14050 the scissor test,
14051 and the stencil writemask affect these write operations. "))
14052 (entry (% (heading (code "GL_DEPTH_COMPONENT")))
14053 (para "
14054 Each pixel is a single-depth component.
14055 Floating-point data is converted directly to an internal floating-point
14056 format with unspecified precision.
14057 Signed integer data is mapped linearly to the internal floating-point
14058 format such that the most positive representable integer value maps to 1.0,
14059 and the most negative representable value maps to "
14060 (math "-1.0")
14061 ".
14062 Unsigned integer data is mapped similarly:
14063 the largest integer value maps to 1.0,
14064 and 0 maps to 0.0.
14065 The resulting floating-point depth value is then multiplied
14066 by "
14067 (code "GL_DEPTH_SCALE")
14068 " and added to "
14069 (code "GL_DEPTH_BIAS")
14070 ".
14071 The result is clamped to the range "
14072 (math "[" "0" "," "1" "]")
14073 ". ")
14074 (para "
14075 The GL then converts the resulting depth components to fragments
14076 by attaching the current raster position color or color index and
14077 texture coordinates to each pixel,
14078 then assigning "
14079 (math (var "x"))
14080 "
14081 and "
14082 (math (var "y"))
14083 "
14084 window coordinates to the "
14085 (math (var "n"))
14086 "th
14087 fragment such that ")
14088 (para (math (var "x")
14089 "_"
14090 (var "n")
14091 "="
14092 (var "x")
14093 "_"
14094 (var "r")
14095 "+"
14096 (var "n")
14097 "%"
14098 (var "width"))
14099 (para (math (var "y")
14100 "_"
14101 (var "n")
14102 "="
14103 (var "y")
14104 "_"
14105 (var "r")
14106 "+"
14107 "⌊"
14108 (var "n")
14109 "/"
14110 (var "width")
14111 ","
14112 "⌋")))
14113 (para "
14114 where "
14115 (math "("
14116 (var "x")
14117 "_"
14118 (var "r")
14119 ","
14120 (var "y")
14121 "_"
14122 (var "r")
14123 ")")
14124 "
14125 is the current raster position.
14126 These pixel fragments are then treated just like the fragments generated by
14127 rasterizing points, lines, or polygons.
14128 Texture mapping,
14129 fog,
14130 and all the fragment operations are applied before the fragments are written
14131 to the frame buffer. "))
14132 (entry (% (heading (code "GL_RGBA"))))
14133 (entry (% (heading (code "GL_BGRA")))
14134 (para "
14135 Each pixel is a four-component group: For "
14136 (code "GL_RGBA")
14137 ", the red
14138 component is first, followed by green, followed by blue, followed by
14139 alpha; for "
14140 (code "GL_BGRA")
14141 " the order is blue, green, red and then alpha.
14142 Floating-point values are converted directly to an internal floating-point
14143 format with unspecified precision.
14144 Signed integer values are mapped linearly to the internal floating-point
14145 format such that the most positive representable integer value maps to 1.0,
14146 and the most negative representable value maps to "
14147 (math "-1.0")
14148 ".
14149 (Note that
14150 this mapping does not convert 0 precisely to 0.0.)
14151 Unsigned integer data is mapped similarly:
14152 The largest integer value maps to 1.0,
14153 and 0 maps to 0.0.
14154 The resulting floating-point color values are then multiplied
14155 by "
14156 (code "GL_c_SCALE")
14157 " and added to "
14158 (code "GL_c_BIAS")
14159 ",
14160 where "
14161 (var "c")
14162 " is RED, GREEN, BLUE, and ALPHA
14163 for the respective color components.
14164 The results are clamped to the range "
14165 (math "[" "0" "," "1" "]")
14166 ". ")
14167 (para "
14168 If "
14169 (code "GL_MAP_COLOR")
14170 " is true,
14171 each color component is scaled by the size of lookup table "
14172 (code "GL_PIXEL_MAP_c_TO_c")
14173 ",
14174 then replaced by the value that it references in that table. "
14175 (var "c")
14176 " is R, G, B, or A respectively. ")
14177 (para "
14178 The GL then converts the resulting RGBA colors to fragments
14179 by attaching the current raster position "
14180 (var "z")
14181 " coordinate and
14182 texture coordinates to each pixel,
14183 then assigning "
14184 (math (var "x"))
14185 "
14186 and "
14187 (math (var "y"))
14188 "
14189 window coordinates to the "
14190 (math (var "n"))
14191 "th
14192 fragment such that ")
14193 (para (math (var "x")
14194 "_"
14195 (var "n")
14196 "="
14197 (var "x")
14198 "_"
14199 (var "r")
14200 "+"
14201 (var "n")
14202 "%"
14203 (var "width"))
14204 (para (math (var "y")
14205 "_"
14206 (var "n")
14207 "="
14208 (var "y")
14209 "_"
14210 (var "r")
14211 "+"
14212 "⌊"
14213 (var "n")
14214 "/"
14215 (var "width")
14216 ","
14217 "⌋")))
14218 (para "
14219 where "
14220 (math "("
14221 (var "x")
14222 "_"
14223 (var "r")
14224 ","
14225 (var "y")
14226 "_"
14227 (var "r")
14228 ")")
14229 "
14230 is the current raster position.
14231 These pixel fragments are then treated just like the fragments generated by
14232 rasterizing points, lines, or polygons.
14233 Texture mapping,
14234 fog,
14235 and all the fragment operations are applied before the fragments are written
14236 to the frame buffer. "))
14237 (entry (% (heading (code "GL_RED")))
14238 (para "
14239 Each pixel is a single red component.
14240 This component is converted to the internal floating-point format in
14241 the same way the red component of an RGBA pixel is. It is
14242 then converted to an RGBA pixel with green and blue set to 0,
14243 and alpha set to 1.
14244 After this conversion, the pixel is treated as if it had been read
14245 as an RGBA pixel. "))
14246 (entry (% (heading (code "GL_GREEN")))
14247 (para "
14248 Each pixel is a single green component.
14249 This component is converted to the internal floating-point format in
14250 the same way the green component of an RGBA pixel is.
14251 It is then converted to an RGBA pixel with red and blue set to 0,
14252 and alpha set to 1.
14253 After this conversion, the pixel is treated as if it had been read
14254 as an RGBA pixel. "))
14255 (entry (% (heading (code "GL_BLUE")))
14256 (para "
14257 Each pixel is a single blue component.
14258 This component is converted to the internal floating-point format in
14259 the same way the blue component of an RGBA pixel is.
14260 It is then converted to an RGBA pixel with red and green set to 0,
14261 and alpha set to 1.
14262 After this conversion, the pixel is treated as if it had been read
14263 as an RGBA pixel. "))
14264 (entry (% (heading (code "GL_ALPHA")))
14265 (para "
14266 Each pixel is a single alpha component.
14267 This component is converted to the internal floating-point format in
14268 the same way the alpha component of an RGBA pixel is.
14269 It is then converted to an RGBA pixel with red, green, and blue set to 0.
14270 After this conversion, the pixel is treated as if it had been read
14271 as an RGBA pixel. "))
14272 (entry (% (heading (code "GL_RGB"))))
14273 (entry (% (heading (code "GL_BGR")))
14274 (para "
14275 Each pixel is a three-component group:
14276 red first, followed by green, followed by blue; for "
14277 (code "GL_BGR")
14278 ", the
14279 first component is blue, followed by green and then red.
14280 Each component is converted to the internal floating-point format in
14281 the same way the red, green, and blue components of an RGBA pixel are.
14282 The color triple is converted to an RGBA pixel with alpha set to 1.
14283 After this conversion, the pixel is treated as if it had been read
14284 as an RGBA pixel. "))
14285 (entry (% (heading (code "GL_LUMINANCE")))
14286 (para "
14287 Each pixel is a single luminance component.
14288 This component is converted to the internal floating-point format in
14289 the same way the red component of an RGBA pixel is.
14290 It is then converted to an RGBA pixel with red, green, and blue set to the
14291 converted luminance value,
14292 and alpha set to 1.
14293 After this conversion, the pixel is treated as if it had been read
14294 as an RGBA pixel. "))
14295 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
14296 (para "
14297 Each pixel is a two-component group:
14298 luminance first, followed by alpha.
14299 The two components are converted to the internal floating-point format in
14300 the same way the red component of an RGBA pixel is.
14301 They are then converted to an RGBA pixel with red, green, and blue set to the
14302 converted luminance value,
14303 and alpha set to the converted alpha value.
14304 After this conversion, the pixel is treated as if it had been read
14305 as an RGBA pixel. ")))
14306 (para "
14307 The following table summarizes the meaning of the valid constants for the "
14308 (var "type")
14309 " parameter: ")
14310 (para)
14311 (table (% (formatter (asis)))
14312 (entry (% (heading (strong "Type")))
14313 (para (strong "Corresponding Type")))
14314 (entry (% (heading (code "GL_UNSIGNED_BYTE")))
14315 (para "
14316 unsigned 8-bit integer "))
14317 (entry (% (heading (code "GL_BYTE")))
14318 (para "
14319 signed 8-bit integer "))
14320 (entry (% (heading (code "GL_BITMAP")))
14321 (para "
14322 single bits in unsigned 8-bit integers "))
14323 (entry (% (heading (code "GL_UNSIGNED_SHORT")))
14324 (para "
14325 unsigned 16-bit integer "))
14326 (entry (% (heading (code "GL_SHORT")))
14327 (para "
14328 signed 16-bit integer "))
14329 (entry (% (heading (code "GL_UNSIGNED_INT")))
14330 (para "
14331 unsigned 32-bit integer "))
14332 (entry (% (heading (code "GL_INT")))
14333 (para "
14334 32-bit integer "))
14335 (entry (% (heading (code "GL_FLOAT")))
14336 (para "
14337 single-precision floating-point "))
14338 (entry (% (heading (code "GL_UNSIGNED_BYTE_3_3_2")))
14339 (para "
14340 unsigned 8-bit integer "))
14341 (entry (% (heading (code "GL_UNSIGNED_BYTE_2_3_3_REV")))
14342 (para "
14343 unsigned 8-bit integer with reversed component ordering "))
14344 (entry (% (heading (code "GL_UNSIGNED_SHORT_5_6_5")))
14345 (para "
14346 unsigned 16-bit integer "))
14347 (entry (% (heading (code "GL_UNSIGNED_SHORT_5_6_5_REV")))
14348 (para "
14349 unsigned 16-bit integer with reversed component ordering "))
14350 (entry (% (heading (code "GL_UNSIGNED_SHORT_4_4_4_4")))
14351 (para "
14352 unsigned 16-bit integer "))
14353 (entry (% (heading (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")))
14354 (para "
14355 unsigned 16-bit integer with reversed component ordering "))
14356 (entry (% (heading (code "GL_UNSIGNED_SHORT_5_5_5_1")))
14357 (para "
14358 unsigned 16-bit integer "))
14359 (entry (% (heading (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")))
14360 (para "
14361 unsigned 16-bit integer with reversed component ordering "))
14362 (entry (% (heading (code "GL_UNSIGNED_INT_8_8_8_8")))
14363 (para "
14364 unsigned 32-bit integer "))
14365 (entry (% (heading (code "GL_UNSIGNED_INT_8_8_8_8_REV")))
14366 (para "
14367 unsigned 32-bit integer with reversed component ordering "))
14368 (entry (% (heading (code "GL_UNSIGNED_INT_10_10_10_2")))
14369 (para "
14370 unsigned 32-bit integer "))
14371 (entry (% (heading (code "GL_UNSIGNED_INT_2_10_10_10_REV")))
14372 (para "
14373 unsigned 32-bit integer with reversed component ordering ")))
14374 (para)
14375 (para "
14376 The rasterization described so far assumes pixel zoom factors of 1.
14377 If "
14378 (code "glPixelZoom")
14379 " is used to change the "
14380 (math (var "x"))
14381 "
14382 and "
14383 (math (var "y"))
14384 "
14385 pixel zoom factors,
14386 pixels are converted to fragments as follows.
14387 If "
14388 (math "("
14389 (var "x")
14390 "_"
14391 (var "r")
14392 ","
14393 (var "y")
14394 "_"
14395 (var "r")
14396 ")")
14397 "
14398 is the current raster position,
14399 and a given pixel is in the "
14400 (math (var "n"))
14401 "th
14402 column and "
14403 (math (var "m"))
14404 "th
14405 row
14406 of the pixel rectangle,
14407 then fragments are generated for pixels whose centers are in the rectangle
14408 with corners at ")
14409 (para (math "("
14410 (var "x")
14411 "_"
14412 (var "r")
14413 "+"
14414 (var "zoom")
14415 "_"
14416 (var "x")
14417 ","
14418 "\u2062"
14419 (var "n")
14420 ","
14421 (var "y")
14422 "_"
14423 (var "r")
14424 "+"
14425 (var "zoom")
14426 "_"
14427 (var "y")
14428 ","
14429 "\u2062"
14430 (var "m")
14431 ")")
14432 (para (math "("
14433 (var "x")
14434 "_"
14435 (var "r")
14436 "+"
14437 (var "zoom")
14438 "_"
14439 (var "x")
14440 ","
14441 "\u2061"
14442 "("
14443 (var "n")
14444 "+"
14445 "1"
14446 ","
14447 ")"
14448 ","
14449 (var "y")
14450 "_"
14451 (var "r")
14452 "+"
14453 (var "zoom")
14454 "_"
14455 (var "y")
14456 ","
14457 "\u2061"
14458 "("
14459 (var "m")
14460 "+"
14461 "1"
14462 ","
14463 ")"
14464 ")")))
14465 (para "
14466 where "
14467 (math (var "zoom") "_" (var "x"))
14468 "
14469 is the value of "
14470 (code "GL_ZOOM_X")
14471 " and "
14472 (math (var "zoom") "_" (var "y"))
14473 "
14474 is the value of "
14475 (code "GL_ZOOM_Y")
14476 ". ")
14477 (heading "Errors")
14478 (para (code "GL_INVALID_ENUM")
14479 " is generated if "
14480 (var "format")
14481 " or "
14482 (var "type")
14483 " is not one of
14484 the accepted values. ")
14485 (para (code "GL_INVALID_ENUM")
14486 " is generated if "
14487 (var "type")
14488 " is "
14489 (code "GL_BITMAP")
14490 " and "
14491 (var "format")
14492 " is not either "
14493 (code "GL_COLOR_INDEX")
14494 " or "
14495 (code "GL_STENCIL_INDEX")
14496 ". ")
14497 (para (code "GL_INVALID_VALUE")
14498 " is generated if either "
14499 (var "width")
14500 " or "
14501 (var "height")
14502 " is negative. ")
14503 (para (code "GL_INVALID_OPERATION")
14504 " is generated if "
14505 (var "format")
14506 " is "
14507 (code "GL_STENCIL_INDEX")
14508 "
14509 and there is no stencil buffer. ")
14510 (para (code "GL_INVALID_OPERATION")
14511 " is generated if "
14512 (var "format")
14513 " is "
14514 (code "GL_RED")
14515 ", "
14516 (code "GL_GREEN")
14517 ", "
14518 (code "GL_BLUE")
14519 ", "
14520 (code "GL_ALPHA")
14521 ", "
14522 (code "GL_RGB")
14523 ", "
14524 (code "GL_RGBA")
14525 ", "
14526 (code "GL_BGR")
14527 ", "
14528 (code "GL_BGRA")
14529 ", "
14530 (code "GL_LUMINANCE")
14531 ",
14532 or "
14533 (code "GL_LUMINANCE_ALPHA")
14534 ",
14535 and the GL is in color index mode. ")
14536 (para (code "GL_INVALID_OPERATION")
14537 " is generated if "
14538 (var "format")
14539 " is one of "
14540 (code "GL_UNSIGNED_BYTE_3_3_2")
14541 ", "
14542 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
14543 ", "
14544 (code "GL_UNSIGNED_SHORT_5_6_5")
14545 ", or "
14546 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
14547 "
14548 and "
14549 (var "format")
14550 " is not "
14551 (code "GL_RGB")
14552 ". ")
14553 (para (code "GL_INVALID_OPERATION")
14554 " is generated if "
14555 (var "format")
14556 " is one of "
14557 (code "GL_UNSIGNED_SHORT_4_4_4_4")
14558 ", "
14559 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
14560 ", "
14561 (code "GL_UNSIGNED_SHORT_5_5_5_1")
14562 ", "
14563 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
14564 ", "
14565 (code "GL_UNSIGNED_INT_8_8_8_8")
14566 ", "
14567 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
14568 ", "
14569 (code "GL_UNSIGNED_INT_10_10_10_2")
14570 ", or "
14571 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
14572 "
14573 and "
14574 (var "format")
14575 " is neither "
14576 (code "GL_RGBA")
14577 " nor "
14578 (code "GL_BGRA")
14579 ". ")
14580 (para (code "GL_INVALID_OPERATION")
14581 " is generated if a non-zero buffer object name is bound to the "
14582 (code "GL_PIXEL_UNPACK_BUFFER")
14583 " target and the buffer object's data store is currently mapped. ")
14584 (para (code "GL_INVALID_OPERATION")
14585 " is generated if a non-zero buffer object name is bound to the "
14586 (code "GL_PIXEL_UNPACK_BUFFER")
14587 " target and the data would be unpacked from the buffer
14588 object such that the memory reads required would exceed the data store size. ")
14589 (para (code "GL_INVALID_OPERATION")
14590 " is generated if a non-zero buffer object name is bound to the "
14591 (code "GL_PIXEL_UNPACK_BUFFER")
14592 " target and "
14593 (var "data")
14594 " is not evenly divisible
14595 into the number of bytes needed to store in memory a datum indicated by "
14596 (var "type")
14597 ". ")
14598 (para (code "GL_INVALID_OPERATION")
14599 " is generated if "
14600 (code "glDrawPixels")
14601 "
14602 is executed between the execution of "
14603 (code "glBegin")
14604 "
14605 and the corresponding execution of "
14606 (code "glEnd")
14607 ". ")))
14608
14609 (define-gl-procedure
14610 glDrawRangeElements
14611 "glDrawRangeElements"
14612 (funcsynopsis
14613 (funcprototype
14614 (funcdef
14615 "void "
14616 (function "glDrawRangeElements"))
14617 (paramdef "GLenum " (parameter "mode"))
14618 (paramdef "GLuint " (parameter "start"))
14619 (paramdef "GLuint " (parameter "end"))
14620 (paramdef "GLsizei " (parameter "count"))
14621 (paramdef "GLenum " (parameter "type"))
14622 (paramdef
14623 "const GLvoid * "
14624 (parameter "indices"))))
14625 '(*fragment*
14626 (heading "render primitives from array data")
14627 (heading "Parameters")
14628 (table (% (formatter (asis)))
14629 (entry (% (heading (var "mode")))
14630 (para "
14631 Specifies what kind of primitives to render.
14632 Symbolic constants "
14633 (code "GL_POINTS")
14634 ", "
14635 (code "GL_LINE_STRIP")
14636 ", "
14637 (code "GL_LINE_LOOP")
14638 ", "
14639 (code "GL_LINES")
14640 ", "
14641 (code "GL_TRIANGLE_STRIP")
14642 ", "
14643 (code "GL_TRIANGLE_FAN")
14644 ", "
14645 (code "GL_TRIANGLES")
14646 ", "
14647 (code "GL_QUAD_STRIP")
14648 ", "
14649 (code "GL_QUADS")
14650 ",
14651 and "
14652 (code "GL_POLYGON")
14653 " are accepted. "))
14654 (entry (% (heading (var "start")))
14655 (para "
14656 Specifies the minimum array index contained in "
14657 (var "indices")
14658 ". "))
14659 (entry (% (heading (var "end")))
14660 (para "
14661 Specifies the maximum array index contained in "
14662 (var "indices")
14663 ". "))
14664 (entry (% (heading (var "count")))
14665 (para "
14666 Specifies the number of elements to be rendered. "))
14667 (entry (% (heading (var "type")))
14668 (para "
14669 Specifies the type of the values in "
14670 (var "indices")
14671 ". Must be one of "
14672 (code "GL_UNSIGNED_BYTE")
14673 ", "
14674 (code "GL_UNSIGNED_SHORT")
14675 ", or "
14676 (code "GL_UNSIGNED_INT")
14677 ". "))
14678 (entry (% (heading (var "indices")))
14679 (para "
14680 Specifies a pointer to the location where the indices are stored. ")))
14681 (heading "Description")
14682 (para (code "glDrawRangeElements")
14683 " is a restricted form of "
14684 (code "glDrawElements")
14685 ". "
14686 (var "mode")
14687 ", "
14688 (var "start")
14689 ", "
14690 (var "end")
14691 ",
14692 and "
14693 (var "count")
14694 " match the corresponding arguments to "
14695 (code "glDrawElements")
14696 ", with
14697 the additional constraint that all values in the arrays "
14698 (var "count")
14699 " must lie
14700 between "
14701 (var "start")
14702 " and "
14703 (var "end")
14704 ", inclusive. ")
14705 (para "
14706 Implementations denote recommended maximum amounts of vertex and
14707 index data,
14708 which may be queried by calling "
14709 (code "glGet")
14710 " with argument "
14711 (code "GL_MAX_ELEMENTS_VERTICES")
14712 " and "
14713 (code "GL_MAX_ELEMENTS_INDICES")
14714 ".
14715 If "
14716 (math (var "end") "-" (var "start") "+" "1")
14717 "
14718 is greater than the value of "
14719 (code "GL_MAX_ELEMENTS_VERTICES")
14720 ", or if "
14721 (var "count")
14722 " is greater than the value of "
14723 (code "GL_MAX_ELEMENTS_INDICES")
14724 ", then the call may operate at reduced
14725 performance. There is no requirement that all vertices in the range "
14726 (math "[" (var "start") "," (var "end") "]")
14727 "
14728 be referenced. However, the implementation may
14729 partially process unused vertices, reducing performance from what could
14730 be achieved with an optimal index set. ")
14731 (para "
14732 When "
14733 (code "glDrawRangeElements")
14734 " is called, it uses "
14735 (var "count")
14736 " sequential elements from an
14737 enabled array, starting at "
14738 (var "start")
14739 " to construct a sequence of
14740 geometric primitives. "
14741 (var "mode")
14742 " specifies what kind of primitives are
14743 constructed, and how the array elements construct these primitives. If
14744 more than one array is enabled, each is used. If "
14745 (code "GL_VERTEX_ARRAY")
14746 " is not enabled, no geometric primitives are
14747 constructed. ")
14748 (para "
14749 Vertex attributes that are modified by "
14750 (code "glDrawRangeElements")
14751 " have an
14752 unspecified value after "
14753 (code "glDrawRangeElements")
14754 " returns. For example, if "
14755 (code "GL_COLOR_ARRAY")
14756 " is enabled, the value of the current color is
14757 undefined after "
14758 (code "glDrawRangeElements")
14759 " executes. Attributes that aren't
14760 modified maintain their previous values. ")
14761 (heading "Errors")
14762 (para "
14763 It is an error for indices to lie outside the range "
14764 (math "[" (var "start") "," (var "end") "]")
14765 ",
14766 but implementations may not check for this situation. Such indices
14767 cause implementation-dependent behavior. ")
14768 (para (code "GL_INVALID_ENUM")
14769 " is generated if "
14770 (var "mode")
14771 " is not an accepted value. ")
14772 (para (code "GL_INVALID_VALUE")
14773 " is generated if "
14774 (var "count")
14775 " is negative. ")
14776 (para (code "GL_INVALID_VALUE")
14777 " is generated if "
14778 (math (var "end") "<" (var "start"))
14779 ". ")
14780 (para (code "GL_INVALID_OPERATION")
14781 " is generated if a non-zero buffer object name is bound to an
14782 enabled array or the element array and the buffer object's data store is currently mapped. ")
14783 (para (code "GL_INVALID_OPERATION")
14784 " is generated if "
14785 (code "glDrawRangeElements")
14786 " is executed between
14787 the execution of "
14788 (code "glBegin")
14789 " and the corresponding "
14790 (code "glEnd")
14791 ". ")))
14792
14793 (define-gl-procedure
14794 glEdgeFlagPointer
14795 "glEdgeFlagPointer"
14796 (funcsynopsis
14797 (funcprototype
14798 (funcdef "void " (function "glEdgeFlagPointer"))
14799 (paramdef "GLsizei " (parameter "stride"))
14800 (paramdef
14801 "const GLvoid * "
14802 (parameter "pointer"))))
14803 '(*fragment*
14804 (heading "define an array of edge flags")
14805 (heading "Parameters")
14806 (table (% (formatter (asis)))
14807 (entry (% (heading (var "stride")))
14808 (para "
14809 Specifies the byte offset between consecutive edge flags.
14810 If "
14811 (var "stride")
14812 " is 0, the edge flags are understood
14813 to be tightly packed in the array. The initial value is 0. "))
14814 (entry (% (heading (var "pointer")))
14815 (para "
14816 Specifies a pointer to the first edge flag in the array. The initial
14817 value is 0. ")))
14818 (heading "Description")
14819 (para (code "glEdgeFlagPointer")
14820 " specifies the location and data format of an array of boolean edge
14821 flags to use when rendering. "
14822 (var "stride")
14823 " specifies the byte stride from one
14824 edge flag to the next, allowing vertices and attributes
14825 to be packed into a single array or stored in separate arrays. ")
14826 (para "
14827 If a non-zero named buffer object is bound to the "
14828 (code "GL_ARRAY_BUFFER")
14829 " target
14830 (see "
14831 (code "glBindBuffer")
14832 ") while an edge flag array is
14833 specified, "
14834 (var "pointer")
14835 " is treated as a byte offset into the buffer object's data store.
14836 Also, the buffer object binding ("
14837 (code "GL_ARRAY_BUFFER_BINDING")
14838 ") is saved as edge flag vertex array
14839 client-side state ("
14840 (code "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING")
14841 "). ")
14842 (para "
14843 When an edge flag array is
14844 specified, "
14845 (var "stride")
14846 " and "
14847 (var "pointer")
14848 " are saved as client-side
14849 state, in addition to the current vertex array buffer object binding. ")
14850 (para "
14851 To enable and disable the edge flag array, call "
14852 (code "glEnableClientState")
14853 " and "
14854 (code "glDisableClientState")
14855 " with the argument "
14856 (code "GL_EDGE_FLAG_ARRAY")
14857 ". If
14858 enabled, the edge flag array is used
14859 when "
14860 (code "glDrawArrays")
14861 ", "
14862 (code "glMultiDrawArrays")
14863 ", "
14864 (code "glDrawElements")
14865 ", "
14866 (code "glMultiDrawElements")
14867 ", "
14868 (code "glDrawRangeElements")
14869 ", or "
14870 (code "glArrayElement")
14871 " is called. ")
14872 (heading "Errors")
14873 (para (code "GL_INVALID_ENUM")
14874 " is generated if "
14875 (var "stride")
14876 " is negative. ")))
14877
14878 (define-gl-procedure
14879 glEdgeFlag
14880 "glEdgeFlag"
14881 (funcsynopsis
14882 (funcprototype
14883 (funcdef "void " (function "glEdgeFlag"))
14884 (paramdef "GLboolean " (parameter "flag"))))
14885 '(*fragment*
14886 (heading
14887 "flag edges as either boundary or nonboundary")
14888 (heading "Parameters")
14889 (table (% (formatter (asis)))
14890 (entry (% (heading (var "flag")))
14891 (para "
14892 Specifies the current edge flag value,
14893 either "
14894 (code "GL_TRUE")
14895 " or "
14896 (code "GL_FALSE")
14897 ". The initial value is "
14898 (code "GL_TRUE")
14899 ". ")))
14900 (heading "Description")
14901 (para "
14902 Each vertex of a polygon,
14903 separate triangle,
14904 or separate quadrilateral specified between a "
14905 (code "glBegin")
14906 "/"
14907 (code "glEnd")
14908 " pair
14909 is marked as the start of either a boundary or nonboundary edge.
14910 If the current edge flag is true when the vertex is specified,
14911 the vertex is marked as the start of a boundary edge.
14912 Otherwise, the vertex is marked as the start of a nonboundary edge. "
14913 (code "glEdgeFlag")
14914 " sets the edge flag bit to "
14915 (code "GL_TRUE")
14916 " if "
14917 (var "flag")
14918 " is "
14919 (code "GL_TRUE")
14920 "
14921 and to "
14922 (code "GL_FALSE")
14923 " otherwise. ")
14924 (para "
14925 The vertices of connected triangles and connected quadrilaterals are always
14926 marked as boundary,
14927 regardless of the value of the edge flag. ")
14928 (para "
14929 Boundary and nonboundary edge flags on vertices are significant only if "
14930 (code "GL_POLYGON_MODE")
14931 " is set to "
14932 (code "GL_POINT")
14933 " or "
14934 (code "GL_LINE")
14935 ".
14936 See "
14937 (code "glPolygonMode")
14938 ". ")))
14939
14940 (define-gl-procedure
14941 glEnableClientState
14942 "glEnableClientState"
14943 (funcsynopsis
14944 (funcprototype
14945 (funcdef
14946 "void "
14947 (function "glEnableClientState"))
14948 (paramdef "GLenum " (parameter "cap"))))
14949 '(*fragment*
14950 (heading
14951 "enable or disable client-side capability")
14952 (heading "Parameters")
14953 (table (% (formatter (asis)))
14954 (entry (% (heading (var "cap")))
14955 (para "
14956 Specifies the capability to enable.
14957 Symbolic constants "
14958 (code "GL_COLOR_ARRAY")
14959 ", "
14960 (code "GL_EDGE_FLAG_ARRAY")
14961 ", "
14962 (code "GL_FOG_COORD_ARRAY")
14963 ", "
14964 (code "GL_INDEX_ARRAY")
14965 ", "
14966 (code "GL_NORMAL_ARRAY")
14967 ", "
14968 (code "GL_SECONDARY_COLOR_ARRAY")
14969 ", "
14970 (code "GL_TEXTURE_COORD_ARRAY")
14971 ", and "
14972 (code "GL_VERTEX_ARRAY")
14973 "
14974 are accepted. ")))
14975 (heading "Description")
14976 (para (code "glEnableClientState")
14977 " and "
14978 (code "glDisableClientState")
14979 "
14980 enable or disable individual client-side capabilities. By default, all
14981 client-side capabilities are disabled.
14982 Both "
14983 (code "glEnableClientState")
14984 " and "
14985 (code "glDisableClientState")
14986 " take a
14987 single argument, "
14988 (var "cap")
14989 ", which can assume one of the following
14990 values: ")
14991 (table (% (formatter (asis)))
14992 (entry (% (heading (code "GL_COLOR_ARRAY")))
14993 (para "
14994 If enabled, the color array is enabled for writing and used during
14995 rendering when "
14996 (code "glArrayElement")
14997 ", "
14998 (code "glDrawArrays")
14999 ", "
15000 (code "glDrawElements")
15001 ", "
15002 (code "glDrawRangeElements")
15003 (code "glMultiDrawArrays")
15004 ", or "
15005 (code "glMultiDrawElements")
15006 " is called. See "
15007 (code "glColorPointer")
15008 ". "))
15009 (entry (% (heading (code "GL_EDGE_FLAG_ARRAY")))
15010 (para "
15011 If enabled, the edge flag array is enabled for writing and used during
15012 rendering when "
15013 (code "glArrayElement")
15014 ", "
15015 (code "glDrawArrays")
15016 ", "
15017 (code "glDrawElements")
15018 ", "
15019 (code "glDrawRangeElements")
15020 (code "glMultiDrawArrays")
15021 ", or "
15022 (code "glMultiDrawElements")
15023 " is called. See "
15024 (code "glEdgeFlagPointer")
15025 ". "))
15026 (entry (% (heading (code "GL_FOG_COORD_ARRAY")))
15027 (para "
15028 If enabled, the fog coordinate array is enabled for writing and used during
15029 rendering when "
15030 (code "glArrayElement")
15031 ", "
15032 (code "glDrawArrays")
15033 ", "
15034 (code "glDrawElements")
15035 ", "
15036 (code "glDrawRangeElements")
15037 (code "glMultiDrawArrays")
15038 ", or "
15039 (code "glMultiDrawElements")
15040 " is called. See "
15041 (code "glFogCoordPointer")
15042 ". "))
15043 (entry (% (heading (code "GL_INDEX_ARRAY")))
15044 (para "
15045 If enabled, the index array is enabled for writing and used during
15046 rendering when "
15047 (code "glArrayElement")
15048 ", "
15049 (code "glDrawArrays")
15050 ", "
15051 (code "glDrawElements")
15052 ", "
15053 (code "glDrawRangeElements")
15054 (code "glMultiDrawArrays")
15055 ", or "
15056 (code "glMultiDrawElements")
15057 " is called. See "
15058 (code "glIndexPointer")
15059 ". "))
15060 (entry (% (heading (code "GL_NORMAL_ARRAY")))
15061 (para "
15062 If enabled, the normal array is enabled for writing and used during
15063 rendering when "
15064 (code "glArrayElement")
15065 ", "
15066 (code "glDrawArrays")
15067 ", "
15068 (code "glDrawElements")
15069 ", "
15070 (code "glDrawRangeElements")
15071 (code "glMultiDrawArrays")
15072 ", or "
15073 (code "glMultiDrawElements")
15074 " is called. See "
15075 (code "glNormalPointer")
15076 ". "))
15077 (entry (% (heading (code "GL_SECONDARY_COLOR_ARRAY")))
15078 (para "
15079 If enabled, the secondary color array is enabled for writing and used
15080 during rendering when "
15081 (code "glArrayElement")
15082 ", "
15083 (code "glDrawArrays")
15084 ", "
15085 (code "glDrawElements")
15086 ", "
15087 (code "glDrawRangeElements")
15088 (code "glMultiDrawArrays")
15089 ", or "
15090 (code "glMultiDrawElements")
15091 " is called. See "
15092 (code "glColorPointer")
15093 ". "))
15094 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY")))
15095 (para "
15096 If enabled, the texture coordinate array is enabled for writing and used
15097 during rendering when "
15098 (code "glArrayElement")
15099 ", "
15100 (code "glDrawArrays")
15101 ", "
15102 (code "glDrawElements")
15103 ", "
15104 (code "glDrawRangeElements")
15105 (code "glMultiDrawArrays")
15106 ", or "
15107 (code "glMultiDrawElements")
15108 " is called. See "
15109 (code "glTexCoordPointer")
15110 ". "))
15111 (entry (% (heading (code "GL_VERTEX_ARRAY")))
15112 (para "
15113 If enabled, the vertex array is enabled for writing and used during
15114 rendering when "
15115 (code "glArrayElement")
15116 ", "
15117 (code "glDrawArrays")
15118 ", "
15119 (code "glDrawElements")
15120 ", "
15121 (code "glDrawRangeElements")
15122 (code "glMultiDrawArrays")
15123 ", or "
15124 (code "glMultiDrawElements")
15125 " is called. See "
15126 (code "glVertexPointer")
15127 ". ")))
15128 (heading "Errors")
15129 (para (code "GL_INVALID_ENUM")
15130 " is generated if "
15131 (var "cap")
15132 " is not an accepted value. ")
15133 (para (code "glEnableClientState")
15134 " is not allowed between the execution of "
15135 (code "glBegin")
15136 " and the
15137 corresponding "
15138 (code "glEnd")
15139 ", but an error may or may not be generated. If
15140 no error is generated, the behavior is undefined. ")))
15141
15142 (define-gl-procedure
15143 glEnableVertexAttribArray
15144 "glEnableVertexAttribArray"
15145 (funcsynopsis
15146 (funcprototype
15147 (funcdef
15148 "void "
15149 (function "glEnableVertexAttribArray"))
15150 (paramdef "GLuint " (parameter "index")))
15151 (funcprototype
15152 (funcdef
15153 "void "
15154 (function "glDisableVertexAttribArray"))
15155 (paramdef "GLuint " (parameter "index"))))
15156 '(*fragment*
15157 (heading
15158 "Enable or disable a generic vertex attribute array")
15159 (heading "Parameters")
15160 (table (% (formatter (asis)))
15161 (entry (% (heading (var "index")))
15162 (para "Specifies the index of the generic vertex
15163 \t\t attribute to be enabled or disabled.")))
15164 (heading "Description")
15165 (para (code "glEnableVertexAttribArray")
15166 " enables the
15167 \tgeneric vertex attribute array specified by\t"
15168 (var "index")
15169 ".\t"
15170 (code "glDisableVertexAttribArray")
15171 " disables the
15172 \tgeneric vertex attribute array specified by\t"
15173 (var "index")
15174 ". By default, all client-side
15175 \tcapabilities are disabled, including all generic vertex
15176 \tattribute arrays. If enabled, the values in the generic vertex
15177 \tattribute array will be accessed and used for rendering when
15178 \tcalls are made to vertex array commands such as\t"
15179 (code "glDrawArrays")
15180 ",\t"
15181 (code "glDrawElements")
15182 ",\t"
15183 (code "glDrawRangeElements")
15184 ",\t"
15185 (code "glArrayElement")
15186 ",\t"
15187 (code "glMultiDrawElements")
15188 ",
15189 \tor\t"
15190 (code "glMultiDrawArrays")
15191 ".")
15192 (heading "Errors")
15193 (para (code "GL_INVALID_VALUE")
15194 " is generated if\t"
15195 (var "index")
15196 " is greater than or equal to\t"
15197 (code "GL_MAX_VERTEX_ATTRIBS")
15198 ".")
15199 (para (code "GL_INVALID_OPERATION")
15200 " is generated if either\t"
15201 (code "glEnableVertexAttribArray ")
15202 " or\t"
15203 (code "glDisableVertexAttribArray ")
15204 " is executed
15205 \tbetween the execution of\t"
15206 (code "glBegin")
15207 "
15208 and the corresponding execution of\t"
15209 (code "glEnd")
15210 ".")))
15211
15212 (define-gl-procedure
15213 glEnable
15214 "glEnable"
15215 (funcsynopsis
15216 (funcprototype
15217 (funcdef "void " (function "glEnable"))
15218 (paramdef "GLenum " (parameter "cap"))))
15219 '(*fragment*
15220 (heading
15221 "enable or disable server-side GL capabilities")
15222 (heading "Parameters")
15223 (table (% (formatter (asis)))
15224 (entry (% (heading (var "cap")))
15225 (para "
15226 Specifies a symbolic constant indicating a GL capability. ")))
15227 (heading "Description")
15228 (para (code "glEnable")
15229 " and "
15230 (code "glDisable")
15231 " enable and disable various capabilities.
15232 Use "
15233 (code "glIsEnabled")
15234 " or "
15235 (code "glGet")
15236 " to determine the current setting
15237 of any capability. The initial value for each capability with the
15238 exception of "
15239 (code "GL_DITHER")
15240 " and "
15241 (code "GL_MULTISAMPLE")
15242 " is "
15243 (code "GL_FALSE")
15244 ". The initial value for "
15245 (code "GL_DITHER")
15246 " and "
15247 (code "GL_MULTISAMPLE")
15248 " is "
15249 (code "GL_TRUE")
15250 ". ")
15251 (para "
15252 Both "
15253 (code "glEnable")
15254 " and "
15255 (code "glDisable")
15256 " take a single argument, "
15257 (var "cap")
15258 ",
15259 which can assume one of the following values: ")
15260 (table (% (formatter (asis)))
15261 (entry (% (heading (code "GL_ALPHA_TEST")))
15262 (para)
15263 (para "
15264 If enabled,
15265 do alpha testing. See "
15266 (code "glAlphaFunc")
15267 ". "))
15268 (entry (% (heading (code "GL_AUTO_NORMAL")))
15269 (para)
15270 (para "
15271 If enabled,
15272 generate normal vectors when either "
15273 (code "GL_MAP2_VERTEX_3")
15274 " or "
15275 (code "GL_MAP2_VERTEX_4")
15276 " is used to generate vertices.
15277 See "
15278 (code "glMap2")
15279 ". "))
15280 (entry (% (heading (code "GL_BLEND")))
15281 (para)
15282 (para "
15283 If enabled,
15284 blend the computed fragment color values with the values in the color
15285 buffers. See "
15286 (code "glBlendFunc")
15287 ". "))
15288 (entry (% (heading (code "GL_CLIP_PLANE") (var "i")))
15289 (para)
15290 (para "
15291 If enabled,
15292 clip geometry against user-defined clipping plane "
15293 (var "i")
15294 ".
15295 See "
15296 (code "glClipPlane")
15297 ". "))
15298 (entry (% (heading (code "GL_COLOR_LOGIC_OP")))
15299 (para)
15300 (para "
15301 If enabled,
15302 apply the currently selected logical operation to the computed fragment
15303 color and color buffer values. See "
15304 (code "glLogicOp")
15305 ". "))
15306 (entry (% (heading (code "GL_COLOR_MATERIAL")))
15307 (para)
15308 (para "
15309 If enabled,
15310 have one or more material parameters track the current color.
15311 See "
15312 (code "glColorMaterial")
15313 ". "))
15314 (entry (% (heading (code "GL_COLOR_SUM")))
15315 (para)
15316 (para "
15317 If enabled and no fragment shader is active,
15318 add the secondary color value to the computed fragment color.
15319 See "
15320 (code "glSecondaryColor")
15321 ". "))
15322 (entry (% (heading (code "GL_COLOR_TABLE")))
15323 (para)
15324 (para "
15325 If enabled,
15326 perform a color table lookup on the incoming RGBA color values.
15327 See "
15328 (code "glColorTable")
15329 ". "))
15330 (entry (% (heading (code "GL_CONVOLUTION_1D")))
15331 (para)
15332 (para "
15333 If enabled,
15334 perform a 1D convolution operation on incoming RGBA color values.
15335 See "
15336 (code "glConvolutionFilter1D")
15337 ". "))
15338 (entry (% (heading (code "GL_CONVOLUTION_2D")))
15339 (para)
15340 (para "
15341 If enabled,
15342 perform a 2D convolution operation on incoming RGBA color values.
15343 See "
15344 (code "glConvolutionFilter2D")
15345 ". "))
15346 (entry (% (heading (code "GL_CULL_FACE")))
15347 (para)
15348 (para "
15349 If enabled,
15350 cull polygons based on their winding in window coordinates.
15351 See "
15352 (code "glCullFace")
15353 ". "))
15354 (entry (% (heading (code "GL_DEPTH_TEST")))
15355 (para)
15356 (para "
15357 If enabled,
15358 do depth comparisons and update the depth buffer. Note that even if
15359 the depth buffer exists and the depth mask is non-zero, the
15360 depth buffer is not updated if the depth test is disabled. See "
15361 (code "glDepthFunc")
15362 " and "
15363 (code "glDepthRange")
15364 ". "))
15365 (entry (% (heading (code "GL_DITHER")))
15366 (para)
15367 (para "
15368 If enabled,
15369 dither color components or indices before they are written to the
15370 color buffer. "))
15371 (entry (% (heading (code "GL_FOG")))
15372 (para)
15373 (para "
15374 If enabled and no fragment shader is active,
15375 blend a fog color into the post-texturing color.
15376 See "
15377 (code "glFog")
15378 ". "))
15379 (entry (% (heading (code "GL_HISTOGRAM")))
15380 (para)
15381 (para "
15382 If enabled,
15383 histogram incoming RGBA color values.
15384 See "
15385 (code "glHistogram")
15386 ". "))
15387 (entry (% (heading (code "GL_INDEX_LOGIC_OP")))
15388 (para)
15389 (para "
15390 If enabled,
15391 apply the currently selected logical operation to the incoming index and color
15392 buffer indices.
15393 See "
15394 (code "glLogicOp")
15395 ". "))
15396 (entry (% (heading (code "GL_LIGHT") (var "i")))
15397 (para)
15398 (para "
15399 If enabled,
15400 include light "
15401 (var "i")
15402 " in the evaluation of the lighting
15403 equation. See "
15404 (code "glLightModel")
15405 " and "
15406 (code "glLight")
15407 ". "))
15408 (entry (% (heading (code "GL_LIGHTING")))
15409 (para)
15410 (para "
15411 If enabled and no vertex shader is active,
15412 use the current lighting parameters to compute the vertex color or index.
15413 Otherwise, simply associate the current color or index with each
15414 vertex. See "
15415 (code "glMaterial")
15416 ", "
15417 (code "glLightModel")
15418 ", and "
15419 (code "glLight")
15420 ". "))
15421 (entry (% (heading (code "GL_LINE_SMOOTH")))
15422 (para)
15423 (para "
15424 If enabled,
15425 draw lines with correct filtering.
15426 Otherwise,
15427 draw aliased lines.
15428 See "
15429 (code "glLineWidth")
15430 ". "))
15431 (entry (% (heading (code "GL_LINE_STIPPLE")))
15432 (para)
15433 (para "
15434 If enabled,
15435 use the current line stipple pattern when drawing lines. See "
15436 (code "glLineStipple")
15437 ". "))
15438 (entry (% (heading (code "GL_MAP1_COLOR_4")))
15439 (para)
15440 (para "
15441 If enabled,
15442 calls to "
15443 (code "glEvalCoord1")
15444 ", "
15445 (code "glEvalMesh1")
15446 ", and "
15447 (code "glEvalPoint1")
15448 " generate RGBA values.
15449 See "
15450 (code "glMap1")
15451 ". "))
15452 (entry (% (heading (code "GL_MAP1_INDEX")))
15453 (para)
15454 (para "
15455 If enabled,
15456 calls to "
15457 (code "glEvalCoord1")
15458 ", "
15459 (code "glEvalMesh1")
15460 ", and "
15461 (code "glEvalPoint1")
15462 " generate color indices.
15463 See "
15464 (code "glMap1")
15465 ". "))
15466 (entry (% (heading (code "GL_MAP1_NORMAL")))
15467 (para)
15468 (para "
15469 If enabled,
15470 calls to "
15471 (code "glEvalCoord1")
15472 ", "
15473 (code "glEvalMesh1")
15474 ", and "
15475 (code "glEvalPoint1")
15476 " generate normals.
15477 See "
15478 (code "glMap1")
15479 ". "))
15480 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_1")))
15481 (para)
15482 (para "
15483 If enabled,
15484 calls to "
15485 (code "glEvalCoord1")
15486 ", "
15487 (code "glEvalMesh1")
15488 ", and "
15489 (code "glEvalPoint1")
15490 " generate "
15491 (var "s")
15492 "
15493 texture coordinates.
15494 See "
15495 (code "glMap1")
15496 ". "))
15497 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_2")))
15498 (para)
15499 (para "
15500 If enabled,
15501 calls to "
15502 (code "glEvalCoord1")
15503 ", "
15504 (code "glEvalMesh1")
15505 ", and "
15506 (code "glEvalPoint1")
15507 " generate "
15508 (var "s")
15509 " and "
15510 (var "t")
15511 " texture coordinates.
15512 See "
15513 (code "glMap1")
15514 ". "))
15515 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_3")))
15516 (para)
15517 (para "
15518 If enabled,
15519 calls to "
15520 (code "glEvalCoord1")
15521 ", "
15522 (code "glEvalMesh1")
15523 ", and "
15524 (code "glEvalPoint1")
15525 " generate "
15526 (var "s")
15527 ", "
15528 (var "t")
15529 ", and "
15530 (var "r")
15531 " texture coordinates.
15532 See "
15533 (code "glMap1")
15534 ". "))
15535 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_4")))
15536 (para)
15537 (para "
15538 If enabled,
15539 calls to "
15540 (code "glEvalCoord1")
15541 ", "
15542 (code "glEvalMesh1")
15543 ", and "
15544 (code "glEvalPoint1")
15545 " generate "
15546 (var "s")
15547 ", "
15548 (var "t")
15549 ", "
15550 (var "r")
15551 ", and "
15552 (var "q")
15553 " texture coordinates.
15554 See "
15555 (code "glMap1")
15556 ". "))
15557 (entry (% (heading (code "GL_MAP1_VERTEX_3")))
15558 (para)
15559 (para "
15560 If enabled,
15561 calls to "
15562 (code "glEvalCoord1")
15563 ", "
15564 (code "glEvalMesh1")
15565 ", and "
15566 (code "glEvalPoint1")
15567 " generate "
15568 (var "x")
15569 ", "
15570 (var "y")
15571 ", and "
15572 (var "z")
15573 " vertex coordinates.
15574 See "
15575 (code "glMap1")
15576 ". "))
15577 (entry (% (heading (code "GL_MAP1_VERTEX_4")))
15578 (para)
15579 (para "
15580 If enabled,
15581 calls to "
15582 (code "glEvalCoord1")
15583 ", "
15584 (code "glEvalMesh1")
15585 ", and "
15586 (code "glEvalPoint1")
15587 " generate
15588 homogeneous "
15589 (var "x")
15590 ", "
15591 (var "y")
15592 ", "
15593 (var "z")
15594 ", and "
15595 (var "w")
15596 " vertex coordinates.
15597 See "
15598 (code "glMap1")
15599 ". "))
15600 (entry (% (heading (code "GL_MAP2_COLOR_4")))
15601 (para)
15602 (para "
15603 If enabled,
15604 calls to "
15605 (code "glEvalCoord2")
15606 ", "
15607 (code "glEvalMesh2")
15608 ", and "
15609 (code "glEvalPoint2")
15610 " generate RGBA values.
15611 See "
15612 (code "glMap2")
15613 ". "))
15614 (entry (% (heading (code "GL_MAP2_INDEX")))
15615 (para)
15616 (para "
15617 If enabled,
15618 calls to "
15619 (code "glEvalCoord2")
15620 ", "
15621 (code "glEvalMesh2")
15622 ", and "
15623 (code "glEvalPoint2")
15624 " generate color indices.
15625 See "
15626 (code "glMap2")
15627 ". "))
15628 (entry (% (heading (code "GL_MAP2_NORMAL")))
15629 (para)
15630 (para "
15631 If enabled,
15632 calls to "
15633 (code "glEvalCoord2")
15634 ", "
15635 (code "glEvalMesh2")
15636 ", and "
15637 (code "glEvalPoint2")
15638 " generate normals.
15639 See "
15640 (code "glMap2")
15641 ". "))
15642 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_1")))
15643 (para)
15644 (para "
15645 If enabled,
15646 calls to "
15647 (code "glEvalCoord2")
15648 ", "
15649 (code "glEvalMesh2")
15650 ", and "
15651 (code "glEvalPoint2")
15652 " generate "
15653 (var "s")
15654 "
15655 texture coordinates.
15656 See "
15657 (code "glMap2")
15658 ". "))
15659 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_2")))
15660 (para)
15661 (para "
15662 If enabled,
15663 calls to "
15664 (code "glEvalCoord2")
15665 ", "
15666 (code "glEvalMesh2")
15667 ", and "
15668 (code "glEvalPoint2")
15669 " generate "
15670 (var "s")
15671 " and "
15672 (var "t")
15673 " texture coordinates.
15674 See "
15675 (code "glMap2")
15676 ". "))
15677 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_3")))
15678 (para)
15679 (para "
15680 If enabled,
15681 calls to "
15682 (code "glEvalCoord2")
15683 ", "
15684 (code "glEvalMesh2")
15685 ", and "
15686 (code "glEvalPoint2")
15687 " generate "
15688 (var "s")
15689 ", "
15690 (var "t")
15691 ", and "
15692 (var "r")
15693 " texture coordinates.
15694 See "
15695 (code "glMap2")
15696 ". "))
15697 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_4")))
15698 (para)
15699 (para "
15700 If enabled,
15701 calls to "
15702 (code "glEvalCoord2")
15703 ", "
15704 (code "glEvalMesh2")
15705 ", and "
15706 (code "glEvalPoint2")
15707 " generate "
15708 (var "s")
15709 ", "
15710 (var "t")
15711 ", "
15712 (var "r")
15713 ", and "
15714 (var "q")
15715 " texture coordinates.
15716 See "
15717 (code "glMap2")
15718 ". "))
15719 (entry (% (heading (code "GL_MAP2_VERTEX_3")))
15720 (para)
15721 (para "
15722 If enabled,
15723 calls to "
15724 (code "glEvalCoord2")
15725 ", "
15726 (code "glEvalMesh2")
15727 ", and "
15728 (code "glEvalPoint2")
15729 " generate "
15730 (var "x")
15731 ", "
15732 (var "y")
15733 ", and "
15734 (var "z")
15735 " vertex coordinates.
15736 See "
15737 (code "glMap2")
15738 ". "))
15739 (entry (% (heading (code "GL_MAP2_VERTEX_4")))
15740 (para)
15741 (para "
15742 If enabled,
15743 calls to "
15744 (code "glEvalCoord2")
15745 ", "
15746 (code "glEvalMesh2")
15747 ", and "
15748 (code "glEvalPoint2")
15749 " generate
15750 homogeneous "
15751 (var "x")
15752 ", "
15753 (var "y")
15754 ", "
15755 (var "z")
15756 ", and "
15757 (var "w")
15758 " vertex coordinates.
15759 See "
15760 (code "glMap2")
15761 ". "))
15762 (entry (% (heading (code "GL_MINMAX")))
15763 (para)
15764 (para "
15765 If enabled,
15766 compute the minimum and maximum values of incoming RGBA color values.
15767 See "
15768 (code "glMinmax")
15769 ". "))
15770 (entry (% (heading (code "GL_MULTISAMPLE")))
15771 (para)
15772 (para "
15773 If enabled,
15774 use multiple fragment samples in computing the final color of a pixel.
15775 See "
15776 (code "glSampleCoverage")
15777 ". "))
15778 (entry (% (heading (code "GL_NORMALIZE")))
15779 (para)
15780 (para "
15781 If enabled and no vertex shader is active,
15782 normal vectors are normalized to unit length
15783 after transformation and before lighting. This method is generally
15784 less efficient than "
15785 (code "GL_RESCALE_NORMAL")
15786 ". See "
15787 (code "glNormal")
15788 " and "
15789 (code "glNormalPointer")
15790 ". "))
15791 (entry (% (heading (code "GL_POINT_SMOOTH")))
15792 (para)
15793 (para "
15794 If enabled,
15795 draw points with proper filtering.
15796 Otherwise,
15797 draw aliased points.
15798 See "
15799 (code "glPointSize")
15800 ". "))
15801 (entry (% (heading (code "GL_POINT_SPRITE")))
15802 (para)
15803 (para "
15804 If enabled,
15805 calculate texture coordinates for points based on texture
15806 environment and point parameter settings. Otherwise texture coordinates
15807 are constant across points. "))
15808 (entry (% (heading (code "GL_POLYGON_OFFSET_FILL")))
15809 (para)
15810 (para "
15811 If enabled, and if the polygon is rendered in "
15812 (code "GL_FILL")
15813 " mode, an offset is added to depth values of a polygon's
15814 fragments before the depth comparison is performed.
15815 See "
15816 (code "glPolygonOffset")
15817 ". "))
15818 (entry (% (heading (code "GL_POLYGON_OFFSET_LINE")))
15819 (para)
15820 (para "
15821 If enabled, and if the polygon is rendered in "
15822 (code "GL_LINE")
15823 " mode, an offset is added to depth values of a polygon's
15824 fragments before the depth comparison is performed.
15825 See "
15826 (code "glPolygonOffset")
15827 ". "))
15828 (entry (% (heading (code "GL_POLYGON_OFFSET_POINT")))
15829 (para)
15830 (para "
15831 If enabled, an offset is added to depth values of a polygon's fragments
15832 before the depth comparison is performed, if the polygon is rendered in "
15833 (code "GL_POINT")
15834 " mode. See "
15835 (code "glPolygonOffset")
15836 ". "))
15837 (entry (% (heading (code "GL_POLYGON_SMOOTH")))
15838 (para)
15839 (para "
15840 If enabled, draw polygons with proper filtering.
15841 Otherwise, draw aliased polygons. For correct antialiased polygons,
15842 an alpha buffer is needed and the polygons must be sorted front to
15843 back. "))
15844 (entry (% (heading (code "GL_POLYGON_STIPPLE")))
15845 (para)
15846 (para "
15847 If enabled,
15848 use the current polygon stipple pattern when rendering
15849 polygons. See "
15850 (code "glPolygonStipple")
15851 ". "))
15852 (entry (% (heading
15853 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")))
15854 (para)
15855 (para "
15856 If enabled,
15857 perform a color table lookup on RGBA color values after color matrix
15858 transformation.
15859 See "
15860 (code "glColorTable")
15861 ". "))
15862 (entry (% (heading
15863 (code "GL_POST_CONVOLUTION_COLOR_TABLE")))
15864 (para)
15865 (para "
15866 If enabled,
15867 perform a color table lookup on RGBA color values after convolution.
15868 See "
15869 (code "glColorTable")
15870 ". "))
15871 (entry (% (heading (code "GL_RESCALE_NORMAL")))
15872 (para)
15873 (para "
15874 If enabled and no vertex shader is active,
15875 normal vectors are scaled after transformation and before
15876 lighting by a factor computed from the modelview matrix. If the
15877 modelview matrix scales space uniformly, this has the effect of
15878 restoring the transformed normal to unit length. This method is generally
15879 more efficient than "
15880 (code "GL_NORMALIZE")
15881 ". See "
15882 (code "glNormal")
15883 " and "
15884 (code "glNormalPointer")
15885 ". "))
15886 (entry (% (heading (code "GL_SAMPLE_ALPHA_TO_COVERAGE")))
15887 (para)
15888 (para "
15889 If enabled,
15890 compute a temporary coverage value where each bit is determined by the
15891 alpha value at the corresponding sample location. The temporary coverage
15892 value is then ANDed with the fragment coverage value. "))
15893 (entry (% (heading (code "GL_SAMPLE_ALPHA_TO_ONE")))
15894 (para)
15895 (para "
15896 If enabled,
15897 each sample alpha value is replaced by the maximum representable alpha value. "))
15898 (entry (% (heading (code "GL_SAMPLE_COVERAGE")))
15899 (para)
15900 (para "
15901 If enabled,
15902 the fragment's coverage is ANDed with the temporary coverage value. If "
15903 (code "GL_SAMPLE_COVERAGE_INVERT")
15904 " is set to "
15905 (code "GL_TRUE")
15906 ", invert the coverage
15907 value.
15908 See "
15909 (code "glSampleCoverage")
15910 ". "))
15911 (entry (% (heading (code "GL_SEPARABLE_2D")))
15912 (para)
15913 (para "
15914 If enabled, perform a two-dimensional convolution operation using a separable
15915 convolution filter on incoming RGBA color values.
15916 See "
15917 (code "glSeparableFilter2D")
15918 ". "))
15919 (entry (% (heading (code "GL_SCISSOR_TEST")))
15920 (para)
15921 (para "
15922 If enabled,
15923 discard fragments that are outside the scissor rectangle.
15924 See "
15925 (code "glScissor")
15926 ". "))
15927 (entry (% (heading (code "GL_STENCIL_TEST")))
15928 (para)
15929 (para "
15930 If enabled,
15931 do stencil testing and update the stencil buffer.
15932 See "
15933 (code "glStencilFunc")
15934 " and "
15935 (code "glStencilOp")
15936 ". "))
15937 (entry (% (heading (code "GL_TEXTURE_1D")))
15938 (para)
15939 (para "
15940 If enabled and no fragment shader is active,
15941 one-dimensional texturing is performed
15942 (unless two- or three-dimensional or cube-mapped texturing is also enabled).
15943 See "
15944 (code "glTexImage1D")
15945 ". "))
15946 (entry (% (heading (code "GL_TEXTURE_2D")))
15947 (para)
15948 (para "
15949 If enabled and no fragment shader is active,
15950 two-dimensional texturing is performed
15951 (unless three-dimensional or cube-mapped texturing is also enabled).
15952 See "
15953 (code "glTexImage2D")
15954 ". "))
15955 (entry (% (heading (code "GL_TEXTURE_3D")))
15956 (para)
15957 (para "
15958 If enabled and no fragment shader is active,
15959 three-dimensional texturing is performed
15960 (unless cube-mapped texturing is also enabled).
15961 See "
15962 (code "glTexImage3D")
15963 ". "))
15964 (entry (% (heading (code "GL_TEXTURE_CUBE_MAP")))
15965 (para)
15966 (para "
15967 If enabled and no fragment shader is active,
15968 cube-mapped texturing is performed.
15969 See "
15970 (code "glTexImage2D")
15971 ". "))
15972 (entry (% (heading (code "GL_TEXTURE_GEN_Q")))
15973 (para)
15974 (para "
15975 If enabled and no vertex shader is active,
15976 the "
15977 (var "q")
15978 " texture coordinate is computed using
15979 the texture generation function defined with "
15980 (code "glTexGen")
15981 ".
15982 Otherwise, the current "
15983 (var "q")
15984 " texture coordinate is used.
15985 See "
15986 (code "glTexGen")
15987 ". "))
15988 (entry (% (heading (code "GL_TEXTURE_GEN_R")))
15989 (para)
15990 (para "
15991 If enabled and no vertex shader is active,
15992 the "
15993 (var "r")
15994 " texture coordinate is computed using
15995 the texture generation function defined with "
15996 (code "glTexGen")
15997 ".
15998 Otherwise, the current "
15999 (var "r")
16000 " texture coordinate is used.
16001 See "
16002 (code "glTexGen")
16003 ". "))
16004 (entry (% (heading (code "GL_TEXTURE_GEN_S")))
16005 (para)
16006 (para "
16007 If enabled and no vertex shader is active,
16008 the "
16009 (var "s")
16010 " texture coordinate is computed using
16011 the texture generation function defined with "
16012 (code "glTexGen")
16013 ".
16014 Otherwise, the current "
16015 (var "s")
16016 " texture coordinate is used.
16017 See "
16018 (code "glTexGen")
16019 ". "))
16020 (entry (% (heading (code "GL_TEXTURE_GEN_T")))
16021 (para)
16022 (para "
16023 If enabled and no vertex shader is active,
16024 the "
16025 (var "t")
16026 " texture coordinate is computed using
16027 the texture generation function defined with "
16028 (code "glTexGen")
16029 ".
16030 Otherwise, the current "
16031 (var "t")
16032 " texture coordinate is used.
16033 See "
16034 (code "glTexGen")
16035 ". "))
16036 (entry (% (heading (code "GL_VERTEX_PROGRAM_POINT_SIZE")))
16037 (para)
16038 (para "
16039 If enabled
16040 and a vertex shader is active, then the derived point size is taken from the (potentially clipped) shader builtin "
16041 (code "gl_PointSize")
16042 " and clamped to the implementation-dependent point size range. "))
16043 (entry (% (heading (code "GL_VERTEX_PROGRAM_TWO_SIDE")))
16044 (para)
16045 (para "
16046 If enabled
16047 and a vertex shader is active, it specifies that the GL will choose between front and back colors based on the
16048 polygon's face direction of which the vertex being shaded is a part. It has no effect on points or lines. ")))
16049 (heading "Errors")
16050 (para (code "GL_INVALID_ENUM")
16051 " is generated if "
16052 (var "cap")
16053 " is not one of the values
16054 listed previously. ")
16055 (para (code "GL_INVALID_OPERATION")
16056 " is generated if "
16057 (code "glEnable")
16058 " or "
16059 (code "glDisable")
16060 "
16061 is executed between the execution of "
16062 (code "glBegin")
16063 "
16064 and the corresponding execution of "
16065 (code "glEnd")
16066 ". ")))
16067
16068 (define-gl-procedure
16069 glEvalCoord
16070 "glEvalCoord"
16071 (funcsynopsis
16072 (funcprototype
16073 (funcdef "void " (function "glEvalCoord1f"))
16074 (paramdef "GLfloat " (parameter "u"))))
16075 '(*fragment*
16076 (heading
16077 "evaluate enabled one- and two-dimensional maps")
16078 (heading "Parameters")
16079 (table (% (formatter (asis)))
16080 (entry (% (heading (var "u")))
16081 (para "
16082 Specifies a value that is the domain coordinate "
16083 (math (var "u"))
16084 "
16085 to the basis function
16086 defined in a previous "
16087 (code "glMap1")
16088 " or "
16089 (code "glMap2")
16090 " command. "))
16091 (entry (% (heading (var "v")))
16092 (para "
16093 Specifies a value that is the domain coordinate "
16094 (math (var "v"))
16095 "
16096 to the basis function
16097 defined in a previous "
16098 (code "glMap2")
16099 " command.
16100 This argument is not present in a "
16101 (code "glEvalCoord1")
16102 " command. ")))
16103 (heading "Description")
16104 (para (code "glEvalCoord1")
16105 " evaluates enabled one-dimensional maps at argument "
16106 (var "u")
16107 ". "
16108 (code "glEvalCoord2")
16109 " does the same for two-dimensional maps using
16110 two domain values, "
16111 (var "u")
16112 " and "
16113 (var "v")
16114 ".
16115 To define a map, call "
16116 (code "glMap1")
16117 " and "
16118 (code "glMap2")
16119 "; to enable and
16120 disable it, call "
16121 (code "glEnable")
16122 " and "
16123 (code "glDisable")
16124 ". ")
16125 (para "
16126 When one of the "
16127 (code "glEvalCoord")
16128 " commands is issued,
16129 all currently enabled maps of the indicated dimension are evaluated.
16130 Then,
16131 for each enabled map,
16132 it is as if the corresponding GL command had been issued with the
16133 computed value.
16134 That is,
16135 if "
16136 (code "GL_MAP1_INDEX")
16137 " or "
16138 (code "GL_MAP2_INDEX")
16139 " is enabled,
16140 a "
16141 (code "glIndex")
16142 " command is simulated.
16143 If "
16144 (code "GL_MAP1_COLOR_4")
16145 " or "
16146 (code "GL_MAP2_COLOR_4")
16147 " is enabled,
16148 a "
16149 (code "glColor")
16150 " command is simulated.
16151 If "
16152 (code "GL_MAP1_NORMAL")
16153 " or "
16154 (code "GL_MAP2_NORMAL")
16155 " is enabled,
16156 a normal vector is produced,
16157 and if any of "
16158 (code "GL_MAP1_TEXTURE_COORD_1")
16159 ", "
16160 (code "GL_MAP1_TEXTURE_COORD_2")
16161 ", "
16162 (code "GL_MAP1_TEXTURE_COORD_3")
16163 ", "
16164 (code "GL_MAP1_TEXTURE_COORD_4")
16165 ", "
16166 (code "GL_MAP2_TEXTURE_COORD_1")
16167 ", "
16168 (code "GL_MAP2_TEXTURE_COORD_2")
16169 ", "
16170 (code "GL_MAP2_TEXTURE_COORD_3")
16171 ", or "
16172 (code "GL_MAP2_TEXTURE_COORD_4")
16173 " is enabled, then an appropriate "
16174 (code "glTexCoord")
16175 " command is simulated. ")
16176 (para "
16177 For color,
16178 color index,
16179 normal,
16180 and texture coordinates the GL uses evaluated values instead of current values for those evaluations
16181 that are enabled,
16182 and current values otherwise,
16183 However,
16184 the evaluated values do not update the current values.
16185 Thus, if "
16186 (code "glVertex")
16187 " commands are interspersed with "
16188 (code "glEvalCoord")
16189 "
16190 commands, the color,
16191 normal,
16192 and texture coordinates associated with the "
16193 (code "glVertex")
16194 " commands are not
16195 affected by the values generated by the "
16196 (code "glEvalCoord")
16197 " commands,
16198 but only by the most recent "
16199 (code "glColor")
16200 ", "
16201 (code "glIndex")
16202 ", "
16203 (code "glNormal")
16204 ", and "
16205 (code "glTexCoord")
16206 " commands. ")
16207 (para "
16208 No commands are issued for maps that are not enabled.
16209 If more than one texture evaluation is enabled for a particular dimension
16210 (for example, "
16211 (code "GL_MAP2_TEXTURE_COORD_1")
16212 " and "
16213 (code "GL_MAP2_TEXTURE_COORD_2")
16214 "),
16215 then only the evaluation of the map that produces the larger
16216 number of coordinates
16217 (in this case, "
16218 (code "GL_MAP2_TEXTURE_COORD_2")
16219 ")
16220 is carried out. "
16221 (code "GL_MAP1_VERTEX_4")
16222 " overrides "
16223 (code "GL_MAP1_VERTEX_3")
16224 ",
16225 and "
16226 (code "GL_MAP2_VERTEX_4")
16227 " overrides "
16228 (code "GL_MAP2_VERTEX_3")
16229 ",
16230 in the same manner.
16231 If neither a three- nor a four-component vertex map is enabled for the
16232 specified dimension,
16233 the "
16234 (code "glEvalCoord")
16235 " command is ignored. ")
16236 (para "
16237 If you have enabled automatic normal generation,
16238 by calling "
16239 (code "glEnable")
16240 " with argument "
16241 (code "GL_AUTO_NORMAL")
16242 ", "
16243 (code "glEvalCoord2")
16244 " generates surface normals analytically,
16245 regardless of the contents or enabling of the "
16246 (code "GL_MAP2_NORMAL")
16247 " map.
16248 Let ")
16249 (para (math (code "m")
16250 "="
16251 "∂"
16252 (code "p")
16253 ","
16254 "/"
16255 "∂"
16256 (var "u")
16257 ","
16258 ","
16259 "×"
16260 "∂"
16261 (code "p")
16262 ","
16263 "/"
16264 "∂"
16265 (var "v")
16266 ","
16267 ","))
16268 (para "
16269 Then the generated normal "
16270 (math (code "n"))
16271 "
16272 is "
16273 (math (code "n")
16274 "="
16275 (code "m")
16276 "/"
16277 "∥"
16278 (code "m")
16279 ","
16280 "∥"
16281 ","))
16282 (para "
16283 If automatic normal generation is disabled,
16284 the corresponding normal map "
16285 (code "GL_MAP2_NORMAL")
16286 ",
16287 if enabled,
16288 is used to produce a normal.
16289 If neither automatic normal generation nor a normal map is enabled,
16290 no normal is generated for "
16291 (code "glEvalCoord2")
16292 " commands. ")))
16293
16294 (define-gl-procedure
16295 glEvalMesh
16296 "glEvalMesh"
16297 (funcsynopsis
16298 (funcprototype
16299 (funcdef "void " (function "glEvalMesh1"))
16300 (paramdef "GLenum " (parameter "mode"))
16301 (paramdef "GLint " (parameter "i1"))
16302 (paramdef "GLint " (parameter "i2"))))
16303 '(*fragment*
16304 (heading
16305 "compute a one- or two-dimensional grid of points or lines")
16306 (heading "Parameters")
16307 (table (% (formatter (asis)))
16308 (entry (% (heading (var "mode")))
16309 (para "
16310 In "
16311 (code "glEvalMesh1")
16312 ", specifies whether to compute a one-dimensional mesh of points or lines.
16313 Symbolic constants "
16314 (code "GL_POINT")
16315 " and "
16316 (code "GL_LINE")
16317 " are accepted. "))
16318 (entry (% (heading (var "i1")))
16319 (itemx (var "i2"))
16320 (para "
16321 Specify the first and last integer values for grid domain variable "
16322 (math (var "i"))
16323 ". ")))
16324 (heading "Description")
16325 (para (code "glMapGrid")
16326 " and "
16327 (code "glEvalMesh")
16328 " are used in tandem to efficiently
16329 generate and evaluate a series of evenly-spaced map domain values. "
16330 (code "glEvalMesh")
16331 " steps through the integer domain of a one- or two-dimensional grid,
16332 whose range is the domain of the evaluation maps specified by "
16333 (code "glMap1")
16334 " and "
16335 (code "glMap2")
16336 ". "
16337 (var "mode")
16338 " determines whether the resulting vertices are connected as
16339 points,
16340 lines,
16341 or filled polygons. ")
16342 (para "
16343 In the one-dimensional case, "
16344 (code "glEvalMesh1")
16345 ",
16346 the mesh is generated as if the following code fragment were executed: ")
16347 (para "
16348 where ")
16349 (example
16350 "
16351 glBegin( "
16352 (var "type")
16353 " );
16354 for ( i = "
16355 (var "i1")
16356 "; i <= "
16357 (var "i2")
16358 "; i += 1 )
16359 glEvalCoord1( "
16360 (math "i"
16361 "·"
16362 "Δ"
16363 (var "u")
16364 "+"
16365 (var "u")
16366 "_"
16367 "1")
16368 " );
16369 glEnd(); ")
16370 (para (math "Δ"
16371 (var "u")
16372 "="
16373 "("
16374 (var "u")
16375 "_"
16376 "2"
16377 "-"
16378 (var "u")
16379 "_"
16380 "1"
16381 ","
16382 ")"
16383 "/"
16384 (var "n")))
16385 (para "
16386 and "
16387 (math (var "n"))
16388 ", "
16389 (math (var "u") "_" "1")
16390 ",
16391 and "
16392 (math (var "u") "_" "2")
16393 "
16394 are the arguments to the most recent "
16395 (code "glMapGrid1")
16396 " command. "
16397 (var "type")
16398 " is "
16399 (code "GL_POINTS")
16400 " if "
16401 (var "mode")
16402 " is "
16403 (code "GL_POINT")
16404 ",
16405 or "
16406 (code "GL_LINES")
16407 " if "
16408 (var "mode")
16409 " is "
16410 (code "GL_LINE")
16411 ". ")
16412 (para "
16413 The one absolute numeric requirement is that if "
16414 (math (var "i") "=" (var "n"))
16415 ",
16416 then the
16417 value computed from "
16418 (math (var "i")
16419 "·"
16420 "Δ"
16421 (var "u")
16422 "+"
16423 (var "u")
16424 "_"
16425 "1")
16426 "
16427 is exactly "
16428 (math (var "u") "_" "2")
16429 ". ")
16430 (para "
16431 In the two-dimensional case, "
16432 (code "glEvalMesh2")
16433 ", let
16434 .cp "
16435 (math "Δ"
16436 (var "u")
16437 "="
16438 "("
16439 (var "u")
16440 "_"
16441 "2"
16442 "-"
16443 (var "u")
16444 "_"
16445 "1"
16446 ","
16447 ")"
16448 "/"
16449 (var "n")))
16450 (para (math "Δ"
16451 (var "v")
16452 "="
16453 "("
16454 (var "v")
16455 "_"
16456 "2"
16457 "-"
16458 (var "v")
16459 "_"
16460 "1"
16461 ","
16462 ")"
16463 "/"
16464 (var "m")))
16465 (para "
16466 where "
16467 (math (var "n"))
16468 ", "
16469 (math (var "u") "_" "1")
16470 ", "
16471 (math (var "u") "_" "2")
16472 ", "
16473 (math (var "m"))
16474 ", "
16475 (math (var "v") "_" "1")
16476 ",
16477 and "
16478 (math (var "v") "_" "2")
16479 "
16480 are the
16481 arguments to the most recent "
16482 (code "glMapGrid2")
16483 " command. Then, if "
16484 (var "mode")
16485 " is "
16486 (code "GL_FILL")
16487 ", the "
16488 (code "glEvalMesh2")
16489 " command is equivalent
16490 to: ")
16491 (para)
16492 (example
16493 "
16494 for ( j = "
16495 (var "j1")
16496 "; j < "
16497 (var "j2")
16498 "; j += 1 ) {
16499 glBegin( GL_QUAD_STRIP );
16500 for ( i = "
16501 (var "i1")
16502 "; i <= "
16503 (var "i2")
16504 "; i += 1 ) {
16505 glEvalCoord2( "
16506 (math "i"
16507 "·"
16508 "Δ"
16509 (var "u")
16510 "+"
16511 (var "u")
16512 "_"
16513 "1"
16514 ","
16515 "j"
16516 "·"
16517 "Δ"
16518 (var "v")
16519 "+"
16520 (var "v")
16521 "_"
16522 "1")
16523 " );
16524 glEvalCoord2( "
16525 (math "i"
16526 "·"
16527 "Δ"
16528 (var "u")
16529 "+"
16530 (var "u")
16531 "_"
16532 "1"
16533 ","
16534 "("
16535 "j"
16536 "+"
16537 "1"
16538 ","
16539 ")"
16540 "·"
16541 "Δ"
16542 (var "v")
16543 "+"
16544 (var "v")
16545 "_"
16546 "1")
16547 " );
16548 }
16549 glEnd();
16550 } ")
16551 (para "
16552 If "
16553 (var "mode")
16554 " is "
16555 (code "GL_LINE")
16556 ", then a call to "
16557 (code "glEvalMesh2")
16558 " is equivalent to: ")
16559 (para)
16560 (example
16561 "
16562 for ( j = "
16563 (var "j1")
16564 "; j <= "
16565 (var "j2")
16566 "; j += 1 ) {
16567 glBegin( GL_LINE_STRIP );
16568 for ( i = "
16569 (var "i1")
16570 "; i <= "
16571 (var "i2")
16572 "; i += 1 )
16573 glEvalCoord2( "
16574 (math "i"
16575 "·"
16576 "Δ"
16577 (var "u")
16578 "+"
16579 (var "u")
16580 "_"
16581 "1"
16582 ","
16583 "j"
16584 "·"
16585 "Δ"
16586 (var "v")
16587 "+"
16588 (var "v")
16589 "_"
16590 "1")
16591 " );
16592 glEnd();
16593 }
16594
16595 for ( i = "
16596 (var "i1")
16597 "; i <= "
16598 (var "i2")
16599 "; i += 1 ) {
16600 glBegin( GL_LINE_STRIP );
16601 for ( j = "
16602 (var "j1")
16603 "; j <= "
16604 (var "j1")
16605 "; j += 1 )
16606 glEvalCoord2( "
16607 (math "i"
16608 "·"
16609 "Δ"
16610 (var "u")
16611 "+"
16612 (var "u")
16613 "_"
16614 "1"
16615 ","
16616 "j"
16617 "·"
16618 "Δ"
16619 (var "v")
16620 "+"
16621 (var "v")
16622 "_"
16623 "1")
16624 " );
16625 glEnd();
16626 } ")
16627 (para "
16628 And finally, if "
16629 (var "mode")
16630 " is "
16631 (code "GL_POINT")
16632 ", then a call to "
16633 (code "glEvalMesh2")
16634 " is equivalent to: ")
16635 (para)
16636 (example
16637 "
16638 glBegin( GL_POINTS );
16639 for ( j = "
16640 (var "j1")
16641 "; j <= "
16642 (var "j2")
16643 "; j += 1 )
16644 for ( i = "
16645 (var "i1")
16646 "; i <= "
16647 (var "i2")
16648 "; i += 1 )
16649 glEvalCoord2( "
16650 (math "i"
16651 "·"
16652 "Δ"
16653 (var "u")
16654 "+"
16655 (var "u")
16656 "_"
16657 "1"
16658 ","
16659 "j"
16660 "·"
16661 "Δ"
16662 (var "v")
16663 "+"
16664 (var "v")
16665 "_"
16666 "1")
16667 " );
16668 glEnd(); ")
16669 (para "
16670 In all three cases, the only absolute numeric requirements are that if "
16671 (math (var "i") "=" (var "n"))
16672 ",
16673 then the value computed from "
16674 (math (var "i")
16675 "·"
16676 "Δ"
16677 (var "u")
16678 "+"
16679 (var "u")
16680 "_"
16681 "1")
16682 "
16683 is exactly "
16684 (math (var "u") "_" "2")
16685 ",
16686 and if "
16687 (math (var "j") "=" (var "m"))
16688 ",
16689 then the value computed from "
16690 (math (var "j")
16691 "·"
16692 "Δ"
16693 (var "v")
16694 "+"
16695 (var "v")
16696 "_"
16697 "1")
16698 "
16699 is exactly "
16700 (math (var "v") "_" "2")
16701 ". ")
16702 (heading "Errors")
16703 (para (code "GL_INVALID_ENUM")
16704 " is generated if "
16705 (var "mode")
16706 " is not an accepted value. ")
16707 (para (code "GL_INVALID_OPERATION")
16708 " is generated if "
16709 (code "glEvalMesh")
16710 "
16711 is executed between the execution of "
16712 (code "glBegin")
16713 "
16714 and the corresponding execution of "
16715 (code "glEnd")
16716 ". ")))
16717
16718 (define-gl-procedure
16719 glEvalPoint
16720 "glEvalPoint"
16721 (funcsynopsis
16722 (funcprototype
16723 (funcdef "void " (function "glEvalPoint1"))
16724 (paramdef "GLint " (parameter "i"))))
16725 '(*fragment*
16726 (heading
16727 "generate and evaluate a single point in a mesh")
16728 (heading "Parameters")
16729 (table (% (formatter (asis)))
16730 (entry (% (heading (var "i")))
16731 (para "
16732 Specifies the integer value for grid domain variable "
16733 (math (var "i"))
16734 ". "))
16735 (entry (% (heading (var "j")))
16736 (para "
16737 Specifies the integer value for grid domain variable "
16738 (math (var "j"))
16739 "
16740 ("
16741 (code "glEvalPoint2")
16742 " only). ")))
16743 (heading "Description")
16744 (para (code "glMapGrid")
16745 " and "
16746 (code "glEvalMesh")
16747 " are used in tandem to efficiently
16748 generate and evaluate a series of evenly spaced map domain values. "
16749 (code "glEvalPoint")
16750 " can be used to evaluate a single grid point in the same gridspace
16751 that is traversed by "
16752 (code "glEvalMesh")
16753 ".
16754 Calling "
16755 (code "glEvalPoint1")
16756 " is equivalent to calling "
16757 "
16758 where "
16759 (math "Δ"
16760 (var "u")
16761 "="
16762 "("
16763 (var "u")
16764 "_"
16765 "2"
16766 "-"
16767 (var "u")
16768 "_"
16769 "1"
16770 ","
16771 ")"
16772 "/"
16773 (var "n")))
16774 (example
16775 "
16776 glEvalCoord1( "
16777 (math "i"
16778 "·"
16779 "Δ"
16780 (var "u")
16781 "+"
16782 (var "u")
16783 "_"
16784 "1")
16785 " ); ")
16786 (para "
16787 and "
16788 (math (var "n"))
16789 ", "
16790 (math (var "u") "_" "1")
16791 ",
16792 and "
16793 (math (var "u") "_" "2")
16794 "
16795 are the arguments to the most recent "
16796 (code "glMapGrid1")
16797 " command.
16798 The one absolute numeric requirement is that if "
16799 (math (var "i") "=" (var "n"))
16800 ",
16801 then the value computed from "
16802 (math (var "i")
16803 "·"
16804 "Δ"
16805 (var "u")
16806 "+"
16807 (var "u")
16808 "_"
16809 "1")
16810 "
16811 is exactly "
16812 (math (var "u") "_" "2")
16813 ". ")
16814 (para "
16815 In the two-dimensional case, "
16816 (code "glEvalPoint2")
16817 ", let ")
16818 (para (math "Δ"
16819 (var "u")
16820 "="
16821 "("
16822 (var "u")
16823 "_"
16824 "2"
16825 "-"
16826 (var "u")
16827 "_"
16828 "1"
16829 ","
16830 ")"
16831 "/"
16832 (var "n"))
16833 (para (math "Δ"
16834 (var "v")
16835 "="
16836 "("
16837 (var "v")
16838 "_"
16839 "2"
16840 "-"
16841 (var "v")
16842 "_"
16843 "1"
16844 ","
16845 ")"
16846 "/"
16847 (var "m"))))
16848 (para "
16849 where "
16850 (math (var "n"))
16851 ", "
16852 (math (var "u") "_" "1")
16853 ", "
16854 (math (var "u") "_" "2")
16855 ", "
16856 (math (var "m"))
16857 ", "
16858 (math (var "v") "_" "1")
16859 ",
16860 and "
16861 (math (var "v") "_" "2")
16862 "
16863 are the arguments to the most recent "
16864 (code "glMapGrid2")
16865 " command.
16866 Then the "
16867 (code "glEvalPoint2")
16868 " command is equivalent to calling "
16869 "
16870 The only absolute numeric requirements are that if "
16871 (math (var "i") "=" (var "n"))
16872 ",
16873 then the value computed from "
16874 (math (var "i")
16875 "·"
16876 "Δ"
16877 (var "u")
16878 "+"
16879 (var "u")
16880 "_"
16881 "1")
16882 "
16883 is exactly "
16884 (math (var "u") "_" "2")
16885 ",
16886 and if "
16887 (math (var "j") "=" (var "m"))
16888 ",
16889 then the value computed from "
16890 (math (var "j")
16891 "·"
16892 "Δ"
16893 (var "v")
16894 "+"
16895 (var "v")
16896 "_"
16897 "1")
16898 "
16899 is exactly "
16900 (math (var "v") "_" "2")
16901 ". ")
16902 (example
16903 "
16904 glEvalCoord2( "
16905 (math "i"
16906 "·"
16907 "Δ"
16908 (var "u")
16909 "+"
16910 (var "u")
16911 "_"
16912 "1"
16913 ","
16914 "j"
16915 "·"
16916 "Δ"
16917 (var "v")
16918 "+"
16919 (var "v")
16920 "_"
16921 "1")
16922 " ); ")))
16923
16924 (define-gl-procedure
16925 glFeedbackBuffer
16926 "glFeedbackBuffer"
16927 (funcsynopsis
16928 (funcprototype
16929 (funcdef "void " (function "glFeedbackBuffer"))
16930 (paramdef "GLsizei " (parameter "size"))
16931 (paramdef "GLenum " (parameter "type"))
16932 (paramdef "GLfloat * " (parameter "buffer"))))
16933 '(*fragment*
16934 (heading "controls feedback mode")
16935 (heading "Parameters")
16936 (table (% (formatter (asis)))
16937 (entry (% (heading (var "size")))
16938 (para "
16939 Specifies the maximum number of values that can be written into "
16940 (var "buffer")
16941 ". "))
16942 (entry (% (heading (var "type")))
16943 (para "
16944 Specifies a symbolic constant that describes the information
16945 that will be returned for each vertex. "
16946 (code "GL_2D")
16947 ", "
16948 (code "GL_3D")
16949 ", "
16950 (code "GL_3D_COLOR")
16951 ", "
16952 (code "GL_3D_COLOR_TEXTURE")
16953 ", and "
16954 (code "GL_4D_COLOR_TEXTURE")
16955 " are accepted. "))
16956 (entry (% (heading (var "buffer")))
16957 (para "
16958 Returns the feedback data. ")))
16959 (heading "Description")
16960 (para "
16961 The "
16962 (code "glFeedbackBuffer")
16963 " function controls feedback.
16964 Feedback, like selection, is a GL mode.
16965 The mode is selected by calling "
16966 (code "glRenderMode")
16967 " with "
16968 (code "GL_FEEDBACK")
16969 ".
16970 When the GL is in feedback mode,
16971 no pixels are produced by rasterization.
16972 Instead, information about primitives that would have been
16973 rasterized is fed back to the application using the GL. ")
16974 (para (code "glFeedbackBuffer")
16975 " has three arguments: "
16976 (var "buffer")
16977 " is a pointer to an array of floating-point values
16978 into which feedback information is placed. "
16979 (var "size")
16980 " indicates the size of the array. "
16981 (var "type")
16982 " is a symbolic constant describing the information
16983 that is fed back for each vertex. "
16984 (code "glFeedbackBuffer")
16985 " must be issued before feedback mode is enabled
16986 (by calling "
16987 (code "glRenderMode")
16988 " with argument "
16989 (code "GL_FEEDBACK")
16990 ").
16991 Setting "
16992 (code "GL_FEEDBACK")
16993 " without establishing the feedback buffer,
16994 or calling "
16995 (code "glFeedbackBuffer")
16996 " while the GL is in feedback mode,
16997 is an error. ")
16998 (para "
16999 When "
17000 (code "glRenderMode")
17001 " is called while in feedback mode, it returns the number of entries
17002 placed in the feedback array and resets the feedback array pointer to the base
17003 of the feedback buffer. The returned value never exceeds "
17004 (var "size")
17005 ". If the feedback
17006 data required more room than was available in "
17007 (var "buffer")
17008 ", "
17009 (code "glRenderMode")
17010 " returns a negative value.
17011 To take the GL out of feedback mode, call "
17012 (code "glRenderMode")
17013 " with a parameter value other than "
17014 (code "GL_FEEDBACK")
17015 ". ")
17016 (para "
17017 While in feedback mode,
17018 each primitive, bitmap, or pixel rectangle that would be rasterized
17019 generates a block of values that are copied into the feedback array.
17020 If doing so would cause the number of entries to exceed the maximum,
17021 the block is partially written so as to fill the array
17022 (if there is any room left at all),
17023 and an overflow flag is set.
17024 Each block begins with a code indicating the primitive type,
17025 followed by values that describe the primitive's vertices and
17026 associated data.
17027 Entries are also written for bitmaps and pixel rectangles.
17028 Feedback occurs after polygon culling and "
17029 (code "glPolygonMode")
17030 " interpretation
17031 of polygons has taken place,
17032 so polygons that are culled are not returned in the feedback buffer.
17033 It can also occur after polygons with more than three edges are broken up
17034 into triangles,
17035 if the GL implementation renders polygons by performing this decomposition. ")
17036 (para "
17037 The "
17038 (code "glPassThrough")
17039 " command can be used to insert a marker
17040 into the feedback buffer.
17041 See "
17042 (code "glPassThrough")
17043 ". ")
17044 (para "
17045 Following is the grammar for the blocks of values written
17046 into the feedback buffer.
17047 Each primitive is indicated with a unique identifying value
17048 followed by some number of vertices.
17049 Polygon entries include an integer value indicating how many vertices follow.
17050 A vertex is fed back as some number of floating-point values,
17051 as determined by "
17052 (var "type")
17053 ".
17054 Colors are fed back as four values in RGBA mode and one value
17055 in color index mode. ")
17056 (para (para "
17057 feedbackList "
17058 (math "←")
17059 " feedbackItem feedbackList | feedbackItem ")
17060 (para "
17061 feedbackItem "
17062 (math "←")
17063 " point | lineSegment | polygon | bitmap | pixelRectangle | passThru ")
17064 (para "
17065 point "
17066 (math "←")
17067 (code "GL_POINT_TOKEN")
17068 " vertex ")
17069 (para "
17070 lineSegment "
17071 (math "←")
17072 (code "GL_LINE_TOKEN")
17073 " vertex vertex | "
17074 (code "GL_LINE_RESET_TOKEN")
17075 " vertex vertex ")
17076 (para "
17077 polygon "
17078 (math "←")
17079 (code "GL_POLYGON_TOKEN")
17080 " n polySpec ")
17081 (para "
17082 polySpec "
17083 (math "←")
17084 " polySpec vertex | vertex vertex vertex ")
17085 (para "
17086 bitmap "
17087 (math "←")
17088 (code "GL_BITMAP_TOKEN")
17089 " vertex ")
17090 (para "
17091 pixelRectangle "
17092 (math "←")
17093 (code "GL_DRAW_PIXEL_TOKEN")
17094 " vertex | "
17095 (code "GL_COPY_PIXEL_TOKEN")
17096 " vertex ")
17097 (para "
17098 passThru "
17099 (math "←")
17100 (code "GL_PASS_THROUGH_TOKEN")
17101 " value ")
17102 (para "
17103 vertex "
17104 (math "←")
17105 " 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture ")
17106 (para "
17107 2d " (math "←") " value value ")
17108 (para "
17109 3d " (math "←") " value value value ")
17110 (para "
17111 3dColor "
17112 (math "←")
17113 " value value value color ")
17114 (para "
17115 3dColorTexture "
17116 (math "←")
17117 " value value value color tex ")
17118 (para "
17119 4dColorTexture "
17120 (math "←")
17121 " value value value value color tex ")
17122 (para "
17123 color " (math "←") " rgba | index ")
17124 (para "
17125 rgba "
17126 (math "←")
17127 " value value value value ")
17128 (para "
17129 index " (math "←") " value ")
17130 (para "
17131 tex "
17132 (math "←")
17133 " value value value value ")
17134 (para))
17135 (para (var "value")
17136 "
17137 is a floating-point number,
17138 and "
17139 (var "n")
17140 "
17141 is a floating-point integer giving the number of vertices in the polygon. "
17142 (code "GL_POINT_TOKEN")
17143 ", "
17144 (code "GL_LINE_TOKEN")
17145 ", "
17146 (code "GL_LINE_RESET_TOKEN")
17147 ", "
17148 (code "GL_POLYGON_TOKEN")
17149 ", "
17150 (code "GL_BITMAP_TOKEN")
17151 ", "
17152 (code "GL_DRAW_PIXEL_TOKEN")
17153 ", "
17154 (code "GL_COPY_PIXEL_TOKEN")
17155 " and "
17156 (code "GL_PASS_THROUGH_TOKEN")
17157 " are symbolic floating-point constants. "
17158 (code "GL_LINE_RESET_TOKEN")
17159 " is returned whenever the line stipple pattern
17160 is reset.
17161 The data returned as a vertex depends on the feedback "
17162 (var "type")
17163 ". ")
17164 (para "
17165 The following table gives the correspondence between "
17166 (var "type")
17167 "
17168 and the number of values per vertex. "
17169 (var "k")
17170 " is 1 in color index mode and 4 in RGBA mode. ")
17171 (para)
17172 (table (% (formatter (asis)))
17173 (entry (% (heading (strong "Type")))
17174 (para (strong "Coordinates")
17175 ", "
17176 (strong "Color")
17177 ", "
17178 (strong "Texture")
17179 ", "
17180 (strong "Total Number of Values")))
17181 (entry (% (heading (code "GL_2D")))
17182 (para (var "x")
17183 ", "
17184 (var "y")
17185 ", "
17186 ", "
17187 ", "
17188 "
17189 2 "))
17190 (entry (% (heading (code "GL_3D")))
17191 (para (var "x")
17192 ", "
17193 (var "y")
17194 ", "
17195 (var "z")
17196 ", "
17197 ", "
17198 ", "
17199 "
17200 3 "))
17201 (entry (% (heading (code "GL_3D_COLOR")))
17202 (para (var "x")
17203 ", "
17204 (var "y")
17205 ", "
17206 (var "z")
17207 ", "
17208 (math (var "k"))
17209 ", "
17210 ", "
17211 (math "3" "+" (var "k"))))
17212 (entry (% (heading (code "GL_3D_COLOR_TEXTURE")))
17213 (para (var "x")
17214 ", "
17215 (var "y")
17216 ", "
17217 (var "z")
17218 ", "
17219 (math (var "k"))
17220 ", "
17221 "
17222 4 "
17223 ", "
17224 (math "7" "+" (var "k"))))
17225 (entry (% (heading (code "GL_4D_COLOR_TEXTURE")))
17226 (para (var "x")
17227 ", "
17228 (var "y")
17229 ", "
17230 (var "z")
17231 ", "
17232 (var "w")
17233 ", "
17234 (math (var "k"))
17235 ", "
17236 "
17237 4 "
17238 ", "
17239 (math "8" "+" (var "k")))))
17240 (para "
17241 Feedback vertex coordinates are in window coordinates,
17242 except "
17243 (var "w")
17244 ",
17245 which is in clip coordinates.
17246 Feedback colors are lighted, if lighting is enabled.
17247 Feedback texture coordinates are generated,
17248 if texture coordinate generation is enabled.
17249 They are always transformed by the texture matrix. ")
17250 (heading "Errors")
17251 (para (code "GL_INVALID_ENUM")
17252 " is generated if "
17253 (var "type")
17254 " is not an accepted value. ")
17255 (para (code "GL_INVALID_VALUE")
17256 " is generated if "
17257 (var "size")
17258 " is negative. ")
17259 (para (code "GL_INVALID_OPERATION")
17260 " is generated if "
17261 (code "glFeedbackBuffer")
17262 " is called while the
17263 render mode is "
17264 (code "GL_FEEDBACK")
17265 ",
17266 or if "
17267 (code "glRenderMode")
17268 " is called with argument "
17269 (code "GL_FEEDBACK")
17270 " before "
17271 (code "glFeedbackBuffer")
17272 " is called at least once. ")
17273 (para (code "GL_INVALID_OPERATION")
17274 " is generated if "
17275 (code "glFeedbackBuffer")
17276 "
17277 is executed between the execution of "
17278 (code "glBegin")
17279 "
17280 and the corresponding execution of "
17281 (code "glEnd")
17282 ". ")))
17283
17284 (define-gl-procedure
17285 glFinish
17286 "glFinish"
17287 (funcsynopsis
17288 (funcprototype
17289 (funcdef "void " (function "glFinish"))
17290 (paramdef (parameter "void"))))
17291 '(*fragment*
17292 (heading
17293 "block until all GL execution is complete")
17294 (heading "Description")
17295 (para (code "glFinish")
17296 " does not return until the effects of all previously
17297 called GL commands are complete.
17298 Such effects include all changes to GL state,
17299 all changes to connection state,
17300 and all changes to the frame buffer contents. ")
17301 (heading "Errors")
17302 (para (code "GL_INVALID_OPERATION")
17303 " is generated if "
17304 (code "glFinish")
17305 " is executed between
17306 the execution of "
17307 (code "glBegin")
17308 "
17309 and the corresponding execution of "
17310 (code "glEnd")
17311 ". ")))
17312
17313 (define-gl-procedure
17314 glFlush
17315 "glFlush"
17316 (funcsynopsis
17317 (funcprototype
17318 (funcdef "void " (function "glFlush"))
17319 (paramdef (parameter "void"))))
17320 '(*fragment*
17321 (heading
17322 "force execution of GL commands in finite time")
17323 (heading "Description")
17324 (para "
17325 Different GL implementations buffer commands in several different locations,
17326 including network buffers and the graphics accelerator itself. "
17327 (code "glFlush")
17328 " empties all of these buffers,
17329 causing all issued commands to be executed as quickly as
17330 they are accepted by the actual rendering engine.
17331 Though this execution may not be completed in any particular
17332 time period,
17333 it does complete in finite time. ")
17334 (para "
17335 Because any GL program might be executed over a network,
17336 or on an accelerator that buffers commands,
17337 all programs should call "
17338 (code "glFlush")
17339 " whenever they count on having
17340 all of their previously issued commands completed.
17341 For example,
17342 call "
17343 (code "glFlush")
17344 " before waiting for user input that depends on
17345 the generated image. ")
17346 (heading "Errors")
17347 (para (code "GL_INVALID_OPERATION")
17348 " is generated if "
17349 (code "glFlush")
17350 "
17351 is executed between the execution of "
17352 (code "glBegin")
17353 "
17354 and the corresponding execution of "
17355 (code "glEnd")
17356 ". ")))
17357
17358 (define-gl-procedure
17359 glFogCoordPointer
17360 "glFogCoordPointer"
17361 (funcsynopsis
17362 (funcprototype
17363 (funcdef "void " (function "glFogCoordPointer"))
17364 (paramdef "GLenum " (parameter "type"))
17365 (paramdef "GLsizei " (parameter "stride"))
17366 (paramdef "GLvoid * " (parameter "pointer"))))
17367 '(*fragment*
17368 (heading "define an array of fog coordinates")
17369 (heading "Parameters")
17370 (table (% (formatter (asis)))
17371 (entry (% (heading (var "type")))
17372 (para "
17373 Specifies the data type of each fog coordinate.
17374 Symbolic constants "
17375 (code "GL_FLOAT")
17376 ",
17377 or "
17378 (code "GL_DOUBLE")
17379 "
17380 are accepted. The initial value is "
17381 (code "GL_FLOAT")
17382 ". "))
17383 (entry (% (heading (var "stride")))
17384 (para "
17385 Specifies the byte offset between consecutive fog coordinates.
17386 If "
17387 (var "stride")
17388 " is 0, the array elements are understood
17389 to be tightly packed. The initial value is 0. "))
17390 (entry (% (heading (var "pointer")))
17391 (para "
17392 Specifies a pointer to the first coordinate of the first fog coordinate in the
17393 array. The initial value is 0. ")))
17394 (heading "Description")
17395 (para (code "glFogCoordPointer")
17396 " specifies the location and data format of an array of fog coordinates
17397 to use when rendering. "
17398 (var "type")
17399 " specifies the data type of each fog
17400 coordinate, and "
17401 (var "stride")
17402 " specifies the byte stride from one fog coordinate to
17403 the next, allowing vertices and attributes to be packed into a single array
17404 or stored in separate arrays. ")
17405 (para "
17406 If a non-zero named buffer object is bound to the "
17407 (code "GL_ARRAY_BUFFER")
17408 " target
17409 (see "
17410 (code "glBindBuffer")
17411 ") while a fog coordinate array is
17412 specified, "
17413 (var "pointer")
17414 " is treated as a byte offset into the buffer object's data store.
17415 Also, the buffer object binding ("
17416 (code "GL_ARRAY_BUFFER_BINDING")
17417 ") is saved as fog coordinate vertex array
17418 client-side state ("
17419 (code "GL_FOG_COORD_ARRAY_BUFFER_BINDING")
17420 "). ")
17421 (para "
17422 When a fog coordinate array is specified, "
17423 (var "type")
17424 ", "
17425 (var "stride")
17426 ", and "
17427 (var "pointer")
17428 " are saved as client-side
17429 state, in addition to the current vertex array buffer object binding. ")
17430 (para "
17431 To enable and disable the fog coordinate array, call "
17432 (code "glEnableClientState")
17433 " and "
17434 (code "glDisableClientState")
17435 " with the argument "
17436 (code "GL_FOG_COORD_ARRAY")
17437 ". If
17438 enabled, the fog coordinate array is used
17439 when "
17440 (code "glDrawArrays")
17441 ", "
17442 (code "glMultiDrawArrays")
17443 ", "
17444 (code "glDrawElements")
17445 ", "
17446 (code "glMultiDrawElements")
17447 ", "
17448 (code "glDrawRangeElements")
17449 ", or "
17450 (code "glArrayElement")
17451 " is called. ")
17452 (heading "Errors")
17453 (para (code "GL_INVALID_ENUM")
17454 " is generated if "
17455 (var "type")
17456 " is not either "
17457 (code "GL_FLOAT")
17458 "
17459 or "
17460 (code "GL_DOUBLE")
17461 ". ")
17462 (para (code "GL_INVALID_VALUE")
17463 " is generated if "
17464 (var "stride")
17465 " is negative. ")))
17466
17467 (define-gl-procedure
17468 glFogCoord
17469 "glFogCoord"
17470 (funcsynopsis
17471 (funcprototype
17472 (funcdef "void " (function "glFogCoordd"))
17473 (paramdef "GLdouble " (parameter "coord"))))
17474 '(*fragment*
17475 (heading "set the current fog coordinates")
17476 (heading "Parameters")
17477 (table (% (formatter (asis)))
17478 (entry (% (heading (var "coord")))
17479 (para "
17480 Specify the fog distance. ")))
17481 (heading "Description")
17482 (para (code "glFogCoord")
17483 " specifies the fog coordinate that is associated with each vertex and
17484 the current raster position. The value specified is interpolated and used
17485 in computing the fog color (see "
17486 (code "glFog")
17487 "). ")))
17488
17489 (define-gl-procedure
17490 glFog
17491 "glFog"
17492 (funcsynopsis
17493 (funcprototype
17494 (funcdef "void " (function "glFogf"))
17495 (paramdef "GLenum " (parameter "pname"))
17496 (paramdef "GLfloat " (parameter "param"))))
17497 '(*fragment*
17498 (heading "specify fog parameters")
17499 (heading "Parameters")
17500 (table (% (formatter (asis)))
17501 (entry (% (heading (var "pname")))
17502 (para "
17503 Specifies a single-valued fog parameter. "
17504 (code "GL_FOG_MODE")
17505 ", "
17506 (code "GL_FOG_DENSITY")
17507 ", "
17508 (code "GL_FOG_START")
17509 ", "
17510 (code "GL_FOG_END")
17511 ", "
17512 (code "GL_FOG_INDEX")
17513 ", and "
17514 (code "GL_FOG_COORD_SRC")
17515 "
17516 are accepted. "))
17517 (entry (% (heading (var "param")))
17518 (para "
17519 Specifies the value that "
17520 (var "pname")
17521 " will be set to. ")))
17522 (heading "Description")
17523 (para "
17524 Fog is initially disabled.
17525 While enabled, fog affects rasterized geometry,
17526 bitmaps, and pixel blocks, but not buffer clear operations. To enable
17527 and disable fog, call "
17528 (code "glEnable")
17529 " and "
17530 (code "glDisable")
17531 " with argument "
17532 (code "GL_FOG")
17533 ". ")
17534 (para (code "glFog")
17535 " assigns the value or values in "
17536 (var "params")
17537 " to the fog parameter
17538 specified by "
17539 (var "pname")
17540 ".
17541 The following values are accepted for "
17542 (var "pname")
17543 ": ")
17544 (table (% (formatter (asis)))
17545 (entry (% (heading (code "GL_FOG_MODE")))
17546 (para (var "params")
17547 " is a single integer or floating-point value that specifies
17548 the equation to be used to compute the fog blend factor, "
17549 (math (var "f"))
17550 ".
17551 Three symbolic constants are accepted: "
17552 (code "GL_LINEAR")
17553 ", "
17554 (code "GL_EXP")
17555 ",
17556 and "
17557 (code "GL_EXP2")
17558 ".
17559 The equations corresponding to these symbolic constants are defined below.
17560 The initial fog mode is "
17561 (code "GL_EXP")
17562 ". "))
17563 (entry (% (heading (code "GL_FOG_DENSITY")))
17564 (para (var "params")
17565 " is a single integer or floating-point value that specifies "
17566 (math (var "density"))
17567 ",
17568 the fog density used in both exponential fog equations.
17569 Only nonnegative densities are accepted.
17570 The initial fog density is 1. "))
17571 (entry (% (heading (code "GL_FOG_START")))
17572 (para (var "params")
17573 " is a single integer or floating-point value that specifies "
17574 (math (var "start"))
17575 ",
17576 the near distance used in the linear fog equation.
17577 The initial near distance is 0. "))
17578 (entry (% (heading (code "GL_FOG_END")))
17579 (para (var "params")
17580 " is a single integer or floating-point value that specifies "
17581 (math (var "end"))
17582 ",
17583 the far distance used in the linear fog equation.
17584 The initial far distance is 1. "))
17585 (entry (% (heading (code "GL_FOG_INDEX")))
17586 (para (var "params")
17587 " is a single integer or floating-point value that specifies "
17588 (math (var "i") "_" (var "f"))
17589 ",
17590 the fog color index.
17591 The initial fog index is 0. "))
17592 (entry (% (heading (code "GL_FOG_COLOR")))
17593 (para (var "params")
17594 " contains four integer or floating-point values that specify "
17595 (math (var "C") "_" (var "f"))
17596 ",
17597 the fog color.
17598 Integer values are mapped linearly such that the most positive representable
17599 value maps to 1.0,
17600 and the most negative representable value maps to "
17601 (math "-1.0")
17602 ".
17603 Floating-point values are mapped directly.
17604 After conversion,
17605 all color components are clamped to the range "
17606 (math "[" "0" "," "1" "]")
17607 ".
17608 The initial fog color is (0, 0, 0, 0). "))
17609 (entry (% (heading (code "GL_FOG_COORD_SRC")))
17610 (para (var "params")
17611 " contains either of the following symbolic constants: "
17612 (code "GL_FOG_COORD")
17613 " or "
17614 (code "GL_FRAGMENT_DEPTH")
17615 ". "
17616 (code "GL_FOG_COORD")
17617 "
17618 specifies that the current fog coordinate should be used as distance value
17619 in the fog color computation. "
17620 (code "GL_FRAGMENT_DEPTH")
17621 " specifies that the
17622 current fragment depth should be used as distance value in the fog
17623 computation. ")))
17624 (para "
17625 Fog blends a fog color with each rasterized pixel fragment's post-texturing
17626 color using a blending factor "
17627 (math (var "f"))
17628 ".
17629 Factor "
17630 (math (var "f"))
17631 "
17632 is computed in one of three ways,
17633 depending on the fog mode.
17634 Let "
17635 (math (var "c"))
17636 "
17637 be either the distance in eye coordinate from the origin (in the
17638 case that the "
17639 (code "GL_FOG_COORD_SRC")
17640 " is "
17641 (code "GL_FRAGMENT_DEPTH")
17642 ") or
17643 the current fog coordinate (in the case that "
17644 (code "GL_FOG_COORD_SRC")
17645 "
17646 is "
17647 (code "GL_FOG_COORD")
17648 ").
17649 The equation for "
17650 (code "GL_LINEAR")
17651 " fog is "
17652 (math (var "f")
17653 "="
17654 (var "end")
17655 "-"
17656 (var "c")
17657 ","
17658 "/"
17659 (var "end")
17660 "-"
17661 (var "start")
17662 ","))
17663 (para "
17664 The equation for "
17665 (code "GL_EXP")
17666 " fog is "
17667 (math (var "f")
17668 "="
17669 (var "e")
17670 "^"
17671 "-"
17672 "("
17673 (var "density")
17674 "·"
17675 (var "c")
17676 ","
17677 ")"
17678 ","))
17679 (para "
17680 The equation for "
17681 (code "GL_EXP2")
17682 " fog is "
17683 (math (var "f")
17684 "="
17685 (var "e")
17686 "^"
17687 "-"
17688 "("
17689 (var "density")
17690 "·"
17691 (var "c")
17692 ","
17693 ")"
17694 ","
17695 "^"
17696 "2"))
17697 (para "
17698 Regardless of the fog mode, "
17699 (math (var "f"))
17700 "
17701 is clamped to the range "
17702 (math "[" "0" "," "1" "]")
17703 "
17704 after it is computed.
17705 Then,
17706 if the GL is in RGBA color mode,
17707 the fragment's red, green, and blue colors, represented by "
17708 (math (var "C") "_" (var "r"))
17709 ",
17710 are replaced by ")
17711 (para (math (var "C")
17712 "_"
17713 (var "r")
17714 ","
17715 "^"
17716 "″"
17717 "="
17718 (var "f")
17719 "×"
17720 (var "C")
17721 "_"
17722 (var "r")
17723 "+"
17724 "("
17725 "1"
17726 "-"
17727 (var "f")
17728 ","
17729 ")"
17730 "×"
17731 (var "C")
17732 "_"
17733 (var "f")))
17734 (para "
17735 Fog does not affect a fragment's alpha component. ")
17736 (para "
17737 In color index mode, the fragment's color index "
17738 (math (var "i") "_" (var "r"))
17739 "
17740 is replaced by ")
17741 (para (math (var "i")
17742 "_"
17743 (var "r")
17744 ","
17745 "^"
17746 "″"
17747 "="
17748 (var "i")
17749 "_"
17750 (var "r")
17751 "+"
17752 "("
17753 "1"
17754 "-"
17755 (var "f")
17756 ","
17757 ")"
17758 "×"
17759 (var "i")
17760 "_"
17761 (var "f")))
17762 (para)
17763 (heading "Errors")
17764 (para (code "GL_INVALID_ENUM")
17765 " is generated if "
17766 (var "pname")
17767 " is not an accepted value,
17768 or if "
17769 (var "pname")
17770 " is "
17771 (code "GL_FOG_MODE")
17772 " and "
17773 (var "params")
17774 " is not an accepted value. ")
17775 (para (code "GL_INVALID_VALUE")
17776 " is generated if "
17777 (var "pname")
17778 " is "
17779 (code "GL_FOG_DENSITY")
17780 "
17781 and "
17782 (var "params")
17783 " is negative. ")
17784 (para (code "GL_INVALID_OPERATION")
17785 " is generated if "
17786 (code "glFog")
17787 "
17788 is executed between the execution of "
17789 (code "glBegin")
17790 "
17791 and the corresponding execution of "
17792 (code "glEnd")
17793 ". ")))
17794
17795 (define-gl-procedure
17796 glFrontFace
17797 "glFrontFace"
17798 (funcsynopsis
17799 (funcprototype
17800 (funcdef "void " (function "glFrontFace"))
17801 (paramdef "GLenum " (parameter "mode"))))
17802 '(*fragment*
17803 (heading
17804 "define front- and back-facing polygons")
17805 (heading "Parameters")
17806 (table (% (formatter (asis)))
17807 (entry (% (heading (var "mode")))
17808 (para "
17809 Specifies the orientation of front-facing polygons. "
17810 (code "GL_CW")
17811 " and "
17812 (code "GL_CCW")
17813 " are accepted.
17814 The initial value is "
17815 (code "GL_CCW")
17816 ". ")))
17817 (heading "Description")
17818 (para "
17819 In a scene composed entirely of opaque closed surfaces,
17820 back-facing polygons are never visible.
17821 Eliminating these invisible polygons has the obvious benefit
17822 of speeding up the rendering of the image.
17823 To enable and disable elimination of back-facing polygons, call "
17824 (code "glEnable")
17825 "
17826 and "
17827 (code "glDisable")
17828 " with argument "
17829 (code "GL_CULL_FACE")
17830 ". ")
17831 (para "
17832 The projection of a polygon to window coordinates is said to have
17833 clockwise winding if an imaginary object following the path
17834 from its first vertex,
17835 its second vertex,
17836 and so on,
17837 to its last vertex,
17838 and finally back to its first vertex,
17839 moves in a clockwise direction about the interior of the polygon.
17840 The polygon's winding is said to be counterclockwise if the imaginary
17841 object following the same path moves in a counterclockwise direction
17842 about the interior of the polygon. "
17843 (code "glFrontFace")
17844 " specifies whether polygons with clockwise winding in window coordinates,
17845 or counterclockwise winding in window coordinates,
17846 are taken to be front-facing.
17847 Passing "
17848 (code "GL_CCW")
17849 " to "
17850 (var "mode")
17851 " selects counterclockwise polygons as
17852 front-facing; "
17853 (code "GL_CW")
17854 " selects clockwise polygons as front-facing.
17855 By default, counterclockwise polygons are taken to be front-facing. ")
17856 (heading "Errors")
17857 (para (code "GL_INVALID_ENUM")
17858 " is generated if "
17859 (var "mode")
17860 " is not an accepted value. ")
17861 (para (code "GL_INVALID_OPERATION")
17862 " is generated if "
17863 (code "glFrontFace")
17864 "
17865 is executed between the execution of "
17866 (code "glBegin")
17867 "
17868 and the corresponding execution of "
17869 (code "glEnd")
17870 ". ")))
17871
17872 (define-gl-procedure
17873 glFrustum
17874 "glFrustum"
17875 (funcsynopsis
17876 (funcprototype
17877 (funcdef "void " (function "glFrustum"))
17878 (paramdef "GLdouble " (parameter "left"))
17879 (paramdef "GLdouble " (parameter "right"))
17880 (paramdef "GLdouble " (parameter "bottom"))
17881 (paramdef "GLdouble " (parameter "top"))
17882 (paramdef "GLdouble " (parameter "nearVal"))
17883 (paramdef "GLdouble " (parameter "farVal"))))
17884 '(*fragment*
17885 (heading
17886 "multiply the current matrix by a perspective matrix")
17887 (heading "Parameters")
17888 (table (% (formatter (asis)))
17889 (entry (% (heading (var "left")))
17890 (itemx (var "right"))
17891 (para "
17892 Specify the coordinates for the left and right vertical clipping planes. "))
17893 (entry (% (heading (var "bottom")))
17894 (itemx (var "top"))
17895 (para "
17896 Specify the coordinates for the bottom and top horizontal clipping planes. "))
17897 (entry (% (heading (var "nearVal")))
17898 (itemx (var "farVal"))
17899 (para "
17900 Specify the distances to the near and far depth clipping planes.
17901 Both distances must be positive. ")))
17902 (heading "Description")
17903 (para (code "glFrustum")
17904 " describes a perspective matrix that produces a perspective projection.
17905 The current matrix (see "
17906 (code "glMatrixMode")
17907 ") is multiplied by this matrix
17908 and the result replaces the current matrix, as if "
17909 (code "glMultMatrix")
17910 " were called with the following matrix
17911 as its argument: ")
17912 (para)
17913 (para (math "["
17914 "("
17915 "2"
17916 "\u2062"
17917 (var "nearVal")
17918 ","
17919 "/"
17920 (var "right")
17921 "-"
17922 (var "left")
17923 ","
17924 ","
17925 " "
17926 "0"
17927 " "
17928 (var "A")
17929 " "
17930 "0"
17931 ")"
17932 ", "
17933 "("
17934 "0"
17935 " "
17936 "2"
17937 "\u2062"
17938 (var "nearVal")
17939 ","
17940 "/"
17941 (var "top")
17942 "-"
17943 (var "bottom")
17944 ","
17945 ","
17946 " "
17947 (var "B")
17948 " "
17949 "0"
17950 ")"
17951 ", "
17952 "("
17953 "0"
17954 " "
17955 "0"
17956 " "
17957 (var "C")
17958 " "
17959 (var "D")
17960 ")"
17961 ", "
17962 "("
17963 "0"
17964 " "
17965 "0"
17966 " "
17967 "-1"
17968 " "
17969 "0"
17970 ")"
17971 ","
17972 "]"))
17973 (para (math (var "A")
17974 "="
17975 (var "right")
17976 "+"
17977 (var "left")
17978 ","
17979 "/"
17980 (var "right")
17981 "-"
17982 (var "left")
17983 ","))
17984 (para (math (var "B")
17985 "="
17986 (var "top")
17987 "+"
17988 (var "bottom")
17989 ","
17990 "/"
17991 (var "top")
17992 "-"
17993 (var "bottom")
17994 ","))
17995 (para (math (var "C")
17996 "="
17997 "-"
17998 (var "farVal")
17999 "+"
18000 (var "nearVal")
18001 ","
18002 "/"
18003 (var "farVal")
18004 "-"
18005 (var "nearVal")
18006 ","
18007 ","))
18008 (para (math (var "D")
18009 "="
18010 "-"
18011 "2"
18012 "\u2062"
18013 (var "farVal")
18014 "\u2062"
18015 (var "nearVal")
18016 ","
18017 "/"
18018 (var "farVal")
18019 "-"
18020 (var "nearVal")
18021 ","
18022 ","))
18023 (para)
18024 (para "
18025 Typically, the matrix mode is "
18026 (code "GL_PROJECTION")
18027 ", and "
18028 (math "("
18029 (var "left")
18030 ","
18031 (var "bottom")
18032 "-"
18033 (var "nearVal")
18034 ")")
18035 "
18036 and "
18037 (math "("
18038 (var "right")
18039 ","
18040 (var "top")
18041 "-"
18042 (var "nearVal")
18043 ")")
18044 "
18045 specify the points on the near clipping plane that are mapped
18046 to the lower left and upper right corners of the window,
18047 assuming that the eye is located at (0, 0, 0). "
18048 (math "-" (var "farVal"))
18049 "
18050 specifies the location of the far clipping plane.
18051 Both "
18052 (var "nearVal")
18053 " and "
18054 (var "farVal")
18055 " must be positive. ")
18056 (para "
18057 Use "
18058 (code "glPushMatrix")
18059 " and "
18060 (code "glPopMatrix")
18061 " to save and restore
18062 the current matrix stack. ")
18063 (heading "Errors")
18064 (para (code "GL_INVALID_VALUE")
18065 " is generated if "
18066 (var "nearVal")
18067 " or "
18068 (var "farVal")
18069 " is not
18070 positive, or if "
18071 (var "left")
18072 " = "
18073 (var "right")
18074 ", or "
18075 (var "bottom")
18076 " = "
18077 (var "top")
18078 ",
18079 or "
18080 (var "near")
18081 " = "
18082 (var "far")
18083 ". ")
18084 (para (code "GL_INVALID_OPERATION")
18085 " is generated if "
18086 (code "glFrustum")
18087 "
18088 is executed between the execution of "
18089 (code "glBegin")
18090 "
18091 and the corresponding execution of "
18092 (code "glEnd")
18093 ". ")))
18094
18095 (define-gl-procedure
18096 glGenBuffers
18097 "glGenBuffers"
18098 (funcsynopsis
18099 (funcprototype
18100 (funcdef "void " (function "glGenBuffers"))
18101 (paramdef "GLsizei " (parameter "n"))
18102 (paramdef "GLuint * " (parameter "buffers"))))
18103 '(*fragment*
18104 (heading "generate buffer object names")
18105 (heading "Parameters")
18106 (table (% (formatter (asis)))
18107 (entry (% (heading (var "n")))
18108 (para "
18109 Specifies the number of buffer object names to be generated. "))
18110 (entry (% (heading (var "buffers")))
18111 (para "
18112 Specifies an array in which the generated buffer object names are stored. ")))
18113 (heading "Description")
18114 (para (code "glGenBuffers")
18115 " returns "
18116 (var "n")
18117 " buffer object names in "
18118 (var "buffers")
18119 ".
18120 There is no guarantee that the names form a contiguous set of integers;
18121 however, it is guaranteed that none of the returned names was in use
18122 immediately before the call to "
18123 (code "glGenBuffers")
18124 ". ")
18125 (para "
18126 Buffer object names returned by a call to "
18127 (code "glGenBuffers")
18128 " are not returned by
18129 subsequent calls, unless they are first deleted with "
18130 (code "glDeleteBuffers")
18131 ". ")
18132 (para "
18133 No buffer objects are associated with the returned buffer object names until they are first bound by calling "
18134 (code "glBindBuffer")
18135 ". ")
18136 (heading "Errors")
18137 (para (code "GL_INVALID_VALUE")
18138 " is generated if "
18139 (var "n")
18140 " is negative. ")
18141 (para (code "GL_INVALID_OPERATION")
18142 " is generated if "
18143 (code "glGenBuffers")
18144 " is executed
18145 between the execution of "
18146 (code "glBegin")
18147 " and the corresponding
18148 execution of "
18149 (code "glEnd")
18150 ". ")))
18151
18152 (define-gl-procedure
18153 glGenLists
18154 "glGenLists"
18155 (funcsynopsis
18156 (funcprototype
18157 (funcdef "GLuint " (function "glGenLists"))
18158 (paramdef "GLsizei " (parameter "range"))))
18159 '(*fragment*
18160 (heading
18161 "generate a contiguous set of empty display lists")
18162 (heading "Parameters")
18163 (table (% (formatter (asis)))
18164 (entry (% (heading (var "range")))
18165 (para "
18166 Specifies the number of contiguous empty display lists
18167 to be generated. ")))
18168 (heading "Description")
18169 (para (code "glGenLists")
18170 " has one argument, "
18171 (var "range")
18172 ".
18173 It returns an integer "
18174 (var "n")
18175 " such that "
18176 (var "range")
18177 " contiguous
18178 empty display lists,
18179 named "
18180 (math (var "n"))
18181 ", "
18182 (math (var "n") "+" "1")
18183 ", "
18184 (math (var "..."))
18185 ", "
18186 (math (var "n") "+" (var "range") "-" "1")
18187 ",
18188 are created.
18189 If "
18190 (var "range")
18191 " is 0,
18192 if there is no group of "
18193 (var "range")
18194 " contiguous names available,
18195 or if any error is generated,
18196 no display lists are generated,
18197 and 0 is returned. ")
18198 (heading "Errors")
18199 (para (code "GL_INVALID_VALUE")
18200 " is generated if "
18201 (var "range")
18202 " is negative. ")
18203 (para (code "GL_INVALID_OPERATION")
18204 " is generated if "
18205 (code "glGenLists")
18206 "
18207 is executed between the execution of "
18208 (code "glBegin")
18209 "
18210 and the corresponding execution of "
18211 (code "glEnd")
18212 ". ")))
18213
18214 (define-gl-procedure
18215 glGenQueries
18216 "glGenQueries"
18217 (funcsynopsis
18218 (funcprototype
18219 (funcdef "void " (function "glGenQueries"))
18220 (paramdef "GLsizei " (parameter "n"))
18221 (paramdef "GLuint * " (parameter "ids"))))
18222 '(*fragment*
18223 (heading "generate query object names")
18224 (heading "Parameters")
18225 (table (% (formatter (asis)))
18226 (entry (% (heading (var "n")))
18227 (para "
18228 Specifies the number of query object names to be generated. "))
18229 (entry (% (heading (var "ids")))
18230 (para "
18231 Specifies an array in which the generated query object names are stored. ")))
18232 (heading "Description")
18233 (para (code "glGenQueries")
18234 " returns "
18235 (var "n")
18236 " query object names in "
18237 (var "ids")
18238 ".
18239 There is no guarantee that the names form a contiguous set of integers;
18240 however, it is guaranteed that none of the returned names was in use
18241 immediately before the call to "
18242 (code "glGenQueries")
18243 ". ")
18244 (para "
18245 Query object names returned by a call to "
18246 (code "glGenQueries")
18247 " are not returned by
18248 subsequent calls, unless they are first deleted with "
18249 (code "glDeleteQueries")
18250 ". ")
18251 (para "
18252 No query objects are associated with the returned query object names until they are first used by calling "
18253 (code "glBeginQuery")
18254 ". ")
18255 (heading "Errors")
18256 (para (code "GL_INVALID_VALUE")
18257 " is generated if "
18258 (var "n")
18259 " is negative. ")
18260 (para (code "GL_INVALID_OPERATION")
18261 " is generated if "
18262 (code "glGenQueries")
18263 " is executed
18264 between the execution of "
18265 (code "glBegin")
18266 " and the corresponding
18267 execution of "
18268 (code "glEnd")
18269 ". ")))
18270
18271 (define-gl-procedure
18272 glGenTextures
18273 "glGenTextures"
18274 (funcsynopsis
18275 (funcprototype
18276 (funcdef "void " (function "glGenTextures"))
18277 (paramdef "GLsizei " (parameter "n"))
18278 (paramdef "GLuint * " (parameter "textures"))))
18279 '(*fragment*
18280 (heading "generate texture names")
18281 (heading "Parameters")
18282 (table (% (formatter (asis)))
18283 (entry (% (heading (var "n")))
18284 (para "
18285 Specifies the number of texture names to be generated. "))
18286 (entry (% (heading (var "textures")))
18287 (para "
18288 Specifies an array in which the generated texture names are stored. ")))
18289 (heading "Description")
18290 (para (code "glGenTextures")
18291 " returns "
18292 (var "n")
18293 " texture names in "
18294 (var "textures")
18295 ".
18296 There is no guarantee that the names form a contiguous set of integers;
18297 however, it is guaranteed that none of the returned names was in use
18298 immediately before the call to "
18299 (code "glGenTextures")
18300 ". ")
18301 (para "
18302 The generated textures have no dimensionality; they assume the dimensionality
18303 of the texture target to which they are first bound
18304 (see "
18305 (code "glBindTexture")
18306 "). ")
18307 (para "
18308 Texture names returned by a call to "
18309 (code "glGenTextures")
18310 " are not returned by
18311 subsequent calls, unless they are first deleted with "
18312 (code "glDeleteTextures")
18313 ". ")
18314 (heading "Errors")
18315 (para (code "GL_INVALID_VALUE")
18316 " is generated if "
18317 (var "n")
18318 " is negative. ")
18319 (para (code "GL_INVALID_OPERATION")
18320 " is generated if "
18321 (code "glGenTextures")
18322 " is executed
18323 between the execution of "
18324 (code "glBegin")
18325 " and the corresponding
18326 execution of "
18327 (code "glEnd")
18328 ". ")))
18329
18330 (define-gl-procedure
18331 glGetActiveAttrib
18332 "glGetActiveAttrib"
18333 (funcsynopsis
18334 (funcprototype
18335 (funcdef "void " (function "glGetActiveAttrib"))
18336 (paramdef "GLuint " (parameter "program"))
18337 (paramdef "GLuint " (parameter "index"))
18338 (paramdef "GLsizei " (parameter "bufSize"))
18339 (paramdef "GLsizei *" (parameter "length"))
18340 (paramdef "GLint *" (parameter "size"))
18341 (paramdef "GLenum *" (parameter "type"))
18342 (paramdef "GLchar *" (parameter "name"))))
18343 '(*fragment*
18344 (heading
18345 "Returns information about an active attribute variable for the specified program object")
18346 (heading "Parameters")
18347 (table (% (formatter (asis)))
18348 (entry (% (heading (var "program")))
18349 (para "Specifies the program object to be
18350 \t\t queried."))
18351 (entry (% (heading (var "index")))
18352 (para "Specifies the index of the attribute variable
18353 \t\t to be queried."))
18354 (entry (% (heading (var "bufSize")))
18355 (para "Specifies the maximum number of characters
18356 \t\t OpenGL is allowed to write in the character buffer
18357 \t\t indicated by "
18358 (var "name")
18359 "."))
18360 (entry (% (heading (var "length")))
18361 (para "Returns the number of characters actually
18362 \t\t written by OpenGL in the string indicated by "
18363 (var "name")
18364 " (excluding the null
18365 \t\t terminator) if a value other than "
18366 (code "NULL")
18367 " is passed."))
18368 (entry (% (heading (var "size")))
18369 (para "Returns the size of the attribute
18370 \t\t variable."))
18371 (entry (% (heading (var "type")))
18372 (para "Returns the data type of the attribute
18373 \t\t variable."))
18374 (entry (% (heading (var "name")))
18375 (para "Returns a null terminated string containing
18376 \t\t the name of the attribute variable.")))
18377 (heading "Description")
18378 (para (code "glGetActiveAttrib")
18379 " returns information
18380 \tabout an active attribute variable in the program object
18381 \tspecified by "
18382 (var "program")
18383 ". The number of
18384 \tactive attributes can be obtained by calling\t"
18385 (code "glGetProgram")
18386 "
18387 with the value "
18388 (code "GL_ACTIVE_ATTRIBUTES")
18389 ". A
18390 \tvalue of 0 for "
18391 (var "index")
18392 " selects the first
18393 \tactive attribute variable. Permissible values for\t"
18394 (var "index")
18395 " range from 0 to the number of
18396 \tactive attribute variables minus 1.")
18397 (para "A vertex shader may use either built-in attribute
18398 \tvariables, user-defined attribute variables, or both. Built-in
18399 \tattribute variables have a prefix of \"gl_\" and
18400 \treference conventional OpenGL vertex attribtes (e.g.,\t"
18401 (var "gl_Vertex")
18402 ",\t"
18403 (var "gl_Normal")
18404 ", etc., see the OpenGL Shading
18405 \tLanguage specification for a complete list.) User-defined
18406 \tattribute variables have arbitrary names and obtain their values
18407 \tthrough numbered generic vertex attributes. An attribute
18408 \tvariable (either built-in or user-defined) is considered active
18409 \tif it is determined during the link operation that it may be
18410 \taccessed during program execution. Therefore,\t"
18411 (var "program")
18412 " should have previously been the
18413 \ttarget of a call to\t"
18414 (code "glLinkProgram")
18415 ",
18416 \tbut it is not necessary for it to have been linked
18417 \tsuccessfully.")
18418 (para "The size of the character buffer required to store the
18419 \tlongest attribute variable name in\t"
18420 (var "program")
18421 " can be obtained by calling\t"
18422 (code "glGetProgram")
18423 "
18424 with the value\t"
18425 (code "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH")
18426 ". This value
18427 \tshould be used to allocate a buffer of sufficient size to store
18428 \tthe returned attribute name. The size of this character buffer
18429 \tis passed in "
18430 (var "bufSize")
18431 ", and a pointer to
18432 \tthis character buffer is passed in\t"
18433 (var "name")
18434 ".")
18435 (para (code "glGetActiveAttrib")
18436 " returns the name of
18437 \tthe attribute variable indicated by\t"
18438 (var "index")
18439 ", storing it in the character buffer
18440 \tspecified by "
18441 (var "name")
18442 ". The string returned
18443 \twill be null terminated. The actual number of characters written
18444 \tinto this buffer is returned in "
18445 (var "length")
18446 ",
18447 \tand this count does not include the null termination character.
18448 \tIf the length of the returned string is not required, a value of\t"
18449 (code "NULL")
18450 " can be passed in the\t"
18451 (var "length")
18452 " argument.")
18453 (para "The "
18454 (var "type")
18455 " argument will return a
18456 \tpointer to the attribute variable's data type. The symbolic
18457 \tconstants "
18458 (code "GL_FLOAT")
18459 ",\t"
18460 (code "GL_FLOAT_VEC2")
18461 ",\t"
18462 (code "GL_FLOAT_VEC3")
18463 ",\t"
18464 (code "GL_FLOAT_VEC4")
18465 ",\t"
18466 (code "GL_FLOAT_MAT2")
18467 ",\t"
18468 (code "GL_FLOAT_MAT3")
18469 ",\t"
18470 (code "GL_FLOAT_MAT4")
18471 ",\t"
18472 (code "GL_FLOAT_MAT2x3")
18473 ",\t"
18474 (code "GL_FLOAT_MAT2x4")
18475 ",\t"
18476 (code "GL_FLOAT_MAT3x2")
18477 ",\t"
18478 (code "GL_FLOAT_MAT3x4")
18479 ",\t"
18480 (code "GL_FLOAT_MAT4x2")
18481 ", or\t"
18482 (code "GL_FLOAT_MAT4x3")
18483 " may be returned. The\t"
18484 (var "size")
18485 " argument will return the size of the
18486 \tattribute, in units of the type returned in\t"
18487 (var "type")
18488 ".")
18489 (para "The list of active attribute variables may include both
18490 \tbuilt-in attribute variables (which begin with the prefix
18491 \t\"gl_\") as well as user-defined attribute variable
18492 \tnames.")
18493 (para "This function will return as much information as it can
18494 \tabout the specified active attribute variable. If no information
18495 \tis available, "
18496 (var "length")
18497 " will be 0, and\t"
18498 (var "name")
18499 " will be an empty string. This
18500 \tsituation could occur if this function is called after a link
18501 \toperation that failed. If an error occurs, the return values\t"
18502 (var "length")
18503 ", "
18504 (var "size")
18505 ",\t"
18506 (var "type")
18507 ", and "
18508 (var "name")
18509 "
18510 will be unmodified.")
18511 (heading "Errors")
18512 (para (code "GL_INVALID_VALUE")
18513 " is generated if\t"
18514 (var "program")
18515 " is not a value generated by
18516 \tOpenGL.")
18517 (para (code "GL_INVALID_OPERATION")
18518 " is generated if\t"
18519 (var "program")
18520 " is not a program object.")
18521 (para (code "GL_INVALID_VALUE")
18522 " is generated if\t"
18523 (var "index")
18524 " is greater than or equal to the
18525 \tnumber of active attribute variables in\t"
18526 (var "program")
18527 ".")
18528 (para (code "GL_INVALID_OPERATION")
18529 " is generated if\t"
18530 (code "glGetActiveAttrib")
18531 " is executed between the
18532 \texecution of\t"
18533 (code "glBegin")
18534 "
18535 and the corresponding execution of\t"
18536 (code "glEnd")
18537 ".")
18538 (para (code "GL_INVALID_VALUE")
18539 " is generated if\t"
18540 (var "bufSize")
18541 " is less than 0.")))
18542
18543 (define-gl-procedure
18544 glGetActiveUniform
18545 "glGetActiveUniform"
18546 (funcsynopsis
18547 (funcprototype
18548 (funcdef "void " (function "glGetActiveUniform"))
18549 (paramdef "GLuint " (parameter "program"))
18550 (paramdef "GLuint " (parameter "index"))
18551 (paramdef "GLsizei " (parameter "bufSize"))
18552 (paramdef "GLsizei *" (parameter "length"))
18553 (paramdef "GLint *" (parameter "size"))
18554 (paramdef "GLenum *" (parameter "type"))
18555 (paramdef "GLchar *" (parameter "name"))))
18556 '(*fragment*
18557 (heading
18558 "Returns information about an active uniform variable for the specified program object")
18559 (heading "Parameters")
18560 (table (% (formatter (asis)))
18561 (entry (% (heading (var "program")))
18562 (para "Specifies the program object to be
18563 \t\t queried."))
18564 (entry (% (heading (var "index")))
18565 (para "Specifies the index of the uniform variable to
18566 \t\t be queried."))
18567 (entry (% (heading (var "bufSize")))
18568 (para "Specifies the maximum number of characters
18569 \t\t OpenGL is allowed to write in the character buffer
18570 \t\t indicated by "
18571 (var "name")
18572 "."))
18573 (entry (% (heading (var "length")))
18574 (para "Returns the number of characters actually
18575 \t\t written by OpenGL in the string indicated by "
18576 (var "name")
18577 " (excluding the null
18578 \t\t terminator) if a value other than "
18579 (code "NULL")
18580 " is passed."))
18581 (entry (% (heading (var "size")))
18582 (para "Returns the size of the uniform
18583 \t\t variable."))
18584 (entry (% (heading (var "type")))
18585 (para "Returns the data type of the uniform
18586 \t\t variable."))
18587 (entry (% (heading (var "name")))
18588 (para "Returns a null terminated string containing
18589 \t\t the name of the uniform variable.")))
18590 (heading "Description")
18591 (para (code "glGetActiveUniform")
18592 " returns
18593 \tinformation about an active uniform variable in the program
18594 \tobject specified by "
18595 (var "program")
18596 ". The number
18597 \tof active uniform variables can be obtained by calling\t"
18598 (code "glGetProgram")
18599 "
18600 with the value "
18601 (code "GL_ACTIVE_UNIFORMS")
18602 ". A value
18603 \tof 0 for "
18604 (var "index")
18605 " selects the first active
18606 \tuniform variable. Permissible values for\t"
18607 (var "index")
18608 " range from 0 to the number of
18609 \tactive uniform variables minus 1.")
18610 (para "Shaders may use either built-in uniform variables,
18611 \tuser-defined uniform variables, or both. Built-in uniform
18612 \tvariables have a prefix of \"gl_\" and reference
18613 \texisting OpenGL state or values derived from such state (e.g.,\t"
18614 (var "gl_Fog")
18615 ",\t"
18616 (var "gl_ModelViewMatrix")
18617 ", etc., see the OpenGL
18618 \tShading Language specification for a complete list.)
18619 \tUser-defined uniform variables have arbitrary names and obtain
18620 \ttheir values from the application through calls to\t"
18621 (code "glUniform")
18622 ".
18623 \tA uniform variable (either built-in or user-defined) is
18624 \tconsidered active if it is determined during the link operation
18625 \tthat it may be accessed during program execution. Therefore,\t"
18626 (var "program")
18627 " should have previously been the
18628 \ttarget of a call to\t"
18629 (code "glLinkProgram")
18630 ",
18631 \tbut it is not necessary for it to have been linked
18632 \tsuccessfully.")
18633 (para "The size of the character buffer required to store the
18634 \tlongest uniform variable name in "
18635 (var "program")
18636 "
18637 can be obtained by calling\t"
18638 (code "glGetProgram")
18639 "
18640 with the value\t"
18641 (code "GL_ACTIVE_UNIFORM_MAX_LENGTH")
18642 ". This value
18643 \tshould be used to allocate a buffer of sufficient size to store
18644 \tthe returned uniform variable name. The size of this character
18645 \tbuffer is passed in "
18646 (var "bufSize")
18647 ", and a
18648 \tpointer to this character buffer is passed in\t"
18649 (var "name."))
18650 (para (code "glGetActiveUniform")
18651 " returns the name
18652 \tof the uniform variable indicated by\t"
18653 (var "index")
18654 ", storing it in the character buffer
18655 \tspecified by "
18656 (var "name")
18657 ". The string returned
18658 \twill be null terminated. The actual number of characters written
18659 \tinto this buffer is returned in "
18660 (var "length")
18661 ",
18662 \tand this count does not include the null termination character.
18663 \tIf the length of the returned string is not required, a value of\t"
18664 (code "NULL")
18665 " can be passed in the\t"
18666 (var "length")
18667 " argument.")
18668 (para "The "
18669 (var "type")
18670 "
18671 argument will return a pointer to the uniform variable's data
18672 \ttype. The symbolic constants\t"
18673 (code "GL_FLOAT")
18674 ",\t"
18675 (code "GL_FLOAT_VEC2")
18676 ",\t"
18677 (code "GL_FLOAT_VEC3")
18678 ",\t"
18679 (code "GL_FLOAT_VEC4")
18680 ",\t"
18681 (code "GL_INT")
18682 ",\t"
18683 (code "GL_INT_VEC2")
18684 ",\t"
18685 (code "GL_INT_VEC3")
18686 ",\t"
18687 (code "GL_INT_VEC4")
18688 ",\t"
18689 (code "GL_BOOL")
18690 ",\t"
18691 (code "GL_BOOL_VEC2")
18692 ",\t"
18693 (code "GL_BOOL_VEC3")
18694 ",\t"
18695 (code "GL_BOOL_VEC4")
18696 ",\t"
18697 (code "GL_FLOAT_MAT2")
18698 ",\t"
18699 (code "GL_FLOAT_MAT3")
18700 ",\t"
18701 (code "GL_FLOAT_MAT4")
18702 ",\t"
18703 (code "GL_FLOAT_MAT2x3")
18704 ",\t"
18705 (code "GL_FLOAT_MAT2x4")
18706 ",\t"
18707 (code "GL_FLOAT_MAT3x2")
18708 ",\t"
18709 (code "GL_FLOAT_MAT3x4")
18710 ",\t"
18711 (code "GL_FLOAT_MAT4x2")
18712 ",\t"
18713 (code "GL_FLOAT_MAT4x3")
18714 ",\t"
18715 (code "GL_SAMPLER_1D")
18716 ",\t"
18717 (code "GL_SAMPLER_2D")
18718 ",\t"
18719 (code "GL_SAMPLER_3D")
18720 ",\t"
18721 (code "GL_SAMPLER_CUBE")
18722 ",\t"
18723 (code "GL_SAMPLER_1D_SHADOW")
18724 ", or\t"
18725 (code "GL_SAMPLER_2D_SHADOW")
18726 "
18727 may be returned.")
18728 (para "If one or more elements of an array are active, the name
18729 \tof the array is returned in "
18730 (var "name")
18731 ", the
18732 \ttype is returned in "
18733 (var "type")
18734 ", and the\t"
18735 (var "size")
18736 " parameter returns the highest array
18737 \telement index used, plus one, as determined by the compiler
18738 \tand/or linker. Only one active uniform variable will be reported
18739 \tfor a uniform array.")
18740 (para "Uniform variables that are declared as structures or
18741 \tarrays of structures will not be returned directly by this
18742 \tfunction. Instead, each of these uniform variables will be
18743 \treduced to its fundamental components containing the
18744 \t\".\" and \"[]\" operators such that each of the
18745 \tnames is valid as an argument to\t"
18746 (code "glGetUniformLocation")
18747 ".
18748 \tEach of these reduced uniform variables is counted as one active
18749 \tuniform variable and is assigned an index. A valid name cannot
18750 \tbe a structure, an array of structures, or a subcomponent of a
18751 \tvector or matrix.")
18752 (para "The size of the uniform variable will be returned in\t"
18753 (var "size")
18754 ". Uniform variables other than arrays
18755 \twill have a size of 1. Structures and arrays of structures will
18756 \tbe reduced as described earlier, such that each of the names
18757 \treturned will be a data type in the earlier list. If this
18758 \treduction results in an array, the size returned will be as
18759 \tdescribed for uniform arrays; otherwise, the size returned will
18760 \tbe 1.")
18761 (para "The list of active uniform variables may include both
18762 \tbuilt-in uniform variables (which begin with the prefix
18763 \t\"gl_\") as well as user-defined uniform variable
18764 \tnames.")
18765 (para "This function will return as much information as it can
18766 \tabout the specified active uniform variable. If no information
18767 \tis available, "
18768 (var "length")
18769 " will be 0, and\t"
18770 (var "name")
18771 " will be an empty string. This
18772 \tsituation could occur if this function is called after a link
18773 \toperation that failed. If an error occurs, the return values\t"
18774 (var "length")
18775 ", "
18776 (var "size")
18777 ",\t"
18778 (var "type")
18779 ", and "
18780 (var "name")
18781 "
18782 will be unmodified.")
18783 (heading "Errors")
18784 (para (code "GL_INVALID_VALUE")
18785 " is generated if\t"
18786 (var "program")
18787 " is not a value generated by
18788 \tOpenGL.")
18789 (para (code "GL_INVALID_OPERATION")
18790 " is generated if\t"
18791 (var "program")
18792 " is not a program object.")
18793 (para (code "GL_INVALID_VALUE")
18794 " is generated if\t"
18795 (var "index")
18796 " is greater than or equal to the
18797 \tnumber of active uniform variables in\t"
18798 (var "program")
18799 ".")
18800 (para (code "GL_INVALID_OPERATION")
18801 " is generated if\t"
18802 (code "glGetActiveUniform")
18803 " is executed between the
18804 \texecution of\t"
18805 (code "glBegin")
18806 "
18807 and the corresponding execution of\t"
18808 (code "glEnd")
18809 ".")
18810 (para (code "GL_INVALID_VALUE")
18811 " is generated if\t"
18812 (var "bufSize")
18813 " is less than 0.")))
18814
18815 (define-gl-procedure
18816 glGetAttachedShaders
18817 "glGetAttachedShaders"
18818 (funcsynopsis
18819 (funcprototype
18820 (funcdef
18821 "void "
18822 (function "glGetAttachedShaders"))
18823 (paramdef "GLuint " (parameter "program"))
18824 (paramdef "GLsizei " (parameter "maxCount"))
18825 (paramdef "GLsizei *" (parameter "count"))
18826 (paramdef "GLuint *" (parameter "shaders"))))
18827 '(*fragment*
18828 (heading
18829 "Returns the handles of the shader objects attached to a program object")
18830 (heading "Parameters")
18831 (table (% (formatter (asis)))
18832 (entry (% (heading (var "program")))
18833 (para "Specifies the program object to be
18834 \t\t queried."))
18835 (entry (% (heading (var "maxCount")))
18836 (para "Specifies the size of the array for storing
18837 \t\t the returned object names."))
18838 (entry (% (heading (var "count")))
18839 (para "Returns the number of names actually returned
18840 \t\t in "
18841 (var "objects")
18842 "."))
18843 (entry (% (heading (var "shaders")))
18844 (para "Specifies an array that is used to return the
18845 \t\t names of attached shader objects.")))
18846 (heading "Description")
18847 (para (code "glGetAttachedShaders")
18848 " returns the
18849 \tnames of the shader objects attached to\t"
18850 (var "program")
18851 ". The names of shader objects that
18852 \tare attached to "
18853 (var "program")
18854 " will be returned
18855 \tin "
18856 (var "shaders.")
18857 " The actual number of shader
18858 \tnames written into "
18859 (var "shaders")
18860 " is returned in\t"
18861 (var "count.")
18862 " If no shader objects are attached
18863 \tto "
18864 (var "program")
18865 ", "
18866 (var "count")
18867 "
18868 is set to 0. The maximum number of shader names that may be
18869 \treturned in "
18870 (var "shaders")
18871 " is specified by\t"
18872 (var "maxCount")
18873 ". ")
18874 (para "If the number of names actually returned is not required
18875 \t(for instance, if it has just been obtained by calling\t"
18876 (code "glGetProgram")
18877 "),
18878 \ta value of "
18879 (code "NULL")
18880 " may be passed for count. If
18881 \tno shader objects are attached to\t"
18882 (var "program")
18883 ", a value of 0 will be returned in\t"
18884 (var "count")
18885 ". The actual number of attached
18886 \tshaders can be obtained by calling\t"
18887 (code "glGetProgram")
18888 "
18889 with the value "
18890 (code "GL_ATTACHED_SHADERS")
18891 ".")
18892 (heading "Errors")
18893 (para (code "GL_INVALID_VALUE")
18894 " is generated if\t"
18895 (var "program")
18896 " is not a value generated by
18897 \tOpenGL.")
18898 (para (code "GL_INVALID_OPERATION")
18899 " is generated if\t"
18900 (var "program")
18901 " is not a program object.")
18902 (para (code "GL_INVALID_VALUE")
18903 " is generated if\t"
18904 (var "maxCount")
18905 " is less than 0.")
18906 (para (code "GL_INVALID_OPERATION")
18907 " is generated if\t"
18908 (code "glGetAttachedShaders")
18909 "
18910 is executed between the execution of\t"
18911 (code "glBegin")
18912 "
18913 and the corresponding execution of\t"
18914 (code "glEnd")
18915 ".")))
18916
18917 (define-gl-procedure
18918 glGetAttribLocation
18919 "glGetAttribLocation"
18920 (funcsynopsis
18921 (funcprototype
18922 (funcdef
18923 "GLint "
18924 (function "glGetAttribLocation"))
18925 (paramdef "GLuint " (parameter "program"))
18926 (paramdef "const GLchar *" (parameter "name"))))
18927 '(*fragment*
18928 (heading
18929 "Returns the location of an attribute variable")
18930 (heading "Parameters")
18931 (table (% (formatter (asis)))
18932 (entry (% (heading (var "program")))
18933 (para "Specifies the program object to be
18934 \t\t queried."))
18935 (entry (% (heading (var "name")))
18936 (para "Points to a null terminated string containing
18937 \t\t the name of the attribute variable whose location is
18938 \t\t to be queried.")))
18939 (heading "Description")
18940 (para (code "glGetAttribLocation")
18941 " queries the
18942 \tpreviously linked program object specified by\t"
18943 (var "program")
18944 " for the attribute variable
18945 \tspecified by "
18946 (var "name")
18947 " and returns the index
18948 \tof the generic vertex attribute that is bound to that attribute
18949 \tvariable. If "
18950 (var "name")
18951 " is a matrix attribute
18952 \tvariable, the index of the first column of the matrix is
18953 \treturned. If the named attribute variable is not an active
18954 \tattribute in the specified program object or if\t"
18955 (var "name")
18956 " starts with the reserved prefix
18957 \t\"gl_\", a value of -1 is returned.")
18958 (para "The association between an attribute variable name and a
18959 \tgeneric attribute index can be specified at any time by calling\t"
18960 (code "glBindAttribLocation")
18961 ".
18962 \tAttribute bindings do not go into effect until\t"
18963 (code "glLinkProgram")
18964 "
18965 is called. After a program object has been linked successfully,
18966 \tthe index values for attribute variables remain fixed until the
18967 \tnext link command occurs. The attribute values can only be
18968 \tqueried after a link if the link was successful.\t"
18969 (code "glGetAttribLocation")
18970 " returns the binding
18971 \tthat actually went into effect the last time\t"
18972 (code "glLinkProgram")
18973 "
18974 was called for the specified program object. Attribute bindings
18975 \tthat have been specified since the last link operation are not
18976 \treturned by "
18977 (code "glGetAttribLocation")
18978 ".")
18979 (heading "Errors")
18980 (para (code "GL_INVALID_OPERATION")
18981 " is generated if\t"
18982 (var "program")
18983 " is not a value generated by
18984 \tOpenGL.")
18985 (para (code "GL_INVALID_OPERATION")
18986 " is generated if\t"
18987 (var "program")
18988 " is not a program object.")
18989 (para (code "GL_INVALID_OPERATION")
18990 " is generated if\t"
18991 (var "program")
18992 " has not been successfully
18993 \tlinked.")
18994 (para (code "GL_INVALID_OPERATION")
18995 " is generated if\t"
18996 (code "glGetAttribLocation")
18997 " is executed between the
18998 \texecution of\t"
18999 (code "glBegin")
19000 "
19001 and the corresponding execution of\t"
19002 (code "glEnd")
19003 ".")))
19004
19005 (define-gl-procedure
19006 glGetBufferParameteriv
19007 "glGetBufferParameteriv"
19008 (funcsynopsis
19009 (funcprototype
19010 (funcdef
19011 "void "
19012 (function "glGetBufferParameteriv"))
19013 (paramdef "GLenum " (parameter "target"))
19014 (paramdef "GLenum " (parameter "value"))
19015 (paramdef "GLint * " (parameter "data"))))
19016 '(*fragment*
19017 (heading "return parameters of a buffer object")
19018 (heading "Parameters")
19019 (table (% (formatter (asis)))
19020 (entry (% (heading (var "target")))
19021 (para "
19022 Specifies the target buffer object.
19023 The symbolic constant must be "
19024 (code "GL_ARRAY_BUFFER")
19025 ", "
19026 (code "GL_ELEMENT_ARRAY_BUFFER")
19027 ", "
19028 (code "GL_PIXEL_PACK_BUFFER")
19029 ", or "
19030 (code "GL_PIXEL_UNPACK_BUFFER")
19031 ". "))
19032 (entry (% (heading (var "value")))
19033 (para "
19034 Specifies the symbolic name of a buffer object parameter.
19035 Accepted values are "
19036 (code "GL_BUFFER_ACCESS")
19037 ", "
19038 (code "GL_BUFFER_MAPPED")
19039 ", "
19040 (code "GL_BUFFER_SIZE")
19041 ", or "
19042 (code "GL_BUFFER_USAGE")
19043 ". "))
19044 (entry (% (heading (var "data")))
19045 (para "
19046 Returns the requested parameter. ")))
19047 (heading "Description")
19048 (para (code "glGetBufferParameteriv")
19049 " returns in "
19050 (var "data")
19051 " a selected parameter of the buffer object
19052 specified by "
19053 (var "target")
19054 ". ")
19055 (para (var "value")
19056 " names a specific buffer object parameter, as follows: ")
19057 (table (% (formatter (asis)))
19058 (entry (% (heading (code "GL_BUFFER_ACCESS")))
19059 (para (var "params")
19060 " returns the access policy set while mapping the buffer object.
19061 The initial value is "
19062 (code "GL_READ_WRITE")
19063 ". "))
19064 (entry (% (heading (code "GL_BUFFER_MAPPED")))
19065 (para (var "params")
19066 " returns a flag indicating whether the buffer object is currently
19067 mapped. The initial value is "
19068 (code "GL_FALSE")
19069 ". "))
19070 (entry (% (heading (code "GL_BUFFER_SIZE")))
19071 (para (var "params")
19072 " returns the size of the buffer object, measured in bytes.
19073 The initial value is 0. "))
19074 (entry (% (heading (code "GL_BUFFER_USAGE")))
19075 (para (var "params")
19076 " returns the buffer object's usage pattern. The initial value is "
19077 (code "GL_STATIC_DRAW")
19078 ". ")))
19079 (heading "Errors")
19080 (para (code "GL_INVALID_ENUM")
19081 " is generated if "
19082 (var "target")
19083 " or "
19084 (var "value")
19085 " is not an
19086 accepted value. ")
19087 (para (code "GL_INVALID_OPERATION")
19088 " is generated if the reserved buffer object name 0 is bound to "
19089 (var "target")
19090 ". ")
19091 (para (code "GL_INVALID_OPERATION")
19092 " is generated if "
19093 (code "glGetBufferParameteriv")
19094 "
19095 is executed between the execution of "
19096 (code "glBegin")
19097 "
19098 and the corresponding execution of "
19099 (code "glEnd")
19100 ". ")))
19101
19102 (define-gl-procedure
19103 glGetBufferPointerv
19104 "glGetBufferPointerv"
19105 (funcsynopsis
19106 (funcprototype
19107 (funcdef
19108 "void "
19109 (function "glGetBufferPointerv"))
19110 (paramdef "GLenum " (parameter "target"))
19111 (paramdef "GLenum " (parameter "pname"))
19112 (paramdef "GLvoid ** " (parameter "params"))))
19113 '(*fragment*
19114 (heading
19115 "return the pointer to a mapped buffer object's data store")
19116 (heading "Parameters")
19117 (table (% (formatter (asis)))
19118 (entry (% (heading (var "target")))
19119 (para "
19120 Specifies the target buffer object.
19121 The symbolic constant must be "
19122 (code "GL_ARRAY_BUFFER")
19123 ", "
19124 (code "GL_ELEMENT_ARRAY_BUFFER")
19125 ", "
19126 (code "GL_PIXEL_PACK_BUFFER")
19127 ", or "
19128 (code "GL_PIXEL_UNPACK_BUFFER")
19129 ". "))
19130 (entry (% (heading (var "pname")))
19131 (para "
19132 Specifies the pointer to be returned. The symbolic constant must be "
19133 (code "GL_BUFFER_MAP_POINTER")
19134 ". "))
19135 (entry (% (heading (var "params")))
19136 (para "
19137 Returns the pointer value specified by "
19138 (var "pname")
19139 ". ")))
19140 (heading "Description")
19141 (para (code "glGetBufferPointerv")
19142 " returns pointer information. "
19143 (var "pname")
19144 " is a symbolic constant
19145 indicating the pointer to be returned, which must be "
19146 (code "GL_BUFFER_MAP_POINTER")
19147 ", the pointer
19148 to which the buffer object's data store is mapped. If the data store is not currently mapped, "
19149 (code "NULL")
19150 " is returned. "
19151 (var "params")
19152 " is a pointer to a location in which to place the returned pointer value. ")
19153 (heading "Errors")
19154 (para (code "GL_INVALID_ENUM")
19155 " is generated if "
19156 (var "target")
19157 " or "
19158 (var "pname")
19159 " is not an
19160 accepted value. ")
19161 (para (code "GL_INVALID_OPERATION")
19162 " is generated if the reserved buffer object name 0 is bound to "
19163 (var "target")
19164 ". ")
19165 (para (code "GL_INVALID_OPERATION")
19166 " is generated if "
19167 (code "glGetBufferPointerv")
19168 "
19169 is executed between the execution of "
19170 (code "glBegin")
19171 "
19172 and the corresponding execution of "
19173 (code "glEnd")
19174 ". ")))
19175
19176 (define-gl-procedure
19177 glGetBufferSubData
19178 "glGetBufferSubData"
19179 (funcsynopsis
19180 (funcprototype
19181 (funcdef "void " (function "glGetBufferSubData"))
19182 (paramdef "GLenum " (parameter "target"))
19183 (paramdef "GLintptr " (parameter "offset"))
19184 (paramdef "GLsizeiptr " (parameter "size"))
19185 (paramdef "GLvoid * " (parameter "data"))))
19186 '(*fragment*
19187 (heading
19188 "returns a subset of a buffer object's data store")
19189 (heading "Parameters")
19190 (table (% (formatter (asis)))
19191 (entry (% (heading (var "target")))
19192 (para "
19193 Specifies the target buffer object.
19194 The symbolic constant must be "
19195 (code "GL_ARRAY_BUFFER")
19196 ", "
19197 (code "GL_ELEMENT_ARRAY_BUFFER")
19198 ", "
19199 (code "GL_PIXEL_PACK_BUFFER")
19200 ", or "
19201 (code "GL_PIXEL_UNPACK_BUFFER")
19202 ". "))
19203 (entry (% (heading (var "offset")))
19204 (para "
19205 Specifies the offset into the buffer object's data store from which data will be returned,
19206 measured in bytes. "))
19207 (entry (% (heading (var "size")))
19208 (para "
19209 Specifies the size in bytes of the data store region being returned. "))
19210 (entry (% (heading (var "data")))
19211 (para "
19212 Specifies a pointer to the location where buffer object data is returned. ")))
19213 (heading "Description")
19214 (para (code "glGetBufferSubData")
19215 " returns some or all of the data from the buffer object currently
19216 bound to "
19217 (var "target")
19218 ". Data starting at byte offset "
19219 (var "offset")
19220 " and
19221 extending for "
19222 (var "size")
19223 " bytes is copied from the data store to the memory pointed to by "
19224 (var "data")
19225 ". An error is thrown if the buffer object is currently mapped, or if "
19226 (var "offset")
19227 " and "
19228 (var "size")
19229 " together define a range beyond the bounds
19230 of the buffer object's data store. ")
19231 (heading "Errors")
19232 (para (code "GL_INVALID_ENUM")
19233 " is generated if "
19234 (var "target")
19235 " is not "
19236 (code "GL_ARRAY_BUFFER")
19237 ", "
19238 (code "GL_ELEMENT_ARRAY_BUFFER")
19239 ", "
19240 (code "GL_PIXEL_PACK_BUFFER")
19241 ", or "
19242 (code "GL_PIXEL_UNPACK_BUFFER")
19243 ". ")
19244 (para (code "GL_INVALID_VALUE")
19245 " is generated if "
19246 (var "offset")
19247 " or "
19248 (var "size")
19249 " is negative, or if together they define a region of memory
19250 that extends beyond the buffer object's allocated data store. ")
19251 (para (code "GL_INVALID_OPERATION")
19252 " is generated if the reserved buffer object name 0 is bound to "
19253 (var "target")
19254 ". ")
19255 (para (code "GL_INVALID_OPERATION")
19256 " is generated if the buffer object being queried is mapped. ")
19257 (para (code "GL_INVALID_OPERATION")
19258 " is generated if "
19259 (code "glGetBufferSubData")
19260 "
19261 is executed between the execution of "
19262 (code "glBegin")
19263 " and the corresponding execution of "
19264 (code "glEnd")
19265 ". ")))
19266
19267 (define-gl-procedure
19268 glGetClipPlane
19269 "glGetClipPlane"
19270 (funcsynopsis
19271 (funcprototype
19272 (funcdef "void " (function "glGetClipPlane"))
19273 (paramdef "GLenum " (parameter "plane"))
19274 (paramdef "GLdouble * " (parameter "equation"))))
19275 '(*fragment*
19276 (heading
19277 "return the coefficients of the specified clipping plane")
19278 (heading "Parameters")
19279 (table (% (formatter (asis)))
19280 (entry (% (heading (var "plane")))
19281 (para "
19282 Specifies a clipping plane.
19283 The number of clipping planes depends on the implementation,
19284 but at least six clipping planes are supported.
19285 They are identified by symbolic names of the form "
19286 (code "GL_CLIP_PLANE")
19287 (math (var "i"))
19288 "
19289 where i ranges from 0 to the value of "
19290 (code "GL_MAX_CLIP_PLANES")
19291 " - 1. "))
19292 (entry (% (heading (var "equation")))
19293 (para "
19294 Returns four double-precision values that are the coefficients of the plane equation of "
19295 (var "plane")
19296 " in eye coordinates.
19297 The initial value is (0, 0, 0, 0). ")))
19298 (heading "Description")
19299 (para (code "glGetClipPlane")
19300 " returns in "
19301 (var "equation")
19302 " the four coefficients of the plane equation
19303 for "
19304 (var "plane")
19305 ". ")
19306 (heading "Errors")
19307 (para (code "GL_INVALID_ENUM")
19308 " is generated if "
19309 (var "plane")
19310 " is not an accepted value. ")
19311 (para (code "GL_INVALID_OPERATION")
19312 " is generated if "
19313 (code "glGetClipPlane")
19314 "
19315 is executed between the execution of "
19316 (code "glBegin")
19317 "
19318 and the corresponding execution of "
19319 (code "glEnd")
19320 ". ")))
19321
19322 (define-gl-procedure
19323 glGetColorTableParameter
19324 "glGetColorTableParameter"
19325 (funcsynopsis
19326 (funcprototype
19327 (funcdef
19328 "void "
19329 (function "glGetColorTableParameterfv"))
19330 (paramdef "GLenum " (parameter "target"))
19331 (paramdef "GLenum " (parameter "pname"))
19332 (paramdef "GLfloat * " (parameter "params"))))
19333 '(*fragment*
19334 (heading "get color lookup table parameters")
19335 (heading "Parameters")
19336 (table (% (formatter (asis)))
19337 (entry (% (heading (var "target")))
19338 (para "
19339 The target color table.
19340 Must be "
19341 (code "GL_COLOR_TABLE")
19342 ", "
19343 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
19344 ", "
19345 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
19346 ", "
19347 (code "GL_PROXY_COLOR_TABLE")
19348 ", "
19349 (code "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE")
19350 ", or "
19351 (code "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE")
19352 ". "))
19353 (entry (% (heading (var "pname")))
19354 (para "
19355 The symbolic name of a color lookup table parameter.
19356 Must be one of "
19357 (code "GL_COLOR_TABLE_BIAS")
19358 ", "
19359 (code "GL_COLOR_TABLE_SCALE")
19360 ", "
19361 (code "GL_COLOR_TABLE_FORMAT")
19362 ", "
19363 (code "GL_COLOR_TABLE_WIDTH")
19364 ", "
19365 (code "GL_COLOR_TABLE_RED_SIZE")
19366 ", "
19367 (code "GL_COLOR_TABLE_GREEN_SIZE")
19368 ", "
19369 (code "GL_COLOR_TABLE_BLUE_SIZE")
19370 ", "
19371 (code "GL_COLOR_TABLE_ALPHA_SIZE")
19372 ", "
19373 (code "GL_COLOR_TABLE_LUMINANCE_SIZE")
19374 ", or "
19375 (code "GL_COLOR_TABLE_INTENSITY_SIZE")
19376 ". "))
19377 (entry (% (heading (var "params")))
19378 (para "
19379 A pointer to an array where the values of the parameter will be stored. ")))
19380 (heading "Description")
19381 (para "
19382 Returns parameters specific to color table "
19383 (var "target")
19384 ". ")
19385 (para "
19386 When "
19387 (var "pname")
19388 " is set to "
19389 (code "GL_COLOR_TABLE_SCALE")
19390 " or "
19391 (code "GL_COLOR_TABLE_BIAS")
19392 ", "
19393 (code "glGetColorTableParameter")
19394 " returns the color
19395 table scale or bias parameters for the table specified by "
19396 (var "target")
19397 ".
19398 For these queries, "
19399 (var "target")
19400 " must be set to "
19401 (code "GL_COLOR_TABLE")
19402 ", "
19403 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
19404 ",
19405 or "
19406 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
19407 " and "
19408 (var "params")
19409 " points to an array of four elements, which receive
19410 the scale or bias factors for red, green, blue, and alpha, in that order. ")
19411 (para (code "glGetColorTableParameter")
19412 " can also be used to retrieve the format and size parameters
19413 for a color table. For these queries, set "
19414 (var "target")
19415 " to either the
19416 color table target or the proxy color table target.
19417 The format and size parameters are set by "
19418 (code "glColorTable")
19419 ". ")
19420 (para "
19421 The following table lists the format and size parameters that may
19422 be queried.
19423 For each symbolic constant listed below for "
19424 (var "pname")
19425 ", "
19426 (var "params")
19427 " must point to an array of the
19428 given length and receive the values indicated. ")
19429 (para)
19430 (table (% (formatter (asis)))
19431 (entry (% (heading (strong "Parameter")))
19432 (para (strong "N") ", " (strong "Meaning")))
19433 (entry (% (heading (code "GL_COLOR_TABLE_FORMAT")))
19434 (para "
19435 1 "
19436 ", "
19437 "
19438 Internal format (e.g., "
19439 (code "GL_RGBA")
19440 ") "))
19441 (entry (% (heading (code "GL_COLOR_TABLE_WIDTH")))
19442 (para "
19443 1 " ", " "
19444 Number of elements in table "))
19445 (entry (% (heading (code "GL_COLOR_TABLE_RED_SIZE")))
19446 (para "
19447 1 "
19448 ", "
19449 "
19450 Size of red component, in bits "))
19451 (entry (% (heading (code "GL_COLOR_TABLE_GREEN_SIZE")))
19452 (para "
19453 1 " ", " "
19454 Size of green component "))
19455 (entry (% (heading (code "GL_COLOR_TABLE_BLUE_SIZE")))
19456 (para "
19457 1 " ", " "
19458 Size of blue component "))
19459 (entry (% (heading (code "GL_COLOR_TABLE_ALPHA_SIZE")))
19460 (para "
19461 1 " ", " "
19462 Size of alpha component "))
19463 (entry (% (heading (code "GL_COLOR_TABLE_LUMINANCE_SIZE")))
19464 (para "
19465 1 " ", " "
19466 Size of luminance component "))
19467 (entry (% (heading (code "GL_COLOR_TABLE_INTENSITY_SIZE")))
19468 (para "
19469 1 " ", " "
19470 Size of intensity component ")))
19471 (para)
19472 (heading "Errors")
19473 (para (code "GL_INVALID_ENUM")
19474 " is generated if "
19475 (var "target")
19476 " or "
19477 (var "pname")
19478 " is not
19479 an acceptable value. ")
19480 (para (code "GL_INVALID_OPERATION")
19481 " is generated if "
19482 (code "glGetColorTableParameter")
19483 " is executed
19484 between the execution of "
19485 (code "glBegin")
19486 " and the corresponding
19487 execution of "
19488 (code "glEnd")
19489 ". ")))
19490
19491 (define-gl-procedure
19492 glGetColorTable
19493 "glGetColorTable"
19494 (funcsynopsis
19495 (funcprototype
19496 (funcdef "void " (function "glGetColorTable"))
19497 (paramdef "GLenum " (parameter "target"))
19498 (paramdef "GLenum " (parameter "format"))
19499 (paramdef "GLenum " (parameter "type"))
19500 (paramdef "GLvoid * " (parameter "table"))))
19501 '(*fragment*
19502 (heading
19503 "retrieve contents of a color lookup table")
19504 (heading "Parameters")
19505 (table (% (formatter (asis)))
19506 (entry (% (heading (var "target")))
19507 (para "
19508 Must be "
19509 (code "GL_COLOR_TABLE")
19510 ", "
19511 (code "GL_POST_CONVOLUTION_COLOR_TABLE")
19512 ",
19513 or "
19514 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")
19515 ". "))
19516 (entry (% (heading (var "format")))
19517 (para "
19518 The format of the pixel data in "
19519 (var "table")
19520 ".
19521 The possible values are "
19522 (code "GL_RED")
19523 ", "
19524 (code "GL_GREEN")
19525 ", "
19526 (code "GL_BLUE")
19527 ", "
19528 (code "GL_ALPHA")
19529 ", "
19530 (code "GL_LUMINANCE")
19531 ", "
19532 (code "GL_LUMINANCE_ALPHA")
19533 ", "
19534 (code "GL_RGB")
19535 ", "
19536 (code "GL_BGR")
19537 ", "
19538 (code "GL_RGBA")
19539 ", and "
19540 (code "GL_BGRA")
19541 ". "))
19542 (entry (% (heading (var "type")))
19543 (para "
19544 The type of the pixel data in "
19545 (var "table")
19546 ".
19547 Symbolic constants "
19548 (code "GL_UNSIGNED_BYTE")
19549 ", "
19550 (code "GL_BYTE")
19551 ", "
19552 (code "GL_BITMAP")
19553 ", "
19554 (code "GL_UNSIGNED_SHORT")
19555 ", "
19556 (code "GL_SHORT")
19557 ", "
19558 (code "GL_UNSIGNED_INT")
19559 ", "
19560 (code "GL_INT")
19561 ", "
19562 (code "GL_FLOAT")
19563 ", "
19564 (code "GL_UNSIGNED_BYTE_3_3_2")
19565 ", "
19566 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
19567 ", "
19568 (code "GL_UNSIGNED_SHORT_5_6_5")
19569 ", "
19570 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
19571 ", "
19572 (code "GL_UNSIGNED_SHORT_4_4_4_4")
19573 ", "
19574 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
19575 ", "
19576 (code "GL_UNSIGNED_SHORT_5_5_5_1")
19577 ", "
19578 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
19579 ", "
19580 (code "GL_UNSIGNED_INT_8_8_8_8")
19581 ", "
19582 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
19583 ", "
19584 (code "GL_UNSIGNED_INT_10_10_10_2")
19585 ", and "
19586 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
19587 "
19588 are accepted. "))
19589 (entry (% (heading (var "table")))
19590 (para "
19591 Pointer to a one-dimensional array of pixel data containing the contents
19592 of the color table. ")))
19593 (heading "Description")
19594 (para (code "glGetColorTable")
19595 " returns in "
19596 (var "table")
19597 " the contents of the color table specified
19598 by "
19599 (var "target")
19600 ". No pixel transfer operations are performed, but pixel
19601 storage modes that are applicable to "
19602 (code "glReadPixels")
19603 " are performed. ")
19604 (para "
19605 If a non-zero named buffer object is bound to the "
19606 (code "GL_PIXEL_PACK_BUFFER")
19607 " target
19608 (see "
19609 (code "glBindBuffer")
19610 ") while a histogram table is
19611 requested, "
19612 (var "table")
19613 " is treated as a byte offset into the buffer object's data store. ")
19614 (para "
19615 Color components that are requested in
19616 the specified "
19617 (var "format")
19618 ", but which are not included in the internal
19619 format of the color lookup table, are returned as zero. The
19620 assignments of internal color components to the components
19621 requested by "
19622 (var "format")
19623 " are ")
19624 (table (% (formatter (asis)))
19625 (entry (% (heading (strong "Internal Component")))
19626 (para (strong "Resulting Component")))
19627 (entry (% (heading "
19628 Red ")) (para "
19629 Red "))
19630 (entry (% (heading "
19631 Green ")) (para "
19632 Green "))
19633 (entry (% (heading "
19634 Blue ")) (para "
19635 Blue "))
19636 (entry (% (heading "
19637 Alpha ")) (para "
19638 Alpha "))
19639 (entry (% (heading "
19640 Luminance "))
19641 (para "
19642 Red "))
19643 (entry (% (heading "
19644 Intensity "))
19645 (para "
19646 Red ")))
19647 (para)
19648 (heading "Errors")
19649 (para (code "GL_INVALID_ENUM")
19650 " is generated if "
19651 (var "target")
19652 " is not one of the allowable
19653 values. ")
19654 (para (code "GL_INVALID_ENUM")
19655 " is generated if "
19656 (var "format")
19657 " is not one of the allowable
19658 values. ")
19659 (para (code "GL_INVALID_ENUM")
19660 " is generated if "
19661 (var "type")
19662 " is not one of the allowable
19663 values. ")
19664 (para (code "GL_INVALID_OPERATION")
19665 " is generated if "
19666 (var "type")
19667 " is one of "
19668 (code "GL_UNSIGNED_BYTE_3_3_2")
19669 ", "
19670 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
19671 ", "
19672 (code "GL_UNSIGNED_SHORT_5_6_5")
19673 ", or "
19674 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
19675 "
19676 and "
19677 (var "format")
19678 " is not "
19679 (code "GL_RGB")
19680 ". ")
19681 (para (code "GL_INVALID_OPERATION")
19682 " is generated if "
19683 (var "type")
19684 " is one of "
19685 (code "GL_UNSIGNED_SHORT_4_4_4_4")
19686 ", "
19687 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
19688 ", "
19689 (code "GL_UNSIGNED_SHORT_5_5_5_1")
19690 ", "
19691 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
19692 ", "
19693 (code "GL_UNSIGNED_INT_8_8_8_8")
19694 ", "
19695 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
19696 ", "
19697 (code "GL_UNSIGNED_INT_10_10_10_2")
19698 ", or "
19699 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
19700 "
19701 and "
19702 (var "format")
19703 " is neither "
19704 (code "GL_RGBA")
19705 " nor "
19706 (code "GL_BGRA")
19707 ". ")
19708 (para (code "GL_INVALID_OPERATION")
19709 " is generated if a non-zero buffer object name is bound to the "
19710 (code "GL_PIXEL_PACK_BUFFER")
19711 " target and the buffer object's data store is currently mapped. ")
19712 (para (code "GL_INVALID_OPERATION")
19713 " is generated if a non-zero buffer object name is bound to the "
19714 (code "GL_PIXEL_PACK_BUFFER")
19715 " target and the data would be packed to the buffer
19716 object such that the memory writes required would exceed the data store size. ")
19717 (para (code "GL_INVALID_OPERATION")
19718 " is generated if a non-zero buffer object name is bound to the "
19719 (code "GL_PIXEL_PACK_BUFFER")
19720 " target and "
19721 (var "table")
19722 " is not evenly divisible
19723 into the number of bytes needed to store in memory a datum indicated by "
19724 (var "type")
19725 ". ")
19726 (para (code "GL_INVALID_OPERATION")
19727 " is generated if "
19728 (code "glGetColorTable")
19729 " is executed
19730 between the execution of "
19731 (code "glBegin")
19732 " and the corresponding
19733 execution of "
19734 (code "glEnd")
19735 ". ")))
19736
19737 (define-gl-procedure
19738 glGetCompressedTexImage
19739 "glGetCompressedTexImage"
19740 (funcsynopsis
19741 (funcprototype
19742 (funcdef
19743 "void "
19744 (function "glGetCompressedTexImage"))
19745 (paramdef "GLenum " (parameter "target"))
19746 (paramdef "GLint " (parameter "lod"))
19747 (paramdef "GLvoid * " (parameter "img"))))
19748 '(*fragment*
19749 (heading "return a compressed texture image")
19750 (heading "Parameters")
19751 (table (% (formatter (asis)))
19752 (entry (% (heading (var "target")))
19753 (para "
19754 Specifies which texture is to be obtained. "
19755 (code "GL_TEXTURE_1D")
19756 ", "
19757 (code "GL_TEXTURE_2D")
19758 ", and "
19759 (code "GL_TEXTURE_3D")
19760 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
19761 ", "
19762 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
19763 ", "
19764 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
19765 ", "
19766 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
19767 ", "
19768 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
19769 ", and "
19770 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
19771 "
19772 are accepted. "))
19773 (entry (% (heading (var "lod")))
19774 (para "
19775 Specifies the level-of-detail number of the desired image.
19776 Level 0 is the base image level.
19777 Level "
19778 (math (var "n"))
19779 "
19780 is the "
19781 (math (var "n"))
19782 "th
19783 mipmap reduction image. "))
19784 (entry (% (heading (var "img")))
19785 (para "
19786 Returns the compressed texture image. ")))
19787 (heading "Description")
19788 (para (code "glGetCompressedTexImage")
19789 " returns the compressed texture image associated with "
19790 (var "target")
19791 " and "
19792 (var "lod")
19793 "
19794 into "
19795 (var "img")
19796 ". "
19797 (var "img")
19798 " should be an array of "
19799 (code "GL_TEXTURE_COMPRESSED_IMAGE_SIZE")
19800 " bytes. "
19801 (var "target")
19802 " specifies whether the desired texture image was one specified by "
19803 (code "glTexImage1D")
19804 " ("
19805 (code "GL_TEXTURE_1D")
19806 "), "
19807 (code "glTexImage2D")
19808 " ("
19809 (code "GL_TEXTURE_2D")
19810 " or any of "
19811 (code "GL_TEXTURE_CUBE_MAP_*")
19812 "), or "
19813 (code "glTexImage3D")
19814 " ("
19815 (code "GL_TEXTURE_3D")
19816 "). "
19817 (var "lod")
19818 " specifies the level-of-detail number of the desired image. ")
19819 (para "
19820 If a non-zero named buffer object is bound to the "
19821 (code "GL_PIXEL_PACK_BUFFER")
19822 " target
19823 (see "
19824 (code "glBindBuffer")
19825 ") while a texture image is
19826 requested, "
19827 (var "img")
19828 " is treated as a byte offset into the buffer object's data store. ")
19829 (para "
19830 To minimize errors, first verify that the texture is compressed by calling "
19831 (code "glGetTexLevelParameter")
19832 " with argument "
19833 (code "GL_TEXTURE_COMPRESSED")
19834 ". If
19835 the texture is compressed, then determine the amount of memory required to
19836 store the compressed texture by calling "
19837 (code "glGetTexLevelParameter")
19838 " with
19839 argument "
19840 (code "GL_TEXTURE_COMPRESSED_IMAGE_SIZE")
19841 ". Finally, retrieve the
19842 internal format of the texture by calling "
19843 (code "glGetTexLevelParameter")
19844 " with
19845 argument "
19846 (code "GL_TEXTURE_INTERNAL_FORMAT")
19847 ".
19848 To store the texture for later use, associate the internal format and size
19849 with the retrieved texture image. These data can be used by the respective
19850 texture or subtexture loading routine used for loading "
19851 (var "target")
19852 " textures. ")
19853 (heading "Errors")
19854 (para (code "GL_INVALID_VALUE")
19855 " is generated if "
19856 (var "lod")
19857 " is less than zero or greater
19858 than the maximum number of LODs permitted by the implementation. ")
19859 (para (code "GL_INVALID_OPERATION")
19860 " is generated if "
19861 (code "glGetCompressedTexImage")
19862 " is used to retrieve a
19863 texture that is in an uncompressed internal format. ")
19864 (para (code "GL_INVALID_OPERATION")
19865 " is generated if a non-zero buffer object name is bound to the "
19866 (code "GL_PIXEL_PACK_BUFFER")
19867 " target and the buffer object's data store is currently mapped. ")
19868 (para (code "GL_INVALID_OPERATION")
19869 " is generated if a non-zero buffer object name is bound to the "
19870 (code "GL_PIXEL_PACK_BUFFER")
19871 " target and the data would be packed to the buffer
19872 object such that the memory writes required would exceed the data store size. ")
19873 (para (code "GL_INVALID_OPERATION")
19874 " is generated if "
19875 (code "glGetCompressedTexImage")
19876 "
19877 is executed between the execution of "
19878 (code "glBegin")
19879 "
19880 and the corresponding execution of "
19881 (code "glEnd")
19882 ". ")))
19883
19884 (define-gl-procedure
19885 glGetConvolutionFilter
19886 "glGetConvolutionFilter"
19887 (funcsynopsis
19888 (funcprototype
19889 (funcdef
19890 "void "
19891 (function "glGetConvolutionFilter"))
19892 (paramdef "GLenum " (parameter "target"))
19893 (paramdef "GLenum " (parameter "format"))
19894 (paramdef "GLenum " (parameter "type"))
19895 (paramdef "GLvoid * " (parameter "image"))))
19896 '(*fragment*
19897 (heading
19898 "get current 1D or 2D convolution filter kernel")
19899 (heading "Parameters")
19900 (table (% (formatter (asis)))
19901 (entry (% (heading (var "target")))
19902 (para "
19903 The filter to be retrieved.
19904 Must be one of "
19905 (code "GL_CONVOLUTION_1D")
19906 " or "
19907 (code "GL_CONVOLUTION_2D")
19908 ". "))
19909 (entry (% (heading (var "format")))
19910 (para "
19911 Format of the output image.
19912 Must be one of "
19913 (code "GL_RED")
19914 ", "
19915 (code "GL_GREEN")
19916 ", "
19917 (code "GL_BLUE")
19918 ", "
19919 (code "GL_ALPHA")
19920 ", "
19921 (code "GL_RGB")
19922 ", "
19923 (code "GL_BGR")
19924 ", "
19925 (code "GL_RGBA")
19926 ", "
19927 (code "GL_BGRA")
19928 ", "
19929 (code "GL_LUMINANCE")
19930 ", or "
19931 (code "GL_LUMINANCE_ALPHA")
19932 ". "))
19933 (entry (% (heading (var "type")))
19934 (para "
19935 Data type of components in the output image.
19936 Symbolic constants "
19937 (code "GL_UNSIGNED_BYTE")
19938 ", "
19939 (code "GL_BYTE")
19940 ", "
19941 (code "GL_BITMAP")
19942 ", "
19943 (code "GL_UNSIGNED_SHORT")
19944 ", "
19945 (code "GL_SHORT")
19946 ", "
19947 (code "GL_UNSIGNED_INT")
19948 ", "
19949 (code "GL_INT")
19950 ", "
19951 (code "GL_FLOAT")
19952 ", "
19953 (code "GL_UNSIGNED_BYTE_3_3_2")
19954 ", "
19955 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
19956 ", "
19957 (code "GL_UNSIGNED_SHORT_5_6_5")
19958 ", "
19959 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
19960 ", "
19961 (code "GL_UNSIGNED_SHORT_4_4_4_4")
19962 ", "
19963 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
19964 ", "
19965 (code "GL_UNSIGNED_SHORT_5_5_5_1")
19966 ", "
19967 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
19968 ", "
19969 (code "GL_UNSIGNED_INT_8_8_8_8")
19970 ", "
19971 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
19972 ", "
19973 (code "GL_UNSIGNED_INT_10_10_10_2")
19974 ", and "
19975 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
19976 "
19977 are accepted. "))
19978 (entry (% (heading (var "image")))
19979 (para "
19980 Pointer to storage for the output image. ")))
19981 (heading "Description")
19982 (para (code "glGetConvolutionFilter")
19983 " returns the current 1D or 2D convolution filter kernel as an image.
19984 The one- or two-dimensional image is placed in "
19985 (var "image")
19986 " according to the
19987 specifications in "
19988 (var "format")
19989 " and "
19990 (var "type")
19991 ".
19992 No pixel transfer operations are performed on this image, but the relevant
19993 pixel storage modes are applied. ")
19994 (para "
19995 If a non-zero named buffer object is bound to the "
19996 (code "GL_PIXEL_PACK_BUFFER")
19997 " target
19998 (see "
19999 (code "glBindBuffer")
20000 ") while a convolution filter is
20001 requested, "
20002 (var "image")
20003 " is treated as a byte offset into the buffer object's data store. ")
20004 (para "
20005 Color components that are present in "
20006 (var "format")
20007 " but not included in the
20008 internal format of the filter are returned as zero.
20009 The assignments of internal color components to the components of "
20010 (var "format")
20011 "
20012 are as follows. ")
20013 (table (% (formatter (asis)))
20014 (entry (% (heading (strong "Internal Component")))
20015 (para (strong "Resulting Component")))
20016 (entry (% (heading "
20017 Red ")) (para "
20018 Red "))
20019 (entry (% (heading "
20020 Green ")) (para "
20021 Green "))
20022 (entry (% (heading "
20023 Blue ")) (para "
20024 Blue "))
20025 (entry (% (heading "
20026 Alpha ")) (para "
20027 Alpha "))
20028 (entry (% (heading "
20029 Luminance "))
20030 (para "
20031 Red "))
20032 (entry (% (heading "
20033 Intensity "))
20034 (para "
20035 Red ")))
20036 (para)
20037 (heading "Errors")
20038 (para (code "GL_INVALID_ENUM")
20039 " is generated if "
20040 (var "target")
20041 " is not one of the allowable
20042 values. ")
20043 (para (code "GL_INVALID_ENUM")
20044 " is generated if "
20045 (var "format")
20046 " is not one of the allowable
20047 values. ")
20048 (para (code "GL_INVALID_ENUM")
20049 " is generated if "
20050 (var "type")
20051 " is not one of the allowable
20052 values. ")
20053 (para (code "GL_INVALID_OPERATION")
20054 " is generated if "
20055 (var "type")
20056 " is one of "
20057 (code "GL_UNSIGNED_BYTE_3_3_2")
20058 ", "
20059 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
20060 ", "
20061 (code "GL_UNSIGNED_SHORT_5_6_5")
20062 ", or "
20063 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
20064 "
20065 and "
20066 (var "format")
20067 " is not "
20068 (code "GL_RGB")
20069 ". ")
20070 (para (code "GL_INVALID_OPERATION")
20071 " is generated if "
20072 (var "type")
20073 " is one of "
20074 (code "GL_UNSIGNED_SHORT_4_4_4_4")
20075 ", "
20076 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
20077 ", "
20078 (code "GL_UNSIGNED_SHORT_5_5_5_1")
20079 ", "
20080 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
20081 ", "
20082 (code "GL_UNSIGNED_INT_8_8_8_8")
20083 ", "
20084 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
20085 ", "
20086 (code "GL_UNSIGNED_INT_10_10_10_2")
20087 ", or "
20088 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
20089 "
20090 and "
20091 (var "format")
20092 " is neither "
20093 (code "GL_RGBA")
20094 " nor "
20095 (code "GL_BGRA")
20096 ". ")
20097 (para (code "GL_INVALID_OPERATION")
20098 " is generated if a non-zero buffer object name is bound to the "
20099 (code "GL_PIXEL_PACK_BUFFER")
20100 " target and the buffer object's data store is currently mapped. ")
20101 (para (code "GL_INVALID_OPERATION")
20102 " is generated if a non-zero buffer object name is bound to the "
20103 (code "GL_PIXEL_PACK_BUFFER")
20104 " target and the data would be packed to the buffer
20105 object such that the memory writes required would exceed the data store size. ")
20106 (para (code "GL_INVALID_OPERATION")
20107 " is generated if a non-zero buffer object name is bound to the "
20108 (code "GL_PIXEL_PACK_BUFFER")
20109 " target and "
20110 (var "image")
20111 " is not evenly divisible
20112 into the number of bytes needed to store in memory a datum indicated by "
20113 (var "type")
20114 ". ")
20115 (para (code "GL_INVALID_OPERATION")
20116 " is generated if "
20117 (code "glGetConvolutionFilter")
20118 " is executed
20119 between the execution of "
20120 (code "glBegin")
20121 " and the corresponding
20122 execution of "
20123 (code "glEnd")
20124 ". ")))
20125
20126 (define-gl-procedure
20127 glGetConvolutionParameter
20128 "glGetConvolutionParameter"
20129 (funcsynopsis
20130 (funcprototype
20131 (funcdef
20132 "void "
20133 (function "glGetConvolutionParameterfv"))
20134 (paramdef "GLenum " (parameter "target"))
20135 (paramdef "GLenum " (parameter "pname"))
20136 (paramdef "GLfloat * " (parameter "params"))))
20137 '(*fragment*
20138 (heading "get convolution parameters")
20139 (heading "Parameters")
20140 (table (% (formatter (asis)))
20141 (entry (% (heading (var "target")))
20142 (para "
20143 The filter whose parameters are to be retrieved.
20144 Must be one of "
20145 (code "GL_CONVOLUTION_1D")
20146 ", "
20147 (code "GL_CONVOLUTION_2D")
20148 ", or "
20149 (code "GL_SEPARABLE_2D")
20150 ". "))
20151 (entry (% (heading (var "pname")))
20152 (para "
20153 The parameter to be retrieved.
20154 Must be one of "
20155 (code "GL_CONVOLUTION_BORDER_MODE")
20156 ", "
20157 (code "GL_CONVOLUTION_BORDER_COLOR")
20158 ", "
20159 (code "GL_CONVOLUTION_FILTER_SCALE")
20160 ", "
20161 (code "GL_CONVOLUTION_FILTER_BIAS")
20162 ", "
20163 (code "GL_CONVOLUTION_FORMAT")
20164 ", "
20165 (code "GL_CONVOLUTION_WIDTH")
20166 ", "
20167 (code "GL_CONVOLUTION_HEIGHT")
20168 ", "
20169 (code "GL_MAX_CONVOLUTION_WIDTH")
20170 ", or "
20171 (code "GL_MAX_CONVOLUTION_HEIGHT")
20172 ". "))
20173 (entry (% (heading (var "params")))
20174 (para "
20175 Pointer to storage for the parameters to be retrieved. ")))
20176 (heading "Description")
20177 (para (code "glGetConvolutionParameter")
20178 " retrieves convolution parameters. "
20179 (var "target")
20180 " determines which convolution filter is queried. "
20181 (var "pname")
20182 " determines which parameter is returned: ")
20183 (table (% (formatter (asis)))
20184 (entry (% (heading (code "GL_CONVOLUTION_BORDER_MODE")))
20185 (para)
20186 (para "
20187 The convolution border mode.
20188 See "
20189 (code "glConvolutionParameter")
20190 " for a list of border modes. "))
20191 (entry (% (heading (code "GL_CONVOLUTION_BORDER_COLOR")))
20192 (para)
20193 (para "
20194 The current convolution border color. "
20195 (var "params")
20196 " must be a pointer to an array of four elements,
20197 which will receive the red, green, blue, and alpha border colors. "))
20198 (entry (% (heading (code "GL_CONVOLUTION_FILTER_SCALE")))
20199 (para)
20200 (para "
20201 The current filter scale factors. "
20202 (var "params")
20203 " must be a pointer to an array of four elements,
20204 which will receive the red, green, blue, and alpha filter scale
20205 factors in that order. "))
20206 (entry (% (heading (code "GL_CONVOLUTION_FILTER_BIAS")))
20207 (para)
20208 (para "
20209 The current filter bias factors. "
20210 (var "params")
20211 " must be a pointer to an array of four elements,
20212 which will receive the red, green, blue, and alpha filter bias
20213 terms in that order. "))
20214 (entry (% (heading (code "GL_CONVOLUTION_FORMAT")))
20215 (para)
20216 (para "
20217 The current internal format.
20218 See "
20219 (code "glConvolutionFilter1D")
20220 ", "
20221 (code "glConvolutionFilter2D")
20222 ",
20223 and "
20224 (code "glSeparableFilter2D")
20225 " for lists of allowable
20226 formats. "))
20227 (entry (% (heading (code "GL_CONVOLUTION_WIDTH")))
20228 (para)
20229 (para "
20230 The current filter image width. "))
20231 (entry (% (heading (code "GL_CONVOLUTION_HEIGHT")))
20232 (para)
20233 (para "
20234 The current filter image height. "))
20235 (entry (% (heading (code "GL_MAX_CONVOLUTION_WIDTH")))
20236 (para)
20237 (para "
20238 The maximum acceptable filter image width. "))
20239 (entry (% (heading (code "GL_MAX_CONVOLUTION_HEIGHT")))
20240 (para)
20241 (para "
20242 The maximum acceptable filter image height. ")))
20243 (heading "Errors")
20244 (para (code "GL_INVALID_ENUM")
20245 " is generated if "
20246 (var "target")
20247 " is not one of the allowable
20248 values. ")
20249 (para (code "GL_INVALID_ENUM")
20250 " is generated if "
20251 (var "pname")
20252 " is not one of the allowable
20253 values. ")
20254 (para (code "GL_INVALID_ENUM")
20255 " is generated if "
20256 (var "target")
20257 " is "
20258 (code "GL_CONVOLUTION_1D")
20259 "
20260 and "
20261 (var "pname")
20262 " is "
20263 (code "GL_CONVOLUTION_HEIGHT")
20264 " or "
20265 (code "GL_MAX_CONVOLUTION_HEIGHT")
20266 ". ")
20267 (para (code "GL_INVALID_OPERATION")
20268 " is generated if "
20269 (code "glGetConvolutionParameter")
20270 " is executed
20271 between the execution of "
20272 (code "glBegin")
20273 " and the corresponding
20274 execution of "
20275 (code "glEnd")
20276 ". ")))
20277
20278 (define-gl-procedure
20279 glGetError
20280 "glGetError"
20281 (funcsynopsis
20282 (funcprototype
20283 (funcdef "GLenum " (function "glGetError"))
20284 (paramdef (parameter "void"))))
20285 '(*fragment*
20286 (heading "return error information")
20287 (heading "Description")
20288 (para (code "glGetError")
20289 " returns the value of the error flag.
20290 Each detectable error is assigned a numeric code and symbolic name.
20291 When an error occurs,
20292 the error flag is set to the appropriate error code value.
20293 No other errors are recorded until "
20294 (code "glGetError")
20295 " is called,
20296 the error code is returned,
20297 and the flag is reset to "
20298 (code "GL_NO_ERROR")
20299 ".
20300 If a call to "
20301 (code "glGetError")
20302 " returns "
20303 (code "GL_NO_ERROR")
20304 ",
20305 there has been no detectable error since the last call to "
20306 (code "glGetError")
20307 ",
20308 or since the GL was initialized. ")
20309 (para "
20310 To allow for distributed implementations,
20311 there may be several error flags.
20312 If any single error flag has recorded an error,
20313 the value of that flag is returned
20314 and that flag is reset to "
20315 (code "GL_NO_ERROR")
20316 "
20317 when "
20318 (code "glGetError")
20319 " is called.
20320 If more than one flag has recorded an error, "
20321 (code "glGetError")
20322 " returns and clears an arbitrary error flag value.
20323 Thus, "
20324 (code "glGetError")
20325 " should always be called in a loop,
20326 until it returns "
20327 (code "GL_NO_ERROR")
20328 ",
20329 if all error flags are to be reset. ")
20330 (para "
20331 Initially, all error flags are set to "
20332 (code "GL_NO_ERROR")
20333 ". ")
20334 (para "
20335 The following errors are currently defined: ")
20336 (table (% (formatter (asis)))
20337 (entry (% (heading (code "GL_NO_ERROR")))
20338 (para "
20339 No error has been recorded.
20340 The value of this symbolic constant is guaranteed to be 0. "))
20341 (entry (% (heading (code "GL_INVALID_ENUM")))
20342 (para "
20343 An unacceptable value is specified for an enumerated argument.
20344 The offending command is ignored
20345 and has no other side effect than to set the error flag. "))
20346 (entry (% (heading (code "GL_INVALID_VALUE")))
20347 (para "
20348 A numeric argument is out of range.
20349 The offending command is ignored
20350 and has no other side effect than to set the error flag. "))
20351 (entry (% (heading (code "GL_INVALID_OPERATION")))
20352 (para "
20353 The specified operation is not allowed in the current state.
20354 The offending command is ignored
20355 and has no other side effect than to set the error flag. "))
20356 (entry (% (heading (code "GL_STACK_OVERFLOW")))
20357 (para "
20358 This command would cause a stack overflow.
20359 The offending command is ignored
20360 and has no other side effect than to set the error flag. "))
20361 (entry (% (heading (code "GL_STACK_UNDERFLOW")))
20362 (para "
20363 This command would cause a stack underflow.
20364 The offending command is ignored
20365 and has no other side effect than to set the error flag. "))
20366 (entry (% (heading (code "GL_OUT_OF_MEMORY")))
20367 (para "
20368 There is not enough memory left to execute the command.
20369 The state of the GL is undefined,
20370 except for the state of the error flags,
20371 after this error is recorded. "))
20372 (entry (% (heading (code "GL_TABLE_TOO_LARGE")))
20373 (para "
20374 The specified table exceeds the implementation's maximum supported table
20375 size. The offending command is ignored and has no other side effect
20376 than to set the error flag. ")))
20377 (para "
20378 When an error flag is set,
20379 results of a GL operation are undefined only if "
20380 (code "GL_OUT_OF_MEMORY")
20381 "
20382 has occurred.
20383 In all other cases,
20384 the command generating the error is ignored and has no effect on the GL state
20385 or frame buffer contents.
20386 If the generating command returns a value, it returns 0.
20387 If "
20388 (code "glGetError")
20389 " itself generates an error, it returns 0. ")
20390 (heading "Errors")
20391 (para (code "GL_INVALID_OPERATION")
20392 " is generated if "
20393 (code "glGetError")
20394 "
20395 is executed between the execution of "
20396 (code "glBegin")
20397 "
20398 and the corresponding execution of "
20399 (code "glEnd")
20400 ".
20401 In this case, "
20402 (code "glGetError")
20403 " returns 0. ")))
20404
20405 (define-gl-procedure
20406 glGetHistogramParameter
20407 "glGetHistogramParameter"
20408 (funcsynopsis
20409 (funcprototype
20410 (funcdef
20411 "void "
20412 (function "glGetHistogramParameterfv"))
20413 (paramdef "GLenum " (parameter "target"))
20414 (paramdef "GLenum " (parameter "pname"))
20415 (paramdef "GLfloat * " (parameter "params"))))
20416 '(*fragment*
20417 (heading "get histogram parameters")
20418 (heading "Parameters")
20419 (table (% (formatter (asis)))
20420 (entry (% (heading (var "target")))
20421 (para "
20422 Must be one of "
20423 (code "GL_HISTOGRAM")
20424 " or "
20425 (code "GL_PROXY_HISTOGRAM")
20426 ". "))
20427 (entry (% (heading (var "pname")))
20428 (para "
20429 The name of the parameter to be retrieved.
20430 Must be one of "
20431 (code "GL_HISTOGRAM_WIDTH")
20432 ", "
20433 (code "GL_HISTOGRAM_FORMAT")
20434 ", "
20435 (code "GL_HISTOGRAM_RED_SIZE")
20436 ", "
20437 (code "GL_HISTOGRAM_GREEN_SIZE")
20438 ", "
20439 (code "GL_HISTOGRAM_BLUE_SIZE")
20440 ", "
20441 (code "GL_HISTOGRAM_ALPHA_SIZE")
20442 ", "
20443 (code "GL_HISTOGRAM_LUMINANCE_SIZE")
20444 ", or "
20445 (code "GL_HISTOGRAM_SINK")
20446 ". "))
20447 (entry (% (heading (var "params")))
20448 (para "
20449 Pointer to storage for the returned values. ")))
20450 (heading "Description")
20451 (para (code "glGetHistogramParameter")
20452 " is used to query parameter values for the current histogram or for
20453 a proxy. The histogram state information may be queried by calling "
20454 (code "glGetHistogramParameter")
20455 " with a "
20456 (var "target")
20457 " of "
20458 (code "GL_HISTOGRAM")
20459 " (to
20460 obtain information for the current histogram table) or "
20461 (code "GL_PROXY_HISTOGRAM")
20462 " (to obtain information from the most recent
20463 proxy request) and one of the following values for the "
20464 (var "pname")
20465 " argument: ")
20466 (para)
20467 (table (% (formatter (asis)))
20468 (entry (% (heading (strong "Parameter")))
20469 (para (strong "Description")))
20470 (entry (% (heading (code "GL_HISTOGRAM_WIDTH")))
20471 (para "
20472 Histogram table width "))
20473 (entry (% (heading (code "GL_HISTOGRAM_FORMAT")))
20474 (para "
20475 Internal format "))
20476 (entry (% (heading (code "GL_HISTOGRAM_RED_SIZE")))
20477 (para "
20478 Red component counter size, in bits "))
20479 (entry (% (heading (code "GL_HISTOGRAM_GREEN_SIZE")))
20480 (para "
20481 Green component counter size, in bits "))
20482 (entry (% (heading (code "GL_HISTOGRAM_BLUE_SIZE")))
20483 (para "
20484 Blue component counter size, in bits "))
20485 (entry (% (heading (code "GL_HISTOGRAM_ALPHA_SIZE")))
20486 (para "
20487 Alpha component counter size, in bits "))
20488 (entry (% (heading (code "GL_HISTOGRAM_LUMINANCE_SIZE")))
20489 (para "
20490 Luminance component counter size, in bits "))
20491 (entry (% (heading (code "GL_HISTOGRAM_SINK")))
20492 (para "
20493 Value of the "
20494 (var "sink")
20495 " parameter ")))
20496 (para)
20497 (heading "Errors")
20498 (para (code "GL_INVALID_ENUM")
20499 " is generated if "
20500 (var "target")
20501 " is not one of the allowable
20502 values. ")
20503 (para (code "GL_INVALID_ENUM")
20504 " is generated if "
20505 (var "pname")
20506 " is not one of the allowable
20507 values. ")
20508 (para (code "GL_INVALID_OPERATION")
20509 " is generated if "
20510 (code "glGetHistogramParameter")
20511 " is executed
20512 between the execution of "
20513 (code "glBegin")
20514 " and the corresponding
20515 execution of "
20516 (code "glEnd")
20517 ". ")))
20518
20519 (define-gl-procedure
20520 glGetHistogram
20521 "glGetHistogram"
20522 (funcsynopsis
20523 (funcprototype
20524 (funcdef "void " (function "glGetHistogram"))
20525 (paramdef "GLenum " (parameter "target"))
20526 (paramdef "GLboolean " (parameter "reset"))
20527 (paramdef "GLenum " (parameter "format"))
20528 (paramdef "GLenum " (parameter "type"))
20529 (paramdef "GLvoid * " (parameter "values"))))
20530 '(*fragment*
20531 (heading "get histogram table")
20532 (heading "Parameters")
20533 (table (% (formatter (asis)))
20534 (entry (% (heading (var "target")))
20535 (para "
20536 Must be " (code "GL_HISTOGRAM") ". "))
20537 (entry (% (heading (var "reset")))
20538 (para "
20539 If "
20540 (code "GL_TRUE")
20541 ", each component counter that is actually returned
20542 is reset to zero. (Other counters are unaffected.)
20543 If "
20544 (code "GL_FALSE")
20545 ", none of the counters in the histogram table is modified. "))
20546 (entry (% (heading (var "format")))
20547 (para "
20548 The format of values to be returned in "
20549 (var "values")
20550 ".
20551 Must be one of "
20552 (code "GL_RED")
20553 ", "
20554 (code "GL_GREEN")
20555 ", "
20556 (code "GL_BLUE")
20557 ", "
20558 (code "GL_ALPHA")
20559 ", "
20560 (code "GL_RGB")
20561 ", "
20562 (code "GL_BGR")
20563 ", "
20564 (code "GL_RGBA")
20565 ", "
20566 (code "GL_BGRA")
20567 ", "
20568 (code "GL_LUMINANCE")
20569 ", or "
20570 (code "GL_LUMINANCE_ALPHA")
20571 ". "))
20572 (entry (% (heading (var "type")))
20573 (para "
20574 The type of values to be returned in "
20575 (var "values")
20576 ".
20577 Symbolic constants "
20578 (code "GL_UNSIGNED_BYTE")
20579 ", "
20580 (code "GL_BYTE")
20581 ", "
20582 (code "GL_BITMAP")
20583 ", "
20584 (code "GL_UNSIGNED_SHORT")
20585 ", "
20586 (code "GL_SHORT")
20587 ", "
20588 (code "GL_UNSIGNED_INT")
20589 ", "
20590 (code "GL_INT")
20591 ", "
20592 (code "GL_FLOAT")
20593 ", "
20594 (code "GL_UNSIGNED_BYTE_3_3_2")
20595 ", "
20596 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
20597 ", "
20598 (code "GL_UNSIGNED_SHORT_5_6_5")
20599 ", "
20600 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
20601 ", "
20602 (code "GL_UNSIGNED_SHORT_4_4_4_4")
20603 ", "
20604 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
20605 ", "
20606 (code "GL_UNSIGNED_SHORT_5_5_5_1")
20607 ", "
20608 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
20609 ", "
20610 (code "GL_UNSIGNED_INT_8_8_8_8")
20611 ", "
20612 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
20613 ", "
20614 (code "GL_UNSIGNED_INT_10_10_10_2")
20615 ", and "
20616 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
20617 "
20618 are accepted. "))
20619 (entry (% (heading (var "values")))
20620 (para "
20621 A pointer to storage for the returned histogram table. ")))
20622 (heading "Description")
20623 (para (code "glGetHistogram")
20624 " returns the current histogram table as a one-dimensional image
20625 with the same width as the histogram.
20626 No pixel transfer operations are performed on this image, but pixel storage
20627 modes that are applicable to 1D images are honored. ")
20628 (para "
20629 If a non-zero named buffer object is bound to the "
20630 (code "GL_PIXEL_PACK_BUFFER")
20631 " target
20632 (see "
20633 (code "glBindBuffer")
20634 ") while a histogram table is
20635 requested, "
20636 (var "values")
20637 " is treated as a byte offset into the buffer object's data store. ")
20638 (para "
20639 Color components that are requested in the specified "
20640 (var "format")
20641 ", but which
20642 are not included in the internal format of the histogram, are returned as
20643 zero.
20644 The assignments of internal color components to the components
20645 requested by "
20646 (var "format")
20647 " are: ")
20648 (table (% (formatter (asis)))
20649 (entry (% (heading (strong "Internal Component")))
20650 (para (strong "Resulting Component")))
20651 (entry (% (heading "
20652 Red ")) (para "
20653 Red "))
20654 (entry (% (heading "
20655 Green ")) (para "
20656 Green "))
20657 (entry (% (heading "
20658 Blue ")) (para "
20659 Blue "))
20660 (entry (% (heading "
20661 Alpha ")) (para "
20662 Alpha "))
20663 (entry (% (heading "
20664 Luminance "))
20665 (para "
20666 Red ")))
20667 (para)
20668 (heading "Errors")
20669 (para (code "GL_INVALID_ENUM")
20670 " is generated if "
20671 (var "target")
20672 " is not "
20673 (code "GL_HISTOGRAM")
20674 ". ")
20675 (para (code "GL_INVALID_ENUM")
20676 " is generated if "
20677 (var "format")
20678 " is not one of the allowable
20679 values. ")
20680 (para (code "GL_INVALID_ENUM")
20681 " is generated if "
20682 (var "type")
20683 " is not one of the allowable
20684 values. ")
20685 (para (code "GL_INVALID_OPERATION")
20686 " is generated if "
20687 (var "type")
20688 " is one of "
20689 (code "GL_UNSIGNED_BYTE_3_3_2")
20690 ", "
20691 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
20692 ", "
20693 (code "GL_UNSIGNED_SHORT_5_6_5")
20694 ", or "
20695 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
20696 "
20697 and "
20698 (var "format")
20699 " is not "
20700 (code "GL_RGB")
20701 ". ")
20702 (para (code "GL_INVALID_OPERATION")
20703 " is generated if "
20704 (var "type")
20705 " is one of "
20706 (code "GL_UNSIGNED_SHORT_4_4_4_4")
20707 ", "
20708 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
20709 ", "
20710 (code "GL_UNSIGNED_SHORT_5_5_5_1")
20711 ", "
20712 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
20713 ", "
20714 (code "GL_UNSIGNED_INT_8_8_8_8")
20715 ", "
20716 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
20717 ", "
20718 (code "GL_UNSIGNED_INT_10_10_10_2")
20719 ", or "
20720 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
20721 "
20722 and "
20723 (var "format")
20724 " is neither "
20725 (code "GL_RGBA")
20726 " nor "
20727 (code "GL_BGRA")
20728 ". ")
20729 (para (code "GL_INVALID_OPERATION")
20730 " is generated if a non-zero buffer object name is bound to the "
20731 (code "GL_PIXEL_PACK_BUFFER")
20732 " target and the buffer object's data store is currently mapped. ")
20733 (para (code "GL_INVALID_OPERATION")
20734 " is generated if a non-zero buffer object name is bound to the "
20735 (code "GL_PIXEL_PACK_BUFFER")
20736 " target and the data would be packed to the buffer
20737 object such that the memory writes required would exceed the data store size. ")
20738 (para (code "GL_INVALID_OPERATION")
20739 " is generated if a non-zero buffer object name is bound to the "
20740 (code "GL_PIXEL_PACK_BUFFER")
20741 " target and "
20742 (var "values")
20743 " is not evenly divisible
20744 into the number of bytes needed to store in memory a datum indicated by "
20745 (var "type")
20746 ". ")
20747 (para (code "GL_INVALID_OPERATION")
20748 " is generated if "
20749 (code "glGetHistogram")
20750 " is executed
20751 between the execution of "
20752 (code "glBegin")
20753 " and the corresponding
20754 execution of "
20755 (code "glEnd")
20756 ". ")))
20757
20758 (define-gl-procedure
20759 glGetLight
20760 "glGetLight"
20761 (funcsynopsis
20762 (funcprototype
20763 (funcdef "void " (function "glGetLightfv"))
20764 (paramdef "GLenum " (parameter "light"))
20765 (paramdef "GLenum " (parameter "pname"))
20766 (paramdef "GLfloat * " (parameter "params"))))
20767 '(*fragment*
20768 (heading "return light source parameter values")
20769 (heading "Parameters")
20770 (table (% (formatter (asis)))
20771 (entry (% (heading (var "light")))
20772 (para "
20773 Specifies a light source.
20774 The number of possible lights depends on the implementation,
20775 but at least eight lights are supported.
20776 They are identified by symbolic names of the form "
20777 (code "GL_LIGHT")
20778 (math (var "i"))
20779 "
20780 where "
20781 (math (var "i"))
20782 "
20783 ranges from 0 to the value of "
20784 (code "GL_MAX_LIGHTS")
20785 " - 1. "))
20786 (entry (% (heading (var "pname")))
20787 (para "
20788 Specifies a light source parameter for "
20789 (var "light")
20790 ".
20791 Accepted symbolic names are "
20792 (code "GL_AMBIENT")
20793 ", "
20794 (code "GL_DIFFUSE")
20795 ", "
20796 (code "GL_SPECULAR")
20797 ", "
20798 (code "GL_POSITION")
20799 ", "
20800 (code "GL_SPOT_DIRECTION")
20801 ", "
20802 (code "GL_SPOT_EXPONENT")
20803 ", "
20804 (code "GL_SPOT_CUTOFF")
20805 ", "
20806 (code "GL_CONSTANT_ATTENUATION")
20807 ", "
20808 (code "GL_LINEAR_ATTENUATION")
20809 ", and "
20810 (code "GL_QUADRATIC_ATTENUATION")
20811 ". "))
20812 (entry (% (heading (var "params")))
20813 (para "
20814 Returns the requested data. ")))
20815 (heading "Description")
20816 (para (code "glGetLight")
20817 " returns in "
20818 (var "params")
20819 " the value or values of a light source parameter. "
20820 (var "light")
20821 " names the light and is a symbolic name of the form "
20822 (code "GL_LIGHT")
20823 (math (var "i"))
20824 "
20825 where i ranges from 0 to the value of "
20826 (code "GL_MAX_LIGHTS")
20827 " - 1. "
20828 (code "GL_MAX_LIGHTS")
20829 " is an implementation dependent constant that is
20830 greater than or equal to eight. "
20831 (var "pname")
20832 " specifies one of ten light source parameters,
20833 again by symbolic name. ")
20834 (para "
20835 The following parameters are defined: ")
20836 (table (% (formatter (asis)))
20837 (entry (% (heading (code "GL_AMBIENT")))
20838 (para (var "params")
20839 " returns four integer or floating-point values representing the
20840 ambient intensity of the light source.
20841 Integer values,
20842 when requested,
20843 are linearly mapped from the internal floating-point representation
20844 such that 1.0 maps to the most positive representable integer value,
20845 and "
20846 (math "-1.0")
20847 "
20848 maps to the most negative representable integer value.
20849 If the internal value is outside the range "
20850 (math "[" "-1" "," "1" "]")
20851 ",
20852 the corresponding integer return value is undefined. The initial value is
20853 (0, 0, 0, 1). "))
20854 (entry (% (heading (code "GL_DIFFUSE")))
20855 (para (var "params")
20856 " returns four integer or floating-point values representing the
20857 diffuse intensity of the light source.
20858 Integer values,
20859 when requested,
20860 are linearly mapped from the internal floating-point representation
20861 such that 1.0 maps to the most positive representable integer value,
20862 and "
20863 (math "-1.0")
20864 "
20865 maps to the most negative representable integer value.
20866 If the internal value is outside the range "
20867 (math "[" "-1" "," "1" "]")
20868 ",
20869 the corresponding integer return value is undefined. The initial value
20870 for "
20871 (code "GL_LIGHT0")
20872 " is (1, 1, 1, 1); for other lights, the
20873 initial value is (0, 0, 0, 0). "))
20874 (entry (% (heading (code "GL_SPECULAR")))
20875 (para (var "params")
20876 " returns four integer or floating-point values representing the
20877 specular intensity of the light source.
20878 Integer values,
20879 when requested,
20880 are linearly mapped from the internal floating-point representation
20881 such that 1.0 maps to the most positive representable integer value,
20882 and "
20883 (math "-1.0")
20884 "
20885 maps to the most negative representable integer value.
20886 If the internal value is outside the range "
20887 (math "[" "-1" "," "1" "]")
20888 ",
20889 the corresponding integer return value is undefined. The initial value
20890 for "
20891 (code "GL_LIGHT0")
20892 " is (1, 1, 1, 1); for other lights, the
20893 initial value is (0, 0, 0, 0). "))
20894 (entry (% (heading (code "GL_POSITION")))
20895 (para (var "params")
20896 " returns four integer or floating-point values representing the
20897 position of the light source.
20898 Integer values,
20899 when requested,
20900 are computed by rounding the internal floating-point values to the
20901 nearest integer value.
20902 The returned values are those maintained in eye coordinates.
20903 They will not be equal to the values specified using "
20904 (code "glLight")
20905 ",
20906 unless the modelview matrix was identity at the time "
20907 (code "glLight")
20908 " was
20909 called. The initial value is (0, 0, 1, 0). "))
20910 (entry (% (heading (code "GL_SPOT_DIRECTION")))
20911 (para (var "params")
20912 " returns three integer or floating-point values representing the
20913 direction of the light source.
20914 Integer values,
20915 when requested,
20916 are computed by rounding the internal floating-point values to the
20917 nearest integer value.
20918 The returned values are those maintained in eye coordinates.
20919 They will not be equal to the values specified using "
20920 (code "glLight")
20921 ",
20922 unless the modelview matrix was identity at the time "
20923 (code "glLight")
20924 " was called.
20925 Although spot direction is normalized before being used in the lighting
20926 equation,
20927 the returned values are the transformed versions of the specified values
20928 prior to normalization. The initial value is "
20929 (math "(" "0" "," "0" "-1" ")")
20930 ". "))
20931 (entry (% (heading (code "GL_SPOT_EXPONENT")))
20932 (para (var "params")
20933 " returns a single integer or floating-point value representing the
20934 spot exponent of the light.
20935 An integer value,
20936 when requested,
20937 is computed by rounding the internal floating-point representation to
20938 the nearest integer. The initial value is 0. "))
20939 (entry (% (heading (code "GL_SPOT_CUTOFF")))
20940 (para (var "params")
20941 " returns a single integer or floating-point value representing the
20942 spot cutoff angle of the light.
20943 An integer value,
20944 when requested,
20945 is computed by rounding the internal floating-point representation to
20946 the nearest integer. The initial value is 180. "))
20947 (entry (% (heading (code "GL_CONSTANT_ATTENUATION")))
20948 (para (var "params")
20949 " returns a single integer or floating-point value representing the
20950 constant (not distance-related) attenuation of the light.
20951 An integer value,
20952 when requested,
20953 is computed by rounding the internal floating-point representation to
20954 the nearest integer. The initial value is 1. "))
20955 (entry (% (heading (code "GL_LINEAR_ATTENUATION")))
20956 (para (var "params")
20957 " returns a single integer or floating-point value representing the
20958 linear attenuation of the light.
20959 An integer value,
20960 when requested,
20961 is computed by rounding the internal floating-point representation to
20962 the nearest integer. The initial value is 0. "))
20963 (entry (% (heading (code "GL_QUADRATIC_ATTENUATION")))
20964 (para (var "params")
20965 " returns a single integer or floating-point value representing the
20966 quadratic attenuation of the light.
20967 An integer value,
20968 when requested,
20969 is computed by rounding the internal floating-point representation to
20970 the nearest integer. The initial value is 0. ")))
20971 (heading "Errors")
20972 (para (code "GL_INVALID_ENUM")
20973 " is generated if "
20974 (var "light")
20975 " or "
20976 (var "pname")
20977 " is not an
20978 accepted value. ")
20979 (para (code "GL_INVALID_OPERATION")
20980 " is generated if "
20981 (code "glGetLight")
20982 "
20983 is executed between the execution of "
20984 (code "glBegin")
20985 "
20986 and the corresponding execution of "
20987 (code "glEnd")
20988 ". ")))
20989
20990 (define-gl-procedure
20991 glGetMap
20992 "glGetMap"
20993 (funcsynopsis
20994 (funcprototype
20995 (funcdef "void " (function "glGetMapdv"))
20996 (paramdef "GLenum " (parameter "target"))
20997 (paramdef "GLenum " (parameter "query"))
20998 (paramdef "GLdouble * " (parameter "v"))))
20999 '(*fragment*
21000 (heading "return evaluator parameters")
21001 (heading "Parameters")
21002 (table (% (formatter (asis)))
21003 (entry (% (heading (var "target")))
21004 (para "
21005 Specifies the symbolic name of a map.
21006 Accepted values are "
21007 (code "GL_MAP1_COLOR_4")
21008 ", "
21009 (code "GL_MAP1_INDEX")
21010 ", "
21011 (code "GL_MAP1_NORMAL")
21012 ", "
21013 (code "GL_MAP1_TEXTURE_COORD_1")
21014 ", "
21015 (code "GL_MAP1_TEXTURE_COORD_2")
21016 ", "
21017 (code "GL_MAP1_TEXTURE_COORD_3")
21018 ", "
21019 (code "GL_MAP1_TEXTURE_COORD_4")
21020 ", "
21021 (code "GL_MAP1_VERTEX_3")
21022 ", "
21023 (code "GL_MAP1_VERTEX_4")
21024 ", "
21025 (code "GL_MAP2_COLOR_4")
21026 ", "
21027 (code "GL_MAP2_INDEX")
21028 ", "
21029 (code "GL_MAP2_NORMAL")
21030 ", "
21031 (code "GL_MAP2_TEXTURE_COORD_1")
21032 ", "
21033 (code "GL_MAP2_TEXTURE_COORD_2")
21034 ", "
21035 (code "GL_MAP2_TEXTURE_COORD_3")
21036 ", "
21037 (code "GL_MAP2_TEXTURE_COORD_4")
21038 ", "
21039 (code "GL_MAP2_VERTEX_3")
21040 ", and "
21041 (code "GL_MAP2_VERTEX_4")
21042 ". "))
21043 (entry (% (heading (var "query")))
21044 (para "
21045 Specifies which parameter to return.
21046 Symbolic names "
21047 (code "GL_COEFF")
21048 ", "
21049 (code "GL_ORDER")
21050 ", and "
21051 (code "GL_DOMAIN")
21052 " are accepted. "))
21053 (entry (% (heading (var "v")))
21054 (para "
21055 Returns the requested data. ")))
21056 (heading "Description")
21057 (para (code "glMap1")
21058 " and "
21059 (code "glMap2")
21060 " define evaluators. "
21061 (code "glGetMap")
21062 " returns evaluator parameters. "
21063 (var "target")
21064 " chooses a map, "
21065 (var "query")
21066 " selects a specific parameter,
21067 and "
21068 (var "v")
21069 " points to storage where the values will be returned. ")
21070 (para "
21071 The acceptable values for the "
21072 (var "target")
21073 " parameter are described
21074 in the "
21075 (code "glMap1")
21076 " and "
21077 (code "glMap2")
21078 " reference pages. ")
21079 (para (var "query")
21080 " can assume the following values: ")
21081 (table (% (formatter (asis)))
21082 (entry (% (heading (code "GL_COEFF")))
21083 (para (var "v")
21084 " returns the control points for the evaluator function.
21085 One-dimensional evaluators return "
21086 (math (var "order"))
21087 "
21088 control points,
21089 and two-dimensional evaluators return "
21090 (math (var "uorder") "×" (var "vorder"))
21091 "
21092 control points.
21093 Each control point consists of one, two, three, or four integer,
21094 single-precision floating-point,
21095 or double-precision floating-point values,
21096 depending on the type of the evaluator.
21097 The GL returns two-dimensional control points in row-major order,
21098 incrementing the "
21099 (math (var "uorder"))
21100 "
21101 index quickly
21102 and the "
21103 (math (var "vorder"))
21104 "
21105 index after each row.
21106 Integer values,
21107 when requested,
21108 are computed by rounding the internal floating-point values to the
21109 nearest integer values. "))
21110 (entry (% (heading (code "GL_ORDER")))
21111 (para (var "v")
21112 " returns the order of the evaluator function.
21113 One-dimensional evaluators return a single value, "
21114 (math (var "order"))
21115 ".
21116 The initial value is 1.
21117 Two-dimensional evaluators return two values, "
21118 (math (var "uorder"))
21119 "
21120 and "
21121 (math (var "vorder"))
21122 ".
21123 The initial value is 1,1. "))
21124 (entry (% (heading (code "GL_DOMAIN")))
21125 (para (var "v")
21126 " returns the linear "
21127 (math (var "u"))
21128 "
21129 and "
21130 (math (var "v"))
21131 "
21132 mapping parameters.
21133 One-dimensional evaluators return two values, "
21134 (math (var "u1"))
21135 "
21136 and "
21137 (math (var "u2"))
21138 ",
21139 as specified by "
21140 (code "glMap1")
21141 ".
21142 Two-dimensional evaluators return four values
21143 ("
21144 (math (var "u1"))
21145 ", "
21146 (math (var "u2"))
21147 ", "
21148 (math (var "v1"))
21149 ",
21150 and "
21151 (math (var "v2"))
21152 ")
21153 as specified by "
21154 (code "glMap2")
21155 ".
21156 Integer values,
21157 when requested,
21158 are computed by rounding the internal floating-point values to the
21159 nearest integer values. ")))
21160 (heading "Errors")
21161 (para (code "GL_INVALID_ENUM")
21162 " is generated if either "
21163 (var "target")
21164 " or "
21165 (var "query")
21166 " is not
21167 an accepted value. ")
21168 (para (code "GL_INVALID_OPERATION")
21169 " is generated if "
21170 (code "glGetMap")
21171 "
21172 is executed between the execution of "
21173 (code "glBegin")
21174 "
21175 and the corresponding execution of "
21176 (code "glEnd")
21177 ". ")))
21178
21179 (define-gl-procedure
21180 glGetMaterial
21181 "glGetMaterial"
21182 (funcsynopsis
21183 (funcprototype
21184 (funcdef "void " (function "glGetMaterialfv"))
21185 (paramdef "GLenum " (parameter "face"))
21186 (paramdef "GLenum " (parameter "pname"))
21187 (paramdef "GLfloat * " (parameter "params"))))
21188 '(*fragment*
21189 (heading "return material parameters")
21190 (heading "Parameters")
21191 (table (% (formatter (asis)))
21192 (entry (% (heading (var "face")))
21193 (para "
21194 Specifies which of the two materials is being queried. "
21195 (code "GL_FRONT")
21196 " or "
21197 (code "GL_BACK")
21198 " are accepted,
21199 representing the front and back materials,
21200 respectively. "))
21201 (entry (% (heading (var "pname")))
21202 (para "
21203 Specifies the material parameter to return. "
21204 (code "GL_AMBIENT")
21205 ", "
21206 (code "GL_DIFFUSE")
21207 ", "
21208 (code "GL_SPECULAR")
21209 ", "
21210 (code "GL_EMISSION")
21211 ", "
21212 (code "GL_SHININESS")
21213 ", and "
21214 (code "GL_COLOR_INDEXES")
21215 "
21216 are accepted. "))
21217 (entry (% (heading (var "params")))
21218 (para "
21219 Returns the requested data. ")))
21220 (heading "Description")
21221 (para (code "glGetMaterial")
21222 " returns in "
21223 (var "params")
21224 " the value or values of parameter "
21225 (var "pname")
21226 "
21227 of material "
21228 (var "face")
21229 ". Six parameters are defined: ")
21230 (table (% (formatter (asis)))
21231 (entry (% (heading (code "GL_AMBIENT")))
21232 (para (var "params")
21233 " returns four integer or floating-point values representing the
21234 ambient reflectance of the material.
21235 Integer values,
21236 when requested,
21237 are linearly mapped from the internal floating-point representation
21238 such that 1.0 maps to the most positive representable integer value,
21239 and "
21240 (math "-1.0")
21241 "
21242 maps to the most negative representable integer value.
21243 If the internal value is outside the range "
21244 (math "[" "-1" "," "1" "]")
21245 ",
21246 the corresponding integer return value is undefined. The initial value is
21247 (0.2, 0.2, 0.2, 1.0) "))
21248 (entry (% (heading (code "GL_DIFFUSE")))
21249 (para (var "params")
21250 " returns four integer or floating-point values representing the
21251 diffuse reflectance of the material.
21252 Integer values,
21253 when requested,
21254 are linearly mapped from the internal floating-point representation
21255 such that 1.0 maps to the most positive representable integer value,
21256 and "
21257 (math "-1.0")
21258 "
21259 maps to the most negative representable integer value.
21260 If the internal value is outside the range "
21261 (math "[" "-1" "," "1" "]")
21262 ",
21263 the corresponding integer return value is undefined. The initial value is
21264 (0.8, 0.8, 0.8, 1.0). "))
21265 (entry (% (heading (code "GL_SPECULAR")))
21266 (para (var "params")
21267 " returns four integer or floating-point values representing the
21268 specular reflectance of the material.
21269 Integer values,
21270 when requested,
21271 are linearly mapped from the internal floating-point representation
21272 such that 1.0 maps to the most positive representable integer value,
21273 and "
21274 (math "-1.0")
21275 "
21276 maps to the most negative representable integer value.
21277 If the internal value is outside the range "
21278 (math "[" "-1" "," "1" "]")
21279 ",
21280 the corresponding integer return value is undefined. The initial value is
21281 (0, 0, 0, 1). "))
21282 (entry (% (heading (code "GL_EMISSION")))
21283 (para (var "params")
21284 " returns four integer or floating-point values representing the
21285 emitted light intensity of the material.
21286 Integer values,
21287 when requested,
21288 are linearly mapped from the internal floating-point representation
21289 such that 1.0 maps to the most positive representable integer value,
21290 and "
21291 (math "-1.0")
21292 "
21293 maps to the most negative representable integer value.
21294 If the internal value is outside the range "
21295 (math "[" "-1" "," "1" "]")
21296 ",
21297 the corresponding integer return value is undefined. The initial value is
21298 (0, 0, 0, 1). "))
21299 (entry (% (heading (code "GL_SHININESS")))
21300 (para (var "params")
21301 " returns one integer or floating-point value representing the
21302 specular exponent of the material.
21303 Integer values,
21304 when requested,
21305 are computed by rounding the internal floating-point value to the
21306 nearest integer value. The initial value is 0. "))
21307 (entry (% (heading (code "GL_COLOR_INDEXES")))
21308 (para (var "params")
21309 " returns three integer or floating-point values representing the
21310 ambient, diffuse, and specular indices of the material.
21311 These indices are used only for color index lighting.
21312 (All the other parameters are used only for RGBA lighting.)
21313 Integer values,
21314 when requested,
21315 are computed by rounding the internal floating-point values to the
21316 nearest integer values. ")))
21317 (heading "Errors")
21318 (para (code "GL_INVALID_ENUM")
21319 " is generated if "
21320 (var "face")
21321 " or "
21322 (var "pname")
21323 " is not an
21324 accepted value. ")
21325 (para (code "GL_INVALID_OPERATION")
21326 " is generated if "
21327 (code "glGetMaterial")
21328 "
21329 is executed between the execution of "
21330 (code "glBegin")
21331 "
21332 and the corresponding execution of "
21333 (code "glEnd")
21334 ". ")))
21335
21336 (define-gl-procedure
21337 glGetMinmaxParameter
21338 "glGetMinmaxParameter"
21339 (funcsynopsis
21340 (funcprototype
21341 (funcdef
21342 "void "
21343 (function "glGetMinmaxParameterfv"))
21344 (paramdef "GLenum " (parameter "target"))
21345 (paramdef "GLenum " (parameter "pname"))
21346 (paramdef "GLfloat * " (parameter "params"))))
21347 '(*fragment*
21348 (heading "get minmax parameters")
21349 (heading "Parameters")
21350 (table (% (formatter (asis)))
21351 (entry (% (heading (var "target")))
21352 (para "
21353 Must be " (code "GL_MINMAX") ". "))
21354 (entry (% (heading (var "pname")))
21355 (para "
21356 The parameter to be retrieved.
21357 Must be one of "
21358 (code "GL_MINMAX_FORMAT")
21359 " or "
21360 (code "GL_MINMAX_SINK")
21361 ". "))
21362 (entry (% (heading (var "params")))
21363 (para "
21364 A pointer to storage for the retrieved parameters. ")))
21365 (heading "Description")
21366 (para (code "glGetMinmaxParameter")
21367 " retrieves parameters for the current minmax table by setting "
21368 (var "pname")
21369 " to one of the following values: ")
21370 (para)
21371 (table (% (formatter (asis)))
21372 (entry (% (heading (strong "Parameter")))
21373 (para (strong "Description")))
21374 (entry (% (heading (code "GL_MINMAX_FORMAT")))
21375 (para "
21376 Internal format of minmax table "))
21377 (entry (% (heading (code "GL_MINMAX_SINK")))
21378 (para "
21379 Value of the "
21380 (var "sink")
21381 " parameter ")))
21382 (para)
21383 (heading "Errors")
21384 (para (code "GL_INVALID_ENUM")
21385 " is generated if "
21386 (var "target")
21387 " is not "
21388 (code "GL_MINMAX")
21389 ". ")
21390 (para (code "GL_INVALID_ENUM")
21391 " is generated if "
21392 (var "pname")
21393 " is not one of the allowable
21394 values. ")
21395 (para (code "GL_INVALID_OPERATION")
21396 " is generated if "
21397 (code "glGetMinmaxParameter")
21398 " is executed
21399 between the execution of "
21400 (code "glBegin")
21401 " and the corresponding
21402 execution of "
21403 (code "glEnd")
21404 ". ")))
21405
21406 (define-gl-procedure
21407 glGetMinmax
21408 "glGetMinmax"
21409 (funcsynopsis
21410 (funcprototype
21411 (funcdef "void " (function "glGetMinmax"))
21412 (paramdef "GLenum " (parameter "target"))
21413 (paramdef "GLboolean " (parameter "reset"))
21414 (paramdef "GLenum " (parameter "format"))
21415 (paramdef "GLenum " (parameter "types"))
21416 (paramdef "GLvoid * " (parameter "values"))))
21417 '(*fragment*
21418 (heading "get minimum and maximum pixel values")
21419 (heading "Parameters")
21420 (table (% (formatter (asis)))
21421 (entry (% (heading (var "target")))
21422 (para "
21423 Must be " (code "GL_MINMAX") ". "))
21424 (entry (% (heading (var "reset")))
21425 (para "
21426 If "
21427 (code "GL_TRUE")
21428 ", all entries in the minmax table that are actually
21429 returned are reset to their initial values. (Other entries are unaltered.)
21430 If "
21431 (code "GL_FALSE")
21432 ", the minmax table is unaltered. "))
21433 (entry (% (heading (var "format")))
21434 (para "
21435 The format of the data to be returned in "
21436 (var "values")
21437 ".
21438 Must be one of "
21439 (code "GL_RED")
21440 ", "
21441 (code "GL_GREEN")
21442 ", "
21443 (code "GL_BLUE")
21444 ", "
21445 (code "GL_ALPHA")
21446 ", "
21447 (code "GL_RGB")
21448 ", "
21449 (code "GL_BGR")
21450 ", "
21451 (code "GL_RGBA")
21452 ", "
21453 (code "GL_BGRA")
21454 ", "
21455 (code "GL_LUMINANCE")
21456 ", or "
21457 (code "GL_LUMINANCE_ALPHA")
21458 ". "))
21459 (entry (% (heading (var "types")))
21460 (para "
21461 The type of the data to be returned in "
21462 (var "values")
21463 ".
21464 Symbolic constants "
21465 (code "GL_UNSIGNED_BYTE")
21466 ", "
21467 (code "GL_BYTE")
21468 ", "
21469 (code "GL_BITMAP")
21470 ", "
21471 (code "GL_UNSIGNED_SHORT")
21472 ", "
21473 (code "GL_SHORT")
21474 ", "
21475 (code "GL_UNSIGNED_INT")
21476 ", "
21477 (code "GL_INT")
21478 ", "
21479 (code "GL_FLOAT")
21480 ", "
21481 (code "GL_UNSIGNED_BYTE_3_3_2")
21482 ", "
21483 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
21484 ", "
21485 (code "GL_UNSIGNED_SHORT_5_6_5")
21486 ", "
21487 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
21488 ", "
21489 (code "GL_UNSIGNED_SHORT_4_4_4_4")
21490 ", "
21491 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
21492 ", "
21493 (code "GL_UNSIGNED_SHORT_5_5_5_1")
21494 ", "
21495 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
21496 ", "
21497 (code "GL_UNSIGNED_INT_8_8_8_8")
21498 ", "
21499 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
21500 ", "
21501 (code "GL_UNSIGNED_INT_10_10_10_2")
21502 ", and "
21503 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
21504 "
21505 are accepted. "))
21506 (entry (% (heading (var "values")))
21507 (para "
21508 A pointer to storage for the returned values. ")))
21509 (heading "Description")
21510 (para (code "glGetMinmax")
21511 " returns the accumulated minimum and maximum pixel values (computed on a
21512 per-component basis) in a one-dimensional image of width 2. The first set
21513 of return values are the minima, and the second set of return values
21514 are the maxima.
21515 The format of the return values is determined by "
21516 (var "format")
21517 ", and their type is
21518 determined by "
21519 (var "types")
21520 ". ")
21521 (para "
21522 If a non-zero named buffer object is bound to the "
21523 (code "GL_PIXEL_PACK_BUFFER")
21524 " target
21525 (see "
21526 (code "glBindBuffer")
21527 ") while minimum and maximum pixel values are
21528 requested, "
21529 (var "values")
21530 " is treated as a byte offset into the buffer object's data store. ")
21531 (para "
21532 No pixel transfer operations are performed on the return values, but pixel
21533 storage modes that are applicable to one-dimensional images are performed.
21534 Color components that are requested in the specified "
21535 (var "format")
21536 ", but that
21537 are not included in the internal format of the minmax table, are
21538 returned as zero. The assignment of internal color components to the
21539 components requested by "
21540 (var "format")
21541 " are as follows: ")
21542 (para)
21543 (table (% (formatter (asis)))
21544 (entry (% (heading (strong "Internal Component")))
21545 (para (strong "Resulting Component")))
21546 (entry (% (heading "
21547 Red ")) (para "
21548 Red "))
21549 (entry (% (heading "
21550 Green ")) (para "
21551 Green "))
21552 (entry (% (heading "
21553 Blue ")) (para "
21554 Blue "))
21555 (entry (% (heading "
21556 Alpha ")) (para "
21557 Alpha "))
21558 (entry (% (heading "
21559 Luminance "))
21560 (para "
21561 Red ")))
21562 (para "
21563 If "
21564 (var "reset")
21565 " is "
21566 (code "GL_TRUE")
21567 ", the minmax table entries corresponding
21568 to the return values are reset to their initial
21569 values. Minimum and maximum values that are not returned are not
21570 modified, even if "
21571 (var "reset")
21572 " is "
21573 (code "GL_TRUE")
21574 ". ")
21575 (heading "Errors")
21576 (para (code "GL_INVALID_ENUM")
21577 " is generated if "
21578 (var "target")
21579 " is not "
21580 (code "GL_MINMAX")
21581 ". ")
21582 (para (code "GL_INVALID_ENUM")
21583 " is generated if "
21584 (var "format")
21585 " is not one of the allowable
21586 values. ")
21587 (para (code "GL_INVALID_ENUM")
21588 " is generated if "
21589 (var "types")
21590 " is not one of the allowable
21591 values. ")
21592 (para (code "GL_INVALID_OPERATION")
21593 " is generated if "
21594 (var "types")
21595 " is one of "
21596 (code "GL_UNSIGNED_BYTE_3_3_2")
21597 ", "
21598 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
21599 ", "
21600 (code "GL_UNSIGNED_SHORT_5_6_5")
21601 ", or "
21602 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
21603 "
21604 and "
21605 (var "format")
21606 " is not "
21607 (code "GL_RGB")
21608 ". ")
21609 (para (code "GL_INVALID_OPERATION")
21610 " is generated if "
21611 (var "types")
21612 " is one of "
21613 (code "GL_UNSIGNED_SHORT_4_4_4_4")
21614 ", "
21615 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
21616 ", "
21617 (code "GL_UNSIGNED_SHORT_5_5_5_1")
21618 ", "
21619 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
21620 ", "
21621 (code "GL_UNSIGNED_INT_8_8_8_8")
21622 ", "
21623 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
21624 ", "
21625 (code "GL_UNSIGNED_INT_10_10_10_2")
21626 ", or "
21627 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
21628 "
21629 and "
21630 (var "format")
21631 " is neither "
21632 (code "GL_RGBA")
21633 " nor "
21634 (code "GL_BGRA")
21635 ". ")
21636 (para (code "GL_INVALID_OPERATION")
21637 " is generated if a non-zero buffer object name is bound to the "
21638 (code "GL_PIXEL_PACK_BUFFER")
21639 " target and the buffer object's data store is currently mapped. ")
21640 (para (code "GL_INVALID_OPERATION")
21641 " is generated if a non-zero buffer object name is bound to the "
21642 (code "GL_PIXEL_PACK_BUFFER")
21643 " target and the data would be packed to the buffer
21644 object such that the memory writes required would exceed the data store size. ")
21645 (para (code "GL_INVALID_OPERATION")
21646 " is generated if a non-zero buffer object name is bound to the "
21647 (code "GL_PIXEL_PACK_BUFFER")
21648 " target and "
21649 (var "values")
21650 " is not evenly divisible
21651 into the number of bytes needed to store in memory a datum indicated by "
21652 (var "type")
21653 ". ")
21654 (para (code "GL_INVALID_OPERATION")
21655 " is generated if "
21656 (code "glGetMinmax")
21657 " is executed
21658 between the execution of "
21659 (code "glBegin")
21660 " and the corresponding
21661 execution of "
21662 (code "glEnd")
21663 ". ")))
21664
21665 (define-gl-procedure
21666 glGetPixelMap
21667 "glGetPixelMap"
21668 (funcsynopsis
21669 (funcprototype
21670 (funcdef "void " (function "glGetPixelMapfv"))
21671 (paramdef "GLenum " (parameter "map"))
21672 (paramdef "GLfloat * " (parameter "data"))))
21673 '(*fragment*
21674 (heading "return the specified pixel map")
21675 (heading "Parameters")
21676 (table (% (formatter (asis)))
21677 (entry (% (heading (var "map")))
21678 (para "
21679 Specifies the name of the pixel map to return.
21680 Accepted values are "
21681 (code "GL_PIXEL_MAP_I_TO_I")
21682 ", "
21683 (code "GL_PIXEL_MAP_S_TO_S")
21684 ", "
21685 (code "GL_PIXEL_MAP_I_TO_R")
21686 ", "
21687 (code "GL_PIXEL_MAP_I_TO_G")
21688 ", "
21689 (code "GL_PIXEL_MAP_I_TO_B")
21690 ", "
21691 (code "GL_PIXEL_MAP_I_TO_A")
21692 ", "
21693 (code "GL_PIXEL_MAP_R_TO_R")
21694 ", "
21695 (code "GL_PIXEL_MAP_G_TO_G")
21696 ", "
21697 (code "GL_PIXEL_MAP_B_TO_B")
21698 ", and "
21699 (code "GL_PIXEL_MAP_A_TO_A")
21700 ". "))
21701 (entry (% (heading (var "data")))
21702 (para "
21703 Returns the pixel map contents. ")))
21704 (heading "Description")
21705 (para "
21706 See the "
21707 (code "glPixelMap")
21708 " reference page for a description of the acceptable
21709 values for the "
21710 (var "map")
21711 " parameter. "
21712 (code "glGetPixelMap")
21713 " returns in "
21714 (var "data")
21715 " the contents of the pixel map
21716 specified in "
21717 (var "map")
21718 ".
21719 Pixel maps are used during the execution of "
21720 (code "glReadPixels")
21721 ", "
21722 (code "glDrawPixels")
21723 ", "
21724 (code "glCopyPixels")
21725 ", "
21726 (code "glTexImage1D")
21727 ", "
21728 (code "glTexImage2D")
21729 ", "
21730 (code "glTexImage3D")
21731 ", "
21732 (code "glTexSubImage1D")
21733 ", "
21734 (code "glTexSubImage2D")
21735 ", "
21736 (code "glTexSubImage3D")
21737 ", "
21738 (code "glCopyTexImage1D")
21739 ", "
21740 (code "glCopyTexImage2D")
21741 ", "
21742 (code "glCopyTexSubImage1D")
21743 ", "
21744 (code "glCopyTexSubImage2D")
21745 ", and "
21746 (code "glCopyTexSubImage3D")
21747 ".
21748 to map color indices,
21749 stencil indices,
21750 color components,
21751 and depth components to other values. ")
21752 (para "
21753 If a non-zero named buffer object is bound to the "
21754 (code "GL_PIXEL_PACK_BUFFER")
21755 " target
21756 (see "
21757 (code "glBindBuffer")
21758 ") while a pixel map is
21759 requested, "
21760 (var "data")
21761 " is treated as a byte offset into the buffer object's data store. ")
21762 (para "
21763 Unsigned integer values,
21764 if requested,
21765 are linearly mapped from the internal fixed or floating-point representation
21766 such that 1.0 maps to the largest representable integer value,
21767 and 0.0 maps to 0.
21768 Return unsigned integer values are undefined if the map value was
21769 not in the range [0,1]. ")
21770 (para "
21771 To determine the required size of "
21772 (var "map")
21773 ",
21774 call "
21775 (code "glGet")
21776 " with the appropriate symbolic
21777 constant. ")
21778 (heading "Errors")
21779 (para (code "GL_INVALID_ENUM")
21780 " is generated if "
21781 (var "map")
21782 " is not an accepted value. ")
21783 (para (code "GL_INVALID_OPERATION")
21784 " is generated if a non-zero buffer object name is bound to the "
21785 (code "GL_PIXEL_PACK_BUFFER")
21786 " target and the buffer object's data store is currently mapped. ")
21787 (para (code "GL_INVALID_OPERATION")
21788 " is generated if a non-zero buffer object name is bound to the "
21789 (code "GL_PIXEL_PACK_BUFFER")
21790 " target and the data would be packed to the buffer
21791 object such that the memory writes required would exceed the data store size. ")
21792 (para (code "GL_INVALID_OPERATION")
21793 " is generated by "
21794 (code "glGetPixelMapfv")
21795 " if a non-zero buffer object name is bound to the "
21796 (code "GL_PIXEL_PACK_BUFFER")
21797 " target and "
21798 (var "data")
21799 " is not evenly divisible
21800 into the number of bytes needed to store in memory a GLfloat datum. ")
21801 (para (code "GL_INVALID_OPERATION")
21802 " is generated by "
21803 (code "glGetPixelMapuiv")
21804 " if a non-zero buffer object name is bound to the "
21805 (code "GL_PIXEL_PACK_BUFFER")
21806 " target and "
21807 (var "data")
21808 " is not evenly divisible
21809 into the number of bytes needed to store in memory a GLuint datum. ")
21810 (para (code "GL_INVALID_OPERATION")
21811 " is generated by "
21812 (code "glGetPixelMapusv")
21813 " if a non-zero buffer object name is bound to the "
21814 (code "GL_PIXEL_PACK_BUFFER")
21815 " target and "
21816 (var "data")
21817 " is not evenly divisible
21818 into the number of bytes needed to store in memory a GLushort datum. ")
21819 (para (code "GL_INVALID_OPERATION")
21820 " is generated if "
21821 (code "glGetPixelMap")
21822 "
21823 is executed between the execution of "
21824 (code "glBegin")
21825 "
21826 and the corresponding execution of "
21827 (code "glEnd")
21828 ". ")))
21829
21830 (define-gl-procedure
21831 glGetPointerv
21832 "glGetPointerv"
21833 (funcsynopsis
21834 (funcprototype
21835 (funcdef "void " (function "glGetPointerv"))
21836 (paramdef "GLenum " (parameter "pname"))
21837 (paramdef "GLvoid ** " (parameter "params"))))
21838 '(*fragment*
21839 (heading
21840 "return the address of the specified pointer")
21841 (heading "Parameters")
21842 (table (% (formatter (asis)))
21843 (entry (% (heading (var "pname")))
21844 (para "
21845 Specifies the array or buffer pointer to be returned.
21846 Symbolic constants "
21847 (code "GL_COLOR_ARRAY_POINTER")
21848 ", "
21849 (code "GL_EDGE_FLAG_ARRAY_POINTER")
21850 ", "
21851 (code "GL_FOG_COORD_ARRAY_POINTER")
21852 ", "
21853 (code "GL_FEEDBACK_BUFFER_POINTER")
21854 ", "
21855 (code "GL_INDEX_ARRAY_POINTER")
21856 ", "
21857 (code "GL_NORMAL_ARRAY_POINTER")
21858 ", "
21859 (code "GL_SECONDARY_COLOR_ARRAY_POINTER")
21860 ", "
21861 (code "GL_SELECTION_BUFFER_POINTER")
21862 ", "
21863 (code "GL_TEXTURE_COORD_ARRAY_POINTER")
21864 ",
21865 or "
21866 (code "GL_VERTEX_ARRAY_POINTER")
21867 "
21868 are accepted. "))
21869 (entry (% (heading (var "params")))
21870 (para "
21871 Returns the pointer value specified by "
21872 (var "pname")
21873 ". ")))
21874 (heading "Description")
21875 (para (code "glGetPointerv")
21876 " returns pointer information. "
21877 (var "pname")
21878 " is a symbolic constant
21879 indicating the pointer to be returned, and "
21880 (var "params")
21881 " is a pointer to a
21882 location in which to place the returned data. ")
21883 (para "
21884 For all "
21885 (var "pname")
21886 " arguments except "
21887 (code "GL_FEEDBACK_BUFFER_POINTER")
21888 " and "
21889 (code "GL_SELECTION_BUFFER_POINTER")
21890 ",
21891 if a non-zero named buffer object was bound to the "
21892 (code "GL_ARRAY_BUFFER")
21893 " target
21894 (see "
21895 (code "glBindBuffer")
21896 ") when the desired pointer was previously
21897 specified, the pointer returned is a byte offset into the buffer object's data store.
21898 Buffer objects are only available in OpenGL versions 1.5 and greater. ")
21899 (heading "Errors")
21900 (para (code "GL_INVALID_ENUM")
21901 " is generated if "
21902 (var "pname")
21903 " is not an accepted value. ")))
21904
21905 (define-gl-procedure
21906 glGetPolygonStipple
21907 "glGetPolygonStipple"
21908 (funcsynopsis
21909 (funcprototype
21910 (funcdef
21911 "void "
21912 (function "glGetPolygonStipple"))
21913 (paramdef "GLubyte * " (parameter "pattern"))))
21914 '(*fragment*
21915 (heading "return the polygon stipple pattern")
21916 (heading "Parameters")
21917 (table (% (formatter (asis)))
21918 (entry (% (heading (var "pattern")))
21919 (para "
21920 Returns the stipple pattern. The initial value is all 1's. ")))
21921 (heading "Description")
21922 (para (code "glGetPolygonStipple")
21923 " returns to "
21924 (var "pattern")
21925 " a "
21926 (math "32" "×" "32")
21927 "
21928 polygon stipple pattern.
21929 The pattern is packed into memory as if "
21930 (code "glReadPixels")
21931 "
21932 with both "
21933 (var "height")
21934 " and "
21935 (var "width")
21936 " of 32, "
21937 (var "type")
21938 " of "
21939 (code "GL_BITMAP")
21940 ",
21941 and "
21942 (var "format")
21943 " of "
21944 (code "GL_COLOR_INDEX")
21945 " were called,
21946 and the stipple pattern were stored in an internal "
21947 (math "32" "×" "32")
21948 "
21949 color
21950 index buffer.
21951 Unlike "
21952 (code "glReadPixels")
21953 ",
21954 however,
21955 pixel transfer operations
21956 (shift, offset, pixel map)
21957 are not applied to the returned stipple image. ")
21958 (para "
21959 If a non-zero named buffer object is bound to the "
21960 (code "GL_PIXEL_PACK_BUFFER")
21961 " target
21962 (see "
21963 (code "glBindBuffer")
21964 ") while a polygon stipple pattern is
21965 requested, "
21966 (var "pattern")
21967 " is treated as a byte offset into the buffer object's data store. ")
21968 (heading "Errors")
21969 (para (code "GL_INVALID_OPERATION")
21970 " is generated if a non-zero buffer object name is bound to the "
21971 (code "GL_PIXEL_PACK_BUFFER")
21972 " target and the buffer object's data store is currently mapped. ")
21973 (para (code "GL_INVALID_OPERATION")
21974 " is generated if a non-zero buffer object name is bound to the "
21975 (code "GL_PIXEL_PACK_BUFFER")
21976 " target and the data would be packed to the buffer
21977 object such that the memory writes required would exceed the data store size. ")
21978 (para (code "GL_INVALID_OPERATION")
21979 " is generated if "
21980 (code "glGetPolygonStipple")
21981 "
21982 is executed between the execution of "
21983 (code "glBegin")
21984 "
21985 and the corresponding execution of "
21986 (code "glEnd")
21987 ". ")))
21988
21989 (define-gl-procedure
21990 glGetProgramInfoLog
21991 "glGetProgramInfoLog"
21992 (funcsynopsis
21993 (funcprototype
21994 (funcdef
21995 "void "
21996 (function "glGetProgramInfoLog"))
21997 (paramdef "GLuint " (parameter "program"))
21998 (paramdef "GLsizei " (parameter "maxLength"))
21999 (paramdef "GLsizei *" (parameter "length"))
22000 (paramdef "GLchar *" (parameter "infoLog"))))
22001 '(*fragment*
22002 (heading
22003 "Returns the information log for a program object")
22004 (heading "Parameters")
22005 (table (% (formatter (asis)))
22006 (entry (% (heading (var "program")))
22007 (para "Specifies the program object whose information
22008 \t\t log is to be queried."))
22009 (entry (% (heading (var "maxLength")))
22010 (para "Specifies the size of the character buffer for
22011 \t\t storing the returned information log."))
22012 (entry (% (heading (var "length")))
22013 (para "Returns the length of the string returned in "
22014 (var "infoLog")
22015 " (excluding the null
22016 \t\t terminator)."))
22017 (entry (% (heading (var "infoLog")))
22018 (para "Specifies an array of characters that is used
22019 \t\t to return the information log.")))
22020 (heading "Description")
22021 (para (code "glGetProgramInfoLog")
22022 " returns the
22023 \tinformation log for the specified program object. The
22024 \tinformation log for a program object is modified when the
22025 \tprogram object is linked or validated. The string that is
22026 \treturned will be null terminated.")
22027 (para (code "glGetProgramInfoLog")
22028 " returns in\t"
22029 (var "infoLog")
22030 " as much of the information log as
22031 \tit can, up to a maximum of "
22032 (var "maxLength")
22033 "
22034 characters. The number of characters actually returned,
22035 \texcluding the null termination character, is specified by\t"
22036 (var "length")
22037 ". If the length of the returned
22038 \tstring is not required, a value of "
22039 (code "NULL")
22040 " can
22041 \tbe passed in the "
22042 (var "length")
22043 " argument. The
22044 \tsize of the buffer required to store the returned information
22045 \tlog can be obtained by calling\t"
22046 (code "glGetProgram")
22047 "
22048 with the value "
22049 (code "GL_INFO_LOG_LENGTH")
22050 ". ")
22051 (para "The information log for a program object is either an
22052 \tempty string, or a string containing information about the last
22053 \tlink operation, or a string containing information about the
22054 \tlast validation operation. It may contain diagnostic messages,
22055 \twarning messages, and other information. When a program object
22056 \tis created, its information log will be a string of length
22057 \t0.")
22058 (heading "Errors")
22059 (para (code "GL_INVALID_VALUE")
22060 " is generated if\t"
22061 (var "program")
22062 " is not a value generated by
22063 \tOpenGL.")
22064 (para (code "GL_INVALID_OPERATION")
22065 " is generated if\t"
22066 (var "program")
22067 " is not a program object.")
22068 (para (code "GL_INVALID_VALUE")
22069 " is generated if\t"
22070 (var "maxLength")
22071 " is less than 0.")
22072 (para (code "GL_INVALID_OPERATION")
22073 " is generated if\t"
22074 (code "glGetProgramInfoLog")
22075 " is executed between the
22076 \texecution of\t"
22077 (code "glBegin")
22078 "
22079 and the corresponding execution of\t"
22080 (code "glEnd")
22081 ".")))
22082
22083 (define-gl-procedure
22084 glGetProgramiv
22085 "glGetProgramiv"
22086 (funcsynopsis
22087 (funcprototype
22088 (funcdef "void " (function "glGetProgramiv"))
22089 (paramdef "GLuint " (parameter "program"))
22090 (paramdef "GLenum " (parameter "pname"))
22091 (paramdef "GLint *" (parameter "params"))))
22092 '(*fragment*
22093 (heading
22094 "Returns a parameter from a program object")
22095 (heading "Parameters")
22096 (table (% (formatter (asis)))
22097 (entry (% (heading (var "program")))
22098 (para "Specifies the program object to be
22099 \t\t queried."))
22100 (entry (% (heading (var "pname")))
22101 (para "Specifies the object parameter. Accepted
22102 \t\t symbolic names are "
22103 (code "GL_DELETE_STATUS")
22104 ", "
22105 (code "GL_LINK_STATUS")
22106 ", "
22107 (code "GL_VALIDATE_STATUS")
22108 ", "
22109 (code "GL_INFO_LOG_LENGTH")
22110 ", "
22111 (code "GL_ATTACHED_SHADERS")
22112 ", "
22113 (code "GL_ACTIVE_ATTRIBUTES")
22114 ", "
22115 (code "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH")
22116 ", "
22117 (code "GL_ACTIVE_UNIFORMS")
22118 ", "
22119 (code "GL_ACTIVE_UNIFORM_MAX_LENGTH")
22120 "."))
22121 (entry (% (heading (var "params")))
22122 (para "Returns the requested object parameter.")))
22123 (heading "Description")
22124 (para (code "glGetProgram")
22125 "
22126 returns in "
22127 (var "params")
22128 "
22129 the value of a parameter for a specific program object. The following parameters are defined:")
22130 (table (% (formatter (asis)))
22131 (entry (% (heading (code "GL_DELETE_STATUS")))
22132 (para)
22133 (para (var "params")
22134 " returns "
22135 (code "GL_TRUE")
22136 " if "
22137 (var "program")
22138 " is currently flagged
22139 \t\t for deletion, and "
22140 (code "GL_FALSE")
22141 "
22142 otherwise."))
22143 (entry (% (heading (code "GL_LINK_STATUS")))
22144 (para)
22145 (para (var "params")
22146 " returns "
22147 (code "GL_TRUE")
22148 " if the last link
22149 \t\t operation on "
22150 (var "program")
22151 " was
22152 \t\t successful, and "
22153 (code "GL_FALSE")
22154 "
22155 otherwise."))
22156 (entry (% (heading (code "GL_VALIDATE_STATUS")))
22157 (para)
22158 (para (var "params")
22159 " returns "
22160 (code "GL_TRUE")
22161 " or if the last
22162 \t\t validation operation on "
22163 (var "program")
22164 " was successful, and "
22165 (code "GL_FALSE")
22166 "
22167 otherwise."))
22168 (entry (% (heading (code "GL_INFO_LOG_LENGTH")))
22169 (para)
22170 (para (var "params")
22171 " returns the
22172 \t\t number of characters in the information log for "
22173 (var "program")
22174 " including the null
22175 \t\t termination character (i.e., the size of the
22176 \t\t character buffer required to store the information
22177 \t\t log). If "
22178 (var "program")
22179 " has no
22180 \t\t information log, a value of 0 is
22181 \t\t returned."))
22182 (entry (% (heading (code "GL_ATTACHED_SHADERS")))
22183 (para)
22184 (para (var "params")
22185 " returns the
22186 \t\t number of shader objects attached to "
22187 (var "program")
22188 "."))
22189 (entry (% (heading (code "GL_ACTIVE_ATTRIBUTES")))
22190 (para)
22191 (para (var "params")
22192 " returns the
22193 \t\t number of active attribute variables for "
22194 (var "program")
22195 "."))
22196 (entry (% (heading (code "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH")))
22197 (para)
22198 (para (var "params")
22199 " returns the
22200 \t\t length of the longest active attribute name for "
22201 (var "program")
22202 ", including the null
22203 \t\t termination character (i.e., the size of the
22204 \t\t character buffer required to store the longest
22205 \t\t attribute name). If no active attributes exist, 0 is
22206 \t\t returned."))
22207 (entry (% (heading (code "GL_ACTIVE_UNIFORMS")))
22208 (para)
22209 (para (var "params")
22210 " returns the
22211 \t\t number of active uniform variables for "
22212 (var "program")
22213 "."))
22214 (entry (% (heading (code "GL_ACTIVE_UNIFORM_MAX_LENGTH")))
22215 (para)
22216 (para (var "params")
22217 " returns the
22218 \t\t length of the longest active uniform variable name
22219 \t\t for "
22220 (var "program")
22221 ", including the
22222 \t\t null termination character (i.e., the size of the
22223 \t\t character buffer required to store the longest
22224 \t\t uniform variable name). If no active uniform
22225 \t\t variables exist, 0 is returned.")))
22226 (heading "Errors")
22227 (para (code "GL_INVALID_VALUE")
22228 "
22229 is generated if "
22230 (var "program")
22231 "
22232 is not a value generated by OpenGL.")
22233 (para (code "GL_INVALID_OPERATION")
22234 "
22235 is generated if "
22236 (var "program")
22237 "
22238 does not refer to a program object.")
22239 (para (code "GL_INVALID_ENUM")
22240 "
22241 is generated if "
22242 (var "pname")
22243 "
22244 is not an accepted value.")
22245 (para (code "GL_INVALID_OPERATION")
22246 " is generated if\t"
22247 (code "glGetProgram")
22248 " is executed between the
22249 \texecution of\t"
22250 (code "glBegin")
22251 "
22252 and the corresponding execution of\t"
22253 (code "glEnd")
22254 ".")))
22255
22256 (define-gl-procedure
22257 glGetQueryiv
22258 "glGetQueryiv"
22259 (funcsynopsis
22260 (funcprototype
22261 (funcdef "void " (function "glGetQueryiv"))
22262 (paramdef "GLenum " (parameter "target"))
22263 (paramdef "GLenum " (parameter "pname"))
22264 (paramdef "GLint * " (parameter "params"))))
22265 '(*fragment*
22266 (heading
22267 "return parameters of a query object target")
22268 (heading "Parameters")
22269 (table (% (formatter (asis)))
22270 (entry (% (heading (var "target")))
22271 (para "
22272 Specifies a query object target.
22273 Must be "
22274 (code "GL_SAMPLES_PASSED")
22275 ". "))
22276 (entry (% (heading (var "pname")))
22277 (para "
22278 Specifies the symbolic name of a query object target parameter.
22279 Accepted values are "
22280 (code "GL_CURRENT_QUERY")
22281 " or "
22282 (code "GL_QUERY_COUNTER_BITS")
22283 ". "))
22284 (entry (% (heading (var "params")))
22285 (para "
22286 Returns the requested data. ")))
22287 (heading "Description")
22288 (para (code "glGetQueryiv")
22289 " returns in "
22290 (var "params")
22291 " a selected parameter of the query object target
22292 specified by "
22293 (var "target")
22294 ". ")
22295 (para (var "pname")
22296 " names a specific query object target parameter. When "
22297 (var "target")
22298 " is "
22299 (code "GL_SAMPLES_PASSED")
22300 ", "
22301 (var "pname")
22302 " can be as follows: ")
22303 (table (% (formatter (asis)))
22304 (entry (% (heading (code "GL_CURRENT_QUERY")))
22305 (para (var "params")
22306 " returns the name of the currently active occlusion query object.
22307 If no occlusion query is active, 0 is returned. The initial value is 0. "))
22308 (entry (% (heading (code "GL_QUERY_COUNTER_BITS")))
22309 (para (var "params")
22310 " returns the number of bits in the query counter used to accumulate passing samples.
22311 If the number of bits returned is 0, the implementation does not support a query counter, and the results
22312 obtained from "
22313 (code "glGetQueryObject")
22314 " are useless. ")))
22315 (heading "Errors")
22316 (para (code "GL_INVALID_ENUM")
22317 " is generated if "
22318 (var "target")
22319 " or "
22320 (var "pname")
22321 " is not an
22322 accepted value. ")
22323 (para (code "GL_INVALID_OPERATION")
22324 " is generated if "
22325 (code "glGetQueryiv")
22326 "
22327 is executed between the execution of "
22328 (code "glBegin")
22329 "
22330 and the corresponding execution of "
22331 (code "glEnd")
22332 ". ")))
22333
22334 (define-gl-procedure
22335 glGetQueryObject
22336 "glGetQueryObject"
22337 (funcsynopsis
22338 (funcprototype
22339 (funcdef "void " (function "glGetQueryObjectiv"))
22340 (paramdef "GLuint " (parameter "id"))
22341 (paramdef "GLenum " (parameter "pname"))
22342 (paramdef "GLint * " (parameter "params"))))
22343 '(*fragment*
22344 (heading "return parameters of a query object")
22345 (heading "Parameters")
22346 (table (% (formatter (asis)))
22347 (entry (% (heading (var "id")))
22348 (para "
22349 Specifies the name of a query object. "))
22350 (entry (% (heading (var "pname")))
22351 (para "
22352 Specifies the symbolic name of a query object parameter.
22353 Accepted values are "
22354 (code "GL_QUERY_RESULT")
22355 " or "
22356 (code "GL_QUERY_RESULT_AVAILABLE")
22357 ". "))
22358 (entry (% (heading (var "params")))
22359 (para "
22360 Returns the requested data. ")))
22361 (heading "Description")
22362 (para (code "glGetQueryObject")
22363 " returns in "
22364 (var "params")
22365 " a selected parameter of the query object
22366 specified by "
22367 (var "id")
22368 ". ")
22369 (para (var "pname")
22370 " names a specific query object parameter. "
22371 (var "pname")
22372 " can be as follows: ")
22373 (table (% (formatter (asis)))
22374 (entry (% (heading (code "GL_QUERY_RESULT")))
22375 (para (var "params")
22376 " returns the value of the query object's passed samples counter.
22377 The initial value is 0. "))
22378 (entry (% (heading (code "GL_QUERY_RESULT_AVAILABLE")))
22379 (para (var "params")
22380 " returns whether the passed samples counter is immediately available.
22381 If a delay would occur waiting for the query result, "
22382 (code "GL_FALSE")
22383 " is returned.
22384 Otherwise, "
22385 (code "GL_TRUE")
22386 " is returned, which also indicates that the results of all
22387 previous queries are available as well. ")))
22388 (heading "Errors")
22389 (para (code "GL_INVALID_ENUM")
22390 " is generated if "
22391 (var "pname")
22392 " is not an accepted value. ")
22393 (para (code "GL_INVALID_OPERATION")
22394 " is generated if "
22395 (var "id")
22396 " is not the name of a query object. ")
22397 (para (code "GL_INVALID_OPERATION")
22398 " is generated if "
22399 (var "id")
22400 " is the name of a currently active
22401 query object. ")
22402 (para (code "GL_INVALID_OPERATION")
22403 " is generated if "
22404 (code "glGetQueryObject")
22405 "
22406 is executed between the execution of "
22407 (code "glBegin")
22408 "
22409 and the corresponding execution of "
22410 (code "glEnd")
22411 ". ")))
22412
22413 (define-gl-procedure
22414 glGetSeparableFilter
22415 "glGetSeparableFilter"
22416 (funcsynopsis
22417 (funcprototype
22418 (funcdef
22419 "void "
22420 (function "glGetSeparableFilter"))
22421 (paramdef "GLenum " (parameter "target"))
22422 (paramdef "GLenum " (parameter "format"))
22423 (paramdef "GLenum " (parameter "type"))
22424 (paramdef "GLvoid * " (parameter "row"))
22425 (paramdef "GLvoid * " (parameter "column"))
22426 (paramdef "GLvoid * " (parameter "span"))))
22427 '(*fragment*
22428 (heading
22429 "get separable convolution filter kernel images")
22430 (heading "Parameters")
22431 (table (% (formatter (asis)))
22432 (entry (% (heading (var "target")))
22433 (para "
22434 The separable filter to be retrieved.
22435 Must be "
22436 (code "GL_SEPARABLE_2D")
22437 ". "))
22438 (entry (% (heading (var "format")))
22439 (para "
22440 Format of the output images.
22441 Must be one of "
22442 (code "GL_RED")
22443 ", "
22444 (code "GL_GREEN")
22445 ", "
22446 (code "GL_BLUE")
22447 ", "
22448 (code "GL_ALPHA")
22449 ", "
22450 (code "GL_RGB")
22451 ", "
22452 (code "GL_BGR")
22453 (code "GL_RGBA")
22454 ", "
22455 (code "GL_BGRA")
22456 ", "
22457 (code "GL_LUMINANCE")
22458 ", or "
22459 (code "GL_LUMINANCE_ALPHA")
22460 ". "))
22461 (entry (% (heading (var "type")))
22462 (para "
22463 Data type of components in the output images.
22464 Symbolic constants "
22465 (code "GL_UNSIGNED_BYTE")
22466 ", "
22467 (code "GL_BYTE")
22468 ", "
22469 (code "GL_BITMAP")
22470 ", "
22471 (code "GL_UNSIGNED_SHORT")
22472 ", "
22473 (code "GL_SHORT")
22474 ", "
22475 (code "GL_UNSIGNED_INT")
22476 ", "
22477 (code "GL_INT")
22478 ", "
22479 (code "GL_FLOAT")
22480 ", "
22481 (code "GL_UNSIGNED_BYTE_3_3_2")
22482 ", "
22483 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
22484 ", "
22485 (code "GL_UNSIGNED_SHORT_5_6_5")
22486 ", "
22487 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
22488 ", "
22489 (code "GL_UNSIGNED_SHORT_4_4_4_4")
22490 ", "
22491 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
22492 ", "
22493 (code "GL_UNSIGNED_SHORT_5_5_5_1")
22494 ", "
22495 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
22496 ", "
22497 (code "GL_UNSIGNED_INT_8_8_8_8")
22498 ", "
22499 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
22500 ", "
22501 (code "GL_UNSIGNED_INT_10_10_10_2")
22502 ", and "
22503 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
22504 "
22505 are accepted. "))
22506 (entry (% (heading (var "row")))
22507 (para "
22508 Pointer to storage for the row filter image. "))
22509 (entry (% (heading (var "column")))
22510 (para "
22511 Pointer to storage for the column filter image. "))
22512 (entry (% (heading (var "span")))
22513 (para "
22514 Pointer to storage for the span filter image (currently unused). ")))
22515 (heading "Description")
22516 (para (code "glGetSeparableFilter")
22517 " returns the two one-dimensional filter kernel images for the
22518 current separable 2D convolution filter.
22519 The row image is placed in "
22520 (var "row")
22521 " and the column image is placed in "
22522 (var "column")
22523 " according to the specifications in "
22524 (var "format")
22525 " and "
22526 (var "type")
22527 ".
22528 (In the current implementation, "
22529 (var "span")
22530 " is not affected in any way.)
22531 No pixel transfer operations are performed on the images, but the relevant
22532 pixel storage modes are applied. ")
22533 (para "
22534 If a non-zero named buffer object is bound to the "
22535 (code "GL_PIXEL_PACK_BUFFER")
22536 " target
22537 (see "
22538 (code "glBindBuffer")
22539 ") while a separable convolution filter is
22540 requested, "
22541 (var "row")
22542 ", "
22543 (var "column")
22544 ", and "
22545 (var "span")
22546 " are treated as a byte offset into the buffer object's data store. ")
22547 (para "
22548 Color components that are present in "
22549 (var "format")
22550 " but not included in the
22551 internal format of the filters are returned as zero.
22552 The assignments of internal color components to the components of "
22553 (var "format")
22554 "
22555 are as follows: ")
22556 (para)
22557 (table (% (formatter (asis)))
22558 (entry (% (heading (strong "Internal Component")))
22559 (para (strong "Resulting Component")))
22560 (entry (% (heading "
22561 Red ")) (para "
22562 Red "))
22563 (entry (% (heading "
22564 Green ")) (para "
22565 Green "))
22566 (entry (% (heading "
22567 Blue ")) (para "
22568 Blue "))
22569 (entry (% (heading "
22570 Alpha ")) (para "
22571 Alpha "))
22572 (entry (% (heading "
22573 Luminance "))
22574 (para "
22575 Red "))
22576 (entry (% (heading "
22577 Intensity "))
22578 (para "
22579 Red ")))
22580 (para)
22581 (heading "Errors")
22582 (para (code "GL_INVALID_ENUM")
22583 " is generated if "
22584 (var "target")
22585 " is not "
22586 (code "GL_SEPARABLE_2D")
22587 ". ")
22588 (para (code "GL_INVALID_ENUM")
22589 " is generated if "
22590 (var "format")
22591 " is not one of the allowable
22592 values. ")
22593 (para (code "GL_INVALID_ENUM")
22594 " is generated if "
22595 (var "type")
22596 " is not one of the allowable
22597 values. ")
22598 (para (code "GL_INVALID_OPERATION")
22599 " is generated if "
22600 (var "type")
22601 " is one of "
22602 (code "GL_UNSIGNED_BYTE_3_3_2")
22603 ", "
22604 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
22605 ", "
22606 (code "GL_UNSIGNED_SHORT_5_6_5")
22607 ", or "
22608 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
22609 "
22610 and "
22611 (var "format")
22612 " is not "
22613 (code "GL_RGB")
22614 ". ")
22615 (para (code "GL_INVALID_OPERATION")
22616 " is generated if "
22617 (var "type")
22618 " is one of "
22619 (code "GL_UNSIGNED_SHORT_4_4_4_4")
22620 ", "
22621 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
22622 ", "
22623 (code "GL_UNSIGNED_SHORT_5_5_5_1")
22624 ", "
22625 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
22626 ", "
22627 (code "GL_UNSIGNED_INT_8_8_8_8")
22628 ", "
22629 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
22630 ", "
22631 (code "GL_UNSIGNED_INT_10_10_10_2")
22632 ", or "
22633 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
22634 "
22635 and "
22636 (var "format")
22637 " is neither "
22638 (code "GL_RGBA")
22639 " nor "
22640 (code "GL_BGRA")
22641 ". ")
22642 (para (code "GL_INVALID_OPERATION")
22643 " is generated if a non-zero buffer object name is bound to the "
22644 (code "GL_PIXEL_PACK_BUFFER")
22645 " target and the buffer object's data store is currently mapped. ")
22646 (para (code "GL_INVALID_OPERATION")
22647 " is generated if a non-zero buffer object name is bound to the "
22648 (code "GL_PIXEL_PACK_BUFFER")
22649 " target and the data would be packed to the buffer
22650 object such that the memory writes required would exceed the data store size. ")
22651 (para (code "GL_INVALID_OPERATION")
22652 " is generated if a non-zero buffer object name is bound to the "
22653 (code "GL_PIXEL_PACK_BUFFER")
22654 " target and "
22655 (var "row")
22656 " or "
22657 (var "column")
22658 " is not evenly divisible
22659 into the number of bytes needed to store in memory a datum indicated by "
22660 (var "type")
22661 ". ")
22662 (para (code "GL_INVALID_OPERATION")
22663 " is generated if "
22664 (code "glGetSeparableFilter")
22665 " is executed
22666 between the execution of "
22667 (code "glBegin")
22668 " and the corresponding
22669 execution of "
22670 (code "glEnd")
22671 ". ")))
22672
22673 (define-gl-procedure
22674 glGetShaderInfoLog
22675 "glGetShaderInfoLog"
22676 (funcsynopsis
22677 (funcprototype
22678 (funcdef "void " (function "glGetShaderInfoLog"))
22679 (paramdef "GLuint " (parameter "shader"))
22680 (paramdef "GLsizei " (parameter "maxLength"))
22681 (paramdef "GLsizei *" (parameter "length"))
22682 (paramdef "GLchar *" (parameter "infoLog"))))
22683 '(*fragment*
22684 (heading
22685 "Returns the information log for a shader object")
22686 (heading "Parameters")
22687 (table (% (formatter (asis)))
22688 (entry (% (heading (var "shader")))
22689 (para "Specifies the shader object whose information
22690 \t\t log is to be queried."))
22691 (entry (% (heading (var "maxLength")))
22692 (para "Specifies the size of the character buffer for
22693 \t\t storing the returned information log."))
22694 (entry (% (heading (var "length")))
22695 (para "Returns the length of the string returned in "
22696 (var "infoLog")
22697 " (excluding the null
22698 \t\t terminator)."))
22699 (entry (% (heading (var "infoLog")))
22700 (para "Specifies an array of characters that is used
22701 \t\t to return the information log.")))
22702 (heading "Description")
22703 (para (code "glGetShaderInfoLog")
22704 " returns the
22705 \tinformation log for the specified shader object. The information
22706 \tlog for a shader object is modified when the shader is compiled.
22707 \tThe string that is returned will be null terminated.")
22708 (para (code "glGetShaderInfoLog")
22709 " returns in\t"
22710 (var "infoLog")
22711 " as much of the information log as
22712 \tit can, up to a maximum of "
22713 (var "maxLength")
22714 "
22715 characters. The number of characters actually returned,
22716 \texcluding the null termination character, is specified by\t"
22717 (var "length")
22718 ". If the length of the returned
22719 \tstring is not required, a value of "
22720 (code "NULL")
22721 " can
22722 \tbe passed in the "
22723 (var "length")
22724 " argument. The
22725 \tsize of the buffer required to store the returned information
22726 \tlog can be obtained by calling\t"
22727 (code "glGetShader")
22728 "
22729 with the value "
22730 (code "GL_INFO_LOG_LENGTH")
22731 ".")
22732 (para "The information log for a shader object is a string that
22733 \tmay contain diagnostic messages, warning messages, and other
22734 \tinformation about the last compile operation. When a shader
22735 \tobject is created, its information log will be a string of
22736 \tlength 0.")
22737 (heading "Errors")
22738 (para (code "GL_INVALID_VALUE")
22739 " is generated if\t"
22740 (var "shader")
22741 " is not a value generated by
22742 \tOpenGL.")
22743 (para (code "GL_INVALID_OPERATION")
22744 " is generated if\t"
22745 (var "shader")
22746 " is not a shader object.")
22747 (para (code "GL_INVALID_VALUE")
22748 " is generated if\t"
22749 (var "maxLength")
22750 " is less than 0.")
22751 (para (code "GL_INVALID_OPERATION")
22752 " is generated if\t"
22753 (code "glGetShaderInfoLog")
22754 " is executed between the
22755 \texecution of\t"
22756 (code "glBegin")
22757 "
22758 and the corresponding execution of\t"
22759 (code "glEnd")
22760 ".")))
22761
22762 (define-gl-procedure
22763 glGetShaderSource
22764 "glGetShaderSource"
22765 (funcsynopsis
22766 (funcprototype
22767 (funcdef "void " (function "glGetShaderSource"))
22768 (paramdef "GLuint " (parameter "shader"))
22769 (paramdef "GLsizei " (parameter "bufSize"))
22770 (paramdef "GLsizei *" (parameter "length"))
22771 (paramdef "GLchar *" (parameter "source"))))
22772 '(*fragment*
22773 (heading
22774 "Returns the source code string from a shader object")
22775 (heading "Parameters")
22776 (table (% (formatter (asis)))
22777 (entry (% (heading (var "shader")))
22778 (para "Specifies the shader object to be
22779 \t\t queried."))
22780 (entry (% (heading (var "bufSize")))
22781 (para "Specifies the size of the character buffer for
22782 \t\t storing the returned source code string."))
22783 (entry (% (heading (var "length")))
22784 (para "Returns the length of the string returned in "
22785 (var "source")
22786 " (excluding the null
22787 \t\t terminator)."))
22788 (entry (% (heading (var "source")))
22789 (para "Specifies an array of characters that is used
22790 \t\t to return the source code string.")))
22791 (heading "Description")
22792 (para (code "glGetShaderSource")
22793 " returns the
22794 \tconcatenation of the source code strings from the shader object
22795 \tspecified by "
22796 (var "shader")
22797 ". The source code
22798 \tstrings for a shader object are the result of a previous call to\t"
22799 (code "glShaderSource")
22800 ".
22801 \tThe string returned by the function will be null
22802 \tterminated.")
22803 (para (code "glGetShaderSource")
22804 " returns in\t"
22805 (var "source")
22806 " as much of the source code string
22807 \tas it can, up to a maximum of "
22808 (var "bufSize")
22809 "
22810 characters. The number of characters actually returned,
22811 \texcluding the null termination character, is specified by\t"
22812 (var "length")
22813 ". If the length of the returned
22814 \tstring is not required, a value of "
22815 (code "NULL")
22816 " can
22817 \tbe passed in the "
22818 (var "length")
22819 " argument. The
22820 \tsize of the buffer required to store the returned source code
22821 \tstring can be obtained by calling\t"
22822 (code "glGetShader")
22823 "
22824 with the value\t"
22825 (code "GL_SHADER_SOURCE_LENGTH")
22826 ".")
22827 (heading "Errors")
22828 (para (code "GL_INVALID_VALUE")
22829 " is generated if\t"
22830 (var "shader")
22831 " is not a value generated by
22832 \tOpenGL.")
22833 (para (code "GL_INVALID_OPERATION")
22834 " is generated if\t"
22835 (var "shader")
22836 " is not a shader object.")
22837 (para (code "GL_INVALID_VALUE")
22838 " is generated if\t"
22839 (var "bufSize")
22840 " is less than 0.")
22841 (para (code "GL_INVALID_OPERATION")
22842 " is generated if\t"
22843 (code "glGetShaderSource")
22844 " is executed between the
22845 \texecution of\t"
22846 (code "glBegin")
22847 "
22848 and the corresponding execution of\t"
22849 (code "glEnd")
22850 ".")))
22851
22852 (define-gl-procedure
22853 glGetShaderiv
22854 "glGetShaderiv"
22855 (funcsynopsis
22856 (funcprototype
22857 (funcdef "void " (function "glGetShaderiv"))
22858 (paramdef "GLuint " (parameter "shader"))
22859 (paramdef "GLenum " (parameter "pname"))
22860 (paramdef "GLint *" (parameter "params"))))
22861 '(*fragment*
22862 (heading
22863 "Returns a parameter from a shader object")
22864 (heading "Parameters")
22865 (table (% (formatter (asis)))
22866 (entry (% (heading (var "shader")))
22867 (para "Specifies the shader object to be
22868 \t\t queried."))
22869 (entry (% (heading (var "pname")))
22870 (para "Specifies the object parameter. Accepted
22871 \t\t symbolic names are "
22872 (code "GL_SHADER_TYPE")
22873 ", "
22874 (code "GL_DELETE_STATUS")
22875 ", "
22876 (code "GL_COMPILE_STATUS")
22877 ", "
22878 (code "GL_INFO_LOG_LENGTH")
22879 ", "
22880 (code "GL_SHADER_SOURCE_LENGTH")
22881 "."))
22882 (entry (% (heading (var "params")))
22883 (para "Returns the requested object parameter.")))
22884 (heading "Description")
22885 (para (code "glGetShader")
22886 "
22887 returns in "
22888 (var "params")
22889 "
22890 the value of a parameter for a specific shader object. The
22891 \tfollowing parameters are defined:")
22892 (table (% (formatter (asis)))
22893 (entry (% (heading (code "GL_SHADER_TYPE")))
22894 (para (var "params")
22895 " returns "
22896 (code "GL_VERTEX_SHADER")
22897 " if "
22898 (var "shader")
22899 " is a vertex shader
22900 \t\t object, and "
22901 (code "GL_FRAGMENT_SHADER")
22902 "
22903 if "
22904 (var "shader")
22905 " is a fragment
22906 \t\t shader object."))
22907 (entry (% (heading (code "GL_DELETE_STATUS")))
22908 (para (var "params")
22909 " returns "
22910 (code "GL_TRUE")
22911 " if "
22912 (var "shader")
22913 " is currently flagged
22914 \t\t for deletion, and "
22915 (code "GL_FALSE")
22916 "
22917 otherwise."))
22918 (entry (% (heading (code "GL_COMPILE_STATUS")))
22919 (para (var "params")
22920 " returns "
22921 (code "GL_TRUE")
22922 " if the last compile
22923 \t\t operation on "
22924 (var "shader")
22925 " was
22926 \t\t successful, and "
22927 (code "GL_FALSE")
22928 "
22929 otherwise."))
22930 (entry (% (heading (code "GL_INFO_LOG_LENGTH")))
22931 (para (var "params")
22932 " returns the
22933 \t\t number of characters in the information log for "
22934 (var "shader")
22935 " including the null
22936 \t\t termination character (i.e., the size of the
22937 \t\t character buffer required to store the information
22938 \t\t log). If "
22939 (var "shader")
22940 " has no
22941 \t\t information log, a value of 0 is returned."))
22942 (entry (% (heading (code "GL_SHADER_SOURCE_LENGTH")))
22943 (para (var "params")
22944 " returns the
22945 \t\t length of the concatenation of the source strings
22946 \t\t that make up the shader source for the "
22947 (var "shader")
22948 ", including the null
22949 \t\t termination character. (i.e., the size of the
22950 \t\t character buffer required to store the shader
22951 \t\t source). If no source code exists, 0 is
22952 \t\t returned.")))
22953 (heading "Errors")
22954 (para (code "GL_INVALID_VALUE")
22955 " is generated if\t"
22956 (var "shader")
22957 " is not a value generated by
22958 \tOpenGL.")
22959 (para (code "GL_INVALID_OPERATION")
22960 " is generated if\t"
22961 (var "shader")
22962 " does not refer to a shader
22963 \tobject.")
22964 (para (code "GL_INVALID_ENUM")
22965 " is generated if\t"
22966 (var "pname")
22967 " is not an accepted value.")
22968 (para (code "GL_INVALID_OPERATION")
22969 " is generated if\t"
22970 (code "glGetShader")
22971 " is executed between the
22972 \texecution of\t"
22973 (code "glBegin")
22974 "
22975 and the corresponding execution of\t"
22976 (code "glEnd")
22977 ".")))
22978
22979 (define-gl-procedure
22980 glGetString
22981 "glGetString"
22982 (funcsynopsis
22983 (funcprototype
22984 (funcdef
22985 "const GLubyte* "
22986 (function "glGetString"))
22987 (paramdef "GLenum " (parameter "name"))))
22988 '(*fragment*
22989 (heading
22990 "return a string describing the current GL connection")
22991 (heading "Parameters")
22992 (table (% (formatter (asis)))
22993 (entry (% (heading (var "name")))
22994 (para "
22995 Specifies a symbolic constant, one of "
22996 (code "GL_VENDOR")
22997 ", "
22998 (code "GL_RENDERER")
22999 ", "
23000 (code "GL_VERSION")
23001 ", "
23002 (code "GL_SHADING_LANGUAGE_VERSION")
23003 ", or "
23004 (code "GL_EXTENSIONS")
23005 ". ")))
23006 (heading "Description")
23007 (para (code "glGetString")
23008 " returns a pointer to a static string
23009 describing some aspect of the current GL connection. "
23010 (var "name")
23011 " can be one of the following: ")
23012 (table (% (formatter (asis)))
23013 (entry (% (heading (code "GL_VENDOR")))
23014 (para)
23015 (para "
23016 Returns the company responsible for this GL implementation.
23017 This name does not change from release to release. "))
23018 (entry (% (heading (code "GL_RENDERER")))
23019 (para)
23020 (para "
23021 Returns the name of the renderer.
23022 This name is typically specific to a particular configuration of a hardware
23023 platform.
23024 It does not change from release to release. "))
23025 (entry (% (heading (code "GL_VERSION")))
23026 (para)
23027 (para "
23028 Returns a version or release number. "))
23029 (entry (% (heading (code "GL_SHADING_LANGUAGE_VERSION")))
23030 (para)
23031 (para "
23032 Returns a version or release number for the shading language. "))
23033 (entry (% (heading (code "GL_EXTENSIONS")))
23034 (para)
23035 (para "
23036 Returns a space-separated list of supported extensions to GL. ")))
23037 (para "
23038 Because the GL does not include queries for the performance
23039 characteristics of an implementation, some applications are written to
23040 recognize known platforms and modify their GL usage based on known
23041 performance characteristics of these platforms.
23042 Strings "
23043 (code "GL_VENDOR")
23044 " and "
23045 (code "GL_RENDERER")
23046 " together uniquely specify
23047 a platform. They do not change from release to release and should be used
23048 by platform-recognition algorithms. ")
23049 (para "
23050 Some applications want to make use of features that
23051 are not part of the standard GL. These features
23052 may be implemented as extensions to the standard GL.
23053 The "
23054 (code "GL_EXTENSIONS")
23055 " string is a space-separated
23056 list of supported GL extensions.
23057 (Extension names never contain a space character.) ")
23058 (para "
23059 The "
23060 (code "GL_VERSION")
23061 " and "
23062 (code "GL_SHADING_LANGUAGE_VERSION")
23063 " strings begin with a version number.
23064 The version number uses one
23065 of these forms: ")
23066 (para (var "major_number.minor_number")
23067 (var "major_number.minor_number.release_number"))
23068 (para "
23069 Vendor-specific information may follow the version
23070 number. Its format depends on the implementation, but
23071 a space always separates the version number and
23072 the vendor-specific information. ")
23073 (para "
23074 All strings are null-terminated. ")
23075 (heading "Errors")
23076 (para (code "GL_INVALID_ENUM")
23077 " is generated if "
23078 (var "name")
23079 " is not an accepted value. ")
23080 (para (code "GL_INVALID_OPERATION")
23081 " is generated if "
23082 (code "glGetString")
23083 "
23084 is executed between the execution of "
23085 (code "glBegin")
23086 "
23087 and the corresponding execution of "
23088 (code "glEnd")
23089 ". ")))
23090
23091 (define-gl-procedure
23092 glGetTexEnv
23093 "glGetTexEnv"
23094 (funcsynopsis
23095 (funcprototype
23096 (funcdef "void " (function "glGetTexEnvfv"))
23097 (paramdef "GLenum " (parameter "target"))
23098 (paramdef "GLenum " (parameter "pname"))
23099 (paramdef "GLfloat * " (parameter "params"))))
23100 '(*fragment*
23101 (heading "return texture environment parameters")
23102 (heading "Parameters")
23103 (table (% (formatter (asis)))
23104 (entry (% (heading (var "target")))
23105 (para "
23106 Specifies a texture environment. May be "
23107 (code "GL_TEXTURE_ENV")
23108 ", "
23109 (code "GL_TEXTURE_FILTER_CONTROL")
23110 ", or "
23111 (code "GL_POINT_SPRITE")
23112 ". "))
23113 (entry (% (heading (var "pname")))
23114 (para "
23115 Specifies the symbolic name of a texture environment parameter.
23116 Accepted values are "
23117 (code "GL_TEXTURE_ENV_MODE")
23118 ", "
23119 (code "GL_TEXTURE_ENV_COLOR")
23120 ", "
23121 (code "GL_TEXTURE_LOD_BIAS")
23122 ", "
23123 (code "GL_COMBINE_RGB")
23124 ", "
23125 (code "GL_COMBINE_ALPHA")
23126 ", "
23127 (code "GL_SRC0_RGB")
23128 ", "
23129 (code "GL_SRC1_RGB")
23130 ", "
23131 (code "GL_SRC2_RGB")
23132 ", "
23133 (code "GL_SRC0_ALPHA")
23134 ", "
23135 (code "GL_SRC1_ALPHA")
23136 ", "
23137 (code "GL_SRC2_ALPHA")
23138 ", "
23139 (code "GL_OPERAND0_RGB")
23140 ", "
23141 (code "GL_OPERAND1_RGB")
23142 ", "
23143 (code "GL_OPERAND2_RGB")
23144 ", "
23145 (code "GL_OPERAND0_ALPHA")
23146 ", "
23147 (code "GL_OPERAND1_ALPHA")
23148 ", "
23149 (code "GL_OPERAND2_ALPHA")
23150 ", "
23151 (code "GL_RGB_SCALE")
23152 ", "
23153 (code "GL_ALPHA_SCALE")
23154 ", or "
23155 (code "GL_COORD_REPLACE")
23156 ". "))
23157 (entry (% (heading (var "params")))
23158 (para "
23159 Returns the requested data. ")))
23160 (heading "Description")
23161 (para (code "glGetTexEnv")
23162 " returns in "
23163 (var "params")
23164 " selected values of a texture environment that
23165 was specified with "
23166 (code "glTexEnv")
23167 ". "
23168 (var "target")
23169 " specifies a texture environment. ")
23170 (para "
23171 When "
23172 (var "target")
23173 " is "
23174 (code "GL_TEXTURE_FILTER_CONTROL")
23175 ", "
23176 (var "pname")
23177 " must be "
23178 (code "GL_TEXTURE_LOD_BIAS")
23179 ".
23180 When "
23181 (var "target")
23182 " is "
23183 (code "GL_POINT_SPRITE")
23184 ", "
23185 (var "pname")
23186 " must be "
23187 (code "GL_COORD_REPLACE")
23188 ".
23189 When "
23190 (var "target")
23191 " is "
23192 (code "GL_TEXTURE_ENV")
23193 ", "
23194 (var "pname")
23195 " can be "
23196 (code "GL_TEXTURE_ENV_MODE")
23197 ", "
23198 (code "GL_TEXTURE_ENV_COLOR")
23199 ", "
23200 (code "GL_COMBINE_RGB")
23201 ", "
23202 (code "GL_COMBINE_ALPHA")
23203 ", "
23204 (code "GL_RGB_SCALE")
23205 ", "
23206 (code "GL_ALPHA_SCALE")
23207 ", "
23208 (code "GL_SRC0_RGB")
23209 ", "
23210 (code "GL_SRC1_RGB")
23211 ", "
23212 (code "GL_SRC2_RGB")
23213 ", "
23214 (code "GL_SRC0_ALPHA")
23215 ", "
23216 (code "GL_SRC1_ALPHA")
23217 ", or "
23218 (code "GL_SRC2_ALPHA")
23219 ". ")
23220 (para (var "pname")
23221 " names a specific texture environment parameter, as follows: ")
23222 (table (% (formatter (asis)))
23223 (entry (% (heading (code "GL_TEXTURE_ENV_MODE")))
23224 (para (var "params")
23225 " returns the single-valued texture environment mode,
23226 a symbolic constant. The initial value is "
23227 (code "GL_MODULATE")
23228 ". "))
23229 (entry (% (heading (code "GL_TEXTURE_ENV_COLOR")))
23230 (para (var "params")
23231 " returns four integer or floating-point values that are the
23232 texture environment color.
23233 Integer values,
23234 when requested,
23235 are linearly mapped from the internal floating-point representation
23236 such that 1.0 maps to the most positive representable integer,
23237 and "
23238 (math "-1.0")
23239 "
23240 maps to the most negative representable integer. The initial
23241 value is (0, 0, 0, 0). "))
23242 (entry (% (heading (code "GL_TEXTURE_LOD_BIAS")))
23243 (para (var "params")
23244 " returns a single floating-point value that is the texture
23245 level-of-detail bias. The initial value is 0. "))
23246 (entry (% (heading (code "GL_COMBINE_RGB")))
23247 (para (var "params")
23248 " returns a single symbolic constant value representing the current
23249 RGB combine mode. The initial value is "
23250 (code "GL_MODULATE")
23251 ". "))
23252 (entry (% (heading (code "GL_COMBINE_ALPHA")))
23253 (para (var "params")
23254 " returns a single symbolic constant value representing the current
23255 alpha combine mode. The initial value is "
23256 (code "GL_MODULATE")
23257 ". "))
23258 (entry (% (heading (code "GL_SRC0_RGB")))
23259 (para (var "params")
23260 " returns a single symbolic constant value representing the texture
23261 combiner zero's RGB source. The initial value is "
23262 (code "GL_TEXTURE")
23263 ". "))
23264 (entry (% (heading (code "GL_SRC1_RGB")))
23265 (para (var "params")
23266 " returns a single symbolic constant value representing the texture
23267 combiner one's RGB source. The initial value is "
23268 (code "GL_PREVIOUS")
23269 ". "))
23270 (entry (% (heading (code "GL_SRC2_RGB")))
23271 (para (var "params")
23272 " returns a single symbolic constant value representing the texture
23273 combiner two's RGB source. The initial value is "
23274 (code "GL_CONSTANT")
23275 ". "))
23276 (entry (% (heading (code "GL_SRC0_ALPHA")))
23277 (para (var "params")
23278 " returns a single symbolic constant value representing the texture
23279 combiner zero's alpha source. The initial value is "
23280 (code "GL_TEXTURE")
23281 ". "))
23282 (entry (% (heading (code "GL_SRC1_ALPHA")))
23283 (para (var "params")
23284 " returns a single symbolic constant value representing the texture
23285 combiner one's alpha source. The initial value is "
23286 (code "GL_PREVIOUS")
23287 ". "))
23288 (entry (% (heading (code "GL_SRC2_ALPHA")))
23289 (para (var "params")
23290 " returns a single symbolic constant value representing the texture
23291 combiner two's alpha source. The initial value is "
23292 (code "GL_CONSTANT")
23293 ". "))
23294 (entry (% (heading (code "GL_OPERAND0_RGB")))
23295 (para (var "params")
23296 " returns a single symbolic constant value representing the texture
23297 combiner zero's RGB operand. The initial value is "
23298 (code "GL_SRC_COLOR")
23299 ". "))
23300 (entry (% (heading (code "GL_OPERAND1_RGB")))
23301 (para (var "params")
23302 " returns a single symbolic constant value representing the texture
23303 combiner one's RGB operand. The initial value is "
23304 (code "GL_SRC_COLOR")
23305 ". "))
23306 (entry (% (heading (code "GL_OPERAND2_RGB")))
23307 (para (var "params")
23308 " returns a single symbolic constant value representing the texture
23309 combiner two's RGB operand. The initial value is "
23310 (code "GL_SRC_ALPHA")
23311 ". "))
23312 (entry (% (heading (code "GL_OPERAND0_ALPHA")))
23313 (para (var "params")
23314 " returns a single symbolic constant value representing the texture
23315 combiner zero's alpha operand. The initial value is "
23316 (code "GL_SRC_ALPHA")
23317 ". "))
23318 (entry (% (heading (code "GL_OPERAND1_ALPHA")))
23319 (para (var "params")
23320 " returns a single symbolic constant value representing the texture
23321 combiner one's alpha operand. The initial value is "
23322 (code "GL_SRC_ALPHA")
23323 ". "))
23324 (entry (% (heading (code "GL_OPERAND2_ALPHA")))
23325 (para (var "params")
23326 " returns a single symbolic constant value representing the texture
23327 combiner two's alpha operand. The initial value is "
23328 (code "GL_SRC_ALPHA")
23329 ". "))
23330 (entry (% (heading (code "GL_RGB_SCALE")))
23331 (para (var "params")
23332 " returns a single floating-point value representing the current RGB
23333 texture combiner scaling factor. The initial value is 1.0. "))
23334 (entry (% (heading (code "GL_ALPHA_SCALE")))
23335 (para (var "params")
23336 " returns a single floating-point value representing the current alpha
23337 texture combiner scaling factor. The initial value is 1.0. "))
23338 (entry (% (heading (code "GL_COORD_REPLACE")))
23339 (para (var "params")
23340 " returns a single boolean value representing the current point sprite
23341 texture coordinate replacement enable state. The initial value is "
23342 (code "GL_FALSE")
23343 ". ")))
23344 (heading "Errors")
23345 (para (code "GL_INVALID_ENUM")
23346 " is generated if "
23347 (var "target")
23348 " or "
23349 (var "pname")
23350 " is not an
23351 accepted value. ")
23352 (para (code "GL_INVALID_OPERATION")
23353 " is generated if "
23354 (code "glGetTexEnv")
23355 "
23356 is executed between the execution of "
23357 (code "glBegin")
23358 "
23359 and the corresponding execution of "
23360 (code "glEnd")
23361 ". ")))
23362
23363 (define-gl-procedure
23364 glGetTexGen
23365 "glGetTexGen"
23366 (funcsynopsis
23367 (funcprototype
23368 (funcdef "void " (function "glGetTexGendv"))
23369 (paramdef "GLenum " (parameter "coord"))
23370 (paramdef "GLenum " (parameter "pname"))
23371 (paramdef "GLdouble * " (parameter "params"))))
23372 '(*fragment*
23373 (heading
23374 "return texture coordinate generation parameters")
23375 (heading "Parameters")
23376 (table (% (formatter (asis)))
23377 (entry (% (heading (var "coord")))
23378 (para "
23379 Specifies a texture coordinate.
23380 Must be "
23381 (code "GL_S")
23382 ", "
23383 (code "GL_T")
23384 ", "
23385 (code "GL_R")
23386 ", or "
23387 (code "GL_Q")
23388 ". "))
23389 (entry (% (heading (var "pname")))
23390 (para "
23391 Specifies the symbolic name of the value(s) to be returned.
23392 Must be either "
23393 (code "GL_TEXTURE_GEN_MODE")
23394 "
23395 or the name of one of the texture generation plane equations: "
23396 (code "GL_OBJECT_PLANE")
23397 " or "
23398 (code "GL_EYE_PLANE")
23399 ". "))
23400 (entry (% (heading (var "params")))
23401 (para "
23402 Returns the requested data. ")))
23403 (heading "Description")
23404 (para (code "glGetTexGen")
23405 " returns in "
23406 (var "params")
23407 " selected parameters of a texture coordinate
23408 generation function that was specified using "
23409 (code "glTexGen")
23410 ". "
23411 (var "coord")
23412 " names one of the ("
23413 (var "s")
23414 ", "
23415 (var "t")
23416 ", "
23417 (var "r")
23418 ", "
23419 (var "q")
23420 ")
23421 texture coordinates,
23422 using the symbolic constant "
23423 (code "GL_S")
23424 ", "
23425 (code "GL_T")
23426 ", "
23427 (code "GL_R")
23428 ", or "
23429 (code "GL_Q")
23430 ". ")
23431 (para (var "pname")
23432 " specifies one of three symbolic names: ")
23433 (table (% (formatter (asis)))
23434 (entry (% (heading (code "GL_TEXTURE_GEN_MODE")))
23435 (para (var "params")
23436 " returns the single-valued texture generation function,
23437 a symbolic constant. The initial value is "
23438 (code "GL_EYE_LINEAR")
23439 ". "))
23440 (entry (% (heading (code "GL_OBJECT_PLANE")))
23441 (para (var "params")
23442 " returns the four plane equation coefficients that specify
23443 object linear-coordinate generation.
23444 Integer values, when requested,
23445 are mapped directly from the internal floating-point representation. "))
23446 (entry (% (heading (code "GL_EYE_PLANE")))
23447 (para (var "params")
23448 " returns the four plane equation coefficients that specify
23449 eye linear-coordinate generation.
23450 Integer values,
23451 when requested,
23452 are mapped directly from the internal floating-point representation.
23453 The returned values are those maintained in eye coordinates.
23454 They are not equal to the values specified using "
23455 (code "glTexGen")
23456 ",
23457 unless the modelview matrix was identity when "
23458 (code "glTexGen")
23459 " was called. ")))
23460 (heading "Errors")
23461 (para (code "GL_INVALID_ENUM")
23462 " is generated if "
23463 (var "coord")
23464 " or "
23465 (var "pname")
23466 " is not an
23467 accepted value. ")
23468 (para (code "GL_INVALID_OPERATION")
23469 " is generated if "
23470 (code "glGetTexGen")
23471 "
23472 is executed between the execution of "
23473 (code "glBegin")
23474 "
23475 and the corresponding execution of "
23476 (code "glEnd")
23477 ". ")))
23478
23479 (define-gl-procedure
23480 glGetTexImage
23481 "glGetTexImage"
23482 (funcsynopsis
23483 (funcprototype
23484 (funcdef "void " (function "glGetTexImage"))
23485 (paramdef "GLenum " (parameter "target"))
23486 (paramdef "GLint " (parameter "level"))
23487 (paramdef "GLenum " (parameter "format"))
23488 (paramdef "GLenum " (parameter "type"))
23489 (paramdef "GLvoid * " (parameter "img"))))
23490 '(*fragment*
23491 (heading "return a texture image")
23492 (heading "Parameters")
23493 (table (% (formatter (asis)))
23494 (entry (% (heading (var "target")))
23495 (para "
23496 Specifies which texture is to be obtained. "
23497 (code "GL_TEXTURE_1D")
23498 ", "
23499 (code "GL_TEXTURE_2D")
23500 ", "
23501 (code "GL_TEXTURE_3D")
23502 ", "
23503 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
23504 ", "
23505 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
23506 ", "
23507 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
23508 ", "
23509 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
23510 ", "
23511 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
23512 ", and "
23513 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
23514 " are accepted. "))
23515 (entry (% (heading (var "level")))
23516 (para "
23517 Specifies the level-of-detail number of the desired image.
23518 Level 0 is the base image level.
23519 Level "
23520 (math (var "n"))
23521 "
23522 is the "
23523 (math (var "n"))
23524 "th
23525 mipmap reduction image. "))
23526 (entry (% (heading (var "format")))
23527 (para "
23528 Specifies a pixel format for the returned data.
23529 The supported formats are "
23530 (code "GL_RED")
23531 ", "
23532 (code "GL_GREEN")
23533 ", "
23534 (code "GL_BLUE")
23535 ", "
23536 (code "GL_ALPHA")
23537 ", "
23538 (code "GL_RGB")
23539 ", "
23540 (code "GL_BGR")
23541 ", "
23542 (code "GL_RGBA")
23543 ", "
23544 (code "GL_BGRA")
23545 ", "
23546 (code "GL_LUMINANCE")
23547 ", and "
23548 (code "GL_LUMINANCE_ALPHA")
23549 ". "))
23550 (entry (% (heading (var "type")))
23551 (para "
23552 Specifies a pixel type for the returned data.
23553 The supported types are "
23554 (code "GL_UNSIGNED_BYTE")
23555 ", "
23556 (code "GL_BYTE")
23557 ", "
23558 (code "GL_UNSIGNED_SHORT")
23559 ", "
23560 (code "GL_SHORT")
23561 ", "
23562 (code "GL_UNSIGNED_INT")
23563 ", "
23564 (code "GL_INT")
23565 ", "
23566 (code "GL_FLOAT")
23567 ", "
23568 (code "GL_UNSIGNED_BYTE_3_3_2")
23569 ", "
23570 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
23571 ", "
23572 (code "GL_UNSIGNED_SHORT_5_6_5")
23573 ", "
23574 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
23575 ", "
23576 (code "GL_UNSIGNED_SHORT_4_4_4_4")
23577 ", "
23578 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
23579 ", "
23580 (code "GL_UNSIGNED_SHORT_5_5_5_1")
23581 ", "
23582 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
23583 ", "
23584 (code "GL_UNSIGNED_INT_8_8_8_8")
23585 ", "
23586 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
23587 ", "
23588 (code "GL_UNSIGNED_INT_10_10_10_2")
23589 ", and "
23590 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
23591 ". "))
23592 (entry (% (heading (var "img")))
23593 (para "
23594 Returns the texture image.
23595 Should be a pointer to an array of the type specified by "
23596 (var "type")
23597 ". ")))
23598 (heading "Description")
23599 (para (code "glGetTexImage")
23600 " returns a texture image into "
23601 (var "img")
23602 ". "
23603 (var "target")
23604 " specifies whether the desired texture image is one specified by "
23605 (code "glTexImage1D")
23606 " ("
23607 (code "GL_TEXTURE_1D")
23608 "), "
23609 (code "glTexImage2D")
23610 " ("
23611 (code "GL_TEXTURE_2D")
23612 " or any of "
23613 (code "GL_TEXTURE_CUBE_MAP_*")
23614 "),
23615 or "
23616 (code "glTexImage3D")
23617 " ("
23618 (code "GL_TEXTURE_3D")
23619 "). "
23620 (var "level")
23621 " specifies the level-of-detail number of the desired image. "
23622 (var "format")
23623 " and "
23624 (var "type")
23625 " specify the format and type of the desired image array.
23626 See the reference pages "
23627 (code "glTexImage1D")
23628 " and "
23629 (code "glDrawPixels")
23630 "
23631 for a description of the acceptable values for the "
23632 (var "format")
23633 " and "
23634 (var "type")
23635 "
23636 parameters, respectively. ")
23637 (para "
23638 If a non-zero named buffer object is bound to the "
23639 (code "GL_PIXEL_PACK_BUFFER")
23640 " target
23641 (see "
23642 (code "glBindBuffer")
23643 ") while a texture image is
23644 requested, "
23645 (var "img")
23646 " is treated as a byte offset into the buffer object's data store. ")
23647 (para "
23648 To understand the operation of "
23649 (code "glGetTexImage")
23650 ", consider the selected internal
23651 four-component texture image to be an RGBA color buffer the size of the image.
23652 The semantics of "
23653 (code "glGetTexImage")
23654 " are then identical to those of "
23655 (code "glReadPixels")
23656 ",
23657 with the exception that no pixel transfer operations are performed,
23658 when called with the same "
23659 (var "format")
23660 " and "
23661 (var "type")
23662 ",
23663 with "
23664 (var "x")
23665 " and "
23666 (var "y")
23667 " set to 0, "
23668 (var "width")
23669 " set to the width of the texture image
23670 (including border if one was specified),
23671 and "
23672 (var "height")
23673 " set to 1 for 1D images,
23674 or to the height of the texture image
23675 (including border if one was specified)
23676 for 2D images.
23677 Because the internal texture image is an RGBA image,
23678 pixel formats "
23679 (code "GL_COLOR_INDEX")
23680 ", "
23681 (code "GL_STENCIL_INDEX")
23682 ",
23683 and "
23684 (code "GL_DEPTH_COMPONENT")
23685 " are not accepted,
23686 and pixel type "
23687 (code "GL_BITMAP")
23688 " is not accepted. ")
23689 (para "
23690 If the selected texture image does not contain four components,
23691 the following mappings are applied.
23692 Single-component textures are treated as RGBA buffers with red set
23693 to the single-component value,
23694 green set to 0, blue set to 0, and alpha set to 1.
23695 Two-component textures are treated as RGBA buffers with red set to
23696 the value of component zero,
23697 alpha set to the value of component one,
23698 and green and blue set to 0.
23699 Finally,
23700 three-component textures are treated as RGBA buffers with red set to
23701 component zero,
23702 green set to component one,
23703 blue set to component two,
23704 and alpha set to 1. ")
23705 (para "
23706 To determine the required size of "
23707 (var "img")
23708 ",
23709 use "
23710 (code "glGetTexLevelParameter")
23711 " to determine the dimensions of the
23712 internal texture image,
23713 then scale the required number of pixels by the storage required for
23714 each pixel,
23715 based on "
23716 (var "format")
23717 " and "
23718 (var "type")
23719 ".
23720 Be sure to take the pixel storage parameters into account,
23721 especially "
23722 (code "GL_PACK_ALIGNMENT")
23723 ". ")
23724 (heading "Errors")
23725 (para (code "GL_INVALID_ENUM")
23726 " is generated if "
23727 (var "target")
23728 ", "
23729 (var "format")
23730 ", or "
23731 (var "type")
23732 " is not
23733 an accepted value. ")
23734 (para (code "GL_INVALID_VALUE")
23735 " is generated if "
23736 (var "level")
23737 " is less than 0. ")
23738 (para (code "GL_INVALID_VALUE")
23739 " may be generated if "
23740 (var "level")
23741 " is greater
23742 than "
23743 (math (var "log")
23744 "_"
23745 "2"
23746 "\u2061"
23747 "("
23748 (var "max")
23749 ","
23750 ")")
23751 ",
23752 where "
23753 (math (var "max"))
23754 "
23755 is the returned value of "
23756 (code "GL_MAX_TEXTURE_SIZE")
23757 ". ")
23758 (para (code "GL_INVALID_OPERATION")
23759 " is returned if "
23760 (var "type")
23761 " is one of "
23762 (code "GL_UNSIGNED_BYTE_3_3_2")
23763 ", "
23764 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
23765 ", "
23766 (code "GL_UNSIGNED_SHORT_5_6_5")
23767 ", or "
23768 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
23769 " and "
23770 (var "format")
23771 " is not "
23772 (code "GL_RGB")
23773 ". ")
23774 (para (code "GL_INVALID_OPERATION")
23775 " is returned if "
23776 (var "type")
23777 " is one of "
23778 (code "GL_UNSIGNED_SHORT_4_4_4_4")
23779 ", "
23780 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
23781 ", "
23782 (code "GL_UNSIGNED_SHORT_5_5_5_1")
23783 ", "
23784 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
23785 ", "
23786 (code "GL_UNSIGNED_INT_8_8_8_8")
23787 ", "
23788 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
23789 ", "
23790 (code "GL_UNSIGNED_INT_10_10_10_2")
23791 ", or "
23792 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
23793 ", and "
23794 (var "format")
23795 " is neither "
23796 (code "GL_RGBA")
23797 "
23798 or "
23799 (code "GL_BGRA")
23800 ". ")
23801 (para (code "GL_INVALID_OPERATION")
23802 " is generated if a non-zero buffer object name is bound to the "
23803 (code "GL_PIXEL_PACK_BUFFER")
23804 " target and the buffer object's data store is currently mapped. ")
23805 (para (code "GL_INVALID_OPERATION")
23806 " is generated if a non-zero buffer object name is bound to the "
23807 (code "GL_PIXEL_PACK_BUFFER")
23808 " target and the data would be packed to the buffer
23809 object such that the memory writes required would exceed the data store size. ")
23810 (para (code "GL_INVALID_OPERATION")
23811 " is generated if a non-zero buffer object name is bound to the "
23812 (code "GL_PIXEL_PACK_BUFFER")
23813 " target and "
23814 (var "img")
23815 " is not evenly divisible
23816 into the number of bytes needed to store in memory a datum indicated by "
23817 (var "type")
23818 ". ")
23819 (para (code "GL_INVALID_OPERATION")
23820 " is generated if "
23821 (code "glGetTexImage")
23822 "
23823 is executed between the execution of "
23824 (code "glBegin")
23825 "
23826 and the corresponding execution of "
23827 (code "glEnd")
23828 ". ")))
23829
23830 (define-gl-procedure
23831 glGetTexLevelParameter
23832 "glGetTexLevelParameter"
23833 (funcsynopsis
23834 (funcprototype
23835 (funcdef
23836 "void "
23837 (function "glGetTexLevelParameterfv"))
23838 (paramdef "GLenum " (parameter "target"))
23839 (paramdef "GLint " (parameter "level"))
23840 (paramdef "GLenum " (parameter "pname"))
23841 (paramdef "GLfloat * " (parameter "params"))))
23842 '(*fragment*
23843 (heading
23844 "return texture parameter values for a specific level of detail")
23845 (heading "Parameters")
23846 (table (% (formatter (asis)))
23847 (entry (% (heading (var "target")))
23848 (para "
23849 Specifies the symbolic name of the target texture,
23850 either "
23851 (code "GL_TEXTURE_1D")
23852 ", "
23853 (code "GL_TEXTURE_2D")
23854 ", "
23855 (code "GL_TEXTURE_3D")
23856 ", "
23857 (code "GL_PROXY_TEXTURE_1D")
23858 ", "
23859 (code "GL_PROXY_TEXTURE_2D")
23860 ", "
23861 (code "GL_PROXY_TEXTURE_3D")
23862 ", "
23863 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
23864 ", "
23865 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
23866 ", "
23867 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
23868 ", "
23869 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
23870 ", "
23871 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
23872 ", "
23873 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
23874 ", or "
23875 (code "GL_PROXY_TEXTURE_CUBE_MAP")
23876 ". "))
23877 (entry (% (heading (var "level")))
23878 (para "
23879 Specifies the level-of-detail number of the desired image.
23880 Level 0 is the base image level.
23881 Level "
23882 (math (var "n"))
23883 "
23884 is the "
23885 (math (var "n"))
23886 "th
23887 mipmap reduction image. "))
23888 (entry (% (heading (var "pname")))
23889 (para "
23890 Specifies the symbolic name of a texture parameter. "
23891 (code "GL_TEXTURE_WIDTH")
23892 ", "
23893 (code "GL_TEXTURE_HEIGHT")
23894 ", "
23895 (code "GL_TEXTURE_DEPTH")
23896 ", "
23897 (code "GL_TEXTURE_INTERNAL_FORMAT")
23898 ", "
23899 (code "GL_TEXTURE_BORDER")
23900 ", "
23901 (code "GL_TEXTURE_RED_SIZE")
23902 ", "
23903 (code "GL_TEXTURE_GREEN_SIZE")
23904 ", "
23905 (code "GL_TEXTURE_BLUE_SIZE")
23906 ", "
23907 (code "GL_TEXTURE_ALPHA_SIZE")
23908 ", "
23909 (code "GL_TEXTURE_LUMINANCE_SIZE")
23910 ", "
23911 (code "GL_TEXTURE_INTENSITY_SIZE")
23912 ", "
23913 (code "GL_TEXTURE_DEPTH_SIZE")
23914 ", "
23915 (code "GL_TEXTURE_COMPRESSED")
23916 ", and "
23917 (code "GL_TEXTURE_COMPRESSED_IMAGE_SIZE")
23918 "
23919 are accepted. "))
23920 (entry (% (heading (var "params")))
23921 (para "
23922 Returns the requested data. ")))
23923 (heading "Description")
23924 (para (code "glGetTexLevelParameter")
23925 " returns in "
23926 (var "params")
23927 " texture parameter values for a specific
23928 level-of-detail value,
23929 specified as "
23930 (var "level")
23931 ". "
23932 (var "target")
23933 " defines the target texture,
23934 either "
23935 (code "GL_TEXTURE_1D")
23936 ", "
23937 (code "GL_TEXTURE_2D")
23938 ", "
23939 (code "GL_TEXTURE_3D")
23940 ", "
23941 (code "GL_PROXY_TEXTURE_1D")
23942 ", "
23943 (code "GL_PROXY_TEXTURE_2D")
23944 ", "
23945 (code "GL_PROXY_TEXTURE_3D")
23946 ", "
23947 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
23948 ", "
23949 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
23950 ", "
23951 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
23952 ", "
23953 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
23954 ", "
23955 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
23956 ", "
23957 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
23958 ", or "
23959 (code "GL_PROXY_TEXTURE_CUBE_MAP")
23960 ". ")
23961 (para (code "GL_MAX_TEXTURE_SIZE")
23962 ", and "
23963 (code "GL_MAX_3D_TEXTURE_SIZE")
23964 " are not really
23965 descriptive enough.
23966 It has to report the largest square texture image that can be
23967 accommodated with mipmaps and borders,
23968 but a long skinny texture, or a texture without mipmaps and borders, may
23969 easily fit in texture memory.
23970 The proxy targets allow the user to more accurately query
23971 whether the GL can accommodate a texture of a given configuration.
23972 If the texture cannot be accommodated, the texture state variables, which
23973 may be queried with "
23974 (code "glGetTexLevelParameter")
23975 ", are set to 0. If the texture can be accommodated,
23976 the texture state values will be set as they would be set for a
23977 non-proxy target. ")
23978 (para (var "pname")
23979 " specifies the texture parameter whose value or values
23980 will be returned. ")
23981 (para "
23982 The accepted parameter names are as follows: ")
23983 (table (% (formatter (asis)))
23984 (entry (% (heading (code "GL_TEXTURE_WIDTH")))
23985 (para)
23986 (para (var "params")
23987 " returns a single value,
23988 the width of the texture image.
23989 This value includes the border of the texture image. The initial value is
23990 0. "))
23991 (entry (% (heading (code "GL_TEXTURE_HEIGHT")))
23992 (para)
23993 (para (var "params")
23994 " returns a single value,
23995 the height of the texture image.
23996 This value includes the border of the texture image. The initial value is
23997 0. "))
23998 (entry (% (heading (code "GL_TEXTURE_DEPTH")))
23999 (para)
24000 (para (var "params")
24001 " returns a single value,
24002 the depth of the texture image.
24003 This value includes the border of the texture image. The initial value is
24004 0. "))
24005 (entry (% (heading (code "GL_TEXTURE_INTERNAL_FORMAT")))
24006 (para)
24007 (para (var "params")
24008 " returns a single value,
24009 the internal format of the texture image. "))
24010 (entry (% (heading (code "GL_TEXTURE_BORDER")))
24011 (para)
24012 (para (var "params")
24013 " returns a single value,
24014 the width in pixels of the border of the texture image. The initial value
24015 is 0. "))
24016 (entry (% (heading (code "GL_TEXTURE_RED_SIZE") ",")))
24017 (entry (% (heading (code "GL_TEXTURE_GREEN_SIZE") ",")))
24018 (entry (% (heading (code "GL_TEXTURE_BLUE_SIZE") ",")))
24019 (entry (% (heading (code "GL_TEXTURE_ALPHA_SIZE") ",")))
24020 (entry (% (heading (code "GL_TEXTURE_LUMINANCE_SIZE") ",")))
24021 (entry (% (heading (code "GL_TEXTURE_INTENSITY_SIZE") ",")))
24022 (entry (% (heading (code "GL_TEXTURE_DEPTH_SIZE")))
24023 (para)
24024 (para "
24025 The internal storage resolution of an individual component.
24026 The resolution chosen by the GL will be a close match for the resolution
24027 requested by the user with the component argument of "
24028 (code "glTexImage1D")
24029 ", "
24030 (code "glTexImage2D")
24031 ", "
24032 (code "glTexImage3D")
24033 ", "
24034 (code "glCopyTexImage1D")
24035 ", and "
24036 (code "glCopyTexImage2D")
24037 ". The initial value is 0. "))
24038 (entry (% (heading (code "GL_TEXTURE_COMPRESSED")))
24039 (para)
24040 (para (var "params")
24041 " returns a single boolean value indicating if the texture image is
24042 stored in a compressed internal format. The initiali value is "
24043 (code "GL_FALSE")
24044 ". "))
24045 (entry (% (heading
24046 (code "GL_TEXTURE_COMPRESSED_IMAGE_SIZE")))
24047 (para)
24048 (para (var "params")
24049 " returns a single integer value, the number of unsigned bytes of the
24050 compressed texture image that would be returned from "
24051 (code "glGetCompressedTexImage")
24052 ". ")))
24053 (heading "Errors")
24054 (para (code "GL_INVALID_ENUM")
24055 " is generated if "
24056 (var "target")
24057 " or "
24058 (var "pname")
24059 " is not an
24060 accepted value. ")
24061 (para (code "GL_INVALID_VALUE")
24062 " is generated if "
24063 (var "level")
24064 " is less than 0. ")
24065 (para (code "GL_INVALID_VALUE")
24066 " may be generated if "
24067 (var "level")
24068 " is greater
24069 than "
24070 (math (var "log") "_" "2")
24071 (var "max")
24072 ",
24073 where "
24074 (var "max")
24075 " is the returned value of "
24076 (code "GL_MAX_TEXTURE_SIZE")
24077 ". ")
24078 (para (code "GL_INVALID_OPERATION")
24079 " is generated if "
24080 (code "glGetTexLevelParameter")
24081 "
24082 is executed between the execution of "
24083 (code "glBegin")
24084 "
24085 and the corresponding execution of "
24086 (code "glEnd")
24087 ". ")
24088 (para (code "GL_INVALID_OPERATION")
24089 " is generated if "
24090 (code "GL_TEXTURE_COMPRESSED_IMAGE_SIZE")
24091 " is queried on texture images with an
24092 uncompressed internal format or on proxy targets. ")))
24093
24094 (define-gl-procedure
24095 glGetTexParameter
24096 "glGetTexParameter"
24097 (funcsynopsis
24098 (funcprototype
24099 (funcdef
24100 "void "
24101 (function "glGetTexParameterfv"))
24102 (paramdef "GLenum " (parameter "target"))
24103 (paramdef "GLenum " (parameter "pname"))
24104 (paramdef "GLfloat * " (parameter "params"))))
24105 '(*fragment*
24106 (heading "return texture parameter values")
24107 (heading "Parameters")
24108 (table (% (formatter (asis)))
24109 (entry (% (heading (var "target")))
24110 (para "
24111 Specifies the symbolic name of the target texture. "
24112 (code "GL_TEXTURE_1D")
24113 ", "
24114 (code "GL_TEXTURE_2D")
24115 ", "
24116 (code "GL_TEXTURE_3D")
24117 ", and "
24118 (code "GL_TEXTURE_CUBE_MAP")
24119 "
24120 are accepted. "))
24121 (entry (% (heading (var "pname")))
24122 (para "
24123 Specifies the symbolic name of a texture parameter. "
24124 (code "GL_TEXTURE_MAG_FILTER")
24125 ", "
24126 (code "GL_TEXTURE_MIN_FILTER")
24127 ", "
24128 (code "GL_TEXTURE_MIN_LOD")
24129 ", "
24130 (code "GL_TEXTURE_MAX_LOD")
24131 ", "
24132 (code "GL_TEXTURE_BASE_LEVEL")
24133 ", "
24134 (code "GL_TEXTURE_MAX_LEVEL")
24135 ", "
24136 (code "GL_TEXTURE_WRAP_S")
24137 ", "
24138 (code "GL_TEXTURE_WRAP_T")
24139 ", "
24140 (code "GL_TEXTURE_WRAP_R")
24141 ", "
24142 (code "GL_TEXTURE_BORDER_COLOR")
24143 ", "
24144 (code "GL_TEXTURE_PRIORITY")
24145 ", "
24146 (code "GL_TEXTURE_RESIDENT")
24147 ", "
24148 (code "GL_TEXTURE_COMPARE_MODE")
24149 ", "
24150 (code "GL_TEXTURE_COMPARE_FUNC")
24151 ", "
24152 (code "GL_DEPTH_TEXTURE_MODE")
24153 ", and "
24154 (code "GL_GENERATE_MIPMAP")
24155 "
24156 are accepted. "))
24157 (entry (% (heading (var "params")))
24158 (para "
24159 Returns the texture parameters. ")))
24160 (heading "Description")
24161 (para (code "glGetTexParameter")
24162 " returns in "
24163 (var "params")
24164 " the value or values of the texture parameter
24165 specified as "
24166 (var "pname")
24167 ". "
24168 (var "target")
24169 " defines the target texture,
24170 either "
24171 (code "GL_TEXTURE_1D")
24172 ", "
24173 (code "GL_TEXTURE_2D")
24174 ", "
24175 (code "GL_TEXTURE_3D")
24176 ", or "
24177 (code "GL_TEXTURE_CUBE_MAP")
24178 ",
24179 to specify one-, two-, or three-dimensional or cube-mapped texturing. "
24180 (var "pname")
24181 " accepts the same symbols as "
24182 (code "glTexParameter")
24183 ",
24184 with the same interpretations: ")
24185 (table (% (formatter (asis)))
24186 (entry (% (heading (code "GL_TEXTURE_MAG_FILTER")))
24187 (para "
24188 Returns the single-valued texture magnification filter,
24189 a symbolic constant. The initial value is "
24190 (code "GL_LINEAR")
24191 ". "))
24192 (entry (% (heading (code "GL_TEXTURE_MIN_FILTER")))
24193 (para "
24194 Returns the single-valued texture minification filter,
24195 a symbolic constant. The initial value is "
24196 (code "GL_NEAREST_MIPMAP_LINEAR")
24197 ". "))
24198 (entry (% (heading (code "GL_TEXTURE_MIN_LOD")))
24199 (para "
24200 Returns the single-valued texture minimum level-of-detail value. The
24201 initial value is "
24202 (math "-1000")
24203 ". "))
24204 (entry (% (heading (code "GL_TEXTURE_MAX_LOD")))
24205 (para "
24206 Returns the single-valued texture maximum level-of-detail value. The
24207 initial value is 1000. "))
24208 (entry (% (heading (code "GL_TEXTURE_BASE_LEVEL")))
24209 (para "
24210 Returns the single-valued base texture mipmap level. The initial value is 0. "))
24211 (entry (% (heading (code "GL_TEXTURE_MAX_LEVEL")))
24212 (para "
24213 Returns the single-valued maximum texture mipmap array level. The initial
24214 value is 1000. "))
24215 (entry (% (heading (code "GL_TEXTURE_WRAP_S")))
24216 (para "
24217 Returns the single-valued wrapping function for texture coordinate "
24218 (math (var "s"))
24219 ",
24220 a symbolic constant. The initial value is "
24221 (code "GL_REPEAT")
24222 ". "))
24223 (entry (% (heading (code "GL_TEXTURE_WRAP_T")))
24224 (para "
24225 Returns the single-valued wrapping function for texture coordinate "
24226 (math (var "t"))
24227 ",
24228 a symbolic constant. The initial value is "
24229 (code "GL_REPEAT")
24230 ". "))
24231 (entry (% (heading (code "GL_TEXTURE_WRAP_R")))
24232 (para "
24233 Returns the single-valued wrapping function for texture coordinate "
24234 (math (var "r"))
24235 ",
24236 a symbolic constant. The initial value is "
24237 (code "GL_REPEAT")
24238 ". "))
24239 (entry (% (heading (code "GL_TEXTURE_BORDER_COLOR")))
24240 (para "
24241 Returns four integer or floating-point numbers that comprise the RGBA color
24242 of the texture border.
24243 Floating-point values are returned in the range "
24244 (math "[" "0" "," "1" "]")
24245 ".
24246 Integer values are returned as a linear mapping of the internal floating-point
24247 representation such that 1.0 maps to the most positive representable
24248 integer and "
24249 (math "-1.0")
24250 "
24251 maps to the most negative representable
24252 integer. The initial value is (0, 0, 0, 0). "))
24253 (entry (% (heading (code "GL_TEXTURE_PRIORITY")))
24254 (para "
24255 Returns the residence priority of the target texture (or the named
24256 texture bound to it). The initial value is 1.
24257 See "
24258 (code "glPrioritizeTextures")
24259 ". "))
24260 (entry (% (heading (code "GL_TEXTURE_RESIDENT")))
24261 (para "
24262 Returns the residence status of the target texture.
24263 If the value returned in "
24264 (var "params")
24265 " is "
24266 (code "GL_TRUE")
24267 ", the texture is
24268 resident in texture memory.
24269 See "
24270 (code "glAreTexturesResident")
24271 ". "))
24272 (entry (% (heading (code "GL_TEXTURE_COMPARE_MODE")))
24273 (para "
24274 Returns a single-valued texture comparison mode, a symbolic constant. The
24275 initial value is "
24276 (code "GL_NONE")
24277 ". See "
24278 (code "glTexParameter")
24279 ". "))
24280 (entry (% (heading (code "GL_TEXTURE_COMPARE_FUNC")))
24281 (para "
24282 Returns a single-valued texture comparison function, a symbolic constant. The
24283 initial value is "
24284 (code "GL_LEQUAL")
24285 ". See "
24286 (code "glTexParameter")
24287 ". "))
24288 (entry (% (heading (code "GL_DEPTH_TEXTURE_MODE")))
24289 (para "
24290 Returns a single-valued texture format indicating how the depth values
24291 should be converted into color components. The initial value is "
24292 (code "GL_LUMINANCE")
24293 ". See "
24294 (code "glTexParameter")
24295 ". "))
24296 (entry (% (heading (code "GL_GENERATE_MIPMAP")))
24297 (para "
24298 Returns a single boolean value indicating if automatic mipmap level updates
24299 are enabled.
24300 See "
24301 (code "glTexParameter")
24302 ". ")))
24303 (heading "Errors")
24304 (para (code "GL_INVALID_ENUM")
24305 " is generated if "
24306 (var "target")
24307 " or "
24308 (var "pname")
24309 " is not an
24310 accepted value. ")
24311 (para (code "GL_INVALID_OPERATION")
24312 " is generated if "
24313 (code "glGetTexParameter")
24314 "
24315 is executed between the execution of "
24316 (code "glBegin")
24317 "
24318 and the corresponding execution of "
24319 (code "glEnd")
24320 ". ")))
24321
24322 (define-gl-procedure
24323 glGetUniformLocation
24324 "glGetUniformLocation"
24325 (funcsynopsis
24326 (funcprototype
24327 (funcdef
24328 "GLint "
24329 (function "glGetUniformLocation"))
24330 (paramdef "GLuint " (parameter "program"))
24331 (paramdef "const GLchar *" (parameter "name"))))
24332 '(*fragment*
24333 (heading
24334 "Returns the location of a uniform variable")
24335 (heading "Parameters")
24336 (table (% (formatter (asis)))
24337 (entry (% (heading (var "program")))
24338 (para "Specifies the program object to be
24339 \t\t queried."))
24340 (entry (% (heading (var "name")))
24341 (para "Points to a null terminated string containing
24342 \t\t the name of the uniform variable whose location is
24343 \t\t to be queried.")))
24344 (heading "Description")
24345 (para (code "glGetUniformLocation ")
24346 " returns an
24347 \tinteger that represents the location of a specific uniform
24348 \tvariable within a program object. "
24349 (var "name")
24350 "
24351 must be a null terminated string that contains no white space.\t"
24352 (var "name")
24353 " must be an active uniform variable
24354 \tname in "
24355 (var "program")
24356 " that is not a structure,
24357 \tan array of structures, or a subcomponent of a vector or a
24358 \tmatrix. This function returns -1 if "
24359 (var "name")
24360 "
24361 does not correspond to an active uniform variable in\t"
24362 (var "program")
24363 " or if "
24364 (var "name")
24365 "
24366 starts with the reserved prefix \"gl_\".")
24367 (para "Uniform variables that are structures or arrays of
24368 \tstructures may be queried by calling\t"
24369 (code "glGetUniformLocation")
24370 " for each field within
24371 \tthe structure. The array element operator \"[]\" and the
24372 \tstructure field operator \".\" may be used in\t"
24373 (var "name")
24374 " in order to select elements within
24375 \tan array or fields within a structure. The result of using these
24376 \toperators is not allowed to be another structure, an array of
24377 \tstructures, or a subcomponent of a vector or a matrix. Except if
24378 \tthe last part of "
24379 (var "name")
24380 " indicates a uniform
24381 \tvariable array, the location of the first element of an array
24382 \tcan be retrieved by using the name of the array, or by using the
24383 \tname appended by \"[0]\".")
24384 (para "The actual locations assigned to uniform variables are not
24385 \tknown until the program object is linked successfully. After
24386 \tlinking has occurred, the command\t"
24387 (code "glGetUniformLocation")
24388 " can be used to obtain
24389 \tthe location of a uniform variable. This location value can then
24390 \tbe passed to\t"
24391 (code "glUniform")
24392 "
24393 to set the value of the uniform variable or to\t"
24394 (code "glGetUniform")
24395 "
24396 in order to query the current value of the uniform variable.
24397 \tAfter a program object has been linked successfully, the index
24398 \tvalues for uniform variables remain fixed until the next link
24399 \tcommand occurs. Uniform variable locations and values can only
24400 \tbe queried after a link if the link was successful.")
24401 (heading "Errors")
24402 (para (code "GL_INVALID_VALUE")
24403 " is generated if\t"
24404 (var "program")
24405 " is not a value generated by
24406 \tOpenGL.")
24407 (para (code "GL_INVALID_OPERATION")
24408 " is generated if\t"
24409 (var "program")
24410 " is not a program object.")
24411 (para (code "GL_INVALID_OPERATION")
24412 " is generated if\t"
24413 (var "program")
24414 " has not been successfully
24415 \tlinked.")
24416 (para (code "GL_INVALID_OPERATION")
24417 " is generated if\t"
24418 (code "glGetUniformLocation")
24419 " is executed between
24420 \tthe execution of\t"
24421 (code "glBegin")
24422 "
24423 and the corresponding execution of\t"
24424 (code "glEnd")
24425 ".")))
24426
24427 (define-gl-procedure
24428 glGetUniformfv
24429 "glGetUniformfv"
24430 (funcsynopsis
24431 (funcprototype
24432 (funcdef "void " (function "glGetUniformfv"))
24433 (paramdef "GLuint " (parameter "program"))
24434 (paramdef "GLint " (parameter "location"))
24435 (paramdef "GLfloat *" (parameter "params")))
24436 (funcprototype
24437 (funcdef "void " (function "glGetUniformiv"))
24438 (paramdef "GLuint " (parameter "program"))
24439 (paramdef "GLint " (parameter "location"))
24440 (paramdef "GLint *" (parameter "params"))))
24441 '(*fragment*
24442 (heading
24443 "Returns the value of a uniform variable")
24444 (heading "Parameters")
24445 (table (% (formatter (asis)))
24446 (entry (% (heading (var "program")))
24447 (para "Specifies the program object to be
24448 \t\t queried."))
24449 (entry (% (heading (var "location")))
24450 (para "Specifies the location of the uniform variable
24451 \t\t to be queried."))
24452 (entry (% (heading (var "params")))
24453 (para "Returns the value of the specified uniform
24454 \t\t variable.")))
24455 (heading "Description")
24456 (para (code "glGetUniform")
24457 " returns in\t"
24458 (var "params")
24459 " the value(s) of the specified
24460 \tuniform variable. The type of the uniform variable specified by\t"
24461 (var "location")
24462 " determines the number of values
24463 \treturned. If the uniform variable is defined in the shader as a
24464 \tboolean, int, or float, a single value will be returned. If it
24465 \tis defined as a vec2, ivec2, or bvec2, two values will be
24466 \treturned. If it is defined as a vec3, ivec3, or bvec3, three
24467 \tvalues will be returned, and so on. To query values stored in
24468 \tuniform variables declared as arrays, call\t"
24469 (code "glGetUniform")
24470 " for each element of the array.
24471 \tTo query values stored in uniform variables declared as
24472 \tstructures, call "
24473 (code "glGetUniform")
24474 " for each
24475 \tfield in the structure. The values for uniform variables
24476 \tdeclared as a matrix will be returned in column major
24477 \torder.")
24478 (para "The locations assigned to uniform variables are not known
24479 \tuntil the program object is linked. After linking has occurred,
24480 \tthe command\t"
24481 (code "glGetUniformLocation")
24482 "
24483 can be used to obtain the location of a uniform variable. This
24484 \tlocation value can then be passed to\t"
24485 (code "glGetUniform")
24486 " in order to query the current
24487 \tvalue of the uniform variable. After a program object has been
24488 \tlinked successfully, the index values for uniform variables
24489 \tremain fixed until the next link command occurs. The uniform
24490 \tvariable values can only be queried after a link if the link was
24491 \tsuccessful.")
24492 (heading "Errors")
24493 (para (code "GL_INVALID_VALUE")
24494 " is generated if\t"
24495 (var "program")
24496 " is not a value generated by
24497 \tOpenGL.")
24498 (para (code "GL_INVALID_OPERATION")
24499 " is generated if\t"
24500 (var "program")
24501 " is not a program object.")
24502 (para (code "GL_INVALID_OPERATION")
24503 " is generated if\t"
24504 (var "program")
24505 " has not been successfully
24506 \tlinked.")
24507 (para (code "GL_INVALID_OPERATION")
24508 " is generated if\t"
24509 (var "location")
24510 " does not correspond to a valid
24511 \tuniform variable location for the specified program object.")
24512 (para (code "GL_INVALID_OPERATION")
24513 " is generated if\t"
24514 (code "glGetUniform")
24515 " is executed between the
24516 \texecution of\t"
24517 (code "glBegin")
24518 "
24519 and the corresponding execution of\t"
24520 (code "glEnd")
24521 ".")))
24522
24523 (define-gl-procedure
24524 glGetVertexAttribPointerv
24525 "glGetVertexAttribPointerv"
24526 (funcsynopsis
24527 (funcprototype
24528 (funcdef
24529 "void "
24530 (function "glGetVertexAttribPointerv"))
24531 (paramdef "GLuint " (parameter "index"))
24532 (paramdef "GLenum " (parameter "pname"))
24533 (paramdef "GLvoid **" (parameter "pointer"))))
24534 '(*fragment*
24535 (heading
24536 "return the address of the specified generic vertex attribute pointer")
24537 (heading "Parameters")
24538 (table (% (formatter (asis)))
24539 (entry (% (heading (var "index")))
24540 (para "Specifies the generic vertex attribute
24541 \t\t parameter to be returned."))
24542 (entry (% (heading (var "pname")))
24543 (para "Specifies the symbolic name of the generic
24544 \t\t vertex attribute parameter to be returned. Must be "
24545 (code "GL_VERTEX_ATTRIB_ARRAY_POINTER")
24546 "."))
24547 (entry (% (heading (var "pointer")))
24548 (para "Returns the pointer value.")))
24549 (heading "Description")
24550 (para (code "glGetVertexAttribPointerv")
24551 " returns
24552 \tpointer information. "
24553 (var "index")
24554 " is the generic
24555 \tvertex attribute to be queried, "
24556 (var "pname")
24557 " is
24558 \ta symbolic constant indicating the pointer to be returned, and\t"
24559 (var "params")
24560 " is a pointer to a location in
24561 \twhich to place the returned data.")
24562 (para "If a non-zero named buffer object was bound to the "
24563 (code "GL_ARRAY_BUFFER")
24564 " target
24565 (see "
24566 (code "glBindBuffer")
24567 ") when the desired pointer was previously
24568 specified, the "
24569 (var "pointer")
24570 " returned is a byte offset into the buffer object's data store. ")
24571 (heading "Errors")
24572 (para (code "GL_INVALID_VALUE")
24573 "
24574 is generated if "
24575 (var "index")
24576 "
24577 is greater than or equal to "
24578 (code "GL_MAX_VERTEX_ATTRIBS")
24579 ".")
24580 (para (code "GL_INVALID_ENUM")
24581 "
24582 is generated if "
24583 (var "pname")
24584 "
24585 is not an accepted value.")))
24586
24587 (define-gl-procedure
24588 glGetVertexAttribdv
24589 "glGetVertexAttribdv"
24590 (funcsynopsis
24591 (funcprototype
24592 (funcdef
24593 "void "
24594 (function "glGetVertexAttribdv"))
24595 (paramdef "GLuint " (parameter "index"))
24596 (paramdef "GLenum " (parameter "pname"))
24597 (paramdef "GLdouble *" (parameter "params")))
24598 (funcprototype
24599 (funcdef
24600 "void "
24601 (function "glGetVertexAttribfv"))
24602 (paramdef "GLuint " (parameter "index"))
24603 (paramdef "GLenum " (parameter "pname"))
24604 (paramdef "GLfloat *" (parameter "params")))
24605 (funcprototype
24606 (funcdef
24607 "void "
24608 (function "glGetVertexAttribiv"))
24609 (paramdef "GLuint " (parameter "index"))
24610 (paramdef "GLenum " (parameter "pname"))
24611 (paramdef "GLint *" (parameter "params"))))
24612 '(*fragment*
24613 (heading
24614 "Return a generic vertex attribute parameter")
24615 (heading "Parameters")
24616 (table (% (formatter (asis)))
24617 (entry (% (heading (var "index")))
24618 (para "Specifies the generic vertex attribute
24619 \t\t parameter to be queried."))
24620 (entry (% (heading (var "pname")))
24621 (para "Specifies the symbolic name of the vertex
24622 \t\t attribute parameter to be queried. Accepted values are "
24623 (code "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING")
24624 ", "
24625 (code "GL_VERTEX_ATTRIB_ARRAY_ENABLED")
24626 ", "
24627 (code "GL_VERTEX_ATTRIB_ARRAY_SIZE")
24628 ", "
24629 (code "GL_VERTEX_ATTRIB_ARRAY_STRIDE")
24630 ", "
24631 (code "GL_VERTEX_ATTRIB_ARRAY_TYPE")
24632 ", "
24633 (code "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED")
24634 ", or "
24635 (code "GL_CURRENT_VERTEX_ATTRIB")
24636 "."))
24637 (entry (% (heading (var "params")))
24638 (para "Returns the requested data.")))
24639 (heading "Description")
24640 (para (code "glGetVertexAttrib")
24641 " returns in\t"
24642 (var "params")
24643 " the value of a generic vertex
24644 \tattribute parameter. The generic vertex attribute to be queried
24645 \tis specified by "
24646 (var "index")
24647 ", and the parameter
24648 \tto be queried is specified by "
24649 (var "pname")
24650 ".")
24651 (para "The accepted parameter names are as follows:")
24652 (table (% (formatter (asis)))
24653 (entry (% (heading
24654 (code "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING")))
24655 (para)
24656 (para (var "params")
24657 " returns a
24658 \t\t single value, the name of the buffer object currently bound to
24659 the binding point corresponding to generic vertex attribute array "
24660 (var "index")
24661 ". If no buffer object is bound,
24662 0 is returned. The initial value is 0."))
24663 (entry (% (heading (code "GL_VERTEX_ATTRIB_ARRAY_ENABLED")))
24664 (para)
24665 (para (var "params")
24666 " returns a
24667 \t\t single value that is non-zero (true) if the vertex
24668 \t\t attribute array for "
24669 (var "index")
24670 " is
24671 \t\t enabled and 0 (false) if it is disabled. The initial
24672 \t\t value is "
24673 (code "GL_FALSE")
24674 "."))
24675 (entry (% (heading (code "GL_VERTEX_ATTRIB_ARRAY_SIZE")))
24676 (para)
24677 (para (var "params")
24678 " returns a
24679 \t\t single value, the size of the vertex attribute array
24680 \t\t for "
24681 (var "index")
24682 ". The size is the
24683 \t\t number of values for each element of the vertex
24684 \t\t attribute array, and it will be 1, 2, 3, or 4. The
24685 \t\t initial value is 4."))
24686 (entry (% (heading (code "GL_VERTEX_ATTRIB_ARRAY_STRIDE")))
24687 (para)
24688 (para (var "params")
24689 " returns a
24690 \t\t single value, the array stride for (number of bytes
24691 \t\t between successive elements in) the vertex attribute
24692 \t\t array for "
24693 (var "index")
24694 ". A value of 0
24695 \t\t indicates that the array elements are stored
24696 \t\t sequentially in memory. The initial value is 0."))
24697 (entry (% (heading (code "GL_VERTEX_ATTRIB_ARRAY_TYPE")))
24698 (para)
24699 (para (var "params")
24700 " returns a
24701 \t\t single value, a symbolic constant indicating the
24702 \t\t array type for the vertex attribute array for "
24703 (var "index")
24704 ". Possible values are "
24705 (code "GL_BYTE")
24706 ", "
24707 (code "GL_UNSIGNED_BYTE")
24708 ", "
24709 (code "GL_SHORT")
24710 ", "
24711 (code "GL_UNSIGNED_SHORT")
24712 ", "
24713 (code "GL_INT")
24714 ", "
24715 (code "GL_UNSIGNED_INT")
24716 ", "
24717 (code "GL_FLOAT")
24718 ", and "
24719 (code "GL_DOUBLE")
24720 ". The initial value is "
24721 (code "GL_FLOAT")
24722 "."))
24723 (entry (% (heading
24724 (code "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED")))
24725 (para)
24726 (para (var "params")
24727 " returns a
24728 \t\t single value that is non-zero (true) if fixed-point
24729 \t\t data types for the vertex attribute array indicated
24730 \t\t by "
24731 (var "index")
24732 " are normalized when
24733 \t\t they are converted to floating point, and 0 (false)
24734 \t\t otherwise. The initial value is "
24735 (code "GL_FALSE")
24736 "."))
24737 (entry (% (heading (code "GL_CURRENT_VERTEX_ATTRIB")))
24738 (para)
24739 (para (var "params")
24740 " returns four
24741 \t\t values that represent the current value for the
24742 \t\t generic vertex attribute specified by index. Generic
24743 \t\t vertex attribute 0 is unique in that it has no
24744 \t\t current state, so an error will be generated if "
24745 (var "index")
24746 " is 0. The initial value
24747 \t\t for all other generic vertex attributes is
24748 \t\t (0,0,0,1).")))
24749 (para "All of the parameters except "
24750 (code "GL_CURRENT_VERTEX_ATTRIB")
24751 "
24752 represent client-side state.")
24753 (heading "Errors")
24754 (para (code "GL_INVALID_VALUE")
24755 " is generated if\t"
24756 (var "index")
24757 " is greater than or equal to\t"
24758 (code "GL_MAX_VERTEX_ATTRIBS")
24759 ".")
24760 (para (code "GL_INVALID_ENUM")
24761 " is generated if\t"
24762 (var "pname")
24763 " is not an accepted value.")
24764 (para (code "GL_INVALID_OPERATION")
24765 " is generated if\t"
24766 (var "index")
24767 " is 0 and\t"
24768 (var "pname")
24769 " is\t"
24770 (code "GL_CURRENT_VERTEX_ATTRIB")
24771 ".")))
24772
24773 (define-gl-procedure
24774 glGet
24775 "glGet"
24776 (funcsynopsis
24777 (funcprototype
24778 (funcdef "void " (function "glGetBooleanv"))
24779 (paramdef "GLenum " (parameter "pname"))
24780 (paramdef "GLboolean * " (parameter "params"))))
24781 '(*fragment*
24782 (heading
24783 "return the value or values of a selected parameter")
24784 (heading "Parameters")
24785 (table (% (formatter (asis)))
24786 (entry (% (heading (var "pname")))
24787 (para "
24788 Specifies the parameter value to be returned.
24789 The symbolic constants in the list below are accepted. "))
24790 (entry (% (heading (var "params")))
24791 (para "
24792 Returns the value or values of the specified parameter. ")))
24793 (heading "Description")
24794 (para "
24795 These four commands return values for simple state variables in GL. "
24796 (var "pname")
24797 " is a symbolic constant indicating the state variable to be returned,
24798 and "
24799 (var "params")
24800 " is a pointer to an array of the indicated type in
24801 which to place the returned data. ")
24802 (para "
24803 Type conversion is performed if "
24804 (var "params")
24805 " has a different type than
24806 the state variable value being requested.
24807 If "
24808 (code "glGetBooleanv")
24809 " is called,
24810 a floating-point (or integer) value is converted to "
24811 (code "GL_FALSE")
24812 " if
24813 and only if it is 0.0 (or 0).
24814 Otherwise,
24815 it is converted to "
24816 (code "GL_TRUE")
24817 ".
24818 If "
24819 (code "glGetIntegerv")
24820 " is called, boolean values are returned as "
24821 (code "GL_TRUE")
24822 " or "
24823 (code "GL_FALSE")
24824 ", and most floating-point values are
24825 rounded to the nearest integer value. Floating-point colors and
24826 normals, however, are returned with a linear mapping that maps 1.0 to
24827 the most positive representable integer value
24828 and "
24829 (math "-1.0")
24830 "
24831 to the most negative representable integer value.
24832 If "
24833 (code "glGetFloatv")
24834 " or "
24835 (code "glGetDoublev")
24836 " is called,
24837 boolean values are returned as "
24838 (code "GL_TRUE")
24839 " or "
24840 (code "GL_FALSE")
24841 ",
24842 and integer values are converted to floating-point values. ")
24843 (para "
24844 The following symbolic constants are accepted by "
24845 (var "pname")
24846 ": ")
24847 (table (% (formatter (asis)))
24848 (entry (% (heading (code "GL_ACCUM_ALPHA_BITS")))
24849 (para)
24850 (para (var "params")
24851 " returns one value,
24852 the number of alpha bitplanes in the accumulation buffer. "))
24853 (entry (% (heading (code "GL_ACCUM_BLUE_BITS")))
24854 (para)
24855 (para (var "params")
24856 " returns one value,
24857 the number of blue bitplanes in the accumulation buffer. "))
24858 (entry (% (heading (code "GL_ACCUM_CLEAR_VALUE")))
24859 (para)
24860 (para (var "params")
24861 " returns four values:
24862 the red, green, blue, and alpha values used to clear the accumulation buffer.
24863 Integer values,
24864 if requested,
24865 are linearly mapped from the internal floating-point representation such
24866 that 1.0 returns the most positive representable integer value,
24867 and "
24868 (math "-1.0")
24869 "
24870 returns the most negative representable integer
24871 value. The initial value is (0, 0, 0, 0).
24872 See "
24873 (code "glClearAccum")
24874 ". "))
24875 (entry (% (heading (code "GL_ACCUM_GREEN_BITS")))
24876 (para)
24877 (para (var "params")
24878 " returns one value,
24879 the number of green bitplanes in the accumulation buffer. "))
24880 (entry (% (heading (code "GL_ACCUM_RED_BITS")))
24881 (para)
24882 (para (var "params")
24883 " returns one value,
24884 the number of red bitplanes in the accumulation buffer. "))
24885 (entry (% (heading (code "GL_ACTIVE_TEXTURE")))
24886 (para)
24887 (para (var "params")
24888 " returns a single value indicating the active multitexture unit.
24889 The initial value is "
24890 (code "GL_TEXTURE0")
24891 ".
24892 See "
24893 (code "glActiveTexture")
24894 ". "))
24895 (entry (% (heading (code "GL_ALIASED_POINT_SIZE_RANGE")))
24896 (para)
24897 (para (var "params")
24898 " returns two values,
24899 the smallest and largest supported sizes for aliased points. "))
24900 (entry (% (heading (code "GL_ALIASED_LINE_WIDTH_RANGE")))
24901 (para)
24902 (para (var "params")
24903 " returns two values,
24904 the smallest and largest supported widths for aliased lines. "))
24905 (entry (% (heading (code "GL_ALPHA_BIAS")))
24906 (para)
24907 (para (var "params")
24908 " returns one value,
24909 the alpha bias factor used during pixel transfers. The initial value is 0.
24910 See "
24911 (code "glPixelTransfer")
24912 ". "))
24913 (entry (% (heading (code "GL_ALPHA_BITS")))
24914 (para)
24915 (para (var "params")
24916 " returns one value,
24917 the number of alpha bitplanes in each color buffer. "))
24918 (entry (% (heading (code "GL_ALPHA_SCALE")))
24919 (para)
24920 (para (var "params")
24921 " returns one value,
24922 the alpha scale factor used
24923 during pixel transfers. The initial value is 1.
24924 See "
24925 (code "glPixelTransfer")
24926 ". "))
24927 (entry (% (heading (code "GL_ALPHA_TEST")))
24928 (para)
24929 (para (var "params")
24930 " returns a single boolean value indicating whether alpha testing
24931 of fragments is enabled. The initial value is "
24932 (code "GL_FALSE")
24933 ".
24934 See "
24935 (code "glAlphaFunc")
24936 ". "))
24937 (entry (% (heading
24938 (code "GL_ALPHA_TEST_FUNC")
24939 (var "params")
24940 " returns one value,"))
24941 (para)
24942 (para "
24943 the symbolic name of the alpha test function. The initial value is "
24944 (code "GL_ALWAYS")
24945 ".
24946 See "
24947 (code "glAlphaFunc")
24948 ". "))
24949 (entry (% (heading (code "GL_ALPHA_TEST_REF")))
24950 (para)
24951 (para (var "params")
24952 " returns one value,
24953 the reference value for the alpha test. The initial value is 0.
24954 See "
24955 (code "glAlphaFunc")
24956 ".
24957 An integer value,
24958 if requested,
24959 is linearly mapped from the internal floating-point representation such
24960 that 1.0 returns the most positive representable integer value,
24961 and "
24962 (math "-1.0")
24963 "
24964 returns the most negative representable integer value. "))
24965 (entry (% (heading (code "GL_ARRAY_BUFFER_BINDING")))
24966 (para)
24967 (para (var "params")
24968 " returns a single value, the name of the buffer object
24969 currently bound to the target "
24970 (code "GL_ARRAY_BUFFER")
24971 ". If no buffer object
24972 is bound to this target, 0 is returned. The initial value is 0.
24973 See "
24974 (code "glBindBuffer")
24975 ". "))
24976 (entry (% (heading (code "GL_ATTRIB_STACK_DEPTH")))
24977 (para)
24978 (para (var "params")
24979 " returns one value,
24980 the depth of the attribute stack.
24981 If the stack is empty,
24982 0 is returned. The initial value is 0.
24983 See "
24984 (code "glPushAttrib")
24985 ". "))
24986 (entry (% (heading (code "GL_AUTO_NORMAL")))
24987 (para)
24988 (para (var "params")
24989 " returns a single boolean value indicating whether 2D map evaluation
24990 automatically generates surface normals. The initial value is "
24991 (code "GL_FALSE")
24992 ".
24993 See "
24994 (code "glMap2")
24995 ". "))
24996 (entry (% (heading (code "GL_AUX_BUFFERS")))
24997 (para)
24998 (para (var "params")
24999 " returns one value,
25000 the number of auxiliary color buffers available. "))
25001 (entry (% (heading (code "GL_BLEND")))
25002 (para)
25003 (para (var "params")
25004 " returns a single boolean value indicating whether blending is
25005 enabled. The initial value is "
25006 (code "GL_FALSE")
25007 ".
25008 See "
25009 (code "glBlendFunc")
25010 ". "))
25011 (entry (% (heading (code "GL_BLEND_COLOR")))
25012 (para)
25013 (para (var "params")
25014 " returns four values,
25015 the red, green, blue, and alpha values which are the components of
25016 the blend color.
25017 See "
25018 (code "glBlendColor")
25019 ". "))
25020 (entry (% (heading (code "GL_BLEND_DST_ALPHA")))
25021 (para)
25022 (para (var "params")
25023 " returns one value,
25024 the symbolic constant identifying the alpha destination blend
25025 function. The initial value is "
25026 (code "GL_ZERO")
25027 ".
25028 See "
25029 (code "glBlendFunc")
25030 " and "
25031 (code "glBlendFuncSeparate")
25032 ". "))
25033 (entry (% (heading (code "GL_BLEND_DST_RGB")))
25034 (para)
25035 (para (var "params")
25036 " returns one value,
25037 the symbolic constant identifying the RGB destination blend
25038 function. The initial value is "
25039 (code "GL_ZERO")
25040 ".
25041 See "
25042 (code "glBlendFunc")
25043 " and "
25044 (code "glBlendFuncSeparate")
25045 ". "))
25046 (entry (% (heading (code "GL_BLEND_EQUATION_RGB")))
25047 (para)
25048 (para (var "params")
25049 " returns one value, a symbolic constant indicating whether
25050 the RGB blend equation is "
25051 (code "GL_FUNC_ADD")
25052 ", "
25053 (code "GL_FUNC_SUBTRACT")
25054 ", "
25055 (code "GL_FUNC_REVERSE_SUBTRACT")
25056 ", "
25057 (code "GL_MIN")
25058 " or "
25059 (code "GL_MAX")
25060 ".
25061 See "
25062 (code "glBlendEquationSeparate")
25063 ". "))
25064 (entry (% (heading (code "GL_BLEND_EQUATION_ALPHA")))
25065 (para)
25066 (para (var "params")
25067 " returns one value, a symbolic constant indicating whether
25068 the Alpha blend equation is "
25069 (code "GL_FUNC_ADD")
25070 ", "
25071 (code "GL_FUNC_SUBTRACT")
25072 ", "
25073 (code "GL_FUNC_REVERSE_SUBTRACT")
25074 ", "
25075 (code "GL_MIN")
25076 " or "
25077 (code "GL_MAX")
25078 ".
25079 See "
25080 (code "glBlendEquationSeparate")
25081 ". "))
25082 (entry (% (heading (code "GL_BLEND_SRC_ALPHA")))
25083 (para)
25084 (para (var "params")
25085 " returns one value,
25086 the symbolic constant identifying the alpha source blend function. The initial
25087 value is "
25088 (code "GL_ONE")
25089 ".
25090 See "
25091 (code "glBlendFunc")
25092 " and "
25093 (code "glBlendFuncSeparate")
25094 ". "))
25095 (entry (% (heading (code "GL_BLEND_SRC_RGB")))
25096 (para)
25097 (para (var "params")
25098 " returns one value,
25099 the symbolic constant identifying the RGB source blend function. The initial
25100 value is "
25101 (code "GL_ONE")
25102 ".
25103 See "
25104 (code "glBlendFunc")
25105 " and "
25106 (code "glBlendFuncSeparate")
25107 ". "))
25108 (entry (% (heading (code "GL_BLUE_BIAS")))
25109 (para)
25110 (para (var "params")
25111 " returns one value,
25112 the blue bias factor used during pixel transfers. The initial value is 0.
25113 See "
25114 (code "glPixelTransfer")
25115 ". "))
25116 (entry (% (heading (code "GL_BLUE_BITS")))
25117 (para)
25118 (para (var "params")
25119 " returns one value,
25120 the number of blue bitplanes in each color buffer. "))
25121 (entry (% (heading (code "GL_BLUE_SCALE")))
25122 (para)
25123 (para (var "params")
25124 " returns one value,
25125 the blue scale factor used during pixel transfers. The initial value is 1.
25126 See "
25127 (code "glPixelTransfer")
25128 ". "))
25129 (entry (% (heading (code "GL_CLIENT_ACTIVE_TEXTURE")))
25130 (para)
25131 (para (var "params")
25132 " returns a single integer value indicating the current client active
25133 multitexture unit. The initial value is "
25134 (code "GL_TEXTURE0")
25135 ".
25136 See "
25137 (code "glClientActiveTexture")
25138 ". "))
25139 (entry (% (heading (code "GL_CLIENT_ATTRIB_STACK_DEPTH")))
25140 (para)
25141 (para (var "params")
25142 " returns one value indicating the depth of the
25143 attribute stack. The initial value is 0.
25144 See "
25145 (code "glPushClientAttrib")
25146 ". "))
25147 (entry (% (heading (code "GL_CLIP_PLANE") (var "i")))
25148 (para)
25149 (para (var "params")
25150 " returns a single boolean value indicating whether the specified
25151 clipping plane is enabled. The initial value is "
25152 (code "GL_FALSE")
25153 ".
25154 See "
25155 (code "glClipPlane")
25156 ". "))
25157 (entry (% (heading (code "GL_COLOR_ARRAY")))
25158 (para)
25159 (para (var "params")
25160 " returns a single boolean value indicating whether the color array is enabled. The initial value is "
25161 (code "GL_FALSE")
25162 ".
25163 See "
25164 (code "glColorPointer")
25165 ". "))
25166 (entry (% (heading (code "GL_COLOR_ARRAY_BUFFER_BINDING")))
25167 (para)
25168 (para (var "params")
25169 " returns a single value, the name of the buffer object
25170 associated with the color array. This buffer object would have been bound to the
25171 target "
25172 (code "GL_ARRAY_BUFFER")
25173 " at the time of the most recent call to "
25174 (code "glColorPointer")
25175 ".
25176 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
25177 See "
25178 (code "glBindBuffer")
25179 ". "))
25180 (entry (% (heading (code "GL_COLOR_ARRAY_SIZE")))
25181 (para)
25182 (para (var "params")
25183 " returns one value,
25184 the number of components per color in the color array. The initial value
25185 is 4.
25186 See "
25187 (code "glColorPointer")
25188 ". "))
25189 (entry (% (heading (code "GL_COLOR_ARRAY_STRIDE")))
25190 (para)
25191 (para (var "params")
25192 " returns one value,
25193 the byte offset between consecutive colors in the color array. The initial
25194 value is 0.
25195 See "
25196 (code "glColorPointer")
25197 ". "))
25198 (entry (% (heading (code "GL_COLOR_ARRAY_TYPE")))
25199 (para)
25200 (para (var "params")
25201 " returns one value,
25202 the data type of each component in the color array. The initial value
25203 is "
25204 (code "GL_FLOAT")
25205 ".
25206 See "
25207 (code "glColorPointer")
25208 ". "))
25209 (entry (% (heading (code "GL_COLOR_CLEAR_VALUE")))
25210 (para)
25211 (para (var "params")
25212 " returns four values:
25213 the red, green, blue, and alpha values used to clear the color buffers.
25214 Integer values,
25215 if requested,
25216 are linearly mapped from the internal floating-point representation such
25217 that 1.0 returns the most positive representable integer value,
25218 and "
25219 (math "-1.0")
25220 "
25221 returns the most negative representable integer
25222 value. The initial value is (0, 0, 0, 0).
25223 See "
25224 (code "glClearColor")
25225 ". "))
25226 (entry (% (heading (code "GL_COLOR_LOGIC_OP")))
25227 (para)
25228 (para (var "params")
25229 " returns a single boolean value indicating whether a fragment's
25230 RGBA color values are merged into the framebuffer using a logical
25231 operation. The initial value is "
25232 (code "GL_FALSE")
25233 ".
25234 See "
25235 (code "glLogicOp")
25236 ". "))
25237 (entry (% (heading (code "GL_COLOR_MATERIAL")))
25238 (para)
25239 (para (var "params")
25240 " returns a single boolean value indicating whether one or more
25241 material parameters are tracking the current color. The initial value
25242 is "
25243 (code "GL_FALSE")
25244 ".
25245 See "
25246 (code "glColorMaterial")
25247 ". "))
25248 (entry (% (heading (code "GL_COLOR_MATERIAL_FACE")))
25249 (para)
25250 (para (var "params")
25251 " returns one value,
25252 a symbolic constant indicating which materials have a parameter that is
25253 tracking the current color. The initial value is "
25254 (code "GL_FRONT_AND_BACK")
25255 ".
25256 See "
25257 (code "glColorMaterial")
25258 ". "))
25259 (entry (% (heading (code "GL_COLOR_MATERIAL_PARAMETER")))
25260 (para)
25261 (para (var "params")
25262 " returns one value,
25263 a symbolic constant indicating which material parameters are
25264 tracking the current color. The initial value is "
25265 (code "GL_AMBIENT_AND_DIFFUSE")
25266 ".
25267 See "
25268 (code "glColorMaterial")
25269 ". "))
25270 (entry (% (heading (code "GL_COLOR_MATRIX")))
25271 (para)
25272 (para (var "params")
25273 " returns sixteen values:
25274 the color matrix on the top of the color matrix stack. Initially
25275 this matrix is the identity matrix.
25276 See "
25277 (code "glPushMatrix")
25278 ". "))
25279 (entry (% (heading (code "GL_COLOR_MATRIX_STACK_DEPTH")))
25280 (para)
25281 (para (var "params")
25282 " returns one value,
25283 the maximum supported depth of the projection matrix stack. The value must
25284 be at least 2.
25285 See "
25286 (code "glPushMatrix")
25287 ". "))
25288 (entry (% (heading (code "GL_COLOR_SUM")))
25289 (para)
25290 (para (var "params")
25291 " returns a single boolean value indicating whether primary and
25292 secondary color sum is enabled.
25293 See "
25294 (code "glSecondaryColor")
25295 ". "))
25296 (entry (% (heading (code "GL_COLOR_TABLE")))
25297 (para)
25298 (para (var "params")
25299 " returns a single boolean value indicating whether the color table
25300 lookup is enabled.
25301 See "
25302 (code "glColorTable")
25303 ". "))
25304 (entry (% (heading (code "GL_COLOR_WRITEMASK")))
25305 (para)
25306 (para (var "params")
25307 " returns four boolean values:
25308 the red, green, blue, and alpha write enables for the color
25309 buffers. The initial value is ("
25310 (code "GL_TRUE")
25311 ", "
25312 (code "GL_TRUE")
25313 ", "
25314 (code "GL_TRUE")
25315 ", "
25316 (code "GL_TRUE")
25317 ").
25318 See "
25319 (code "glColorMask")
25320 ". "))
25321 (entry (% (heading (code "GL_COMPRESSED_TEXTURE_FORMATS")))
25322 (para)
25323 (para (var "params")
25324 " returns a list of symbolic
25325 constants of length "
25326 (code "GL_NUM_COMPRESSED_TEXTURE_FORMATS")
25327 " indicating which compressed texture formats are available.
25328 See "
25329 (code "glCompressedTexImage2D")
25330 ". "))
25331 (entry (% (heading (code "GL_CONVOLUTION_1D")))
25332 (para)
25333 (para (var "params")
25334 " returns a single boolean value indicating whether 1D convolution
25335 is enabled. The initial value is "
25336 (code "GL_FALSE")
25337 ".
25338 See "
25339 (code "glConvolutionFilter1D")
25340 ". "))
25341 (entry (% (heading (code "GL_CONVOLUTION_2D")))
25342 (para)
25343 (para (var "params")
25344 " returns a single boolean value indicating whether 2D convolution
25345 is enabled. The initial value is "
25346 (code "GL_FALSE")
25347 ".
25348 See "
25349 (code "glConvolutionFilter2D")
25350 ". "))
25351 (entry (% (heading (code "GL_CULL_FACE")))
25352 (para)
25353 (para (var "params")
25354 " returns a single boolean value indicating whether polygon culling
25355 is enabled. The initial value is "
25356 (code "GL_FALSE")
25357 ".
25358 See "
25359 (code "glCullFace")
25360 ". "))
25361 (entry (% (heading (code "GL_CULL_FACE_MODE")))
25362 (para)
25363 (para (var "params")
25364 " returns one value,
25365 a symbolic constant indicating which polygon faces are to be
25366 culled. The initial value is "
25367 (code "GL_BACK")
25368 ".
25369 See "
25370 (code "glCullFace")
25371 ". "))
25372 (entry (% (heading (code "GL_CURRENT_COLOR")))
25373 (para)
25374 (para (var "params")
25375 " returns four values:
25376 the red, green, blue, and alpha values of the current color.
25377 Integer values,
25378 if requested,
25379 are linearly mapped from the internal floating-point representation such
25380 that 1.0 returns the most positive representable integer value,
25381 and "
25382 (math "-1.0")
25383 "
25384 returns the most negative representable integer value.
25385 The initial value is (1, 1, 1, 1).
25386 See "
25387 (code "glColor")
25388 ". "))
25389 (entry (% (heading (code "GL_CURRENT_FOG_COORD")))
25390 (para)
25391 (para (var "params")
25392 " returns one value, the current fog coordinate. The initial value
25393 is 0.
25394 See "
25395 (code "glFogCoord")
25396 ". "))
25397 (entry (% (heading (code "GL_CURRENT_INDEX")))
25398 (para)
25399 (para (var "params")
25400 " returns one value,
25401 the current color index. The initial value is 1.
25402 See "
25403 (code "glIndex")
25404 ". "))
25405 (entry (% (heading (code "GL_CURRENT_NORMAL")))
25406 (para)
25407 (para (var "params")
25408 " returns three values:
25409 the "
25410 (var "x")
25411 ", "
25412 (var "y")
25413 ", and "
25414 (var "z")
25415 " values of the current normal.
25416 Integer values,
25417 if requested,
25418 are linearly mapped from the internal floating-point representation such
25419 that 1.0 returns the most positive representable integer value,
25420 and "
25421 (math "-1.0")
25422 "
25423 returns the most negative representable integer value.
25424 The initial value is (0, 0, 1).
25425 See "
25426 (code "glNormal")
25427 ". "))
25428 (entry (% (heading (code "GL_CURRENT_PROGRAM")))
25429 (para)
25430 (para (var "params")
25431 " returns one value,
25432 the name of the program object that is currently active, or 0 if no program object is active.
25433 See "
25434 (code "glUseProgram")
25435 ". "))
25436 (entry (% (heading (code "GL_CURRENT_RASTER_COLOR")))
25437 (para)
25438 (para (var "params")
25439 " returns four values:
25440 the red, green, blue, and alpha color values of the current raster position.
25441 Integer values,
25442 if requested,
25443 are linearly mapped from the internal floating-point representation such
25444 that 1.0 returns the most positive representable integer value,
25445 and "
25446 (math "-1.0")
25447 "
25448 returns the most negative representable integer
25449 value. The initial value is (1, 1, 1, 1).
25450 See "
25451 (code "glRasterPos")
25452 ". "))
25453 (entry (% (heading (code "GL_CURRENT_RASTER_DISTANCE")))
25454 (para)
25455 (para (var "params")
25456 " returns one value, the distance from the eye to the current
25457 raster position. The initial value is 0.
25458 See "
25459 (code "glRasterPos")
25460 ". "))
25461 (entry (% (heading (code "GL_CURRENT_RASTER_INDEX")))
25462 (para)
25463 (para (var "params")
25464 " returns one value,
25465 the color index of the current raster position. The initial value is 1.
25466 See "
25467 (code "glRasterPos")
25468 ". "))
25469 (entry (% (heading (code "GL_CURRENT_RASTER_POSITION")))
25470 (para)
25471 (para (var "params")
25472 " returns four values:
25473 the "
25474 (var "x")
25475 ", "
25476 (var "y")
25477 ", "
25478 (var "z")
25479 ", and "
25480 (var "w")
25481 " components of the current
25482 raster position. "
25483 (var "x")
25484 ", "
25485 (var "y")
25486 ", and "
25487 (var "z")
25488 " are in window coordinates,
25489 and "
25490 (var "w")
25491 " is in clip coordinates. The initial value is (0, 0, 0, 1).
25492 See "
25493 (code "glRasterPos")
25494 ". "))
25495 (entry (% (heading
25496 (code "GL_CURRENT_RASTER_POSITION_VALID")))
25497 (para)
25498 (para (var "params")
25499 " returns a single boolean value indicating whether the current
25500 raster position is valid. The initial value is "
25501 (code "GL_TRUE")
25502 ".
25503 See "
25504 (code "glRasterPos")
25505 ". "))
25506 (entry (% (heading
25507 (code "GL_CURRENT_RASTER_SECONDARY_COLOR")))
25508 (para)
25509 (para (var "params")
25510 " returns four values:
25511 the red, green, blue, and alpha secondary color values of the current raster position.
25512 Integer values,
25513 if requested,
25514 are linearly mapped from the internal floating-point representation such
25515 that 1.0 returns the most positive representable integer value,
25516 and "
25517 (math "-1.0")
25518 "
25519 returns the most negative representable integer
25520 value. The initial value is (1, 1, 1, 1).
25521 See "
25522 (code "glRasterPos")
25523 ". "))
25524 (entry (% (heading
25525 (code "GL_CURRENT_RASTER_TEXTURE_COORDS")))
25526 (para)
25527 (para (var "params")
25528 " returns four values: the "
25529 (var "s")
25530 ", "
25531 (var "t")
25532 ", "
25533 (var "r")
25534 ", and "
25535 (var "q")
25536 "
25537 texture coordinates of the current raster position. The initial value is (0, 0, 0, 1).
25538 See "
25539 (code "glRasterPos")
25540 " and "
25541 (code "glMultiTexCoord")
25542 ". "))
25543 (entry (% (heading (code "GL_CURRENT_SECONDARY_COLOR")))
25544 (para)
25545 (para (var "params")
25546 " returns four values: the red, green, blue, and alpha values of the
25547 current secondary color. Integer values, if requested, are linearly mapped
25548 from the internal floating-point representation such that 1.0 returns the
25549 most positive representable integer value, and "
25550 (math "-1.0")
25551 "
25552 returns the most
25553 negative representable integer value. The initial value is (0, 0, 0, 0).
25554 See "
25555 (code "glSecondaryColor")
25556 ". "))
25557 (entry (% (heading (code "GL_CURRENT_TEXTURE_COORDS")))
25558 (para)
25559 (para (var "params")
25560 " returns four values:
25561 the "
25562 (var "s")
25563 ", "
25564 (var "t")
25565 ", "
25566 (var "r")
25567 ", and "
25568 (var "q")
25569 " current texture
25570 coordinates. The initial value is (0, 0, 0, 1).
25571 See "
25572 (code "glMultiTexCoord")
25573 ". "))
25574 (entry (% (heading (code "GL_DEPTH_BIAS")))
25575 (para)
25576 (para (var "params")
25577 " returns one value,
25578 the depth bias factor used during pixel transfers. The initial value is 0.
25579 See "
25580 (code "glPixelTransfer")
25581 ". "))
25582 (entry (% (heading (code "GL_DEPTH_BITS")))
25583 (para)
25584 (para (var "params")
25585 " returns one value,
25586 the number of bitplanes in the depth buffer. "))
25587 (entry (% (heading (code "GL_DEPTH_CLEAR_VALUE")))
25588 (para)
25589 (para (var "params")
25590 " returns one value,
25591 the value that is used to clear the depth buffer.
25592 Integer values,
25593 if requested,
25594 are linearly mapped from the internal floating-point representation such
25595 that 1.0 returns the most positive representable integer value,
25596 and "
25597 (math "-1.0")
25598 "
25599 returns the most negative representable integer
25600 value. The initial value is 1.
25601 See "
25602 (code "glClearDepth")
25603 ". "))
25604 (entry (% (heading (code "GL_DEPTH_FUNC")))
25605 (para)
25606 (para (var "params")
25607 " returns one value,
25608 the symbolic constant that indicates the depth comparison
25609 function. The initial value is "
25610 (code "GL_LESS")
25611 ".
25612 See "
25613 (code "glDepthFunc")
25614 ". "))
25615 (entry (% (heading (code "GL_DEPTH_RANGE")))
25616 (para)
25617 (para (var "params")
25618 " returns two values:
25619 the near and far mapping limits for the depth buffer.
25620 Integer values,
25621 if requested,
25622 are linearly mapped from the internal floating-point representation such
25623 that 1.0 returns the most positive representable integer value,
25624 and "
25625 (math "-1.0")
25626 "
25627 returns the most negative representable integer
25628 value. The initial value is (0, 1).
25629 See "
25630 (code "glDepthRange")
25631 ". "))
25632 (entry (% (heading (code "GL_DEPTH_SCALE")))
25633 (para)
25634 (para (var "params")
25635 " returns one value,
25636 the depth scale factor used during pixel transfers. The initial value is 1.
25637 See "
25638 (code "glPixelTransfer")
25639 ". "))
25640 (entry (% (heading (code "GL_DEPTH_TEST")))
25641 (para)
25642 (para (var "params")
25643 " returns a single boolean value indicating whether depth testing
25644 of fragments is enabled. The initial value is "
25645 (code "GL_FALSE")
25646 ".
25647 See "
25648 (code "glDepthFunc")
25649 " and "
25650 (code "glDepthRange")
25651 ". "))
25652 (entry (% (heading (code "GL_DEPTH_WRITEMASK")))
25653 (para)
25654 (para (var "params")
25655 " returns a single boolean value indicating if the depth buffer
25656 is enabled for writing. The initial value is "
25657 (code "GL_TRUE")
25658 ".
25659 See "
25660 (code "glDepthMask")
25661 ". "))
25662 (entry (% (heading (code "GL_DITHER")))
25663 (para)
25664 (para (var "params")
25665 " returns a single boolean value indicating whether dithering of
25666 fragment colors and indices is enabled. The initial value is "
25667 (code "GL_TRUE")
25668 ". "))
25669 (entry (% (heading (code "GL_DOUBLEBUFFER")))
25670 (para)
25671 (para (var "params")
25672 " returns a single boolean value indicating whether double buffering
25673 is supported. "))
25674 (entry (% (heading (code "GL_DRAW_BUFFER")))
25675 (para)
25676 (para (var "params")
25677 " returns one value,
25678 a symbolic constant indicating which buffers are being drawn to.
25679 See "
25680 (code "glDrawBuffer")
25681 ". The initial value is "
25682 (code "GL_BACK")
25683 " if there
25684 are back buffers, otherwise it is "
25685 (code "GL_FRONT")
25686 ". "))
25687 (entry (% (heading (code "GL_DRAW_BUFFER") (var "i")))
25688 (para)
25689 (para (var "params")
25690 " returns one value,
25691 a symbolic constant indicating which buffers are being drawn to by the corresponding output color.
25692 See "
25693 (code "glDrawBuffers")
25694 ".
25695 The initial value of "
25696 (code "GL_DRAW_BUFFER0")
25697 " is "
25698 (code "GL_BACK")
25699 " if there
25700 are back buffers, otherwise it is "
25701 (code "GL_FRONT")
25702 ". The
25703 initial values of draw buffers for all other output colors is "
25704 (code "GL_NONE")
25705 ". "))
25706 (entry (% (heading (code "GL_EDGE_FLAG")))
25707 (para)
25708 (para (var "params")
25709 " returns a single boolean value indicating whether the current
25710 edge flag is "
25711 (code "GL_TRUE")
25712 " or "
25713 (code "GL_FALSE")
25714 ". The initial value is "
25715 (code "GL_TRUE")
25716 ".
25717 See "
25718 (code "glEdgeFlag")
25719 ". "))
25720 (entry (% (heading (code "GL_EDGE_FLAG_ARRAY")))
25721 (para)
25722 (para (var "params")
25723 " returns a single boolean value indicating whether the edge
25724 flag array is enabled. The initial value is "
25725 (code "GL_FALSE")
25726 ".
25727 See "
25728 (code "glEdgeFlagPointer")
25729 ". "))
25730 (entry (% (heading
25731 (code "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING")))
25732 (para)
25733 (para (var "params")
25734 " returns a single value, the name of the buffer object
25735 associated with the edge flag array. This buffer object would have been bound to the
25736 target "
25737 (code "GL_ARRAY_BUFFER")
25738 " at the time of the most recent call to "
25739 (code "glEdgeFlagPointer")
25740 ".
25741 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
25742 See "
25743 (code "glBindBuffer")
25744 ". "))
25745 (entry (% (heading (code "GL_EDGE_FLAG_ARRAY_STRIDE")))
25746 (para)
25747 (para (var "params")
25748 " returns one value,
25749 the byte offset between consecutive edge flags in the edge flag
25750 array. The initial value is 0.
25751 See "
25752 (code "glEdgeFlagPointer")
25753 ". "))
25754 (entry (% (heading
25755 (code "GL_ELEMENT_ARRAY_BUFFER_BINDING")))
25756 (para)
25757 (para (var "params")
25758 " returns a single value, the name of the buffer object
25759 currently bound to the target "
25760 (code "GL_ELEMENT_ARRAY_BUFFER")
25761 ". If no buffer object
25762 is bound to this target, 0 is returned. The initial value is 0.
25763 See "
25764 (code "glBindBuffer")
25765 ". "))
25766 (entry (% (heading (code "GL_FEEDBACK_BUFFER_SIZE")))
25767 (para)
25768 (para (var "params")
25769 " returns one value, the size of the feedback buffer.
25770 See "
25771 (code "glFeedbackBuffer")
25772 ". "))
25773 (entry (% (heading (code "GL_FEEDBACK_BUFFER_TYPE")))
25774 (para)
25775 (para (var "params")
25776 " returns one value, the type of the feedback buffer.
25777 See "
25778 (code "glFeedbackBuffer")
25779 ". "))
25780 (entry (% (heading (code "GL_FOG")))
25781 (para)
25782 (para (var "params")
25783 " returns a single boolean value indicating whether fogging is
25784 enabled. The initial value is "
25785 (code "GL_FALSE")
25786 ".
25787 See "
25788 (code "glFog")
25789 ". "))
25790 (entry (% (heading (code "GL_FOG_COORD_ARRAY")))
25791 (para)
25792 (para (var "params")
25793 " returns a single boolean value indicating whether the fog coordinate array is enabled. The initial value is "
25794 (code "GL_FALSE")
25795 ".
25796 See "
25797 (code "glFogCoordPointer")
25798 ". "))
25799 (entry (% (heading
25800 (code "GL_FOG_COORD_ARRAY_BUFFER_BINDING")))
25801 (para)
25802 (para (var "params")
25803 " returns a single value, the name of the buffer object
25804 associated with the fog coordinate array. This buffer object would have been bound to the
25805 target "
25806 (code "GL_ARRAY_BUFFER")
25807 " at the time of the most recent call to "
25808 (code "glFogCoordPointer")
25809 ".
25810 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
25811 See "
25812 (code "glBindBuffer")
25813 ". "))
25814 (entry (% (heading (code "GL_FOG_COORD_ARRAY_STRIDE")))
25815 (para)
25816 (para (var "params")
25817 " returns one value,
25818 the byte offset between consecutive fog coordinates in the fog coordinate
25819 array. The initial value is 0.
25820 See "
25821 (code "glFogCoordPointer")
25822 ". "))
25823 (entry (% (heading (code "GL_FOG_COORD_ARRAY_TYPE")))
25824 (para)
25825 (para (var "params")
25826 " returns one value, the type of the fog coordinate array.
25827 The initial value is "
25828 (code "GL_FLOAT")
25829 ".
25830 See "
25831 (code "glFogCoordPointer")
25832 ". "))
25833 (entry (% (heading (code "GL_FOG_COORD_SRC")))
25834 (para)
25835 (para (var "params")
25836 " returns one value, a symbolic constant indicating the source of the fog coordinate.
25837 The initial value is "
25838 (code "GL_FRAGMENT_DEPTH")
25839 ".
25840 See "
25841 (code "glFog")
25842 ". "))
25843 (entry (% (heading (code "GL_FOG_COLOR")))
25844 (para)
25845 (para (var "params")
25846 " returns four values:
25847 the red, green, blue, and alpha components of the fog color.
25848 Integer values,
25849 if requested,
25850 are linearly mapped from the internal floating-point representation such
25851 that 1.0 returns the most positive representable integer value,
25852 and "
25853 (math "-1.0")
25854 "
25855 returns the most negative representable integer
25856 value. The initial value is (0, 0, 0, 0).
25857 See "
25858 (code "glFog")
25859 ". "))
25860 (entry (% (heading (code "GL_FOG_DENSITY")))
25861 (para)
25862 (para (var "params")
25863 " returns one value,
25864 the fog density parameter. The initial value is 1.
25865 See "
25866 (code "glFog")
25867 ". "))
25868 (entry (% (heading (code "GL_FOG_END")))
25869 (para)
25870 (para (var "params")
25871 " returns one value,
25872 the end factor for the linear fog equation. The initial value is 1.
25873 See "
25874 (code "glFog")
25875 ". "))
25876 (entry (% (heading (code "GL_FOG_HINT")))
25877 (para)
25878 (para (var "params")
25879 " returns one value,
25880 a symbolic constant indicating the mode of the fog hint. The initial value
25881 is "
25882 (code "GL_DONT_CARE")
25883 ".
25884 See "
25885 (code "glHint")
25886 ". "))
25887 (entry (% (heading (code "GL_FOG_INDEX")))
25888 (para)
25889 (para (var "params")
25890 " returns one value,
25891 the fog color index. The initial value is 0.
25892 See "
25893 (code "glFog")
25894 ". "))
25895 (entry (% (heading (code "GL_FOG_MODE")))
25896 (para)
25897 (para (var "params")
25898 " returns one value,
25899 a symbolic constant indicating which fog equation is selected. The initial
25900 value is "
25901 (code "GL_EXP")
25902 ".
25903 See "
25904 (code "glFog")
25905 ". "))
25906 (entry (% (heading (code "GL_FOG_START")))
25907 (para)
25908 (para (var "params")
25909 " returns one value,
25910 the start factor for the linear fog equation. The initial value is 0.
25911 See "
25912 (code "glFog")
25913 ". "))
25914 (entry (% (heading
25915 (code "GL_FRAGMENT_SHADER_DERIVATIVE_HINT")))
25916 (para)
25917 (para (var "params")
25918 " returns one value,
25919 a symbolic constant indicating the mode of the derivative accuracy hint
25920 for fragment shaders. The initial value
25921 is "
25922 (code "GL_DONT_CARE")
25923 ".
25924 See "
25925 (code "glHint")
25926 ". "))
25927 (entry (% (heading (code "GL_FRONT_FACE")))
25928 (para)
25929 (para (var "params")
25930 " returns one value,
25931 a symbolic constant indicating whether clockwise or counterclockwise
25932 polygon winding is treated as front-facing. The initial value is "
25933 (code "GL_CCW")
25934 ".
25935 See "
25936 (code "glFrontFace")
25937 ". "))
25938 (entry (% (heading (code "GL_GENERATE_MIPMAP_HINT")))
25939 (para)
25940 (para (var "params")
25941 " returns one value,
25942 a symbolic constant indicating the mode of the mipmap generation filtering
25943 hint. The initial value is "
25944 (code "GL_DONT_CARE")
25945 ".
25946 See "
25947 (code "glHint")
25948 ". "))
25949 (entry (% (heading (code "GL_GREEN_BIAS")))
25950 (para)
25951 (para (var "params")
25952 " returns one value,
25953 the green bias factor used during pixel transfers. The initial value is 0. "))
25954 (entry (% (heading (code "GL_GREEN_BITS")))
25955 (para)
25956 (para (var "params")
25957 " returns one value,
25958 the number of green bitplanes in each color buffer. "))
25959 (entry (% (heading (code "GL_GREEN_SCALE")))
25960 (para)
25961 (para (var "params")
25962 " returns one value,
25963 the green scale factor used during pixel transfers. The initial value is 1.
25964 See "
25965 (code "glPixelTransfer")
25966 ". "))
25967 (entry (% (heading (code "GL_HISTOGRAM")))
25968 (para)
25969 (para (var "params")
25970 " returns a single boolean value indicating whether histogram is
25971 enabled. The initial value is "
25972 (code "GL_FALSE")
25973 ".
25974 See "
25975 (code "glHistogram")
25976 ". "))
25977 (entry (% (heading (code "GL_INDEX_ARRAY")))
25978 (para)
25979 (para (var "params")
25980 " returns a single boolean value indicating whether the color
25981 index array is enabled. The initial value is "
25982 (code "GL_FALSE")
25983 ".
25984 See "
25985 (code "glIndexPointer")
25986 ". "))
25987 (entry (% (heading (code "GL_INDEX_ARRAY_BUFFER_BINDING")))
25988 (para)
25989 (para (var "params")
25990 " returns a single value, the name of the buffer object
25991 associated with the color index array. This buffer object would have been bound to the
25992 target "
25993 (code "GL_ARRAY_BUFFER")
25994 " at the time of the most recent call to "
25995 (code "glIndexPointer")
25996 ".
25997 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
25998 See "
25999 (code "glBindBuffer")
26000 ". "))
26001 (entry (% (heading (code "GL_INDEX_ARRAY_STRIDE")))
26002 (para)
26003 (para (var "params")
26004 " returns one value,
26005 the byte offset between consecutive color indexes in the color index
26006 array. The initial value is 0.
26007 See "
26008 (code "glIndexPointer")
26009 ". "))
26010 (entry (% (heading (code "GL_INDEX_ARRAY_TYPE")))
26011 (para)
26012 (para (var "params")
26013 " returns one value,
26014 the data type of indexes in the color index array. The initial value is "
26015 (code "GL_FLOAT")
26016 ".
26017 See "
26018 (code "glIndexPointer")
26019 ". "))
26020 (entry (% (heading (code "GL_INDEX_BITS")))
26021 (para)
26022 (para (var "params")
26023 " returns one value,
26024 the number of bitplanes in each color index buffer. "))
26025 (entry (% (heading (code "GL_INDEX_CLEAR_VALUE")))
26026 (para)
26027 (para (var "params")
26028 " returns one value,
26029 the color index used to clear the color index buffers. The initial value
26030 is 0.
26031 See "
26032 (code "glClearIndex")
26033 ". "))
26034 (entry (% (heading (code "GL_INDEX_LOGIC_OP")))
26035 (para)
26036 (para (var "params")
26037 " returns a single boolean value indicating whether a fragment's index
26038 values are merged into the framebuffer using a logical
26039 operation. The initial value is "
26040 (code "GL_FALSE")
26041 ".
26042 See "
26043 (code "glLogicOp")
26044 ". "))
26045 (entry (% (heading (code "GL_INDEX_MODE")))
26046 (para)
26047 (para (var "params")
26048 " returns a single boolean value indicating whether the GL is in
26049 color index mode ("
26050 (code "GL_TRUE")
26051 ") or RGBA mode ("
26052 (code "GL_FALSE")
26053 "). "))
26054 (entry (% (heading (code "GL_INDEX_OFFSET")))
26055 (para)
26056 (para (var "params")
26057 " returns one value,
26058 the offset added to color and stencil indices during pixel
26059 transfers. The initial value is 0.
26060 See "
26061 (code "glPixelTransfer")
26062 ". "))
26063 (entry (% (heading (code "GL_INDEX_SHIFT")))
26064 (para)
26065 (para (var "params")
26066 " returns one value,
26067 the amount that color and stencil indices are shifted during pixel
26068 transfers. The initial value is 0.
26069 See "
26070 (code "glPixelTransfer")
26071 ". "))
26072 (entry (% (heading (code "GL_INDEX_WRITEMASK")))
26073 (para)
26074 (para (var "params")
26075 " returns one value,
26076 a mask indicating which bitplanes of each color index buffer can be
26077 written. The initial value is all 1's.
26078 See "
26079 (code "glIndexMask")
26080 ". "))
26081 (entry (% (heading (code "GL_LIGHT") (var "i")))
26082 (para)
26083 (para (var "params")
26084 " returns a single boolean value indicating whether the specified
26085 light is enabled. The initial value is "
26086 (code "GL_FALSE")
26087 ".
26088 See "
26089 (code "glLight")
26090 " and "
26091 (code "glLightModel")
26092 ". "))
26093 (entry (% (heading (code "GL_LIGHTING")))
26094 (para)
26095 (para (var "params")
26096 " returns a single boolean value indicating whether lighting is
26097 enabled. The initial value is "
26098 (code "GL_FALSE")
26099 ".
26100 See "
26101 (code "glLightModel")
26102 ". "))
26103 (entry (% (heading (code "GL_LIGHT_MODEL_AMBIENT")))
26104 (para)
26105 (para (var "params")
26106 " returns four values:
26107 the red, green, blue, and alpha components of the ambient intensity of
26108 the entire scene.
26109 Integer values,
26110 if requested,
26111 are linearly mapped from the internal floating-point representation such
26112 that 1.0 returns the most positive representable integer value,
26113 and "
26114 (math "-1.0")
26115 "
26116 returns the most negative representable integer
26117 value. The initial value is (0.2, 0.2, 0.2, 1.0).
26118 See "
26119 (code "glLightModel")
26120 ". "))
26121 (entry (% (heading (code "GL_LIGHT_MODEL_COLOR_CONTROL")))
26122 (para)
26123 (para (var "params")
26124 " returns single enumerated value indicating whether specular
26125 reflection calculations are separated from normal lighting computations.
26126 The initial value is "
26127 (code "GL_SINGLE_COLOR")
26128 ". "))
26129 (entry (% (heading (code "GL_LIGHT_MODEL_LOCAL_VIEWER")))
26130 (para)
26131 (para (var "params")
26132 " returns a single boolean value indicating whether specular reflection
26133 calculations treat the viewer as being local to the scene. The initial
26134 value is "
26135 (code "GL_FALSE")
26136 ".
26137 See "
26138 (code "glLightModel")
26139 ". "))
26140 (entry (% (heading (code "GL_LIGHT_MODEL_TWO_SIDE")))
26141 (para)
26142 (para (var "params")
26143 " returns a single boolean value indicating whether separate materials
26144 are used to compute lighting for front- and back-facing
26145 polygons. The initial value is "
26146 (code "GL_FALSE")
26147 ".
26148 See "
26149 (code "glLightModel")
26150 ". "))
26151 (entry (% (heading (code "GL_LINE_SMOOTH")))
26152 (para)
26153 (para (var "params")
26154 " returns a single boolean value indicating whether antialiasing of
26155 lines is enabled. The initial value is "
26156 (code "GL_FALSE")
26157 ".
26158 See "
26159 (code "glLineWidth")
26160 ". "))
26161 (entry (% (heading (code "GL_LINE_SMOOTH_HINT")))
26162 (para)
26163 (para (var "params")
26164 " returns one value,
26165 a symbolic constant indicating the mode of the line antialiasing
26166 hint. The initial value is "
26167 (code "GL_DONT_CARE")
26168 ".
26169 See "
26170 (code "glHint")
26171 ". "))
26172 (entry (% (heading (code "GL_LINE_STIPPLE")))
26173 (para)
26174 (para (var "params")
26175 " returns a single boolean value indicating whether stippling of lines
26176 is enabled. The initial value is "
26177 (code "GL_FALSE")
26178 ".
26179 See "
26180 (code "glLineStipple")
26181 ". "))
26182 (entry (% (heading (code "GL_LINE_STIPPLE_PATTERN")))
26183 (para)
26184 (para (var "params")
26185 " returns one value,
26186 the 16-bit line stipple pattern. The initial value is all 1's.
26187 See "
26188 (code "glLineStipple")
26189 ". "))
26190 (entry (% (heading (code "GL_LINE_STIPPLE_REPEAT")))
26191 (para)
26192 (para (var "params")
26193 " returns one value,
26194 the line stipple repeat factor. The initial value is 1.
26195 See "
26196 (code "glLineStipple")
26197 ". "))
26198 (entry (% (heading (code "GL_LINE_WIDTH")))
26199 (para)
26200 (para (var "params")
26201 " returns one value,
26202 the line width as specified with "
26203 (code "glLineWidth")
26204 ". The initial value is
26205 1. "))
26206 (entry (% (heading (code "GL_LINE_WIDTH_GRANULARITY")))
26207 (para)
26208 (para (var "params")
26209 " returns one value,
26210 the width difference between adjacent supported widths for antialiased lines.
26211 See "
26212 (code "glLineWidth")
26213 ". "))
26214 (entry (% (heading (code "GL_LINE_WIDTH_RANGE")))
26215 (para)
26216 (para (var "params")
26217 " returns two values:
26218 the smallest and largest supported widths for antialiased
26219 lines.
26220 See "
26221 (code "glLineWidth")
26222 ". "))
26223 (entry (% (heading (code "GL_LIST_BASE")))
26224 (para)
26225 (para (var "params")
26226 " returns one value,
26227 the base offset added to all names in arrays presented to "
26228 (code "glCallLists")
26229 ". The initial value is 0.
26230 See "
26231 (code "glListBase")
26232 ". "))
26233 (entry (% (heading (code "GL_LIST_INDEX")))
26234 (para)
26235 (para (var "params")
26236 " returns one value,
26237 the name of the display list currently under construction.
26238 0 is returned if no display list is currently under
26239 construction. The initial value is 0.
26240 See "
26241 (code "glNewList")
26242 ". "))
26243 (entry (% (heading (code "GL_LIST_MODE")))
26244 (para)
26245 (para (var "params")
26246 " returns one value,
26247 a symbolic constant indicating the construction mode of the display list
26248 currently under construction. The initial value is 0.
26249 See "
26250 (code "glNewList")
26251 ". "))
26252 (entry (% (heading (code "GL_LOGIC_OP_MODE")))
26253 (para)
26254 (para (var "params")
26255 " returns one value,
26256 a symbolic constant indicating the selected logic operation
26257 mode. The initial value is "
26258 (code "GL_COPY")
26259 ".
26260 See "
26261 (code "glLogicOp")
26262 ". "))
26263 (entry (% (heading (code "GL_MAP1_COLOR_4")))
26264 (para)
26265 (para (var "params")
26266 " returns a single boolean value indicating whether
26267 1D evaluation generates colors. The initial value is "
26268 (code "GL_FALSE")
26269 ".
26270 See "
26271 (code "glMap1")
26272 ". "))
26273 (entry (% (heading (code "GL_MAP1_GRID_DOMAIN")))
26274 (para)
26275 (para (var "params")
26276 " returns two values:
26277 the endpoints of the 1D map's grid domain. The initial value is (0, 1).
26278 See "
26279 (code "glMapGrid")
26280 ". "))
26281 (entry (% (heading (code "GL_MAP1_GRID_SEGMENTS")))
26282 (para)
26283 (para (var "params")
26284 " returns one value,
26285 the number of partitions in the 1D map's grid domain. The initial value
26286 is 1.
26287 See "
26288 (code "glMapGrid")
26289 ". "))
26290 (entry (% (heading (code "GL_MAP1_INDEX")))
26291 (para)
26292 (para (var "params")
26293 " returns a single boolean value indicating whether
26294 1D evaluation generates color indices. The initial value is "
26295 (code "GL_FALSE")
26296 ".
26297 See "
26298 (code "glMap1")
26299 ". "))
26300 (entry (% (heading (code "GL_MAP1_NORMAL")))
26301 (para)
26302 (para (var "params")
26303 " returns a single boolean value indicating whether
26304 1D evaluation generates normals. The initial value is "
26305 (code "GL_FALSE")
26306 ".
26307 See "
26308 (code "glMap1")
26309 ". "))
26310 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_1")))
26311 (para)
26312 (para (var "params")
26313 " returns a single boolean value indicating whether
26314 1D evaluation generates 1D texture coordinates. The initial value is "
26315 (code "GL_FALSE")
26316 ".
26317 See "
26318 (code "glMap1")
26319 ". "))
26320 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_2")))
26321 (para)
26322 (para (var "params")
26323 " returns a single boolean value indicating whether
26324 1D evaluation generates 2D texture coordinates. The initial value is "
26325 (code "GL_FALSE")
26326 ".
26327 See "
26328 (code "glMap1")
26329 ". "))
26330 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_3")))
26331 (para)
26332 (para (var "params")
26333 " returns a single boolean value indicating whether
26334 1D evaluation generates 3D texture coordinates. The initial value is "
26335 (code "GL_FALSE")
26336 ".
26337 See "
26338 (code "glMap1")
26339 ". "))
26340 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_4")))
26341 (para)
26342 (para (var "params")
26343 " returns a single boolean value indicating whether
26344 1D evaluation generates 4D texture coordinates. The initial value is "
26345 (code "GL_FALSE")
26346 ".
26347 See "
26348 (code "glMap1")
26349 ". "))
26350 (entry (% (heading (code "GL_MAP1_VERTEX_3")))
26351 (para)
26352 (para (var "params")
26353 " returns a single boolean value indicating whether
26354 1D evaluation generates 3D vertex coordinates. The initial value is "
26355 (code "GL_FALSE")
26356 ".
26357 See "
26358 (code "glMap1")
26359 ". "))
26360 (entry (% (heading (code "GL_MAP1_VERTEX_4")))
26361 (para)
26362 (para (var "params")
26363 " returns a single boolean value indicating whether
26364 1D evaluation generates 4D vertex coordinates. The initial value is "
26365 (code "GL_FALSE")
26366 ".
26367 See "
26368 (code "glMap1")
26369 ". "))
26370 (entry (% (heading (code "GL_MAP2_COLOR_4")))
26371 (para)
26372 (para (var "params")
26373 " returns a single boolean value indicating whether
26374 2D evaluation generates colors. The initial value is "
26375 (code "GL_FALSE")
26376 ".
26377 See "
26378 (code "glMap2")
26379 ". "))
26380 (entry (% (heading (code "GL_MAP2_GRID_DOMAIN")))
26381 (para)
26382 (para (var "params")
26383 " returns four values:
26384 the endpoints of the 2D map's "
26385 (math (var "i"))
26386 "
26387 and "
26388 (math (var "j"))
26389 "
26390 grid domains. The initial value
26391 is (0,1; 0,1).
26392 See "
26393 (code "glMapGrid")
26394 ". "))
26395 (entry (% (heading (code "GL_MAP2_GRID_SEGMENTS")))
26396 (para)
26397 (para (var "params")
26398 " returns two values:
26399 the number of partitions in the 2D map's "
26400 (math (var "i"))
26401 "
26402 and "
26403 (math (var "j"))
26404 "
26405 grid
26406 domains. The initial value is (1,1).
26407 See "
26408 (code "glMapGrid")
26409 ". "))
26410 (entry (% (heading (code "GL_MAP2_INDEX")))
26411 (para)
26412 (para (var "params")
26413 " returns a single boolean value indicating whether
26414 2D evaluation generates color indices. The initial value is "
26415 (code "GL_FALSE")
26416 ".
26417 See "
26418 (code "glMap2")
26419 ". "))
26420 (entry (% (heading (code "GL_MAP2_NORMAL")))
26421 (para)
26422 (para (var "params")
26423 " returns a single boolean value indicating whether
26424 2D evaluation generates normals. The initial value is "
26425 (code "GL_FALSE")
26426 ".
26427 See "
26428 (code "glMap2")
26429 ". "))
26430 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_1")))
26431 (para)
26432 (para (var "params")
26433 " returns a single boolean value indicating whether
26434 2D evaluation generates 1D texture coordinates. The initial value is "
26435 (code "GL_FALSE")
26436 ".
26437 See "
26438 (code "glMap2")
26439 ". "))
26440 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_2")))
26441 (para)
26442 (para (var "params")
26443 " returns a single boolean value indicating whether
26444 2D evaluation generates 2D texture coordinates. The initial value is "
26445 (code "GL_FALSE")
26446 ".
26447 See "
26448 (code "glMap2")
26449 ". "))
26450 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_3")))
26451 (para)
26452 (para (var "params")
26453 " returns a single boolean value indicating whether
26454 2D evaluation generates 3D texture coordinates. The initial value is "
26455 (code "GL_FALSE")
26456 ".
26457 See "
26458 (code "glMap2")
26459 ". "))
26460 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_4")))
26461 (para)
26462 (para (var "params")
26463 " returns a single boolean value indicating whether
26464 2D evaluation generates 4D texture coordinates. The initial value is "
26465 (code "GL_FALSE")
26466 ".
26467 See "
26468 (code "glMap2")
26469 ". "))
26470 (entry (% (heading (code "GL_MAP2_VERTEX_3")))
26471 (para)
26472 (para (var "params")
26473 " returns a single boolean value indicating whether
26474 2D evaluation generates 3D vertex coordinates. The initial value is "
26475 (code "GL_FALSE")
26476 ".
26477 See "
26478 (code "glMap2")
26479 ". "))
26480 (entry (% (heading (code "GL_MAP2_VERTEX_4")))
26481 (para)
26482 (para (var "params")
26483 " returns a single boolean value indicating whether
26484 2D evaluation generates 4D vertex coordinates. The initial value is "
26485 (code "GL_FALSE")
26486 ".
26487 See "
26488 (code "glMap2")
26489 ". "))
26490 (entry (% (heading (code "GL_MAP_COLOR")))
26491 (para)
26492 (para (var "params")
26493 " returns a single boolean value indicating if colors and
26494 color indices are to be replaced by table lookup during pixel
26495 transfers. The initial value is "
26496 (code "GL_FALSE")
26497 ".
26498 See "
26499 (code "glPixelTransfer")
26500 ". "))
26501 (entry (% (heading (code "GL_MAP_STENCIL")))
26502 (para)
26503 (para (var "params")
26504 " returns a single boolean value indicating if stencil indices
26505 are to be replaced by table lookup during pixel transfers. The initial
26506 value is "
26507 (code "GL_FALSE")
26508 ".
26509 See "
26510 (code "glPixelTransfer")
26511 ". "))
26512 (entry (% (heading (code "GL_MATRIX_MODE")))
26513 (para)
26514 (para (var "params")
26515 " returns one value,
26516 a symbolic constant indicating which matrix stack is currently the
26517 target of all matrix operations. The initial value is "
26518 (code "GL_MODELVIEW")
26519 ".
26520 See "
26521 (code "glMatrixMode")
26522 ". "))
26523 (entry (% (heading (code "GL_MAX_3D_TEXTURE_SIZE")))
26524 (para)
26525 (para (var "params")
26526 " returns one value,
26527 a rough estimate of the largest 3D texture that the GL can handle.
26528 The value must be at least 16.
26529 If the GL version is 1.2 or greater, use "
26530 (code "GL_PROXY_TEXTURE_3D")
26531 " to determine if a texture is too large.
26532 See "
26533 (code "glTexImage3D")
26534 ". "))
26535 (entry (% (heading
26536 (code "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH")))
26537 (para)
26538 (para (var "params")
26539 " returns one value indicating the maximum supported depth
26540 of the client attribute stack.
26541 See "
26542 (code "glPushClientAttrib")
26543 ". "))
26544 (entry (% (heading (code "GL_MAX_ATTRIB_STACK_DEPTH")))
26545 (para)
26546 (para (var "params")
26547 " returns one value,
26548 the maximum supported depth of the attribute stack. The value must be
26549 at least 16.
26550 See "
26551 (code "glPushAttrib")
26552 ". "))
26553 (entry (% (heading (code "GL_MAX_CLIP_PLANES")))
26554 (para)
26555 (para (var "params")
26556 " returns one value,
26557 the maximum number of application-defined clipping planes. The value must be at least 6.
26558 See "
26559 (code "glClipPlane")
26560 ". "))
26561 (entry (% (heading
26562 (code "GL_MAX_COLOR_MATRIX_STACK_DEPTH")))
26563 (para)
26564 (para (var "params")
26565 " returns one value, the maximum supported depth of the color matrix
26566 stack. The value must be at least 2.
26567 See "
26568 (code "glPushMatrix")
26569 ". "))
26570 (entry (% (heading
26571 (code "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS")))
26572 (para)
26573 (para (var "params")
26574 " returns one value, the maximum supported texture image units that
26575 can be used to access texture maps from the vertex shader and the fragment processor combined.
26576 If both the vertex shader and the fragment processing stage access the same texture image
26577 unit, then that counts as using two texture image units against this limit.
26578 The value must be at least 2.
26579 See "
26580 (code "glActiveTexture")
26581 ". "))
26582 (entry (% (heading (code "GL_MAX_CUBE_MAP_TEXTURE_SIZE")))
26583 (para)
26584 (para (var "params")
26585 " returns one value.
26586 The value gives a rough estimate of the largest cube-map texture that
26587 the GL can handle. The value must be at least 16.
26588 If the GL version is 1.3 or greater, use "
26589 (code "GL_PROXY_TEXTURE_CUBE_MAP")
26590 "
26591 to determine if a texture is too large.
26592 See "
26593 (code "glTexImage2D")
26594 ". "))
26595 (entry (% (heading (code "GL_MAX_DRAW_BUFFERS")))
26596 (para)
26597 (para (var "params")
26598 " returns one value, the maximum number
26599 of simultaneous output colors allowed from a fragment shader using the "
26600 (code "gl_FragData")
26601 " built-in array. The value must be at least 1.
26602 See "
26603 (code "glDrawBuffers")
26604 ". "))
26605 (entry (% (heading (code "GL_MAX_ELEMENTS_INDICES")))
26606 (para)
26607 (para (var "params")
26608 " returns one value,
26609 the recommended maximum number of vertex array indices.
26610 See "
26611 (code "glDrawRangeElements")
26612 ". "))
26613 (entry (% (heading (code "GL_MAX_ELEMENTS_VERTICES")))
26614 (para)
26615 (para (var "params")
26616 " returns one value,
26617 the recommended maximum number of vertex array vertices.
26618 See "
26619 (code "glDrawRangeElements")
26620 ". "))
26621 (entry (% (heading (code "GL_MAX_EVAL_ORDER")))
26622 (para)
26623 (para (var "params")
26624 " returns one value,
26625 the maximum equation order supported by 1D and 2D
26626 evaluators. The value must be at least 8.
26627 See "
26628 (code "glMap1")
26629 " and "
26630 (code "glMap2")
26631 ". "))
26632 (entry (% (heading
26633 (code "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS")))
26634 (para)
26635 (para (var "params")
26636 " returns one value,
26637 the maximum number of individual floating-point, integer, or boolean values that can be held
26638 in uniform variable storage for a fragment shader. The value must be at least 64.
26639 See "
26640 (code "glUniform")
26641 ". "))
26642 (entry (% (heading (code "GL_MAX_LIGHTS")))
26643 (para)
26644 (para (var "params")
26645 " returns one value,
26646 the maximum number of lights. The value must be at least 8.
26647 See "
26648 (code "glLight")
26649 ". "))
26650 (entry (% (heading (code "GL_MAX_LIST_NESTING")))
26651 (para)
26652 (para (var "params")
26653 " returns one value,
26654 the maximum recursion depth allowed during display-list
26655 traversal. The value must be at least 64.
26656 See "
26657 (code "glCallList")
26658 ". "))
26659 (entry (% (heading (code "GL_MAX_MODELVIEW_STACK_DEPTH")))
26660 (para)
26661 (para (var "params")
26662 " returns one value,
26663 the maximum supported depth of the modelview matrix stack. The value must
26664 be at least 32.
26665 See "
26666 (code "glPushMatrix")
26667 ". "))
26668 (entry (% (heading (code "GL_MAX_NAME_STACK_DEPTH")))
26669 (para)
26670 (para (var "params")
26671 " returns one value,
26672 the maximum supported depth of the selection name stack. The value must be at least 64.
26673 See "
26674 (code "glPushName")
26675 ". "))
26676 (entry (% (heading (code "GL_MAX_PIXEL_MAP_TABLE")))
26677 (para)
26678 (para (var "params")
26679 " returns one value,
26680 the maximum supported size of a "
26681 (code "glPixelMap")
26682 " lookup table.
26683 The value must be at least 32.
26684 See "
26685 (code "glPixelMap")
26686 ". "))
26687 (entry (% (heading (code "GL_MAX_PROJECTION_STACK_DEPTH")))
26688 (para)
26689 (para (var "params")
26690 " returns one value, the maximum supported depth of the projection
26691 matrix stack. The value must be at least 2.
26692 See "
26693 (code "glPushMatrix")
26694 ". "))
26695 (entry (% (heading (code "GL_MAX_TEXTURE_COORDS")))
26696 (para)
26697 (para (var "params")
26698 " returns one value,
26699 the maximum number of texture coordinate sets available to vertex and fragment shaders.
26700 The value must be at least 2.
26701 See "
26702 (code "glActiveTexture")
26703 " and "
26704 (code "glClientActiveTexture")
26705 ". "))
26706 (entry (% (heading (code "GL_MAX_TEXTURE_IMAGE_UNITS")))
26707 (para)
26708 (para (var "params")
26709 " returns one value, the maximum supported texture image units that
26710 can be used to access texture maps from the fragment shader.
26711 The value must be at least 2.
26712 See "
26713 (code "glActiveTexture")
26714 ". "))
26715 (entry (% (heading (code "GL_MAX_TEXTURE_LOD_BIAS")))
26716 (para)
26717 (para (var "params")
26718 " returns one value,
26719 the maximum, absolute value of the texture level-of-detail bias. The
26720 value must be at least 4. "))
26721 (entry (% (heading (code "GL_MAX_TEXTURE_SIZE")))
26722 (para)
26723 (para (var "params")
26724 " returns one value.
26725 The value gives a rough estimate of the largest texture that
26726 the GL can handle. The value must be at least 64.
26727 If the GL version is 1.1 or greater, use "
26728 (code "GL_PROXY_TEXTURE_1D")
26729 " or "
26730 (code "GL_PROXY_TEXTURE_2D")
26731 "
26732 to determine if a texture is too large.
26733 See "
26734 (code "glTexImage1D")
26735 " and "
26736 (code "glTexImage2D")
26737 ". "))
26738 (entry (% (heading (code "GL_MAX_TEXTURE_STACK_DEPTH")))
26739 (para)
26740 (para (var "params")
26741 " returns one value,
26742 the maximum supported depth of the texture matrix stack. The value must be at least 2.
26743 See "
26744 (code "glPushMatrix")
26745 ". "))
26746 (entry (% (heading (code "GL_MAX_TEXTURE_UNITS")))
26747 (para)
26748 (para (var "params")
26749 " returns a single value indicating the number of conventional
26750 texture units supported. Each conventional texture unit includes both a texture coordinate set
26751 and a texture image unit. Conventional texture units may be used for fixed-function (non-shader)
26752 rendering. The value must be at least 2. Additional texture coordinate sets and texture
26753 image units may be accessed from vertex and fragment shaders.
26754 See "
26755 (code "glActiveTexture")
26756 " and "
26757 (code "glClientActiveTexture")
26758 ". "))
26759 (entry (% (heading (code "GL_MAX_VARYING_FLOATS")))
26760 (para)
26761 (para (var "params")
26762 " returns one value,
26763 the maximum number of interpolators available for processing varying variables used by
26764 vertex and fragment shaders. This value represents the number of individual floating-point
26765 values that can be interpolated; varying variables declared as vectors, matrices, and arrays
26766 will all consume multiple interpolators. The value must be at least 32. "))
26767 (entry (% (heading (code "GL_MAX_VERTEX_ATTRIBS")))
26768 (para)
26769 (para (var "params")
26770 " returns one value,
26771 the maximum number of 4-component generic vertex attributes accessible to a vertex shader.
26772 The value must be at least 16.
26773 See "
26774 (code "glVertexAttrib")
26775 ". "))
26776 (entry (% (heading
26777 (code "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS")))
26778 (para)
26779 (para (var "params")
26780 " returns one value, the maximum supported texture image units that
26781 can be used to access texture maps from the vertex shader. The value may be 0.
26782 See "
26783 (code "glActiveTexture")
26784 ". "))
26785 (entry (% (heading
26786 (code "GL_MAX_VERTEX_UNIFORM_COMPONENTS")))
26787 (para)
26788 (para (var "params")
26789 " returns one value,
26790 the maximum number of individual floating-point, integer, or boolean values that can be held
26791 in uniform variable storage for a vertex shader. The value must be at least 512.
26792 See "
26793 (code "glUniform")
26794 ". "))
26795 (entry (% (heading (code "GL_MAX_VIEWPORT_DIMS")))
26796 (para)
26797 (para (var "params")
26798 " returns two values:
26799 the maximum supported width and height of the viewport.
26800 These must be at least as large as the visible dimensions of the display
26801 being rendered to.
26802 See "
26803 (code "glViewport")
26804 ". "))
26805 (entry (% (heading (code "GL_MINMAX")))
26806 (para)
26807 (para (var "params")
26808 " returns a single boolean value indicating whether pixel minmax
26809 values are computed. The initial value is "
26810 (code "GL_FALSE")
26811 ".
26812 See "
26813 (code "glMinmax")
26814 ". "))
26815 (entry (% (heading (code "GL_MODELVIEW_MATRIX")))
26816 (para)
26817 (para (var "params")
26818 " returns sixteen values:
26819 the modelview matrix on the top of the modelview matrix stack. Initially
26820 this matrix is the identity matrix.
26821 See "
26822 (code "glPushMatrix")
26823 ". "))
26824 (entry (% (heading (code "GL_MODELVIEW_STACK_DEPTH")))
26825 (para)
26826 (para (var "params")
26827 " returns one value,
26828 the number of matrices on the modelview matrix stack.
26829 The initial value is 1.
26830 See "
26831 (code "glPushMatrix")
26832 ". "))
26833 (entry (% (heading (code "GL_NAME_STACK_DEPTH")))
26834 (para)
26835 (para (var "params")
26836 " returns one value,
26837 the number of names on the selection name stack. The initial value is 0.
26838 See "
26839 (code "glPushName")
26840 ". "))
26841 (entry (% (heading (code "GL_NORMAL_ARRAY")))
26842 (para)
26843 (para (var "params")
26844 " returns a single boolean value, indicating whether the normal
26845 array is enabled. The initial value is "
26846 (code "GL_FALSE")
26847 ".
26848 See "
26849 (code "glNormalPointer")
26850 ". "))
26851 (entry (% (heading (code "GL_NORMAL_ARRAY_BUFFER_BINDING")))
26852 (para)
26853 (para (var "params")
26854 " returns a single value, the name of the buffer object
26855 associated with the normal array. This buffer object would have been bound to the
26856 target "
26857 (code "GL_ARRAY_BUFFER")
26858 " at the time of the most recent call to "
26859 (code "glNormalPointer")
26860 ".
26861 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
26862 See "
26863 (code "glBindBuffer")
26864 ". "))
26865 (entry (% (heading (code "GL_NORMAL_ARRAY_STRIDE")))
26866 (para)
26867 (para (var "params")
26868 " returns one value,
26869 the byte offset between consecutive normals in the normal
26870 array. The initial value is 0.
26871 See "
26872 (code "glNormalPointer")
26873 ". "))
26874 (entry (% (heading (code "GL_NORMAL_ARRAY_TYPE")))
26875 (para)
26876 (para (var "params")
26877 " returns one value,
26878 the data type of each coordinate in the normal array. The initial value is "
26879 (code "GL_FLOAT")
26880 ".
26881 See "
26882 (code "glNormalPointer")
26883 ". "))
26884 (entry (% (heading (code "GL_NORMALIZE")))
26885 (para)
26886 (para (var "params")
26887 " returns a single boolean value indicating whether normals are
26888 automatically scaled to unit length after they have been transformed to
26889 eye coordinates. The initial value is "
26890 (code "GL_FALSE")
26891 ".
26892 See "
26893 (code "glNormal")
26894 ". "))
26895 (entry (% (heading
26896 (code "GL_NUM_COMPRESSED_TEXTURE_FORMATS")))
26897 (para)
26898 (para (var "params")
26899 " returns a single integer value indicating the number of available
26900 compressed texture formats. The minimum value is 0.
26901 See "
26902 (code "glCompressedTexImage2D")
26903 ". "))
26904 (entry (% (heading (code "GL_PACK_ALIGNMENT")))
26905 (para)
26906 (para (var "params")
26907 " returns one value,
26908 the byte alignment used for writing pixel data to memory. The initial
26909 value is 4.
26910 See "
26911 (code "glPixelStore")
26912 ". "))
26913 (entry (% (heading (code "GL_PACK_IMAGE_HEIGHT")))
26914 (para)
26915 (para (var "params")
26916 " returns one value,
26917 the image height used for writing pixel data to memory. The initial
26918 value is 0.
26919 See "
26920 (code "glPixelStore")
26921 ". "))
26922 (entry (% (heading (code "GL_PACK_LSB_FIRST")))
26923 (para)
26924 (para (var "params")
26925 " returns a single boolean value indicating whether single-bit
26926 pixels being written to memory are written first to the least significant
26927 bit of each unsigned byte. The initial value is "
26928 (code "GL_FALSE")
26929 ".
26930 See "
26931 (code "glPixelStore")
26932 ". "))
26933 (entry (% (heading (code "GL_PACK_ROW_LENGTH")))
26934 (para)
26935 (para (var "params")
26936 " returns one value,
26937 the row length used for writing pixel data to memory. The initial value is
26938 0.
26939 See "
26940 (code "glPixelStore")
26941 ". "))
26942 (entry (% (heading (code "GL_PACK_SKIP_IMAGES")))
26943 (para)
26944 (para (var "params")
26945 " returns one value,
26946 the number of pixel images skipped before the first pixel is written
26947 into memory. The initial value is 0.
26948 See "
26949 (code "glPixelStore")
26950 ". "))
26951 (entry (% (heading (code "GL_PACK_SKIP_PIXELS")))
26952 (para)
26953 (para (var "params")
26954 " returns one value,
26955 the number of pixel locations skipped before the first pixel is written
26956 into memory. The initial value is 0.
26957 See "
26958 (code "glPixelStore")
26959 ". "))
26960 (entry (% (heading (code "GL_PACK_SKIP_ROWS")))
26961 (para)
26962 (para (var "params")
26963 " returns one value,
26964 the number of rows of pixel locations skipped before the first pixel is written
26965 into memory. The initial value is 0.
26966 See "
26967 (code "glPixelStore")
26968 ". "))
26969 (entry (% (heading (code "GL_PACK_SWAP_BYTES")))
26970 (para)
26971 (para (var "params")
26972 " returns a single boolean value indicating whether the bytes of
26973 two-byte and four-byte pixel indices and components are swapped before being
26974 written to memory. The initial value is "
26975 (code "GL_FALSE")
26976 ".
26977 See "
26978 (code "glPixelStore")
26979 ". "))
26980 (entry (% (heading (code "GL_PERSPECTIVE_CORRECTION_HINT")))
26981 (para)
26982 (para (var "params")
26983 " returns one value,
26984 a symbolic constant indicating the mode of the perspective correction
26985 hint. The initial value is "
26986 (code "GL_DONT_CARE")
26987 ".
26988 See "
26989 (code "glHint")
26990 ". "))
26991 (entry (% (heading (code "GL_PIXEL_MAP_A_TO_A_SIZE")))
26992 (para)
26993 (para (var "params")
26994 " returns one value,
26995 the size of the alpha-to-alpha pixel translation table.
26996 The initial value is 1.
26997 See "
26998 (code "glPixelMap")
26999 ". "))
27000 (entry (% (heading (code "GL_PIXEL_MAP_B_TO_B_SIZE")))
27001 (para)
27002 (para (var "params")
27003 " returns one value,
27004 the size of the blue-to-blue pixel translation table.
27005 The initial value is 1.
27006 See "
27007 (code "glPixelMap")
27008 ". "))
27009 (entry (% (heading (code "GL_PIXEL_MAP_G_TO_G_SIZE")))
27010 (para)
27011 (para (var "params")
27012 " returns one value,
27013 the size of the green-to-green pixel translation table.
27014 The initial value is 1.
27015 See "
27016 (code "glPixelMap")
27017 ". "))
27018 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_A_SIZE")))
27019 (para)
27020 (para (var "params")
27021 " returns one value,
27022 the size of the index-to-alpha pixel translation table.
27023 The initial value is 1.
27024 See "
27025 (code "glPixelMap")
27026 ". "))
27027 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_B_SIZE")))
27028 (para)
27029 (para (var "params")
27030 " returns one value,
27031 the size of the index-to-blue pixel translation table.
27032 The initial value is 1.
27033 See "
27034 (code "glPixelMap")
27035 ". "))
27036 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_G_SIZE")))
27037 (para)
27038 (para (var "params")
27039 " returns one value,
27040 the size of the index-to-green pixel translation table.
27041 The initial value is 1.
27042 See "
27043 (code "glPixelMap")
27044 ". "))
27045 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_I_SIZE")))
27046 (para)
27047 (para (var "params")
27048 " returns one value,
27049 the size of the index-to-index pixel translation table.
27050 The initial value is 1.
27051 See "
27052 (code "glPixelMap")
27053 ". "))
27054 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_R_SIZE")))
27055 (para)
27056 (para (var "params")
27057 " returns one value,
27058 the size of the index-to-red pixel translation table.
27059 The initial value is 1.
27060 See "
27061 (code "glPixelMap")
27062 ". "))
27063 (entry (% (heading (code "GL_PIXEL_MAP_R_TO_R_SIZE")))
27064 (para)
27065 (para (var "params")
27066 " returns one value,
27067 the size of the red-to-red pixel translation table.
27068 The initial value is 1.
27069 See "
27070 (code "glPixelMap")
27071 ". "))
27072 (entry (% (heading (code "GL_PIXEL_MAP_S_TO_S_SIZE")))
27073 (para)
27074 (para (var "params")
27075 " returns one value,
27076 the size of the stencil-to-stencil pixel translation table.
27077 The initial value is 1.
27078 See "
27079 (code "glPixelMap")
27080 ". "))
27081 (entry (% (heading (code "GL_PIXEL_PACK_BUFFER_BINDING")))
27082 (para)
27083 (para (var "params")
27084 " returns a single value, the name of the buffer object
27085 currently bound to the target "
27086 (code "GL_PIXEL_PACK_BUFFER")
27087 ". If no buffer object
27088 is bound to this target, 0 is returned. The initial value is 0.
27089 See "
27090 (code "glBindBuffer")
27091 ". "))
27092 (entry (% (heading (code "GL_PIXEL_UNPACK_BUFFER_BINDING")))
27093 (para)
27094 (para (var "params")
27095 " returns a single value, the name of the buffer object
27096 currently bound to the target "
27097 (code "GL_PIXEL_UNPACK_BUFFER")
27098 ". If no buffer object
27099 is bound to this target, 0 is returned. The initial value is 0.
27100 See "
27101 (code "glBindBuffer")
27102 ". "))
27103 (entry (% (heading (code "GL_POINT_DISTANCE_ATTENUATION")))
27104 (para)
27105 (para (var "params")
27106 " returns three values,
27107 the coefficients for computing the attenuation value for points.
27108 See "
27109 (code "glPointParameter")
27110 ". "))
27111 (entry (% (heading (code "GL_POINT_FADE_THRESHOLD_SIZE")))
27112 (para)
27113 (para (var "params")
27114 " returns one value,
27115 the point size threshold for determining the point size.
27116 See "
27117 (code "glPointParameter")
27118 ". "))
27119 (entry (% (heading (code "GL_POINT_SIZE")))
27120 (para)
27121 (para (var "params")
27122 " returns one value,
27123 the point size as specified by "
27124 (code "glPointSize")
27125 ". The initial value is 1. "))
27126 (entry (% (heading (code "GL_POINT_SIZE_GRANULARITY")))
27127 (para)
27128 (para (var "params")
27129 " returns one value,
27130 the size difference between adjacent supported sizes for antialiased points.
27131 See "
27132 (code "glPointSize")
27133 ". "))
27134 (entry (% (heading (code "GL_POINT_SIZE_MAX")))
27135 (para)
27136 (para (var "params")
27137 " returns one value,
27138 the upper bound for the attenuated point sizes. The initial value is 0.0.
27139 See "
27140 (code "glPointParameter")
27141 ". "))
27142 (entry (% (heading (code "GL_POINT_SIZE_MIN")))
27143 (para)
27144 (para (var "params")
27145 " returns one value,
27146 the lower bound for the attenuated point sizes. The initial value is 1.0.
27147 See "
27148 (code "glPointParameter")
27149 ". "))
27150 (entry (% (heading (code "GL_POINT_SIZE_RANGE")))
27151 (para)
27152 (para (var "params")
27153 " returns two values:
27154 the smallest and largest supported sizes for antialiased
27155 points. The smallest size must be at most 1, and the largest size must
27156 be at least 1.
27157 See "
27158 (code "glPointSize")
27159 ". "))
27160 (entry (% (heading (code "GL_POINT_SMOOTH")))
27161 (para)
27162 (para (var "params")
27163 " returns a single boolean value indicating whether antialiasing of
27164 points is enabled. The initial value is "
27165 (code "GL_FALSE")
27166 ".
27167 See "
27168 (code "glPointSize")
27169 ". "))
27170 (entry (% (heading (code "GL_POINT_SMOOTH_HINT")))
27171 (para)
27172 (para (var "params")
27173 " returns one value,
27174 a symbolic constant indicating the mode of the point antialiasing
27175 hint. The initial value is "
27176 (code "GL_DONT_CARE")
27177 ".
27178 See "
27179 (code "glHint")
27180 ". "))
27181 (entry (% (heading (code "GL_POINT_SPRITE")))
27182 (para)
27183 (para (var "params")
27184 " returns a single boolean value indicating whether point sprite is
27185 enabled. The initial value is "
27186 (code "GL_FALSE")
27187 ". "))
27188 (entry (% (heading (code "GL_POLYGON_MODE")))
27189 (para)
27190 (para (var "params")
27191 " returns two values:
27192 symbolic constants indicating whether front-facing and back-facing polygons
27193 are rasterized as points, lines, or filled polygons. The initial value is "
27194 (code "GL_FILL")
27195 ".
27196 See "
27197 (code "glPolygonMode")
27198 ". "))
27199 (entry (% (heading (code "GL_POLYGON_OFFSET_FACTOR")))
27200 (para)
27201 (para (var "params")
27202 " returns one value,
27203 the scaling factor used to determine the variable offset that is added
27204 to the depth value of each fragment generated when a polygon is
27205 rasterized. The initial value is 0.
27206 See "
27207 (code "glPolygonOffset")
27208 ". "))
27209 (entry (% (heading (code "GL_POLYGON_OFFSET_UNITS")))
27210 (para)
27211 (para (var "params")
27212 " returns one value.
27213 This value is multiplied by an implementation-specific value and then
27214 added to the depth value of each fragment
27215 generated when a polygon is rasterized. The initial value is 0.
27216 See "
27217 (code "glPolygonOffset")
27218 ". "))
27219 (entry (% (heading (code "GL_POLYGON_OFFSET_FILL")))
27220 (para)
27221 (para (var "params")
27222 " returns a single boolean value indicating whether polygon offset
27223 is enabled for polygons in fill mode. The initial value is "
27224 (code "GL_FALSE")
27225 ".
27226 See "
27227 (code "glPolygonOffset")
27228 ". "))
27229 (entry (% (heading (code "GL_POLYGON_OFFSET_LINE")))
27230 (para)
27231 (para (var "params")
27232 " returns a single boolean value indicating whether polygon offset
27233 is enabled for polygons in line mode. The initial value is "
27234 (code "GL_FALSE")
27235 ".
27236 See "
27237 (code "glPolygonOffset")
27238 ". "))
27239 (entry (% (heading (code "GL_POLYGON_OFFSET_POINT")))
27240 (para)
27241 (para (var "params")
27242 " returns a single boolean value indicating whether polygon offset
27243 is enabled for polygons in point mode. The initial value is "
27244 (code "GL_FALSE")
27245 ".
27246 See "
27247 (code "glPolygonOffset")
27248 ". "))
27249 (entry (% (heading (code "GL_POLYGON_SMOOTH")))
27250 (para)
27251 (para (var "params")
27252 " returns a single boolean value indicating whether antialiasing of
27253 polygons is enabled. The initial value is "
27254 (code "GL_FALSE")
27255 ".
27256 See "
27257 (code "glPolygonMode")
27258 ". "))
27259 (entry (% (heading (code "GL_POLYGON_SMOOTH_HINT")))
27260 (para)
27261 (para (var "params")
27262 " returns one value,
27263 a symbolic constant indicating the mode of the polygon antialiasing
27264 hint. The initial value is "
27265 (code "GL_DONT_CARE")
27266 ".
27267 See "
27268 (code "glHint")
27269 ". "))
27270 (entry (% (heading (code "GL_POLYGON_STIPPLE")))
27271 (para)
27272 (para (var "params")
27273 " returns a single boolean value indicating whether polygon
27274 stippling is enabled. The initial value is "
27275 (code "GL_FALSE")
27276 ".
27277 See "
27278 (code "glPolygonStipple")
27279 ". "))
27280 (entry (% (heading
27281 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")))
27282 (para)
27283 (para (var "params")
27284 " returns a single boolean value indicating whether post color
27285 matrix transformation lookup is enabled.
27286 The initial value is "
27287 (code "GL_FALSE")
27288 ".
27289 See "
27290 (code "glColorTable")
27291 ". "))
27292 (entry (% (heading (code "GL_POST_COLOR_MATRIX_RED_BIAS")))
27293 (para)
27294 (para (var "params")
27295 " returns one value, the red bias factor applied to RGBA fragments
27296 after color matrix transformations.
27297 The initial value is 0.
27298 See "
27299 (code "glPixelTransfer")
27300 ". "))
27301 (entry (% (heading
27302 (code "GL_POST_COLOR_MATRIX_GREEN_BIAS")))
27303 (para)
27304 (para (var "params")
27305 " returns one value, the green bias factor applied to RGBA fragments
27306 after color matrix transformations.
27307 The initial value is 0.
27308 See "
27309 (code "glPixelTransfer")))
27310 (entry (% (heading (code "GL_POST_COLOR_MATRIX_BLUE_BIAS")))
27311 (para)
27312 (para (var "params")
27313 " returns one value, the blue bias factor applied to RGBA fragments
27314 after color matrix transformations.
27315 The initial value is 0.
27316 See "
27317 (code "glPixelTransfer")
27318 ". "))
27319 (entry (% (heading
27320 (code "GL_POST_COLOR_MATRIX_ALPHA_BIAS")))
27321 (para)
27322 (para (var "params")
27323 " returns one value, the alpha bias factor applied to RGBA fragments
27324 after color matrix transformations.
27325 The initial value is 0.
27326 See "
27327 (code "glPixelTransfer")
27328 ". "))
27329 (entry (% (heading (code "GL_POST_COLOR_MATRIX_RED_SCALE")))
27330 (para)
27331 (para (var "params")
27332 " returns one value, the red scale factor applied to RGBA fragments
27333 after color matrix transformations.
27334 The initial value is 1.
27335 See "
27336 (code "glPixelTransfer")
27337 ". "))
27338 (entry (% (heading
27339 (code "GL_POST_COLOR_MATRIX_GREEN_SCALE")))
27340 (para)
27341 (para (var "params")
27342 " returns one value, the green scale factor applied to RGBA fragments
27343 after color matrix transformations.
27344 The initial value is 1.
27345 See "
27346 (code "glPixelTransfer")
27347 ". "))
27348 (entry (% (heading
27349 (code "GL_POST_COLOR_MATRIX_BLUE_SCALE")))
27350 (para)
27351 (para (var "params")
27352 " returns one value, the blue scale factor applied to RGBA fragments
27353 after color matrix transformations.
27354 The initial value is 1.
27355 See "
27356 (code "glPixelTransfer")
27357 ". "))
27358 (entry (% (heading
27359 (code "GL_POST_COLOR_MATRIX_ALPHA_SCALE")))
27360 (para)
27361 (para (var "params")
27362 " returns one value, the alpha scale factor applied to RGBA fragments
27363 after color matrix transformations.
27364 The initial value is 1.
27365 See "
27366 (code "glPixelTransfer")
27367 ". "))
27368 (entry (% (heading
27369 (code "GL_POST_CONVOLUTION_COLOR_TABLE")))
27370 (para)
27371 (para (var "params")
27372 " returns a single boolean value indicating whether post convolution
27373 lookup is enabled. The initial value is "
27374 (code "GL_FALSE")
27375 ".
27376 See "
27377 (code "glColorTable")
27378 ". "))
27379 (entry (% (heading (code "GL_POST_CONVOLUTION_RED_BIAS")))
27380 (para)
27381 (para (var "params")
27382 " returns one value, the red bias factor applied to RGBA fragments
27383 after convolution. The initial value is 0.
27384 See "
27385 (code "glPixelTransfer")
27386 ". "))
27387 (entry (% (heading (code "GL_POST_CONVOLUTION_GREEN_BIAS")))
27388 (para)
27389 (para (var "params")
27390 " returns one value, the green bias factor applied to RGBA fragments
27391 after convolution. The initial value is 0.
27392 See "
27393 (code "glPixelTransfer")
27394 ". "))
27395 (entry (% (heading (code "GL_POST_CONVOLUTION_BLUE_BIAS")))
27396 (para)
27397 (para (var "params")
27398 " returns one value, the blue bias factor applied to RGBA fragments
27399 after convolution. The initial value is 0.
27400 See "
27401 (code "glPixelTransfer")
27402 ". "))
27403 (entry (% (heading (code "GL_POST_CONVOLUTION_ALPHA_BIAS")))
27404 (para)
27405 (para (var "params")
27406 " returns one value, the alpha bias factor applied to RGBA fragments
27407 after convolution. The initial value is 0.
27408 See "
27409 (code "glPixelTransfer")
27410 ". "))
27411 (entry (% (heading (code "GL_POST_CONVOLUTION_RED_SCALE")))
27412 (para)
27413 (para (var "params")
27414 " returns one value, the red scale factor applied to RGBA fragments
27415 after convolution. The initial value is 1.
27416 See "
27417 (code "glPixelTransfer")
27418 ". "))
27419 (entry (% (heading
27420 (code "GL_POST_CONVOLUTION_GREEN_SCALE")))
27421 (para)
27422 (para (var "params")
27423 " returns one value, the green scale factor applied to RGBA fragments
27424 after convolution. The initial value is 1.
27425 See "
27426 (code "glPixelTransfer")
27427 ". "))
27428 (entry (% (heading (code "GL_POST_CONVOLUTION_BLUE_SCALE")))
27429 (para)
27430 (para (var "params")
27431 " returns one value, the blue scale factor applied to RGBA fragments
27432 after convolution. The initial value is 1.
27433 See "
27434 (code "glPixelTransfer")
27435 ". "))
27436 (entry (% (heading
27437 (code "GL_POST_CONVOLUTION_ALPHA_SCALE")))
27438 (para)
27439 (para (var "params")
27440 " returns one value, the alpha scale factor applied to RGBA fragments
27441 after convolution. The initial value is 1.
27442 See "
27443 (code "glPixelTransfer")
27444 ". "))
27445 (entry (% (heading (code "GL_PROJECTION_MATRIX")))
27446 (para)
27447 (para (var "params")
27448 " returns sixteen values:
27449 the projection matrix on the top of the projection matrix
27450 stack. Initially this matrix is the identity matrix.
27451 See "
27452 (code "glPushMatrix")
27453 ". "))
27454 (entry (% (heading (code "GL_PROJECTION_STACK_DEPTH")))
27455 (para)
27456 (para (var "params")
27457 " returns one value,
27458 the number of matrices on the projection matrix stack.
27459 The initial value is 1.
27460 See "
27461 (code "glPushMatrix")
27462 ". "))
27463 (entry (% (heading (code "GL_READ_BUFFER")))
27464 (para)
27465 (para (var "params")
27466 " returns one value,
27467 a symbolic constant indicating which color buffer is selected for
27468 reading. The initial value is "
27469 (code "GL_BACK")
27470 " if there is a back buffer,
27471 otherwise it is "
27472 (code "GL_FRONT")
27473 ".
27474 See "
27475 (code "glReadPixels")
27476 " and "
27477 (code "glAccum")
27478 ". "))
27479 (entry (% (heading (code "GL_RED_BIAS")))
27480 (para)
27481 (para (var "params")
27482 " returns one value,
27483 the red bias factor used during pixel transfers. The initial value is 0. "))
27484 (entry (% (heading (code "GL_RED_BITS")))
27485 (para)
27486 (para (var "params")
27487 " returns one value,
27488 the number of red bitplanes in each color buffer. "))
27489 (entry (% (heading (code "GL_RED_SCALE")))
27490 (para)
27491 (para (var "params")
27492 " returns one value,
27493 the red scale factor used during pixel transfers. The initial value is 1.
27494 See "
27495 (code "glPixelTransfer")
27496 ". "))
27497 (entry (% (heading (code "GL_RENDER_MODE")))
27498 (para)
27499 (para (var "params")
27500 " returns one value,
27501 a symbolic constant indicating whether the GL is in render,
27502 select,
27503 or feedback mode. The initial value is "
27504 (code "GL_RENDER")
27505 ".
27506 See "
27507 (code "glRenderMode")
27508 ". "))
27509 (entry (% (heading (code "GL_RESCALE_NORMAL")))
27510 (para)
27511 (para (var "params")
27512 " returns single boolean value
27513 indicating whether normal rescaling is enabled.
27514 See "
27515 (code "glEnable")
27516 ". "))
27517 (entry (% (heading (code "GL_RGBA_MODE")))
27518 (para)
27519 (para (var "params")
27520 " returns a single boolean value indicating whether the GL is in RGBA
27521 mode (true) or color index mode (false).
27522 See "
27523 (code "glColor")
27524 ". "))
27525 (entry (% (heading (code "GL_SAMPLE_BUFFERS")))
27526 (para)
27527 (para (var "params")
27528 " returns a single integer value indicating the number of sample buffers
27529 associated with the framebuffer.
27530 See "
27531 (code "glSampleCoverage")
27532 ". "))
27533 (entry (% (heading (code "GL_SAMPLE_COVERAGE_VALUE")))
27534 (para)
27535 (para (var "params")
27536 " returns a single positive floating-point value indicating the
27537 current sample coverage value.
27538 See "
27539 (code "glSampleCoverage")
27540 ". "))
27541 (entry (% (heading (code "GL_SAMPLE_COVERAGE_INVERT")))
27542 (para)
27543 (para (var "params")
27544 " returns a single boolean value indicating if the temporary
27545 coverage value should be inverted.
27546 See "
27547 (code "glSampleCoverage")
27548 ". "))
27549 (entry (% (heading (code "GL_SAMPLES")))
27550 (para)
27551 (para (var "params")
27552 " returns a single integer value indicating the coverage mask size.
27553 See "
27554 (code "glSampleCoverage")
27555 ". "))
27556 (entry (% (heading (code "GL_SCISSOR_BOX")))
27557 (para)
27558 (para (var "params")
27559 " returns four values:
27560 the "
27561 (math (var "x"))
27562 "
27563 and "
27564 (math (var "y"))
27565 "
27566 window coordinates of the scissor box,
27567 followed by its width and height.
27568 Initially the "
27569 (math (var "x"))
27570 "
27571 and "
27572 (math (var "y"))
27573 "
27574 window coordinates are both 0 and the
27575 width and height are set to the size of the window.
27576 See "
27577 (code "glScissor")
27578 ". "))
27579 (entry (% (heading (code "GL_SCISSOR_TEST")))
27580 (para)
27581 (para (var "params")
27582 " returns a single boolean value indicating whether scissoring is
27583 enabled. The initial value is "
27584 (code "GL_FALSE")
27585 ".
27586 See "
27587 (code "glScissor")
27588 ". "))
27589 (entry (% (heading (code "GL_SECONDARY_COLOR_ARRAY")))
27590 (para)
27591 (para (var "params")
27592 " returns a single boolean value indicating whether the secondary color array is enabled. The initial value is "
27593 (code "GL_FALSE")
27594 ".
27595 See "
27596 (code "glSecondaryColorPointer")
27597 ". "))
27598 (entry (% (heading
27599 (code "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING")))
27600 (para)
27601 (para (var "params")
27602 " returns a single value, the name of the buffer object
27603 associated with the secondary color array. This buffer object would have been bound to the
27604 target "
27605 (code "GL_ARRAY_BUFFER")
27606 " at the time of the most recent call to "
27607 (code "glSecondaryColorPointer")
27608 ".
27609 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
27610 See "
27611 (code "glBindBuffer")
27612 ". "))
27613 (entry (% (heading (code "GL_SECONDARY_COLOR_ARRAY_SIZE")))
27614 (para)
27615 (para (var "params")
27616 " returns one value, the number of components per color in the
27617 secondary color array. The initial value is 3.
27618 See "
27619 (code "glSecondaryColorPointer")
27620 ". "))
27621 (entry (% (heading
27622 (code "GL_SECONDARY_COLOR_ARRAY_STRIDE")))
27623 (para)
27624 (para (var "params")
27625 " returns one value, the byte offset between consecutive colors in
27626 the secondary color array. The initial value is 0.
27627 See "
27628 (code "glSecondaryColorPointer")
27629 ". "))
27630 (entry (% (heading (code "GL_SECONDARY_COLOR_ARRAY_TYPE")))
27631 (para)
27632 (para (var "params")
27633 " returns one value, the data type of each component in the secondary
27634 color array. The initial value is "
27635 (code "GL_FLOAT")
27636 ".
27637 See "
27638 (code "glSecondaryColorPointer")
27639 ". "))
27640 (entry (% (heading (code "GL_SELECTION_BUFFER_SIZE")))
27641 (para)
27642 (para (var "params")
27643 " return one value,
27644 the size of the selection buffer.
27645 See "
27646 (code "glSelectBuffer")
27647 ". "))
27648 (entry (% (heading (code "GL_SEPARABLE_2D")))
27649 (para)
27650 (para (var "params")
27651 " returns a single boolean value indicating whether 2D separable
27652 convolution is enabled. The initial value is "
27653 (code "GL_FALSE")
27654 ".
27655 See "
27656 (code "glSeparableFilter2D")
27657 ". "))
27658 (entry (% (heading (code "GL_SHADE_MODEL")))
27659 (para)
27660 (para (var "params")
27661 " returns one value,
27662 a symbolic constant indicating whether the shading mode is flat or
27663 smooth. The initial value is "
27664 (code "GL_SMOOTH")
27665 ".
27666 See "
27667 (code "glShadeModel")
27668 ". "))
27669 (entry (% (heading (code "GL_SMOOTH_LINE_WIDTH_RANGE")))
27670 (para)
27671 (para (var "params")
27672 " returns two values,
27673 the smallest and largest supported widths for antialiased lines.
27674 See "
27675 (code "glLineWidth")
27676 ". "))
27677 (entry (% (heading
27678 (code "GL_SMOOTH_LINE_WIDTH_GRANULARITY")))
27679 (para)
27680 (para (var "params")
27681 " returns one value,
27682 the granularity of widths for antialiased lines.
27683 See "
27684 (code "glLineWidth")
27685 ". "))
27686 (entry (% (heading (code "GL_SMOOTH_POINT_SIZE_RANGE")))
27687 (para)
27688 (para (var "params")
27689 " returns two values,
27690 the smallest and largest supported widths for antialiased points.
27691 See "
27692 (code "glPointSize")
27693 ". "))
27694 (entry (% (heading
27695 (code "GL_SMOOTH_POINT_SIZE_GRANULARITY")))
27696 (para)
27697 (para (var "params")
27698 " returns one value,
27699 the granularity of sizes for antialiased points.
27700 See "
27701 (code "glPointSize")
27702 ". "))
27703 (entry (% (heading (code "GL_STENCIL_BACK_FAIL")))
27704 (para)
27705 (para (var "params")
27706 " returns one value,
27707 a symbolic constant indicating what action is taken for back-facing polygons when the stencil
27708 test fails. The initial value is "
27709 (code "GL_KEEP")
27710 ".
27711 See "
27712 (code "glStencilOpSeparate")
27713 ". "))
27714 (entry (% (heading (code "GL_STENCIL_BACK_FUNC")))
27715 (para)
27716 (para (var "params")
27717 " returns one value,
27718 a symbolic constant indicating what function is used for back-facing polygons to compare the
27719 stencil reference value with the stencil buffer value. The initial value
27720 is "
27721 (code "GL_ALWAYS")
27722 ".
27723 See "
27724 (code "glStencilFuncSeparate")
27725 ". "))
27726 (entry (% (heading
27727 (code "GL_STENCIL_BACK_PASS_DEPTH_FAIL")))
27728 (para)
27729 (para (var "params")
27730 " returns one value,
27731 a symbolic constant indicating what action is taken for back-facing polygons when the stencil
27732 test passes,
27733 but the depth test fails. The initial value is "
27734 (code "GL_KEEP")
27735 ".
27736 See "
27737 (code "glStencilOpSeparate")
27738 ". "))
27739 (entry (% (heading
27740 (code "GL_STENCIL_BACK_PASS_DEPTH_PASS")))
27741 (para)
27742 (para (var "params")
27743 " returns one value,
27744 a symbolic constant indicating what action is taken for back-facing polygons when the stencil
27745 test passes and the depth test passes. The initial value is "
27746 (code "GL_KEEP")
27747 ".
27748 See "
27749 (code "glStencilOpSeparate")
27750 ". "))
27751 (entry (% (heading (code "GL_STENCIL_BACK_REF")))
27752 (para)
27753 (para (var "params")
27754 " returns one value,
27755 the reference value that is compared with the contents of the stencil
27756 buffer for back-facing polygons. The initial value is 0.
27757 See "
27758 (code "glStencilFuncSeparate")
27759 ". "))
27760 (entry (% (heading (code "GL_STENCIL_BACK_VALUE_MASK")))
27761 (para)
27762 (para (var "params")
27763 " returns one value,
27764 the mask that is used for back-facing polygons to mask both the stencil reference value and the
27765 stencil buffer value before they are compared. The initial value is all 1's.
27766 See "
27767 (code "glStencilFuncSeparate")
27768 ". "))
27769 (entry (% (heading (code "GL_STENCIL_BACK_WRITEMASK")))
27770 (para)
27771 (para (var "params")
27772 " returns one value,
27773 the mask that controls writing of the stencil bitplanes for back-facing polygons. The initial value
27774 is all 1's.
27775 See "
27776 (code "glStencilMaskSeparate")
27777 ". "))
27778 (entry (% (heading (code "GL_STENCIL_BITS")))
27779 (para)
27780 (para (var "params")
27781 " returns one value,
27782 the number of bitplanes in the stencil buffer. "))
27783 (entry (% (heading (code "GL_STENCIL_CLEAR_VALUE")))
27784 (para)
27785 (para (var "params")
27786 " returns one value,
27787 the index to which the stencil bitplanes are cleared. The initial value is
27788 0.
27789 See "
27790 (code "glClearStencil")
27791 ". "))
27792 (entry (% (heading (code "GL_STENCIL_FAIL")))
27793 (para)
27794 (para (var "params")
27795 " returns one value,
27796 a symbolic constant indicating what action is taken when the stencil
27797 test fails. The initial value is "
27798 (code "GL_KEEP")
27799 ".
27800 See "
27801 (code "glStencilOp")
27802 ".
27803 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27804 and front-facing polygons. Back-facing polygons use separate stencil state.
27805 See "
27806 (code "glStencilOpSeparate")
27807 ". "))
27808 (entry (% (heading (code "GL_STENCIL_FUNC")))
27809 (para)
27810 (para (var "params")
27811 " returns one value,
27812 a symbolic constant indicating what function is used to compare the
27813 stencil reference value with the stencil buffer value. The initial value
27814 is "
27815 (code "GL_ALWAYS")
27816 ".
27817 See "
27818 (code "glStencilFunc")
27819 ".
27820 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27821 and front-facing polygons. Back-facing polygons use separate stencil state.
27822 See "
27823 (code "glStencilFuncSeparate")
27824 ". "))
27825 (entry (% (heading (code "GL_STENCIL_PASS_DEPTH_FAIL")))
27826 (para)
27827 (para (var "params")
27828 " returns one value,
27829 a symbolic constant indicating what action is taken when the stencil
27830 test passes,
27831 but the depth test fails. The initial value is "
27832 (code "GL_KEEP")
27833 ".
27834 See "
27835 (code "glStencilOp")
27836 ".
27837 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27838 and front-facing polygons. Back-facing polygons use separate stencil state.
27839 See "
27840 (code "glStencilOpSeparate")
27841 ". "))
27842 (entry (% (heading (code "GL_STENCIL_PASS_DEPTH_PASS")))
27843 (para)
27844 (para (var "params")
27845 " returns one value,
27846 a symbolic constant indicating what action is taken when the stencil
27847 test passes and the depth test passes. The initial value is "
27848 (code "GL_KEEP")
27849 ".
27850 See "
27851 (code "glStencilOp")
27852 ".
27853 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27854 and front-facing polygons. Back-facing polygons use separate stencil state.
27855 See "
27856 (code "glStencilOpSeparate")
27857 ". "))
27858 (entry (% (heading (code "GL_STENCIL_REF")))
27859 (para)
27860 (para (var "params")
27861 " returns one value,
27862 the reference value that is compared with the contents of the stencil
27863 buffer. The initial value is 0.
27864 See "
27865 (code "glStencilFunc")
27866 ".
27867 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27868 and front-facing polygons. Back-facing polygons use separate stencil state.
27869 See "
27870 (code "glStencilFuncSeparate")
27871 ". "))
27872 (entry (% (heading (code "GL_STENCIL_TEST")))
27873 (para)
27874 (para (var "params")
27875 " returns a single boolean value indicating whether stencil testing
27876 of fragments is enabled. The initial value is "
27877 (code "GL_FALSE")
27878 ".
27879 See "
27880 (code "glStencilFunc")
27881 " and "
27882 (code "glStencilOp")
27883 ". "))
27884 (entry (% (heading (code "GL_STENCIL_VALUE_MASK")))
27885 (para)
27886 (para (var "params")
27887 " returns one value,
27888 the mask that is used to mask both the stencil reference value and the
27889 stencil buffer value before they are compared. The initial value is all 1's.
27890 See "
27891 (code "glStencilFunc")
27892 ".
27893 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27894 and front-facing polygons. Back-facing polygons use separate stencil state.
27895 See "
27896 (code "glStencilFuncSeparate")
27897 ". "))
27898 (entry (% (heading (code "GL_STENCIL_WRITEMASK")))
27899 (para)
27900 (para (var "params")
27901 " returns one value,
27902 the mask that controls writing of the stencil bitplanes. The initial value
27903 is all 1's.
27904 See "
27905 (code "glStencilMask")
27906 ".
27907 If the GL version is 2.0 or greater, this stencil state only affects non-polygons
27908 and front-facing polygons. Back-facing polygons use separate stencil state.
27909 See "
27910 (code "glStencilMaskSeparate")
27911 ". "))
27912 (entry (% (heading (code "GL_STEREO")))
27913 (para)
27914 (para (var "params")
27915 " returns a single boolean value indicating whether stereo buffers
27916 (left and right) are supported. "))
27917 (entry (% (heading (code "GL_SUBPIXEL_BITS")))
27918 (para)
27919 (para (var "params")
27920 " returns one value,
27921 an estimate of the number of bits of subpixel resolution that are used to
27922 position rasterized geometry in window coordinates. The value must be at least 4. "))
27923 (entry (% (heading (code "GL_TEXTURE_1D")))
27924 (para)
27925 (para (var "params")
27926 " returns a single boolean value indicating whether 1D texture
27927 mapping is enabled. The initial value is "
27928 (code "GL_FALSE")
27929 ".
27930 See "
27931 (code "glTexImage1D")
27932 ". "))
27933 (entry (% (heading (code "GL_TEXTURE_BINDING_1D")))
27934 (para)
27935 (para (var "params")
27936 " returns a single value, the name of the texture
27937 currently bound to the target "
27938 (code "GL_TEXTURE_1D")
27939 ". The initial value is 0.
27940 See "
27941 (code "glBindTexture")
27942 ". "))
27943 (entry (% (heading (code "GL_TEXTURE_2D")))
27944 (para)
27945 (para (var "params")
27946 " returns a single boolean value indicating whether 2D texture
27947 mapping is enabled. The initial value is "
27948 (code "GL_FALSE")
27949 ".
27950 See "
27951 (code "glTexImage2D")
27952 ". "))
27953 (entry (% (heading (code "GL_TEXTURE_BINDING_2D")))
27954 (para)
27955 (para (var "params")
27956 " returns a single value, the name of the texture
27957 currently bound to the target "
27958 (code "GL_TEXTURE_2D")
27959 ". The initial value is 0.
27960 See "
27961 (code "glBindTexture")
27962 ". "))
27963 (entry (% (heading (code "GL_TEXTURE_3D")))
27964 (para)
27965 (para (var "params")
27966 " returns a single boolean value indicating whether 3D texture
27967 mapping is enabled. The initial value is "
27968 (code "GL_FALSE")
27969 ".
27970 See "
27971 (code "glTexImage3D")
27972 ". "))
27973 (entry (% (heading (code "GL_TEXTURE_BINDING_3D")))
27974 (para)
27975 (para (var "params")
27976 " returns a single value, the name of the texture
27977 currently bound to the target "
27978 (code "GL_TEXTURE_3D")
27979 ". The initial value is 0.
27980 See "
27981 (code "glBindTexture")
27982 ". "))
27983 (entry (% (heading (code "GL_TEXTURE_BINDING_CUBE_MAP")))
27984 (para)
27985 (para (var "params")
27986 " returns a single value, the name of the texture
27987 currently bound to the target "
27988 (code "GL_TEXTURE_CUBE_MAP")
27989 ". The initial value is 0.
27990 See "
27991 (code "glBindTexture")
27992 ". "))
27993 (entry (% (heading (code "GL_TEXTURE_COMPRESSION_HINT")))
27994 (para)
27995 (para (var "params")
27996 " returns a single value indicating the mode of the texture
27997 compression hint. The initial value is "
27998 (code "GL_DONT_CARE")
27999 ". "))
28000 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY")))
28001 (para)
28002 (para (var "params")
28003 " returns a single boolean value indicating whether the texture
28004 coordinate array is enabled. The initial value is "
28005 (code "GL_FALSE")
28006 ".
28007 See "
28008 (code "glTexCoordPointer")
28009 ". "))
28010 (entry (% (heading
28011 (code "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING")))
28012 (para)
28013 (para (var "params")
28014 " returns a single value, the name of the buffer object
28015 associated with the texture coordinate array. This buffer object would have been bound to the
28016 target "
28017 (code "GL_ARRAY_BUFFER")
28018 " at the time of the most recent call to "
28019 (code "glTexCoordPointer")
28020 ".
28021 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
28022 See "
28023 (code "glBindBuffer")
28024 ". "))
28025 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY_SIZE")))
28026 (para)
28027 (para (var "params")
28028 " returns one value,
28029 the number of coordinates per element in the texture coordinate
28030 array. The initial value is 4.
28031 See "
28032 (code "glTexCoordPointer")
28033 ". "))
28034 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY_STRIDE")))
28035 (para)
28036 (para (var "params")
28037 " returns one value,
28038 the byte offset between consecutive elements in the texture coordinate
28039 array. The initial value is 0.
28040 See "
28041 (code "glTexCoordPointer")
28042 ". "))
28043 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY_TYPE")))
28044 (para)
28045 (para (var "params")
28046 " returns one value,
28047 the data type of the coordinates in the texture coordinate
28048 array. The initial value is "
28049 (code "GL_FLOAT")
28050 ".
28051 See "
28052 (code "glTexCoordPointer")
28053 ". "))
28054 (entry (% (heading (code "GL_TEXTURE_CUBE_MAP")))
28055 (para)
28056 (para (var "params")
28057 " returns a single boolean value indicating whether cube-mapped texture
28058 mapping is enabled. The initial value is "
28059 (code "GL_FALSE")
28060 ".
28061 See "
28062 (code "glTexImage2D")
28063 ". "))
28064 (entry (% (heading (code "GL_TEXTURE_GEN_Q")))
28065 (para)
28066 (para (var "params")
28067 " returns a single boolean value indicating whether automatic generation
28068 of the "
28069 (var "q")
28070 " texture coordinate is enabled. The initial value is "
28071 (code "GL_FALSE")
28072 ".
28073 See "
28074 (code "glTexGen")
28075 ". "))
28076 (entry (% (heading (code "GL_TEXTURE_GEN_R")))
28077 (para)
28078 (para (var "params")
28079 " returns a single boolean value indicating whether automatic generation
28080 of the "
28081 (var "r")
28082 " texture coordinate is enabled. The initial value is "
28083 (code "GL_FALSE")
28084 ".
28085 See "
28086 (code "glTexGen")
28087 ". "))
28088 (entry (% (heading (code "GL_TEXTURE_GEN_S")))
28089 (para)
28090 (para (var "params")
28091 " returns a single boolean value indicating whether automatic generation
28092 of the "
28093 (var "S")
28094 " texture coordinate is enabled. The initial value is "
28095 (code "GL_FALSE")
28096 ".
28097 See "
28098 (code "glTexGen")
28099 ". "))
28100 (entry (% (heading (code "GL_TEXTURE_GEN_T")))
28101 (para)
28102 (para (var "params")
28103 " returns a single boolean value indicating whether automatic generation
28104 of the T texture coordinate is enabled. The initial value is "
28105 (code "GL_FALSE")
28106 ".
28107 See "
28108 (code "glTexGen")
28109 ". "))
28110 (entry (% (heading (code "GL_TEXTURE_MATRIX")))
28111 (para)
28112 (para (var "params")
28113 " returns sixteen values:
28114 the texture matrix on the top of the texture matrix stack. Initially this
28115 matrix is the identity matrix.
28116 See "
28117 (code "glPushMatrix")
28118 ". "))
28119 (entry (% (heading (code "GL_TEXTURE_STACK_DEPTH")))
28120 (para)
28121 (para (var "params")
28122 " returns one value,
28123 the number of matrices on the texture matrix stack.
28124 The initial value is 1.
28125 See "
28126 (code "glPushMatrix")
28127 ". "))
28128 (entry (% (heading (code "GL_TRANSPOSE_COLOR_MATRIX")))
28129 (para)
28130 (para (var "params")
28131 " returns 16 values, the elements of the color matrix in row-major
28132 order.
28133 See "
28134 (code "glLoadTransposeMatrix")
28135 ". "))
28136 (entry (% (heading (code "GL_TRANSPOSE_MODELVIEW_MATRIX")))
28137 (para)
28138 (para (var "params")
28139 " returns 16 values, the elements of the modelview matrix in row-major
28140 order.
28141 See "
28142 (code "glLoadTransposeMatrix")
28143 ". "))
28144 (entry (% (heading (code "GL_TRANSPOSE_PROJECTION_MATRIX")))
28145 (para)
28146 (para (var "params")
28147 " returns 16 values, the elements of the projection matrix in row-major
28148 order.
28149 See "
28150 (code "glLoadTransposeMatrix")
28151 ". "))
28152 (entry (% (heading (code "GL_TRANSPOSE_TEXTURE_MATRIX")))
28153 (para)
28154 (para (var "params")
28155 " returns 16 values, the elements of the texture matrix in row-major
28156 order.
28157 See "
28158 (code "glLoadTransposeMatrix")
28159 ". "))
28160 (entry (% (heading (code "GL_UNPACK_ALIGNMENT")))
28161 (para)
28162 (para (var "params")
28163 " returns one value,
28164 the byte alignment used for reading pixel data from memory. The initial
28165 value is 4.
28166 See "
28167 (code "glPixelStore")
28168 ". "))
28169 (entry (% (heading (code "GL_UNPACK_IMAGE_HEIGHT")))
28170 (para)
28171 (para (var "params")
28172 " returns one value,
28173 the image height used for reading pixel data from memory. The initial
28174 is 0.
28175 See "
28176 (code "glPixelStore")
28177 ". "))
28178 (entry (% (heading (code "GL_UNPACK_LSB_FIRST")))
28179 (para)
28180 (para (var "params")
28181 " returns a single boolean value indicating whether single-bit
28182 pixels being read from memory are read first from the least significant
28183 bit of each unsigned byte. The initial value is "
28184 (code "GL_FALSE")
28185 ".
28186 See "
28187 (code "glPixelStore")
28188 ". "))
28189 (entry (% (heading (code "GL_UNPACK_ROW_LENGTH")))
28190 (para)
28191 (para (var "params")
28192 " returns one value,
28193 the row length used for reading pixel data from memory. The initial value
28194 is 0.
28195 See "
28196 (code "glPixelStore")
28197 ". "))
28198 (entry (% (heading (code "GL_UNPACK_SKIP_IMAGES")))
28199 (para)
28200 (para (var "params")
28201 " returns one value,
28202 the number of pixel images skipped before the first pixel is read
28203 from memory. The initial value is 0.
28204 See "
28205 (code "glPixelStore")
28206 ". "))
28207 (entry (% (heading (code "GL_UNPACK_SKIP_PIXELS")))
28208 (para)
28209 (para (var "params")
28210 " returns one value,
28211 the number of pixel locations skipped before the first pixel is read
28212 from memory. The initial value is 0.
28213 See "
28214 (code "glPixelStore")
28215 ". "))
28216 (entry (% (heading (code "GL_UNPACK_SKIP_ROWS")))
28217 (para)
28218 (para (var "params")
28219 " returns one value,
28220 the number of rows of pixel locations skipped before the first pixel is read
28221 from memory. The initial value is 0.
28222 See "
28223 (code "glPixelStore")
28224 ". "))
28225 (entry (% (heading (code "GL_UNPACK_SWAP_BYTES")))
28226 (para)
28227 (para (var "params")
28228 " returns a single boolean value indicating whether the bytes of
28229 two-byte and four-byte pixel indices and components are swapped after being
28230 read from memory. The initial value is "
28231 (code "GL_FALSE")
28232 ".
28233 See "
28234 (code "glPixelStore")
28235 ". "))
28236 (entry (% (heading (code "GL_VERTEX_ARRAY")))
28237 (para)
28238 (para (var "params")
28239 " returns a single boolean value indicating whether the vertex
28240 array is enabled. The initial value is "
28241 (code "GL_FALSE")
28242 ".
28243 See "
28244 (code "glVertexPointer")
28245 ". "))
28246 (entry (% (heading (code "GL_VERTEX_ARRAY_BUFFER_BINDING")))
28247 (para)
28248 (para (var "params")
28249 " returns a single value, the name of the buffer object
28250 associated with the vertex array. This buffer object would have been bound to the
28251 target "
28252 (code "GL_ARRAY_BUFFER")
28253 " at the time of the most recent call to "
28254 (code "glVertexPointer")
28255 ".
28256 If no buffer object was bound to this target, 0 is returned. The initial value is 0.
28257 See "
28258 (code "glBindBuffer")
28259 ". "))
28260 (entry (% (heading (code "GL_VERTEX_ARRAY_SIZE")))
28261 (para)
28262 (para (var "params")
28263 " returns one value,
28264 the number of coordinates per vertex in the vertex array. The initial
28265 value is 4.
28266 See "
28267 (code "glVertexPointer")
28268 ". "))
28269 (entry (% (heading (code "GL_VERTEX_ARRAY_STRIDE")))
28270 (para)
28271 (para (var "params")
28272 " returns one value,
28273 the byte offset between consecutive vertices in the vertex
28274 array. The initial value is 0.
28275 See "
28276 (code "glVertexPointer")
28277 ". "))
28278 (entry (% (heading (code "GL_VERTEX_ARRAY_TYPE")))
28279 (para)
28280 (para (var "params")
28281 " returns one value,
28282 the data type of each coordinate in the vertex array. The initial value is "
28283 (code "GL_FLOAT")
28284 ".
28285 See "
28286 (code "glVertexPointer")
28287 ". "))
28288 (entry (% (heading (code "GL_VERTEX_PROGRAM_POINT_SIZE")))
28289 (para)
28290 (para (var "params")
28291 " returns a single boolean value indicating whether vertex
28292 program point size mode is enabled. If enabled, and a vertex shader is active, then the
28293 point size is taken from the shader built-in "
28294 (code "gl_PointSize")
28295 ". If disabled,
28296 and a vertex shader is active, then the point size is taken from the point state as specified
28297 by "
28298 (code "glPointSize")
28299 ".
28300 The initial value is "
28301 (code "GL_FALSE")
28302 ". "))
28303 (entry (% (heading (code "GL_VERTEX_PROGRAM_TWO_SIDE")))
28304 (para)
28305 (para (var "params")
28306 " returns a single boolean value indicating whether vertex
28307 program two-sided color mode is enabled. If enabled, and a vertex shader is active, then the
28308 GL chooses the back color output for back-facing polygons, and the front color output for
28309 non-polygons and front-facing polygons. If disabled, and a vertex shader is active, then the
28310 front color output is always selected. The initial value is "
28311 (code "GL_FALSE")
28312 ". "))
28313 (entry (% (heading (code "GL_VIEWPORT")))
28314 (para)
28315 (para (var "params")
28316 " returns four values:
28317 the "
28318 (math (var "x"))
28319 "
28320 and "
28321 (math (var "y"))
28322 "
28323 window coordinates of the viewport,
28324 followed by its width and height.
28325 Initially the "
28326 (math (var "x"))
28327 "
28328 and "
28329 (math (var "y"))
28330 "
28331 window coordinates are both set to 0,
28332 and the width and height are set to the width and height of the window into
28333 which the GL will do its rendering.
28334 See "
28335 (code "glViewport")
28336 ". "))
28337 (entry (% (heading (code "GL_ZOOM_X")))
28338 (para)
28339 (para (var "params")
28340 " returns one value,
28341 the "
28342 (math (var "x"))
28343 "
28344 pixel zoom factor. The initial value is 1.
28345 See "
28346 (code "glPixelZoom")
28347 ". "))
28348 (entry (% (heading (code "GL_ZOOM_Y")))
28349 (para)
28350 (para (var "params")
28351 " returns one value,
28352 the "
28353 (math (var "y"))
28354 "
28355 pixel zoom factor. The initial value is 1.
28356 See "
28357 (code "glPixelZoom")
28358 ". ")))
28359 (para "
28360 Many of the boolean parameters can also be queried more easily using "
28361 (code "glIsEnabled")
28362 ". ")
28363 (heading "Errors")
28364 (para (code "GL_INVALID_ENUM")
28365 " is generated if "
28366 (var "pname")
28367 " is not an accepted value. ")
28368 (para (code "GL_INVALID_OPERATION")
28369 " is generated if "
28370 (code "glGet")
28371 "
28372 is executed between the execution of "
28373 (code "glBegin")
28374 "
28375 and the corresponding execution of "
28376 (code "glEnd")
28377 ". ")
28378 (para)))
28379
28380 (define-gl-procedure
28381 glHint
28382 "glHint"
28383 (funcsynopsis
28384 (funcprototype
28385 (funcdef "void " (function "glHint"))
28386 (paramdef "GLenum " (parameter "target"))
28387 (paramdef "GLenum " (parameter "mode"))))
28388 '(*fragment*
28389 (heading "specify implementation-specific hints")
28390 (heading "Parameters")
28391 (table (% (formatter (asis)))
28392 (entry (% (heading (var "target")))
28393 (para "
28394 Specifies a symbolic constant indicating the behavior to be controlled. "
28395 (code "GL_FOG_HINT")
28396 ", "
28397 (code "GL_GENERATE_MIPMAP_HINT")
28398 ", "
28399 (code "GL_LINE_SMOOTH_HINT")
28400 ", "
28401 (code "GL_PERSPECTIVE_CORRECTION_HINT")
28402 ", "
28403 (code "GL_POINT_SMOOTH_HINT")
28404 ", "
28405 (code "GL_POLYGON_SMOOTH_HINT")
28406 ", "
28407 (code "GL_TEXTURE_COMPRESSION_HINT")
28408 ", and "
28409 (code "GL_FRAGMENT_SHADER_DERIVATIVE_HINT")
28410 "
28411 are accepted. "))
28412 (entry (% (heading (var "mode")))
28413 (para "
28414 Specifies a symbolic constant indicating the desired behavior. "
28415 (code "GL_FASTEST")
28416 ", "
28417 (code "GL_NICEST")
28418 ", and "
28419 (code "GL_DONT_CARE")
28420 " are accepted. ")))
28421 (heading "Description")
28422 (para "
28423 Certain aspects of GL behavior,
28424 when there is room for interpretation,
28425 can be controlled with hints.
28426 A hint is specified with two arguments. "
28427 (var "target")
28428 " is a symbolic
28429 constant indicating the behavior to be controlled,
28430 and "
28431 (var "mode")
28432 " is another symbolic constant indicating the desired
28433 behavior. The initial value for each "
28434 (var "target")
28435 " is "
28436 (code "GL_DONT_CARE")
28437 ". "
28438 (var "mode")
28439 " can be one of the following: ")
28440 (table (% (formatter (asis)))
28441 (entry (% (heading (code "GL_FASTEST")))
28442 (para)
28443 (para "
28444 The most efficient option should be chosen. "))
28445 (entry (% (heading (code "GL_NICEST")))
28446 (para)
28447 (para "
28448 The most correct,
28449 or highest quality,
28450 option should be chosen. "))
28451 (entry (% (heading (code "GL_DONT_CARE")))
28452 (para)
28453 (para "
28454 No preference. ")))
28455 (para "
28456 Though the implementation aspects that can be hinted are well defined,
28457 the interpretation of the hints depends on the implementation.
28458 The hint aspects that can be specified with "
28459 (var "target")
28460 ",
28461 along with suggested semantics,
28462 are as follows: ")
28463 (table (% (formatter (asis)))
28464 (entry (% (heading (code "GL_FOG_HINT")))
28465 (para)
28466 (para "
28467 Indicates the accuracy of fog calculation.
28468 If per-pixel fog calculation is not efficiently supported
28469 by the GL implementation,
28470 hinting "
28471 (code "GL_DONT_CARE")
28472 " or "
28473 (code "GL_FASTEST")
28474 " can result in per-vertex
28475 calculation of fog effects. "))
28476 (entry (% (heading
28477 (code "GL_FRAGMENT_SHADER_DERIVATIVE_HINT")))
28478 (para)
28479 (para "
28480 Indicates the accuracy of the derivative calculation for the GL shading language fragment processing built-in functions: "
28481 (code "dFdx")
28482 ", "
28483 (code "dFdy")
28484 ", and "
28485 (code "fwidth")
28486 ". "))
28487 (entry (% (heading (code "GL_GENERATE_MIPMAP_HINT")))
28488 (para)
28489 (para "
28490 Indicates the quality of filtering when generating mipmap images. "))
28491 (entry (% (heading (code "GL_LINE_SMOOTH_HINT")))
28492 (para)
28493 (para "
28494 Indicates the sampling quality of antialiased lines.
28495 If a larger filter function is applied, hinting "
28496 (code "GL_NICEST")
28497 " can
28498 result in more pixel fragments being generated during rasterization. "))
28499 (entry (% (heading (code "GL_PERSPECTIVE_CORRECTION_HINT")))
28500 (para)
28501 (para "
28502 Indicates the quality of color, texture coordinate, and fog coordinate
28503 interpolation. If perspective-corrected parameter interpolation is not
28504 efficiently supported by the GL implementation, hinting "
28505 (code "GL_DONT_CARE")
28506 "
28507 or "
28508 (code "GL_FASTEST")
28509 " can result in simple linear interpolation of colors
28510 and/or texture coordinates. "))
28511 (entry (% (heading (code "GL_POINT_SMOOTH_HINT")))
28512 (para)
28513 (para "
28514 Indicates the sampling quality of antialiased points.
28515 If a larger filter function is applied, hinting "
28516 (code "GL_NICEST")
28517 " can
28518 result in more pixel fragments being generated during rasterization. "))
28519 (entry (% (heading (code "GL_POLYGON_SMOOTH_HINT")))
28520 (para)
28521 (para "
28522 Indicates the sampling quality of antialiased polygons.
28523 Hinting "
28524 (code "GL_NICEST")
28525 " can result in more pixel fragments being generated
28526 during rasterization,
28527 if a larger filter function is applied. "))
28528 (entry (% (heading (code "GL_TEXTURE_COMPRESSION_HINT")))
28529 (para)
28530 (para "
28531 Indicates the quality and performance of the compressing texture images.
28532 Hinting "
28533 (code "GL_FASTEST")
28534 " indicates that texture images should be compressed
28535 as quickly as possible, while "
28536 (code "GL_NICEST")
28537 " indicates that texture images
28538 should be compressed with as little image quality loss as possible. "
28539 (code "GL_NICEST")
28540 " should be selected if the texture is to be retrieved by "
28541 (code "glGetCompressedTexImage")
28542 " for reuse. ")))
28543 (heading "Errors")
28544 (para (code "GL_INVALID_ENUM")
28545 " is generated if either "
28546 (var "target")
28547 " or "
28548 (var "mode")
28549 " is not
28550 an accepted value. ")
28551 (para (code "GL_INVALID_OPERATION")
28552 " is generated if "
28553 (code "glHint")
28554 "
28555 is executed between the execution of "
28556 (code "glBegin")
28557 "
28558 and the corresponding execution of "
28559 (code "glEnd")
28560 ". ")))
28561
28562 (define-gl-procedure
28563 glHistogram
28564 "glHistogram"
28565 (funcsynopsis
28566 (funcprototype
28567 (funcdef "void " (function "glHistogram"))
28568 (paramdef "GLenum " (parameter "target"))
28569 (paramdef "GLsizei " (parameter "width"))
28570 (paramdef "GLenum " (parameter "internalformat"))
28571 (paramdef "GLboolean " (parameter "sink"))))
28572 '(*fragment*
28573 (heading "define histogram table")
28574 (heading "Parameters")
28575 (table (% (formatter (asis)))
28576 (entry (% (heading (var "target")))
28577 (para "
28578 The histogram whose parameters are to be set.
28579 Must be one of "
28580 (code "GL_HISTOGRAM")
28581 " or "
28582 (code "GL_PROXY_HISTOGRAM")
28583 ". "))
28584 (entry (% (heading (var "width")))
28585 (para "
28586 The number of entries in the histogram table. Must be a power of 2. "))
28587 (entry (% (heading (var "internalformat")))
28588 (para "
28589 The format of entries in the histogram table.
28590 Must be one of "
28591 (code "GL_ALPHA")
28592 ", "
28593 (code "GL_ALPHA4")
28594 ", "
28595 (code "GL_ALPHA8")
28596 ", "
28597 (code "GL_ALPHA12")
28598 ", "
28599 (code "GL_ALPHA16")
28600 ", "
28601 (code "GL_LUMINANCE")
28602 ", "
28603 (code "GL_LUMINANCE4")
28604 ", "
28605 (code "GL_LUMINANCE8")
28606 ", "
28607 (code "GL_LUMINANCE12")
28608 ", "
28609 (code "GL_LUMINANCE16")
28610 ", "
28611 (code "GL_LUMINANCE_ALPHA")
28612 ", "
28613 (code "GL_LUMINANCE4_ALPHA4")
28614 ", "
28615 (code "GL_LUMINANCE6_ALPHA2")
28616 ", "
28617 (code "GL_LUMINANCE8_ALPHA8")
28618 ", "
28619 (code "GL_LUMINANCE12_ALPHA4")
28620 ", "
28621 (code "GL_LUMINANCE12_ALPHA12")
28622 ", "
28623 (code "GL_LUMINANCE16_ALPHA16")
28624 ", "
28625 (code "GL_R3_G3_B2")
28626 ", "
28627 (code "GL_RGB")
28628 ", "
28629 (code "GL_RGB4")
28630 ", "
28631 (code "GL_RGB5")
28632 ", "
28633 (code "GL_RGB8")
28634 ", "
28635 (code "GL_RGB10")
28636 ", "
28637 (code "GL_RGB12")
28638 ", "
28639 (code "GL_RGB16")
28640 ", "
28641 (code "GL_RGBA")
28642 ", "
28643 (code "GL_RGBA2")
28644 ", "
28645 (code "GL_RGBA4")
28646 ", "
28647 (code "GL_RGB5_A1")
28648 ", "
28649 (code "GL_RGBA8")
28650 ", "
28651 (code "GL_RGB10_A2")
28652 ", "
28653 (code "GL_RGBA12")
28654 ", or "
28655 (code "GL_RGBA16")
28656 ". "))
28657 (entry (% (heading (var "sink")))
28658 (para "
28659 If "
28660 (code "GL_TRUE")
28661 ", pixels will be consumed by the histogramming
28662 process and no drawing or texture loading will take place.
28663 If "
28664 (code "GL_FALSE")
28665 ", pixels will proceed to the minmax process after
28666 histogramming. ")))
28667 (heading "Description")
28668 (para "
28669 When "
28670 (code "GL_HISTOGRAM")
28671 " is enabled, RGBA color components are converted to
28672 histogram table indices by clamping to the range [0,1], multiplying by
28673 the width of the histogram table, and rounding to the nearest integer.
28674 The table entries selected by the RGBA indices are then incremented.
28675 (If the internal format of the histogram table includes luminance, then
28676 the index derived from the R color component determines the luminance
28677 table entry to be incremented.) If a histogram table entry is incremented
28678 beyond its maximum value, then its value becomes undefined. (This is
28679 not an error.) ")
28680 (para "
28681 Histogramming is performed only for RGBA pixels (though these may
28682 be specified originally as color indices and converted to RGBA by
28683 index table lookup).
28684 Histogramming is enabled with "
28685 (code "glEnable")
28686 " and disabled with "
28687 (code "glDisable")
28688 ". ")
28689 (para "
28690 When "
28691 (var "target")
28692 " is "
28693 (code "GL_HISTOGRAM")
28694 ", "
28695 (code "glHistogram")
28696 " redefines the current
28697 histogram table to have "
28698 (var "width")
28699 " entries of the format specified by "
28700 (var "internalformat")
28701 ".
28702 The entries are indexed 0 through "
28703 (math (var "width") "-" "1")
28704 ",
28705 and
28706 all entries are initialized to zero.
28707 The values in the previous histogram table, if any, are lost.
28708 If "
28709 (var "sink")
28710 " is "
28711 (code "GL_TRUE")
28712 ", then pixels are discarded after histogramming;
28713 no further processing of the pixels takes place, and no drawing,
28714 texture loading, or pixel readback will result. ")
28715 (para "
28716 When "
28717 (var "target")
28718 " is "
28719 (code "GL_PROXY_HISTOGRAM")
28720 ", "
28721 (code "glHistogram")
28722 " computes all
28723 state information as if the histogram table were to be redefined,
28724 but does not actually define the new table.
28725 If the requested histogram table is too large to be supported, then the
28726 state information will be set to zero.
28727 This provides a way to determine if a histogram table with the given
28728 parameters can be supported. ")
28729 (para)
28730 (heading "Errors")
28731 (para (code "GL_INVALID_ENUM")
28732 " is generated if "
28733 (var "target")
28734 " is not one of the allowable
28735 values. ")
28736 (para (code "GL_INVALID_VALUE")
28737 " is generated if "
28738 (var "width")
28739 " is less than zero or is
28740 not a power of 2. ")
28741 (para (code "GL_INVALID_ENUM")
28742 " is generated if "
28743 (var "internalformat")
28744 " is not one of the
28745 allowable values. ")
28746 (para (code "GL_TABLE_TOO_LARGE")
28747 " is generated if "
28748 (var "target")
28749 " is "
28750 (code "GL_HISTOGRAM")
28751 "
28752 and the histogram table specified is too large for the implementation. ")
28753 (para (code "GL_INVALID_OPERATION")
28754 " is generated if "
28755 (code "glHistogram")
28756 " is executed
28757 between the execution of "
28758 (code "glBegin")
28759 " and the corresponding
28760 execution of "
28761 (code "glEnd")
28762 ". ")))
28763
28764 (define-gl-procedure
28765 glIndexMask
28766 "glIndexMask"
28767 (funcsynopsis
28768 (funcprototype
28769 (funcdef "void " (function "glIndexMask"))
28770 (paramdef "GLuint " (parameter "mask"))))
28771 '(*fragment*
28772 (heading
28773 "control the writing of individual bits in the color index buffers")
28774 (heading "Parameters")
28775 (table (% (formatter (asis)))
28776 (entry (% (heading (var "mask")))
28777 (para "
28778 Specifies a bit mask to enable and disable the writing of individual bits
28779 in the color index buffers.
28780 Initially, the mask is all 1's. ")))
28781 (heading "Description")
28782 (para (code "glIndexMask")
28783 " controls the writing of individual bits in the color index buffers.
28784 The least significant "
28785 (math (var "n"))
28786 "
28787 bits of "
28788 (var "mask")
28789 ",
28790 where "
28791 (math (var "n"))
28792 "
28793 is the number of bits in a color index buffer,
28794 specify a mask.
28795 Where a 1 (one) appears in the mask,
28796 it's possible to write to the corresponding bit in the color index
28797 buffer (or buffers).
28798 Where a 0 (zero) appears,
28799 the corresponding bit is write-protected. ")
28800 (para "
28801 This mask is used only in color index mode,
28802 and it affects only the buffers currently selected for writing
28803 (see "
28804 (code "glDrawBuffer")
28805 ").
28806 Initially, all bits are enabled for writing. ")
28807 (heading "Errors")
28808 (para (code "GL_INVALID_OPERATION")
28809 " is generated if "
28810 (code "glIndexMask")
28811 "
28812 is executed between the execution of "
28813 (code "glBegin")
28814 "
28815 and the corresponding execution of "
28816 (code "glEnd")
28817 ". ")))
28818
28819 (define-gl-procedure
28820 glIndexPointer
28821 "glIndexPointer"
28822 (funcsynopsis
28823 (funcprototype
28824 (funcdef "void " (function "glIndexPointer"))
28825 (paramdef "GLenum " (parameter "type"))
28826 (paramdef "GLsizei " (parameter "stride"))
28827 (paramdef
28828 "const GLvoid * "
28829 (parameter "pointer"))))
28830 '(*fragment*
28831 (heading "define an array of color indexes")
28832 (heading "Parameters")
28833 (table (% (formatter (asis)))
28834 (entry (% (heading (var "type")))
28835 (para "
28836 Specifies the data type of each color index in the array.
28837 Symbolic constants "
28838 (code "GL_UNSIGNED_BYTE")
28839 ", "
28840 (code "GL_SHORT")
28841 ", "
28842 (code "GL_INT")
28843 ", "
28844 (code "GL_FLOAT")
28845 ",
28846 and "
28847 (code "GL_DOUBLE")
28848 "
28849 are accepted. The initial value is "
28850 (code "GL_FLOAT")
28851 ". "))
28852 (entry (% (heading (var "stride")))
28853 (para "
28854 Specifies the byte offset between consecutive color indexes.
28855 If "
28856 (var "stride")
28857 " is 0, the color indexes are understood to
28858 be tightly packed in the array. The initial value is 0. "))
28859 (entry (% (heading (var "pointer")))
28860 (para "
28861 Specifies a pointer to the first index in the array.
28862 The initial value is 0. ")))
28863 (heading "Description")
28864 (para (code "glIndexPointer")
28865 " specifies the location and data format of an array of color indexes
28866 to use when rendering. "
28867 (var "type")
28868 " specifies the data type of
28869 each color index and "
28870 (var "stride")
28871 " specifies the byte stride from one
28872 color index to the next, allowing vertices and attributes
28873 to be packed into a single array or stored in separate arrays. ")
28874 (para "
28875 If a non-zero named buffer object is bound to the "
28876 (code "GL_ARRAY_BUFFER")
28877 " target
28878 (see "
28879 (code "glBindBuffer")
28880 ") while a color index array is
28881 specified, "
28882 (var "pointer")
28883 " is treated as a byte offset into the buffer object's data store.
28884 Also, the buffer object binding ("
28885 (code "GL_ARRAY_BUFFER_BINDING")
28886 ") is saved as color index vertex array
28887 client-side state ("
28888 (code "GL_INDEX_ARRAY_BUFFER_BINDING")
28889 "). ")
28890 (para "
28891 When a color index array is specified, "
28892 (var "type")
28893 ", "
28894 (var "stride")
28895 ", and "
28896 (var "pointer")
28897 " are saved as client-side
28898 state, in addition to the current vertex array buffer object binding. ")
28899 (para "
28900 To enable and disable the color index array, call "
28901 (code "glEnableClientState")
28902 " and "
28903 (code "glDisableClientState")
28904 " with the argument "
28905 (code "GL_INDEX_ARRAY")
28906 ". If
28907 enabled, the color index array is used
28908 when "
28909 (code "glDrawArrays")
28910 ", "
28911 (code "glMultiDrawArrays")
28912 ", "
28913 (code "glDrawElements")
28914 ", "
28915 (code "glMultiDrawElements")
28916 ", "
28917 (code "glDrawRangeElements")
28918 ", or "
28919 (code "glArrayElement")
28920 " is called. ")
28921 (heading "Errors")
28922 (para (code "GL_INVALID_ENUM")
28923 " is generated if "
28924 (var "type")
28925 " is not an accepted value. ")
28926 (para (code "GL_INVALID_VALUE")
28927 " is generated if "
28928 (var "stride")
28929 " is negative. ")))
28930
28931 (define-gl-procedure
28932 glIndex
28933 "glIndex"
28934 (funcsynopsis
28935 (funcprototype
28936 (funcdef "void " (function "glIndexs"))
28937 (paramdef "GLshort " (parameter "c"))))
28938 '(*fragment*
28939 (heading "set the current color index")
28940 (heading "Parameters")
28941 (table (% (formatter (asis)))
28942 (entry (% (heading (var "c")))
28943 (para "
28944 Specifies the new value for the current color index. ")
28945 (para)))
28946 (heading "Description")
28947 (para (code "glIndex")
28948 " updates the current (single-valued) color index.
28949 It takes one argument, the new value for the current color index. ")
28950 (para "
28951 The current index is stored as a floating-point value.
28952 Integer values are converted directly to floating-point values,
28953 with no special mapping.
28954 The initial value is 1. ")
28955 (para "
28956 Index values outside the representable range of the color index buffer
28957 are not clamped.
28958 However,
28959 before an index is dithered (if enabled) and written to the frame buffer,
28960 it is converted to fixed-point format.
28961 Any bits in the integer portion of the resulting fixed-point value
28962 that do not correspond to bits in the frame buffer are masked out. ")))
28963
28964 (define-gl-procedure
28965 glInitNames
28966 "glInitNames"
28967 (funcsynopsis
28968 (funcprototype
28969 (funcdef "void " (function "glInitNames"))
28970 (paramdef (parameter "void"))))
28971 '(*fragment*
28972 (heading "initialize the name stack")
28973 (heading "Description")
28974 (para "
28975 The name stack is used during selection mode to allow sets of rendering
28976 commands to be uniquely identified.
28977 It consists of an ordered set of unsigned integers. "
28978 (code "glInitNames")
28979 " causes the name stack to be initialized to its default empty state. ")
28980 (para "
28981 The name stack is always empty while the render mode is not "
28982 (code "GL_SELECT")
28983 ".
28984 Calls to "
28985 (code "glInitNames")
28986 " while the render mode is not "
28987 (code "GL_SELECT")
28988 " are ignored. ")
28989 (heading "Errors")
28990 (para (code "GL_INVALID_OPERATION")
28991 " is generated if "
28992 (code "glInitNames")
28993 "
28994 is executed between the execution of "
28995 (code "glBegin")
28996 " and the corresponding execution of "
28997 (code "glEnd")
28998 ". ")))
28999
29000 (define-gl-procedure
29001 glInterleavedArrays
29002 "glInterleavedArrays"
29003 (funcsynopsis
29004 (funcprototype
29005 (funcdef
29006 "void "
29007 (function "glInterleavedArrays"))
29008 (paramdef "GLenum " (parameter "format"))
29009 (paramdef "GLsizei " (parameter "stride"))
29010 (paramdef
29011 "const GLvoid * "
29012 (parameter "pointer"))))
29013 '(*fragment*
29014 (heading
29015 "simultaneously specify and enable several interleaved arrays")
29016 (heading "Parameters")
29017 (table (% (formatter (asis)))
29018 (entry (% (heading (var "format")))
29019 (para "
29020 Specifies the type of array to enable. Symbolic constants "
29021 (code "GL_V2F")
29022 ", "
29023 (code "GL_V3F")
29024 ", "
29025 (code "GL_C4UB_V2F")
29026 ", "
29027 (code "GL_C4UB_V3F")
29028 ", "
29029 (code "GL_C3F_V3F")
29030 ", "
29031 (code "GL_N3F_V3F")
29032 ", "
29033 (code "GL_C4F_N3F_V3F")
29034 ", "
29035 (code "GL_T2F_V3F")
29036 ", "
29037 (code "GL_T4F_V4F")
29038 ", "
29039 (code "GL_T2F_C4UB_V3F")
29040 ", "
29041 (code "GL_T2F_C3F_V3F")
29042 ", "
29043 (code "GL_T2F_N3F_V3F")
29044 ", "
29045 (code "GL_T2F_C4F_N3F_V3F")
29046 ",
29047 and "
29048 (code "GL_T4F_C4F_N3F_V4F")
29049 "
29050 are accepted. "))
29051 (entry (% (heading (var "stride")))
29052 (para "
29053 Specifies the offset in bytes between each aggregate array element. ")))
29054 (heading "Description")
29055 (para (code "glInterleavedArrays")
29056 " lets you specify and enable individual color,
29057 normal,
29058 texture and vertex
29059 arrays whose elements are part of a larger aggregate array element.
29060 For some implementations, this is more efficient than specifying the arrays
29061 separately. ")
29062 (para "
29063 If "
29064 (var "stride")
29065 " is 0, the aggregate elements are stored consecutively.
29066 Otherwise, "
29067 (var "stride")
29068 " bytes occur between the beginning of one
29069 aggregate array element and the beginning of the next aggregate array
29070 element. ")
29071 (para (var "format")
29072 " serves as a ``key''
29073 describing the extraction of individual arrays from the aggregate array.
29074 If "
29075 (var "format")
29076 " contains a T, then texture coordinates are
29077 extracted from the interleaved array. If C is present, color values
29078 are extracted. If N is present, normal coordinates are extracted.
29079 Vertex coordinates are always extracted. ")
29080 (para "
29081 The digits 2, 3, and 4 denote how many values are extracted.
29082 F indicates that values are extracted as floating-point values.
29083 Colors may also be extracted as 4 unsigned bytes if 4UB follows the
29084 C. If a color is extracted as 4 unsigned bytes, the vertex
29085 array element which follows is located at the first possible
29086 floating-point aligned address. ")
29087 (heading "Errors")
29088 (para (code "GL_INVALID_ENUM")
29089 " is generated if "
29090 (var "format")
29091 " is not an accepted value. ")
29092 (para (code "GL_INVALID_VALUE")
29093 " is generated if "
29094 (var "stride")
29095 " is negative. ")))
29096
29097 (define-gl-procedure
29098 glIsBuffer
29099 "glIsBuffer"
29100 (funcsynopsis
29101 (funcprototype
29102 (funcdef "GLboolean " (function "glIsBuffer"))
29103 (paramdef "GLuint " (parameter "buffer"))))
29104 '(*fragment*
29105 (heading
29106 "determine if a name corresponds to a buffer object")
29107 (heading "Parameters")
29108 (table (% (formatter (asis)))
29109 (entry (% (heading (var "buffer")))
29110 (para "
29111 Specifies a value that may be the name of a buffer object. ")))
29112 (heading "Description")
29113 (para (code "glIsBuffer")
29114 " returns "
29115 (code "GL_TRUE")
29116 " if "
29117 (var "buffer")
29118 " is currently the name of a buffer object.
29119 If "
29120 (var "buffer")
29121 " is zero, or is a non-zero value that is not currently the
29122 name of a buffer object, or if an error occurs, "
29123 (code "glIsBuffer")
29124 " returns "
29125 (code "GL_FALSE")
29126 ". ")
29127 (para "
29128 A name returned by "
29129 (code "glGenBuffers")
29130 ", but not yet associated with a buffer object
29131 by calling "
29132 (code "glBindBuffer")
29133 ", is not the name of a buffer object. ")
29134 (heading "Errors")
29135 (para (code "GL_INVALID_OPERATION")
29136 " is generated if "
29137 (code "glIsBuffer")
29138 " is executed
29139 between the execution of "
29140 (code "glBegin")
29141 " and the corresponding
29142 execution of "
29143 (code "glEnd")
29144 ". ")))
29145
29146 (define-gl-procedure
29147 glIsEnabled
29148 "glIsEnabled"
29149 (funcsynopsis
29150 (funcprototype
29151 (funcdef "GLboolean " (function "glIsEnabled"))
29152 (paramdef "GLenum " (parameter "cap"))))
29153 '(*fragment*
29154 (heading "test whether a capability is enabled")
29155 (heading "Parameters")
29156 (table (% (formatter (asis)))
29157 (entry (% (heading (var "cap")))
29158 (para "
29159 Specifies a symbolic constant indicating a GL capability. ")))
29160 (heading "Description")
29161 (para (code "glIsEnabled")
29162 " returns "
29163 (code "GL_TRUE")
29164 " if "
29165 (var "cap")
29166 " is an enabled capability
29167 and returns "
29168 (code "GL_FALSE")
29169 " otherwise.
29170 Initially all capabilities except "
29171 (code "GL_DITHER")
29172 " are disabled; "
29173 (code "GL_DITHER")
29174 " is initially enabled. ")
29175 (para "
29176 The following capabilities are accepted for "
29177 (var "cap")
29178 ": ")
29179 (para)
29180 (table (% (formatter (asis)))
29181 (entry (% (heading (strong "Constant")))
29182 (para (strong "See")))
29183 (entry (% (heading (code "GL_ALPHA_TEST")))
29184 (para (code "glAlphaFunc")))
29185 (entry (% (heading (code "GL_AUTO_NORMAL")))
29186 (para (code "glEvalCoord")))
29187 (entry (% (heading (code "GL_BLEND")))
29188 (para (code "glBlendFunc")
29189 ", "
29190 (code "glLogicOp")))
29191 (entry (% (heading (code "GL_CLIP_PLANE") (var "i")))
29192 (para (code "glClipPlane")))
29193 (entry (% (heading (code "GL_COLOR_ARRAY")))
29194 (para (code "glColorPointer")))
29195 (entry (% (heading (code "GL_COLOR_LOGIC_OP")))
29196 (para (code "glLogicOp")))
29197 (entry (% (heading (code "GL_COLOR_MATERIAL")))
29198 (para (code "glColorMaterial")))
29199 (entry (% (heading (code "GL_COLOR_SUM")))
29200 (para (code "glSecondaryColor")))
29201 (entry (% (heading (code "GL_COLOR_TABLE")))
29202 (para (code "glColorTable")))
29203 (entry (% (heading (code "GL_CONVOLUTION_1D")))
29204 (para (code "glConvolutionFilter1D")))
29205 (entry (% (heading (code "GL_CONVOLUTION_2D")))
29206 (para (code "glConvolutionFilter2D")))
29207 (entry (% (heading (code "GL_CULL_FACE")))
29208 (para (code "glCullFace")))
29209 (entry (% (heading (code "GL_DEPTH_TEST")))
29210 (para (code "glDepthFunc")
29211 ", "
29212 (code "glDepthRange")))
29213 (entry (% (heading (code "GL_DITHER")))
29214 (para (code "glEnable")))
29215 (entry (% (heading (code "GL_EDGE_FLAG_ARRAY")))
29216 (para (code "glEdgeFlagPointer")))
29217 (entry (% (heading (code "GL_FOG")))
29218 (para (code "glFog")))
29219 (entry (% (heading (code "GL_FOG_COORD_ARRAY")))
29220 (para (code "glFogCoordPointer")))
29221 (entry (% (heading (code "GL_HISTOGRAM")))
29222 (para (code "glHistogram")))
29223 (entry (% (heading (code "GL_INDEX_ARRAY")))
29224 (para (code "glIndexPointer")))
29225 (entry (% (heading (code "GL_INDEX_LOGIC_OP")))
29226 (para (code "glLogicOp")))
29227 (entry (% (heading (code "GL_LIGHT") (var "i")))
29228 (para (code "glLightModel")
29229 ", "
29230 (code "glLight")))
29231 (entry (% (heading (code "GL_LIGHTING")))
29232 (para (code "glMaterial")
29233 ", "
29234 (code "glLightModel")
29235 ", "
29236 (code "glLight")))
29237 (entry (% (heading (code "GL_LINE_SMOOTH")))
29238 (para (code "glLineWidth")))
29239 (entry (% (heading (code "GL_LINE_STIPPLE")))
29240 (para (code "glLineStipple")))
29241 (entry (% (heading (code "GL_MAP1_COLOR_4")))
29242 (para (code "glMap1")))
29243 (entry (% (heading (code "GL_MAP1_INDEX")))
29244 (para (code "glMap1")))
29245 (entry (% (heading (code "GL_MAP1_NORMAL")))
29246 (para (code "glMap1")))
29247 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_1")))
29248 (para (code "glMap1")))
29249 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_2")))
29250 (para (code "glMap1")))
29251 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_3")))
29252 (para (code "glMap1")))
29253 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_4")))
29254 (para (code "glMap1")))
29255 (entry (% (heading (code "GL_MAP2_COLOR_4")))
29256 (para (code "glMap2")))
29257 (entry (% (heading (code "GL_MAP2_INDEX")))
29258 (para (code "glMap2")))
29259 (entry (% (heading (code "GL_MAP2_NORMAL")))
29260 (para (code "glMap2")))
29261 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_1")))
29262 (para (code "glMap2")))
29263 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_2")))
29264 (para (code "glMap2")))
29265 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_3")))
29266 (para (code "glMap2")))
29267 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_4")))
29268 (para (code "glMap2")))
29269 (entry (% (heading (code "GL_MAP2_VERTEX_3")))
29270 (para (code "glMap2")))
29271 (entry (% (heading (code "GL_MAP2_VERTEX_4")))
29272 (para (code "glMap2")))
29273 (entry (% (heading (code "GL_MINMAX")))
29274 (para (code "glMinmax")))
29275 (entry (% (heading (code "GL_MULTISAMPLE")))
29276 (para (code "glSampleCoverage")))
29277 (entry (% (heading (code "GL_NORMAL_ARRAY")))
29278 (para (code "glNormalPointer")))
29279 (entry (% (heading (code "GL_NORMALIZE")))
29280 (para (code "glNormal")))
29281 (entry (% (heading (code "GL_POINT_SMOOTH")))
29282 (para (code "glPointSize")))
29283 (entry (% (heading (code "GL_POINT_SPRITE")))
29284 (para (code "glEnable")))
29285 (entry (% (heading (code "GL_POLYGON_SMOOTH")))
29286 (para (code "glPolygonMode")))
29287 (entry (% (heading (code "GL_POLYGON_OFFSET_FILL")))
29288 (para (code "glPolygonOffset")))
29289 (entry (% (heading (code "GL_POLYGON_OFFSET_LINE")))
29290 (para (code "glPolygonOffset")))
29291 (entry (% (heading (code "GL_POLYGON_OFFSET_POINT")))
29292 (para (code "glPolygonOffset")))
29293 (entry (% (heading (code "GL_POLYGON_STIPPLE")))
29294 (para (code "glPolygonStipple")))
29295 (entry (% (heading
29296 (code "GL_POST_COLOR_MATRIX_COLOR_TABLE")))
29297 (para (code "glColorTable")))
29298 (entry (% (heading
29299 (code "GL_POST_CONVOLUTION_COLOR_TABLE")))
29300 (para (code "glColorTable")))
29301 (entry (% (heading (code "GL_RESCALE_NORMAL")))
29302 (para (code "glNormal")))
29303 (entry (% (heading (code "GL_SAMPLE_ALPHA_TO_COVERAGE")))
29304 (para (code "glSampleCoverage")))
29305 (entry (% (heading (code "GL_SAMPLE_ALPHA_TO_ONE")))
29306 (para (code "glSampleCoverage")))
29307 (entry (% (heading (code "GL_SAMPLE_COVERAGE")))
29308 (para (code "glSampleCoverage")))
29309 (entry (% (heading (code "GL_SCISSOR_TEST")))
29310 (para (code "glScissor")))
29311 (entry (% (heading (code "GL_SECONDARY_COLOR_ARRAY")))
29312 (para (code "glSecondaryColorPointer")))
29313 (entry (% (heading (code "GL_SEPARABLE_2D")))
29314 (para (code "glSeparableFilter2D")))
29315 (entry (% (heading (code "GL_STENCIL_TEST")))
29316 (para (code "glStencilFunc")
29317 ", "
29318 (code "glStencilOp")))
29319 (entry (% (heading (code "GL_TEXTURE_1D")))
29320 (para (code "glTexImage1D")))
29321 (entry (% (heading (code "GL_TEXTURE_2D")))
29322 (para (code "glTexImage2D")))
29323 (entry (% (heading (code "GL_TEXTURE_3D")))
29324 (para (code "glTexImage3D")))
29325 (entry (% (heading (code "GL_TEXTURE_COORD_ARRAY")))
29326 (para (code "glTexCoordPointer")))
29327 (entry (% (heading (code "GL_TEXTURE_CUBE_MAP")))
29328 (para (code "glTexImage2D")))
29329 (entry (% (heading (code "GL_TEXTURE_GEN_Q")))
29330 (para (code "glTexGen")))
29331 (entry (% (heading (code "GL_TEXTURE_GEN_R")))
29332 (para (code "glTexGen")))
29333 (entry (% (heading (code "GL_TEXTURE_GEN_S")))
29334 (para (code "glTexGen")))
29335 (entry (% (heading (code "GL_TEXTURE_GEN_T")))
29336 (para (code "glTexGen")))
29337 (entry (% (heading (code "GL_VERTEX_ARRAY")))
29338 (para (code "glVertexPointer")))
29339 (entry (% (heading (code "GL_VERTEX_PROGRAM_POINT_SIZE")))
29340 (para (code "glEnable")))
29341 (entry (% (heading (code "GL_VERTEX_PROGRAM_TWO_SIDE")))
29342 (para (code "glEnable"))))
29343 (para)
29344 (heading "Errors")
29345 (para (code "GL_INVALID_ENUM")
29346 " is generated if "
29347 (var "cap")
29348 " is not an accepted value. ")
29349 (para (code "GL_INVALID_OPERATION")
29350 " is generated if "
29351 (code "glIsEnabled")
29352 "
29353 is executed between the execution of "
29354 (code "glBegin")
29355 "
29356 and the corresponding execution of "
29357 (code "glEnd")
29358 ". ")))
29359
29360 (define-gl-procedure
29361 glIsList
29362 "glIsList"
29363 (funcsynopsis
29364 (funcprototype
29365 (funcdef "GLboolean " (function "glIsList"))
29366 (paramdef "GLuint " (parameter "list"))))
29367 '(*fragment*
29368 (heading
29369 "determine if a name corresponds to a display list")
29370 (heading "Parameters")
29371 (table (% (formatter (asis)))
29372 (entry (% (heading (var "list")))
29373 (para "
29374 Specifies a potential display list name. ")))
29375 (heading "Description")
29376 (para (code "glIsList")
29377 " returns "
29378 (code "GL_TRUE")
29379 " if "
29380 (var "list")
29381 " is the name
29382 of a display list and returns "
29383 (code "GL_FALSE")
29384 " if it is not, or if an error occurs. ")
29385 (para "
29386 A name returned by "
29387 (code "glGenLists")
29388 ", but not yet associated with a display list
29389 by calling "
29390 (code "glNewList")
29391 ", is not the name of a display list. ")
29392 (heading "Errors")
29393 (para (code "GL_INVALID_OPERATION")
29394 " is generated if "
29395 (code "glIsList")
29396 "
29397 is executed between the execution of "
29398 (code "glBegin")
29399 "
29400 and the corresponding execution of "
29401 (code "glEnd")
29402 ". ")))
29403
29404 (define-gl-procedure
29405 glIsProgram
29406 "glIsProgram"
29407 (funcsynopsis
29408 (funcprototype
29409 (funcdef "GLboolean " (function "glIsProgram"))
29410 (paramdef "GLuint " (parameter "program"))))
29411 '(*fragment*
29412 (heading
29413 "Determines if a name corresponds to a program object")
29414 (heading "Parameters")
29415 (table (% (formatter (asis)))
29416 (entry (% (heading (var "program")))
29417 (para "Specifies a potential program object.")))
29418 (heading "Description")
29419 (para (code "glIsProgram")
29420 " returns\t"
29421 (code "GL_TRUE")
29422 " if "
29423 (var "program")
29424 "
29425 is the name of a program object previously created with "
29426 (code "glCreateProgram")
29427 " and not yet deleted with "
29428 (code "glDeleteProgram")
29429 ".
29430 \tIf "
29431 (var "program")
29432 " is zero or a non-zero value that
29433 \tis not the name of a program object, or if an error occurs, "
29434 (code "glIsProgram")
29435 " returns "
29436 (code "GL_FALSE")
29437 ".")
29438 (heading "Errors")
29439 (para (code "GL_INVALID_OPERATION")
29440 " is generated if\t"
29441 (code "glIsProgram")
29442 " is executed between the
29443 \texecution of\t"
29444 (code "glBegin")
29445 "
29446 and the corresponding execution of\t"
29447 (code "glEnd")
29448 ".")))
29449
29450 (define-gl-procedure
29451 glIsQuery
29452 "glIsQuery"
29453 (funcsynopsis
29454 (funcprototype
29455 (funcdef "GLboolean " (function "glIsQuery"))
29456 (paramdef "GLuint " (parameter "id"))))
29457 '(*fragment*
29458 (heading
29459 "determine if a name corresponds to a query object")
29460 (heading "Parameters")
29461 (table (% (formatter (asis)))
29462 (entry (% (heading (var "id")))
29463 (para "
29464 Specifies a value that may be the name of a query object. ")))
29465 (heading "Description")
29466 (para (code "glIsQuery")
29467 " returns "
29468 (code "GL_TRUE")
29469 " if "
29470 (var "id")
29471 " is currently the name of a query object.
29472 If "
29473 (var "id")
29474 " is zero, or is a non-zero value that is not currently the
29475 name of a query object, or if an error occurs, "
29476 (code "glIsQuery")
29477 " returns "
29478 (code "GL_FALSE")
29479 ". ")
29480 (para "
29481 A name returned by "
29482 (code "glGenQueries")
29483 ", but not yet associated with a query object
29484 by calling "
29485 (code "glBeginQuery")
29486 ", is not the name of a query object. ")
29487 (heading "Errors")
29488 (para (code "GL_INVALID_OPERATION")
29489 " is generated if "
29490 (code "glIsQuery")
29491 " is executed
29492 between the execution of "
29493 (code "glBegin")
29494 " and the corresponding
29495 execution of "
29496 (code "glEnd")
29497 ". ")))
29498
29499 (define-gl-procedure
29500 glIsShader
29501 "glIsShader"
29502 (funcsynopsis
29503 (funcprototype
29504 (funcdef "GLboolean " (function "glIsShader"))
29505 (paramdef "GLuint " (parameter "shader"))))
29506 '(*fragment*
29507 (heading
29508 "Determines if a name corresponds to a shader object")
29509 (heading "Parameters")
29510 (table (% (formatter (asis)))
29511 (entry (% (heading (var "shader")))
29512 (para "Specifies a potential shader object.")))
29513 (heading "Description")
29514 (para (code "glIsShader")
29515 " returns\t"
29516 (code "GL_TRUE")
29517 " if "
29518 (var "shader")
29519 " is
29520 \tthe name of a shader object previously created with "
29521 (code "glCreateShader")
29522 " and not yet deleted with "
29523 (code "glDeleteShader")
29524 ".
29525 If "
29526 (var "shader")
29527 " is
29528 \tzero or a non-zero value that is not the name of a shader
29529 \tobject, or if an error occurs, "
29530 (code "glIsShader ")
29531 " returns\t"
29532 (code "GL_FALSE")
29533 ".")
29534 (heading "Errors")
29535 (para (code "GL_INVALID_OPERATION")
29536 " is generated if\t"
29537 (code "glIsShader")
29538 " is executed between the
29539 \texecution of\t"
29540 (code "glBegin")
29541 "
29542 and the corresponding execution of\t"
29543 (code "glEnd")
29544 ".")))
29545
29546 (define-gl-procedure
29547 glIsTexture
29548 "glIsTexture"
29549 (funcsynopsis
29550 (funcprototype
29551 (funcdef "GLboolean " (function "glIsTexture"))
29552 (paramdef "GLuint " (parameter "texture"))))
29553 '(*fragment*
29554 (heading
29555 "determine if a name corresponds to a texture")
29556 (heading "Parameters")
29557 (table (% (formatter (asis)))
29558 (entry (% (heading (var "texture")))
29559 (para "
29560 Specifies a value that may be the name of a texture. ")))
29561 (heading "Description")
29562 (para (code "glIsTexture")
29563 " returns "
29564 (code "GL_TRUE")
29565 " if "
29566 (var "texture")
29567 " is currently the name of a texture.
29568 If "
29569 (var "texture")
29570 " is zero, or is a non-zero value that is not currently the
29571 name of a texture, or if an error occurs, "
29572 (code "glIsTexture")
29573 " returns "
29574 (code "GL_FALSE")
29575 ". ")
29576 (para "
29577 A name returned by "
29578 (code "glGenTextures")
29579 ", but not yet associated with a texture
29580 by calling "
29581 (code "glBindTexture")
29582 ", is not the name of a texture. ")
29583 (heading "Errors")
29584 (para (code "GL_INVALID_OPERATION")
29585 " is generated if "
29586 (code "glIsTexture")
29587 " is executed
29588 between the execution of "
29589 (code "glBegin")
29590 " and the corresponding
29591 execution of "
29592 (code "glEnd")
29593 ". ")))
29594
29595 (define-gl-procedure
29596 glLightModel
29597 "glLightModel"
29598 (funcsynopsis
29599 (funcprototype
29600 (funcdef "void " (function "glLightModelf"))
29601 (paramdef "GLenum " (parameter "pname"))
29602 (paramdef "GLfloat " (parameter "param"))))
29603 '(*fragment*
29604 (heading "set the lighting model parameters")
29605 (heading "Parameters")
29606 (table (% (formatter (asis)))
29607 (entry (% (heading (var "pname")))
29608 (para "
29609 Specifies a single-valued lighting model parameter. "
29610 (code "GL_LIGHT_MODEL_LOCAL_VIEWER")
29611 ", "
29612 (code "GL_LIGHT_MODEL_COLOR_CONTROL")
29613 ", and "
29614 (code "GL_LIGHT_MODEL_TWO_SIDE")
29615 " are accepted. "))
29616 (entry (% (heading (var "param")))
29617 (para "
29618 Specifies the value that "
29619 (var "param")
29620 " will be set to. ")))
29621 (heading "Description")
29622 (para (code "glLightModel")
29623 " sets the lighting model parameter. "
29624 (var "pname")
29625 " names a parameter and "
29626 (var "params")
29627 " gives the new value.
29628 There are three lighting model parameters: ")
29629 (table (% (formatter (asis)))
29630 (entry (% (heading (code "GL_LIGHT_MODEL_AMBIENT")))
29631 (para)
29632 (para (var "params")
29633 " contains four integer or floating-point values that specify
29634 the ambient RGBA intensity of the entire scene.
29635 Integer values are mapped linearly such that the most positive representable
29636 value maps to 1.0,
29637 and the most negative representable value maps to "
29638 (math "-1.0")
29639 ".
29640 Floating-point values are mapped directly.
29641 Neither integer nor floating-point values are clamped.
29642 The initial ambient scene intensity is (0.2, 0.2, 0.2, 1.0). "))
29643 (entry (% (heading (code "GL_LIGHT_MODEL_COLOR_CONTROL")))
29644 (para)
29645 (para (var "params")
29646 " must be either "
29647 (code "GL_SEPARATE_SPECULAR_COLOR")
29648 " or "
29649 (code "GL_SINGLE_COLOR")
29650 ". "
29651 (code "GL_SINGLE_COLOR")
29652 " specifies that a single color is generated from the
29653 lighting computation for a vertex. "
29654 (code "GL_SEPARATE_SPECULAR_COLOR")
29655 "
29656 specifies that the specular color computation of lighting be stored
29657 separately from the remainder of the lighting computation. The specular
29658 color is summed into the generated fragment's color after the application
29659 of texture mapping (if enabled). The initial value is "
29660 (code "GL_SINGLE_COLOR")
29661 ". "))
29662 (entry (% (heading (code "GL_LIGHT_MODEL_LOCAL_VIEWER")))
29663 (para)
29664 (para (var "params")
29665 " is a single integer or floating-point value that specifies
29666 how specular reflection angles are computed.
29667 If "
29668 (var "params")
29669 " is 0 (or 0.0), specular reflection angles take the
29670 view direction to be parallel to and in the direction of the -"
29671 (var "z")
29672 " axis,
29673 regardless of the location of the vertex in eye coordinates.
29674 Otherwise, specular reflections are computed from the origin
29675 of the eye coordinate system.
29676 The initial value is 0. "))
29677 (entry (% (heading (code "GL_LIGHT_MODEL_TWO_SIDE")))
29678 (para)
29679 (para (var "params")
29680 " is a single integer or floating-point value that specifies
29681 whether one- or two-sided lighting calculations are done for polygons.
29682 It has no effect on the lighting calculations for points,
29683 lines,
29684 or bitmaps.
29685 If "
29686 (var "params")
29687 " is 0 (or 0.0), one-sided lighting is specified,
29688 and only the "
29689 (var "front")
29690 " material parameters are used in the
29691 lighting equation.
29692 Otherwise, two-sided lighting is specified.
29693 In this case, vertices of back-facing polygons are lighted using the "
29694 (var "back")
29695 " material parameters
29696 and have their normals reversed before the lighting equation is evaluated.
29697 Vertices of front-facing polygons are always lighted using the "
29698 (var "front")
29699 " material parameters,
29700 with no change to their normals. The initial value is 0. ")))
29701 (para "
29702 In RGBA mode, the lighted color of a vertex is the sum of
29703 the material emission intensity,
29704 the product of the material ambient reflectance and the lighting model full-scene
29705 ambient intensity,
29706 and the contribution of each enabled light source.
29707 Each light source contributes the sum of three terms:
29708 ambient, diffuse, and specular.
29709 The ambient light source contribution is the product of the material ambient
29710 reflectance and the light's ambient intensity.
29711 The diffuse light source contribution is the product of the material diffuse
29712 reflectance,
29713 the light's diffuse intensity,
29714 and the dot product of the vertex's normal with the normalized vector from
29715 the vertex to the light source.
29716 The specular light source contribution is the product of the material specular
29717 reflectance,
29718 the light's specular intensity,
29719 and the dot product of the normalized vertex-to-eye and vertex-to-light
29720 vectors,
29721 raised to the power of the shininess of the material.
29722 All three light source contributions are attenuated equally based on
29723 the distance from the vertex to the light source and on light source
29724 direction, spread exponent, and spread cutoff angle.
29725 All dot products are replaced with 0 if they evaluate to a negative value. ")
29726 (para "
29727 The alpha component of the resulting lighted color is set to the alpha value
29728 of the material diffuse reflectance. ")
29729 (para "
29730 In color index mode,
29731 the value of the lighted index of a vertex ranges from the ambient
29732 to the specular values passed to "
29733 (code "glMaterial")
29734 " using "
29735 (code "GL_COLOR_INDEXES")
29736 ".
29737 Diffuse and specular coefficients,
29738 computed with a (.30, .59, .11) weighting of the lights' colors,
29739 the shininess of the material,
29740 and the same reflection and attenuation equations as in the RGBA case,
29741 determine how much above ambient the resulting index is. ")
29742 (heading "Errors")
29743 (para (code "GL_INVALID_ENUM")
29744 " is generated if "
29745 (var "pname")
29746 " is not an accepted value. ")
29747 (para (code "GL_INVALID_ENUM")
29748 " is generated if "
29749 (var "pname")
29750 " is "
29751 (code "GL_LIGHT_MODEL_COLOR_CONTROL")
29752 " and "
29753 (var "params")
29754 " is not one of "
29755 (code "GL_SINGLE_COLOR")
29756 " or "
29757 (code "GL_SEPARATE_SPECULAR_COLOR")
29758 ". ")
29759 (para (code "GL_INVALID_OPERATION")
29760 " is generated if "
29761 (code "glLightModel")
29762 " is executed between
29763 the execution of "
29764 (code "glBegin")
29765 " and the corresponding execution of "
29766 (code "glEnd")
29767 ". ")))
29768
29769 (define-gl-procedure
29770 glLight
29771 "glLight"
29772 (funcsynopsis
29773 (funcprototype
29774 (funcdef "void " (function "glLightf"))
29775 (paramdef "GLenum " (parameter "light"))
29776 (paramdef "GLenum " (parameter "pname"))
29777 (paramdef "GLfloat " (parameter "param"))))
29778 '(*fragment*
29779 (heading "set light source parameters")
29780 (heading "Parameters")
29781 (table (% (formatter (asis)))
29782 (entry (% (heading (var "light")))
29783 (para "
29784 Specifies a light.
29785 The number of lights depends on the implementation,
29786 but at least eight lights are supported.
29787 They are identified by symbolic names of the form "
29788 (code "GL_LIGHT")
29789 (math (var "i"))
29790 ",
29791 where i ranges from 0 to the value of "
29792 (code "GL_MAX_LIGHTS")
29793 " - 1. "))
29794 (entry (% (heading (var "pname")))
29795 (para "
29796 Specifies a single-valued light source parameter for "
29797 (var "light")
29798 ". "
29799 (code "GL_SPOT_EXPONENT")
29800 ", "
29801 (code "GL_SPOT_CUTOFF")
29802 ", "
29803 (code "GL_CONSTANT_ATTENUATION")
29804 ", "
29805 (code "GL_LINEAR_ATTENUATION")
29806 ", and "
29807 (code "GL_QUADRATIC_ATTENUATION")
29808 " are accepted. "))
29809 (entry (% (heading (var "param")))
29810 (para "
29811 Specifies the value that parameter "
29812 (var "pname")
29813 " of light source "
29814 (var "light")
29815 "
29816 will be set to. ")))
29817 (heading "Description")
29818 (para (code "glLight")
29819 " sets the values of individual light source parameters. "
29820 (var "light")
29821 " names the light and is a symbolic name of the form "
29822 (code "GL_LIGHT")
29823 (math (var "i"))
29824 ",
29825 where i ranges from 0 to the value of "
29826 (code "GL_MAX_LIGHTS")
29827 " - 1. "
29828 (var "pname")
29829 " specifies one of ten light source parameters,
29830 again by symbolic name. "
29831 (var "params")
29832 " is either a single value or a pointer to an array that contains
29833 the new values. ")
29834 (para "
29835 To enable and disable lighting calculation, call "
29836 (code "glEnable")
29837 "
29838 and "
29839 (code "glDisable")
29840 " with argument "
29841 (code "GL_LIGHTING")
29842 ". Lighting is
29843 initially disabled.
29844 When it is enabled,
29845 light sources that are enabled contribute to the lighting calculation.
29846 Light source "
29847 (math (var "i"))
29848 "
29849 is enabled and disabled using "
29850 (code "glEnable")
29851 " and "
29852 (code "glDisable")
29853 " with argument "
29854 (code "GL_LIGHT")
29855 (math (var "i"))
29856 ". ")
29857 (para "
29858 The ten light parameters are as follows: ")
29859 (table (% (formatter (asis)))
29860 (entry (% (heading (code "GL_AMBIENT")))
29861 (para (var "params")
29862 " contains four integer or floating-point values that specify
29863 the ambient RGBA intensity of the light.
29864 Integer values are mapped linearly such that the most positive representable
29865 value maps to 1.0,
29866 and the most negative representable value maps to "
29867 (math "-1.0")
29868 ".
29869 Floating-point values are mapped directly.
29870 Neither integer nor floating-point values are clamped.
29871 The initial ambient light intensity is (0, 0, 0, 1). "))
29872 (entry (% (heading (code "GL_DIFFUSE")))
29873 (para (var "params")
29874 " contains four integer or floating-point values that specify
29875 the diffuse RGBA intensity of the light.
29876 Integer values are mapped linearly such that the most positive representable
29877 value maps to 1.0,
29878 and the most negative representable value maps to "
29879 (math "-1.0")
29880 ".
29881 Floating-point values are mapped directly.
29882 Neither integer nor floating-point values are clamped.
29883 The initial value
29884 for "
29885 (code "GL_LIGHT0")
29886 " is (1, 1, 1, 1); for other lights, the
29887 initial value is (0, 0, 0, 1). "))
29888 (entry (% (heading (code "GL_SPECULAR")))
29889 (para (var "params")
29890 " contains four integer or floating-point values that specify
29891 the specular RGBA intensity of the light.
29892 Integer values are mapped linearly such that the most positive representable
29893 value maps to 1.0,
29894 and the most negative representable value maps to "
29895 (math "-1.0")
29896 ".
29897 Floating-point values are mapped directly.
29898 Neither integer nor floating-point values are clamped.
29899 The initial value
29900 for "
29901 (code "GL_LIGHT0")
29902 " is (1, 1, 1, 1); for other lights, the
29903 initial value is (0, 0, 0, 1). "))
29904 (entry (% (heading (code "GL_POSITION")))
29905 (para (var "params")
29906 " contains four integer or floating-point values that specify
29907 the position of the light in homogeneous object coordinates.
29908 Both integer and floating-point values are mapped directly.
29909 Neither integer nor floating-point values are clamped. ")
29910 (para "
29911 The position is transformed by the modelview matrix when "
29912 (code "glLight")
29913 " is called (just as if it were a point),
29914 and it is stored in eye coordinates.
29915 If the "
29916 (math (var "w"))
29917 "
29918 component of the position is 0,
29919 the light is treated as a directional source.
29920 Diffuse and specular lighting calculations take the light's direction,
29921 but not its actual position,
29922 into account,
29923 and attenuation is disabled.
29924 Otherwise,
29925 diffuse and specular lighting calculations are based on the actual location
29926 of the light in eye coordinates,
29927 and attenuation is enabled.
29928 The initial position is (0, 0, 1, 0);
29929 thus, the initial light source is directional,
29930 parallel to, and in the direction of the "
29931 (math "-" (var "z"))
29932 "
29933 axis. "))
29934 (entry (% (heading (code "GL_SPOT_DIRECTION")))
29935 (para (var "params")
29936 " contains three integer or floating-point values that specify
29937 the direction of the light in homogeneous object coordinates.
29938 Both integer and floating-point values are mapped directly.
29939 Neither integer nor floating-point values are clamped. ")
29940 (para "
29941 The spot direction is transformed by the upper 3x3 of the modelview matrix when "
29942 (code "glLight")
29943 " is called,
29944 and it is stored in eye coordinates.
29945 It is significant only when "
29946 (code "GL_SPOT_CUTOFF")
29947 " is not 180,
29948 which it is initially.
29949 The initial direction is "
29950 (math "(" "0" "," "0" "-1" ")")
29951 ". "))
29952 (entry (% (heading (code "GL_SPOT_EXPONENT")))
29953 (para (var "params")
29954 " is a single integer or floating-point value that specifies
29955 the intensity distribution of the light.
29956 Integer and floating-point values are mapped directly.
29957 Only values in the range "
29958 (math "[" "0" "," "128" "]")
29959 "
29960 are accepted. ")
29961 (para "
29962 Effective light intensity is attenuated by the cosine of the angle between
29963 the direction of the light and the direction from the light to the vertex
29964 being lighted,
29965 raised to the power of the spot exponent.
29966 Thus, higher spot exponents result in a more focused light source,
29967 regardless of the spot cutoff angle (see "
29968 (code "GL_SPOT_CUTOFF")
29969 ", next paragraph).
29970 The initial spot exponent is 0,
29971 resulting in uniform light distribution. "))
29972 (entry (% (heading (code "GL_SPOT_CUTOFF")))
29973 (para (var "params")
29974 " is a single integer or floating-point value that specifies
29975 the maximum spread angle of a light source.
29976 Integer and floating-point values are mapped directly.
29977 Only values in the range "
29978 (math "[" "0" "," "90" "]")
29979 "
29980 and the special value 180
29981 are accepted.
29982 If the angle between the direction of the light and the direction from the
29983 light to the vertex being lighted is greater than the spot cutoff angle,
29984 the light is completely masked.
29985 Otherwise, its intensity is controlled by the spot exponent and the
29986 attenuation factors.
29987 The initial spot cutoff is 180,
29988 resulting in uniform light distribution. "))
29989 (entry (% (heading (code "GL_CONSTANT_ATTENUATION"))))
29990 (entry (% (heading (code "GL_LINEAR_ATTENUATION"))))
29991 (entry (% (heading (code "GL_QUADRATIC_ATTENUATION")))
29992 (para (var "params")
29993 " is a single integer or floating-point value that specifies
29994 one of the three light attenuation factors.
29995 Integer and floating-point values are mapped directly.
29996 Only nonnegative values are accepted.
29997 If the light is positional,
29998 rather than directional,
29999 its intensity is attenuated by the reciprocal of the sum of the constant
30000 factor, the linear factor times the distance between the light
30001 and the vertex being lighted,
30002 and the quadratic factor times the square of the same distance.
30003 The initial attenuation factors are (1, 0, 0),
30004 resulting in no attenuation. ")))
30005 (heading "Errors")
30006 (para (code "GL_INVALID_ENUM")
30007 " is generated if either "
30008 (var "light")
30009 " or "
30010 (var "pname")
30011 "
30012 is not an accepted value. ")
30013 (para (code "GL_INVALID_VALUE")
30014 " is generated if a spot exponent value is specified
30015 outside the range "
30016 (math "[" "0" "," "128" "]")
30017 ",
30018 or if spot cutoff is specified outside the range "
30019 (math "[" "0" "," "90" "]")
30020 "
30021 (except for the
30022 special value 180),
30023 or if a negative attenuation factor is specified. ")
30024 (para (code "GL_INVALID_OPERATION")
30025 " is generated if "
30026 (code "glLight")
30027 " is executed between
30028 the execution of "
30029 (code "glBegin")
30030 " and the corresponding execution of "
30031 (code "glEnd")
30032 ". ")))
30033
30034 (define-gl-procedure
30035 glLineStipple
30036 "glLineStipple"
30037 (funcsynopsis
30038 (funcprototype
30039 (funcdef "void " (function "glLineStipple"))
30040 (paramdef "GLint " (parameter "factor"))
30041 (paramdef "GLushort " (parameter "pattern"))))
30042 '(*fragment*
30043 (heading "specify the line stipple pattern")
30044 (heading "Parameters")
30045 (table (% (formatter (asis)))
30046 (entry (% (heading (var "factor")))
30047 (para "
30048 Specifies a multiplier for each bit in the line stipple pattern.
30049 If "
30050 (var "factor")
30051 " is 3,
30052 for example,
30053 each bit in the pattern is used three times
30054 before the next bit in the pattern is used. "
30055 (var "factor")
30056 " is clamped to the range [1, 256] and defaults to 1. "))
30057 (entry (% (heading (var "pattern")))
30058 (para "
30059 Specifies a 16-bit integer whose bit pattern determines
30060 which fragments of a line will be drawn when the line is rasterized.
30061 Bit zero is used first; the default pattern is all 1's. ")))
30062 (heading "Description")
30063 (para "
30064 Line stippling masks out certain fragments produced by rasterization;
30065 those fragments will not be drawn.
30066 The masking is achieved by using three parameters:
30067 the 16-bit line stipple pattern "
30068 (var "pattern")
30069 ",
30070 the repeat count "
30071 (var "factor")
30072 ",
30073 and an integer stipple counter "
30074 (math (var "s"))
30075 ". ")
30076 (para "
30077 Counter "
30078 (math (var "s"))
30079 "
30080 is reset to 0 whenever "
30081 (code "glBegin")
30082 " is called
30083 and before each line segment of a "
30084 (code "glBegin")
30085 "("
30086 (code "GL_LINES")
30087 ")/"
30088 (code "glEnd")
30089 "
30090 sequence is generated.
30091 It is incremented after each fragment of a unit width aliased line segment
30092 is generated
30093 or after each "
30094 (math (var "i"))
30095 "
30096 fragments of an "
30097 (math (var "i"))
30098 "
30099 width line segment are generated.
30100 The "
30101 (math (var "i"))
30102 "
30103 fragments associated with count "
30104 (math (var "s"))
30105 "
30106 are masked out if ")
30107 (para (var "pattern")
30108 " bit "
30109 (math "("
30110 (var "s")
30111 "/"
30112 (var "factor")
30113 ","
30114 ")"
30115 "%"
30116 "16"))
30117 (para "
30118 is 0, otherwise these fragments are sent to the frame buffer.
30119 Bit zero of "
30120 (var "pattern")
30121 " is the least significant bit. ")
30122 (para "
30123 Antialiased lines are treated as a sequence of "
30124 (math "1" "×" (var "width"))
30125 "
30126 rectangles
30127 for purposes of stippling.
30128 Whether rectangle "
30129 (math (var "s"))
30130 "
30131 is rasterized or not depends on the fragment rule
30132 described for aliased lines,
30133 counting rectangles rather than groups of fragments. ")
30134 (para "
30135 To enable and disable line stippling, call "
30136 (code "glEnable")
30137 " and "
30138 (code "glDisable")
30139 "
30140 with argument "
30141 (code "GL_LINE_STIPPLE")
30142 ".
30143 When enabled,
30144 the line stipple pattern is applied as described above.
30145 When disabled,
30146 it is as if the pattern were all 1's.
30147 Initially, line stippling is disabled. ")
30148 (heading "Errors")
30149 (para (code "GL_INVALID_OPERATION")
30150 " is generated if "
30151 (code "glLineStipple")
30152 "
30153 is executed between the execution of "
30154 (code "glBegin")
30155 "
30156 and the corresponding execution of "
30157 (code "glEnd")
30158 ". ")))
30159
30160 (define-gl-procedure
30161 glLineWidth
30162 "glLineWidth"
30163 (funcsynopsis
30164 (funcprototype
30165 (funcdef "void " (function "glLineWidth"))
30166 (paramdef "GLfloat " (parameter "width"))))
30167 '(*fragment*
30168 (heading "specify the width of rasterized lines")
30169 (heading "Parameters")
30170 (table (% (formatter (asis)))
30171 (entry (% (heading (var "width")))
30172 (para "
30173 Specifies the width of rasterized lines.
30174 The initial value is 1. ")))
30175 (heading "Description")
30176 (para (code "glLineWidth")
30177 " specifies the rasterized width of both aliased and antialiased
30178 lines.
30179 Using a line width other than 1 has different effects,
30180 depending on whether line antialiasing is enabled.
30181 To enable and disable line antialiasing, call "
30182 (code "glEnable")
30183 " and "
30184 (code "glDisable")
30185 "
30186 with argument "
30187 (code "GL_LINE_SMOOTH")
30188 ". Line antialiasing is initially
30189 disabled. ")
30190 (para "
30191 If line antialiasing is disabled,
30192 the actual width is determined by rounding the supplied width
30193 to the nearest integer.
30194 (If the rounding results in the value 0,
30195 it is as if the line width were 1.)
30196 If "
30197 (math "∣"
30198 "Δ"
30199 (var "x")
30200 ","
30201 "∣"
30202 ">="
30203 "∣"
30204 "Δ"
30205 (var "y")
30206 ","
30207 "∣")
30208 ", "
30209 (var "i")
30210 " pixels are filled in each column that is rasterized,
30211 where "
30212 (var "i")
30213 " is the rounded value of "
30214 (var "width")
30215 ".
30216 Otherwise, "
30217 (var "i")
30218 " pixels are filled in each row that is rasterized. ")
30219 (para "
30220 If antialiasing is enabled,
30221 line rasterization produces a fragment for each pixel square
30222 that intersects the region lying within the rectangle having width
30223 equal to the current line width,
30224 length equal to the actual length of the line,
30225 and centered on the mathematical line segment.
30226 The coverage value for each fragment is the window coordinate area
30227 of the intersection of the rectangular region with the corresponding
30228 pixel square.
30229 This value is saved and used in the final rasterization step. ")
30230 (para "
30231 Not all widths can be supported when line antialiasing is enabled. If an
30232 unsupported width is requested, the nearest supported width is used.
30233 Only width 1 is guaranteed to be supported; others depend on the
30234 implementation. Likewise, there is a range for aliased line widths as well.
30235 To query the range of supported widths and the size
30236 difference between supported widths within the range, call "
30237 (code "glGet")
30238 "
30239 with arguments "
30240 (code "GL_ALIASED_LINE_WIDTH_RANGE")
30241 ", "
30242 (code "GL_SMOOTH_LINE_WIDTH_RANGE")
30243 ", and "
30244 (code "GL_SMOOTH_LINE_WIDTH_GRANULARITY")
30245 ". ")
30246 (heading "Errors")
30247 (para (code "GL_INVALID_VALUE")
30248 " is generated if "
30249 (var "width")
30250 " is less than or equal to 0. ")
30251 (para (code "GL_INVALID_OPERATION")
30252 " is generated if "
30253 (code "glLineWidth")
30254 "
30255 is executed between the execution of "
30256 (code "glBegin")
30257 "
30258 and the corresponding execution of "
30259 (code "glEnd")
30260 ". ")))
30261
30262 (define-gl-procedure
30263 glLinkProgram
30264 "glLinkProgram"
30265 (funcsynopsis
30266 (funcprototype
30267 (funcdef "void " (function "glLinkProgram"))
30268 (paramdef "GLuint " (parameter "program"))))
30269 '(*fragment*
30270 (heading "Links a program object")
30271 (heading "Parameters")
30272 (table (% (formatter (asis)))
30273 (entry (% (heading (var "program")))
30274 (para "Specifies the handle of the program object to be linked.")))
30275 (heading "Description")
30276 (para (code "glLinkProgram")
30277 " links the program
30278 \tobject specified by "
30279 (var "program")
30280 ". If any
30281 \tshader objects of type "
30282 (code "GL_VERTEX_SHADER")
30283 " are
30284 \tattached to "
30285 (var "program")
30286 ", they will be used to
30287 \tcreate an executable that will run on the programmable vertex
30288 \tprocessor. If any shader objects of type\t"
30289 (code "GL_FRAGMENT_SHADER")
30290 " are attached to\t"
30291 (var "program")
30292 ", they will be used to create an
30293 \texecutable that will run on the programmable fragment
30294 \tprocessor.")
30295 (para "The status of the link operation will be stored as part of
30296 \tthe program object's state. This value will be set to\t"
30297 (code "GL_TRUE")
30298 " if the program object was linked
30299 \twithout errors and is ready for use, and\t"
30300 (code "GL_FALSE")
30301 " otherwise. It can be queried by
30302 \tcalling\t"
30303 (code "glGetProgram")
30304 "
30305 with arguments "
30306 (var "program")
30307 " and\t"
30308 (code "GL_LINK_STATUS")
30309 ".")
30310 (para "As a result of a successful link operation, all active
30311 \tuser-defined uniform variables belonging to\t"
30312 (var "program")
30313 " will be initialized to 0, and
30314 \teach of the program object's active uniform variables will be
30315 \tassigned a location that can be queried by calling\t"
30316 (code "glGetUniformLocation")
30317 ".
30318 \tAlso, any active user-defined attribute variables that have not
30319 \tbeen bound to a generic vertex attribute index will be bound to
30320 \tone at this time.")
30321 (para "Linking of a program object can fail for a number of
30322 \treasons as specified in the "
30323 (var "OpenGL Shading Language
30324 \tSpecification")
30325 ". The following lists some of the
30326 \tconditions that will cause a link error.")
30327 (itemize
30328 (item (para "The number of active attribute variables supported
30329 \t\tby the implementation has been exceeded."))
30330 (item (para "The storage limit for uniform variables has been
30331 \t\texceeded."))
30332 (item (para "The number of active uniform variables supported
30333 \t\tby the implementation has been exceeded."))
30334 (item (para "The "
30335 (code "main")
30336 " function is missing
30337 \t\tfor the vertex shader or the fragment shader."))
30338 (item (para "A varying variable actually used in the fragment
30339 \t\tshader is not declared in the same way (or is not
30340 \t\tdeclared at all) in the vertex shader."))
30341 (item (para "A reference to a function or variable name is
30342 \t\tunresolved."))
30343 (item (para "A shared global is declared with two different
30344 \t\ttypes or two different initial values."))
30345 (item (para "One or more of the attached shader objects has not
30346 \t\tbeen successfully compiled."))
30347 (item (para "Binding a generic attribute matrix caused some
30348 \t\trows of the matrix to fall outside the allowed maximum
30349 \t\tof "
30350 (code "GL_MAX_VERTEX_ATTRIBS")
30351 "."))
30352 (item (para "Not enough contiguous vertex attribute slots could
30353 \t\tbe found to bind attribute matrices.")))
30354 (para "When a program object has been successfully linked, the
30355 \tprogram object can be made part of current state by calling\t"
30356 (code "glUseProgram")
30357 ".
30358 \tWhether or not the link operation was successful, the program
30359 \tobject's information log will be overwritten. The information
30360 \tlog can be retrieved by calling\t"
30361 (code "glGetProgramInfoLog")
30362 ".")
30363 (para (code "glLinkProgram")
30364 " will also install the
30365 \tgenerated executables as part of the current rendering state if
30366 \tthe link operation was successful and the specified program
30367 \tobject is already currently in use as a result of a previous
30368 \tcall to\t"
30369 (code "glUseProgram")
30370 ".
30371 \tIf the program object currently in use is relinked
30372 \tunsuccessfully, its link status will be set to\t"
30373 (code "GL_FALSE")
30374 " , but the executables and
30375 \tassociated state will remain part of the current state until a
30376 \tsubsequent call to "
30377 (code "glUseProgram")
30378 " removes it
30379 \tfrom use. After it is removed from use, it cannot be made part
30380 \tof current state until it has been successfully relinked.")
30381 (para "If "
30382 (var "program")
30383 " contains shader objects
30384 \tof type "
30385 (code "GL_VERTEX_SHADER")
30386 " but does not
30387 \tcontain shader objects of type\t"
30388 (code "GL_FRAGMENT_SHADER")
30389 ", the vertex shader will
30390 \tbe linked against the implicit interface for fixed functionality
30391 \tfragment processing. Similarly, if\t"
30392 (var "program")
30393 " contains shader objects of type\t"
30394 (code "GL_FRAGMENT_SHADER")
30395 " but it does not contain
30396 \tshader objects of type "
30397 (code "GL_VERTEX_SHADER")
30398 ",
30399 \tthe fragment shader will be linked against the implicit
30400 \tinterface for fixed functionality vertex processing.")
30401 (para "The program object's information log is updated and the
30402 \tprogram is generated at the time of the link operation. After
30403 \tthe link operation, applications are free to modify attached
30404 \tshader objects, compile attached shader objects, detach shader
30405 \tobjects, delete shader objects, and attach additional shader
30406 \tobjects. None of these operations affects the information log or
30407 \tthe program that is part of the program object.")
30408 (heading "Errors")
30409 (para (code "GL_INVALID_VALUE")
30410 "
30411 is generated if "
30412 (var "program")
30413 "
30414 is not a value generated by OpenGL.")
30415 (para (code "GL_INVALID_OPERATION")
30416 "
30417 is generated if "
30418 (var "program")
30419 "
30420 is not a program object.")
30421 (para (code "GL_INVALID_OPERATION")
30422 "
30423 is generated if "
30424 (code "glLinkProgram")
30425 "
30426 is executed between the execution of "
30427 (code "glBegin")
30428 "
30429 and the corresponding execution of "
30430 (code "glEnd")
30431 ".")))
30432
30433 (define-gl-procedure
30434 glListBase
30435 "glListBase"
30436 (funcsynopsis
30437 (funcprototype
30438 (funcdef "void " (function "glListBase"))
30439 (paramdef "GLuint " (parameter "base"))))
30440 '(*fragment*
30441 (heading "set the display-list base for ")
30442 (heading "Parameters")
30443 (table (% (formatter (asis)))
30444 (entry (% (heading (var "base")))
30445 (para "
30446 Specifies an integer offset that will be added to "
30447 (code "glCallLists")
30448 "
30449 offsets to generate display-list names.
30450 The initial value is 0. ")))
30451 (heading "Description")
30452 (para (code "glCallLists")
30453 " specifies an array of offsets.
30454 Display-list names are generated by adding "
30455 (var "base")
30456 " to each offset.
30457 Names that reference valid display lists are executed;
30458 the others are ignored. ")
30459 (heading "Errors")
30460 (para (code "GL_INVALID_OPERATION")
30461 " is generated if "
30462 (code "glListBase")
30463 "
30464 is executed between the execution of "
30465 (code "glBegin")
30466 "
30467 and the corresponding execution of "
30468 (code "glEnd")
30469 ". ")))
30470
30471 (define-gl-procedure
30472 glLoadIdentity
30473 "glLoadIdentity"
30474 (funcsynopsis
30475 (funcprototype
30476 (funcdef "void " (function "glLoadIdentity"))
30477 (paramdef (parameter "void"))))
30478 '(*fragment*
30479 (heading
30480 "replace the current matrix with the identity matrix")
30481 (heading "Description")
30482 (para (code "glLoadIdentity")
30483 " replaces the current matrix with the identity matrix.
30484 It is semantically equivalent to calling "
30485 (code "glLoadMatrix")
30486 "
30487 with the identity matrix ")
30488 (para)
30489 (para (math "("
30490 "("
30491 "1"
30492 " "
30493 "0"
30494 " "
30495 "0"
30496 " "
30497 "0"
30498 ")"
30499 ", "
30500 "("
30501 "0"
30502 " "
30503 "1"
30504 " "
30505 "0"
30506 " "
30507 "0"
30508 ")"
30509 ", "
30510 "("
30511 "0"
30512 " "
30513 "0"
30514 " "
30515 "1"
30516 " "
30517 "0"
30518 ")"
30519 ", "
30520 "("
30521 "0"
30522 " "
30523 "0"
30524 " "
30525 "0"
30526 " "
30527 "1"
30528 ")"
30529 ","
30530 ","
30531 ")"))
30532 (para)
30533 (para "
30534 but in some cases it is more efficient. ")
30535 (heading "Errors")
30536 (para (code "GL_INVALID_OPERATION")
30537 " is generated if "
30538 (code "glLoadIdentity")
30539 "
30540 is executed between the execution of "
30541 (code "glBegin")
30542 "
30543 and the corresponding execution of "
30544 (code "glEnd")
30545 ". ")))
30546
30547 (define-gl-procedure
30548 glLoadMatrix
30549 "glLoadMatrix"
30550 (funcsynopsis
30551 (funcprototype
30552 (funcdef "void " (function "glLoadMatrixd"))
30553 (paramdef "const GLdouble * " (parameter "m"))))
30554 '(*fragment*
30555 (heading
30556 "replace the current matrix with the specified matrix")
30557 (heading "Parameters")
30558 (table (% (formatter (asis)))
30559 (entry (% (heading (var "m")))
30560 (para "
30561 Specifies a pointer to 16 consecutive values, which are used as the
30562 elements of a "
30563 (math "4" "×" "4")
30564 "
30565 column-major matrix. ")))
30566 (heading "Description")
30567 (para (code "glLoadMatrix")
30568 " replaces the current matrix with the one whose elements are specified by "
30569 (var "m")
30570 ".
30571 The current matrix is the projection matrix,
30572 modelview matrix,
30573 or texture matrix,
30574 depending on the current matrix mode
30575 (see "
30576 (code "glMatrixMode")
30577 "). ")
30578 (para "
30579 The current matrix, M, defines a transformation of coordinates.
30580 For instance, assume M refers to the modelview matrix.
30581 If "
30582 (math (var "v")
30583 "="
30584 "("
30585 (var "v")
30586 "\u2061"
30587 "["
30588 "0"
30589 ","
30590 "]"
30591 ","
30592 (var "v")
30593 "\u2061"
30594 "["
30595 "1"
30596 ","
30597 "]"
30598 (var "v")
30599 "\u2061"
30600 "["
30601 "2"
30602 ","
30603 "]"
30604 (var "v")
30605 "\u2061"
30606 "["
30607 "3"
30608 ","
30609 "]"
30610 ")")
30611 "
30612 is the set of object coordinates
30613 of a vertex,
30614 and "
30615 (var "m")
30616 " points to an array of "
30617 (math "16")
30618 "
30619 single- or double-precision
30620 floating-point values "
30621 (math (var "m")
30622 "="
30623 "{"
30624 (var "m")
30625 "\u2061"
30626 "["
30627 "0"
30628 ","
30629 "]"
30630 ","
30631 (var "m")
30632 "\u2061"
30633 "["
30634 "1"
30635 ","
30636 "]"
30637 (var "...")
30638 (var "m")
30639 "\u2061"
30640 "["
30641 "15"
30642 ","
30643 "]"
30644 "}")
30645 ",
30646 then the modelview transformation "
30647 (math (var "M") "\u2061" "(" (var "v") "," ")")
30648 "
30649 does the following: ")
30650 (para (math (var "M")
30651 "\u2061"
30652 "("
30653 (var "v")
30654 ","
30655 ")"
30656 "="
30657 "("
30658 "("
30659 (var "m")
30660 "\u2061"
30661 "["
30662 "0"
30663 ","
30664 "]"
30665 " "
30666 (var "m")
30667 "\u2061"
30668 "["
30669 "4"
30670 ","
30671 "]"
30672 " "
30673 (var "m")
30674 "\u2061"
30675 "["
30676 "8"
30677 ","
30678 "]"
30679 " "
30680 (var "m")
30681 "\u2061"
30682 "["
30683 "12"
30684 ","
30685 "]"
30686 ")"
30687 ", "
30688 "("
30689 (var "m")
30690 "\u2061"
30691 "["
30692 "1"
30693 ","
30694 "]"
30695 " "
30696 (var "m")
30697 "\u2061"
30698 "["
30699 "5"
30700 ","
30701 "]"
30702 " "
30703 (var "m")
30704 "\u2061"
30705 "["
30706 "9"
30707 ","
30708 "]"
30709 " "
30710 (var "m")
30711 "\u2061"
30712 "["
30713 "13"
30714 ","
30715 "]"
30716 ")"
30717 ", "
30718 "("
30719 (var "m")
30720 "\u2061"
30721 "["
30722 "2"
30723 ","
30724 "]"
30725 " "
30726 (var "m")
30727 "\u2061"
30728 "["
30729 "6"
30730 ","
30731 "]"
30732 " "
30733 (var "m")
30734 "\u2061"
30735 "["
30736 "10"
30737 ","
30738 "]"
30739 " "
30740 (var "m")
30741 "\u2061"
30742 "["
30743 "14"
30744 ","
30745 "]"
30746 ")"
30747 ", "
30748 "("
30749 (var "m")
30750 "\u2061"
30751 "["
30752 "3"
30753 ","
30754 "]"
30755 " "
30756 (var "m")
30757 "\u2061"
30758 "["
30759 "7"
30760 ","
30761 "]"
30762 " "
30763 (var "m")
30764 "\u2061"
30765 "["
30766 "11"
30767 ","
30768 "]"
30769 " "
30770 (var "m")
30771 "\u2061"
30772 "["
30773 "15"
30774 ","
30775 "]"
30776 ")"
30777 ","
30778 ")"
30779 "×"
30780 "("
30781 "("
30782 (var "v")
30783 "\u2061"
30784 "["
30785 "0"
30786 ","
30787 "]"
30788 ")"
30789 ", "
30790 "("
30791 (var "v")
30792 "\u2061"
30793 "["
30794 "1"
30795 ","
30796 "]"
30797 ")"
30798 ", "
30799 "("
30800 (var "v")
30801 "\u2061"
30802 "["
30803 "2"
30804 ","
30805 "]"
30806 ")"
30807 ", "
30808 "("
30809 (var "v")
30810 "\u2061"
30811 "["
30812 "3"
30813 ","
30814 "]"
30815 ")"
30816 ","
30817 ")"))
30818 (para)
30819 (para "
30820 Projection and texture transformations are similarly defined. ")
30821 (heading "Errors")
30822 (para (code "GL_INVALID_OPERATION")
30823 " is generated if "
30824 (code "glLoadMatrix")
30825 "
30826 is executed between the execution of "
30827 (code "glBegin")
30828 "
30829 and the corresponding execution of "
30830 (code "glEnd")
30831 ". ")))
30832
30833 (define-gl-procedure
30834 glLoadName
30835 "glLoadName"
30836 (funcsynopsis
30837 (funcprototype
30838 (funcdef "void " (function "glLoadName"))
30839 (paramdef "GLuint " (parameter "name"))))
30840 '(*fragment*
30841 (heading "load a name onto the name stack")
30842 (heading "Parameters")
30843 (table (% (formatter (asis)))
30844 (entry (% (heading (var "name")))
30845 (para "
30846 Specifies a name that will replace the top value on the name stack. ")))
30847 (heading "Description")
30848 (para "
30849 The name stack is used during selection mode to allow sets of rendering
30850 commands to be uniquely identified.
30851 It consists of an ordered set of unsigned integers and is initially empty. ")
30852 (para (code "glLoadName")
30853 " causes "
30854 (var "name")
30855 " to replace the value on the top of the name stack. ")
30856 (para "
30857 The name stack is always empty while the render mode is not "
30858 (code "GL_SELECT")
30859 ".
30860 Calls to "
30861 (code "glLoadName")
30862 " while the render mode is not "
30863 (code "GL_SELECT")
30864 " are ignored. ")
30865 (heading "Errors")
30866 (para (code "GL_INVALID_OPERATION")
30867 " is generated if "
30868 (code "glLoadName")
30869 " is called while the
30870 name stack is empty. ")
30871 (para (code "GL_INVALID_OPERATION")
30872 " is generated if "
30873 (code "glLoadName")
30874 " is executed between
30875 the execution of "
30876 (code "glBegin")
30877 " and the corresponding execution of "
30878 (code "glEnd")
30879 ". ")))
30880
30881 (define-gl-procedure
30882 glLoadTransposeMatrix
30883 "glLoadTransposeMatrix"
30884 (funcsynopsis
30885 (funcprototype
30886 (funcdef
30887 "void "
30888 (function "glLoadTransposeMatrixd"))
30889 (paramdef "const GLdouble * " (parameter "m"))))
30890 '(*fragment*
30891 (heading
30892 "replace the current matrix with the specified row-major ordered matrix")
30893 (heading "Parameters")
30894 (table (% (formatter (asis)))
30895 (entry (% (heading (var "m")))
30896 (para "
30897 Specifies a pointer to 16 consecutive values, which are used as the
30898 elements of a "
30899 (math "4" "×" "4")
30900 "
30901 row-major matrix. ")))
30902 (heading "Description")
30903 (para (code "glLoadTransposeMatrix")
30904 " replaces the current matrix with the one whose elements are specified by "
30905 (var "m")
30906 ".
30907 The current matrix is the projection matrix,
30908 modelview matrix,
30909 or texture matrix,
30910 depending on the current matrix mode
30911 (see "
30912 (code "glMatrixMode")
30913 "). ")
30914 (para "
30915 The current matrix, M, defines a transformation of coordinates.
30916 For instance, assume M refers to the modelview matrix.
30917 If "
30918 (math (var "v")
30919 "="
30920 "("
30921 (var "v")
30922 "\u2061"
30923 "["
30924 "0"
30925 ","
30926 "]"
30927 ","
30928 (var "v")
30929 "\u2061"
30930 "["
30931 "1"
30932 ","
30933 "]"
30934 (var "v")
30935 "\u2061"
30936 "["
30937 "2"
30938 ","
30939 "]"
30940 (var "v")
30941 "\u2061"
30942 "["
30943 "3"
30944 ","
30945 "]"
30946 ")")
30947 "
30948 is the set of object coordinates
30949 of a vertex,
30950 and "
30951 (var "m")
30952 " points to an array of "
30953 (math "16")
30954 "
30955 single- or double-precision
30956 floating-point values "
30957 (math (var "m")
30958 "="
30959 "{"
30960 (var "m")
30961 "\u2061"
30962 "["
30963 "0"
30964 ","
30965 "]"
30966 ","
30967 (var "m")
30968 "\u2061"
30969 "["
30970 "1"
30971 ","
30972 "]"
30973 (var "...")
30974 (var "m")
30975 "\u2061"
30976 "["
30977 "15"
30978 ","
30979 "]"
30980 "}")
30981 ",
30982 then the modelview transformation "
30983 (math (var "M") "\u2061" "(" (var "v") "," ")")
30984 "
30985 does the following: ")
30986 (para (math (var "M")
30987 "\u2061"
30988 "("
30989 (var "v")
30990 ","
30991 ")"
30992 "="
30993 "("
30994 "("
30995 (var "m")
30996 "\u2061"
30997 "["
30998 "0"
30999 ","
31000 "]"
31001 " "
31002 (var "m")
31003 "\u2061"
31004 "["
31005 "1"
31006 ","
31007 "]"
31008 " "
31009 (var "m")
31010 "\u2061"
31011 "["
31012 "2"
31013 ","
31014 "]"
31015 " "
31016 (var "m")
31017 "\u2061"
31018 "["
31019 "3"
31020 ","
31021 "]"
31022 ")"
31023 ", "
31024 "("
31025 (var "m")
31026 "\u2061"
31027 "["
31028 "4"
31029 ","
31030 "]"
31031 " "
31032 (var "m")
31033 "\u2061"
31034 "["
31035 "5"
31036 ","
31037 "]"
31038 " "
31039 (var "m")
31040 "\u2061"
31041 "["
31042 "6"
31043 ","
31044 "]"
31045 " "
31046 (var "m")
31047 "\u2061"
31048 "["
31049 "7"
31050 ","
31051 "]"
31052 ")"
31053 ", "
31054 "("
31055 (var "m")
31056 "\u2061"
31057 "["
31058 "8"
31059 ","
31060 "]"
31061 " "
31062 (var "m")
31063 "\u2061"
31064 "["
31065 "9"
31066 ","
31067 "]"
31068 " "
31069 (var "m")
31070 "\u2061"
31071 "["
31072 "10"
31073 ","
31074 "]"
31075 " "
31076 (var "m")
31077 "\u2061"
31078 "["
31079 "11"
31080 ","
31081 "]"
31082 ")"
31083 ", "
31084 "("
31085 (var "m")
31086 "\u2061"
31087 "["
31088 "12"
31089 ","
31090 "]"
31091 " "
31092 (var "m")
31093 "\u2061"
31094 "["
31095 "13"
31096 ","
31097 "]"
31098 " "
31099 (var "m")
31100 "\u2061"
31101 "["
31102 "14"
31103 ","
31104 "]"
31105 " "
31106 (var "m")
31107 "\u2061"
31108 "["
31109 "15"
31110 ","
31111 "]"
31112 ")"
31113 ","
31114 ")"
31115 "×"
31116 "("
31117 "("
31118 (var "v")
31119 "\u2061"
31120 "["
31121 "0"
31122 ","
31123 "]"
31124 ")"
31125 ", "
31126 "("
31127 (var "v")
31128 "\u2061"
31129 "["
31130 "1"
31131 ","
31132 "]"
31133 ")"
31134 ", "
31135 "("
31136 (var "v")
31137 "\u2061"
31138 "["
31139 "2"
31140 ","
31141 "]"
31142 ")"
31143 ", "
31144 "("
31145 (var "v")
31146 "\u2061"
31147 "["
31148 "3"
31149 ","
31150 "]"
31151 ")"
31152 ","
31153 ")"))
31154 (para)
31155 (para "
31156 Projection and texture transformations are similarly defined. ")
31157 (para "
31158 Calling "
31159 (code "glLoadTransposeMatrix")
31160 " with matrix "
31161 (math (var "M"))
31162 "
31163 is identical in operation to "
31164 (code "glLoadMatrix")
31165 " with "
31166 (math (var "M") "^" (var "T"))
31167 ",
31168 where "
31169 (math (var "T"))
31170 "
31171 represents the transpose. ")
31172 (heading "Errors")
31173 (para (code "GL_INVALID_OPERATION")
31174 " is generated if "
31175 (code "glLoadTransposeMatrix")
31176 "
31177 is executed between the execution of "
31178 (code "glBegin")
31179 "
31180 and the corresponding execution of "
31181 (code "glEnd")
31182 ". ")))
31183
31184 (define-gl-procedure
31185 glLogicOp
31186 "glLogicOp"
31187 (funcsynopsis
31188 (funcprototype
31189 (funcdef "void " (function "glLogicOp"))
31190 (paramdef "GLenum " (parameter "opcode"))))
31191 '(*fragment*
31192 (heading
31193 "specify a logical pixel operation for color index rendering")
31194 (heading "Parameters")
31195 (table (% (formatter (asis)))
31196 (entry (% (heading (var "opcode")))
31197 (para "
31198 Specifies a symbolic constant that selects a logical operation.
31199 The following symbols are accepted: "
31200 (code "GL_CLEAR")
31201 ", "
31202 (code "GL_SET")
31203 ", "
31204 (code "GL_COPY")
31205 ", "
31206 (code "GL_COPY_INVERTED")
31207 ", "
31208 (code "GL_NOOP")
31209 ", "
31210 (code "GL_INVERT")
31211 ", "
31212 (code "GL_AND")
31213 ", "
31214 (code "GL_NAND")
31215 ", "
31216 (code "GL_OR")
31217 ", "
31218 (code "GL_NOR")
31219 ", "
31220 (code "GL_XOR")
31221 ", "
31222 (code "GL_EQUIV")
31223 ", "
31224 (code "GL_AND_REVERSE")
31225 ", "
31226 (code "GL_AND_INVERTED")
31227 ", "
31228 (code "GL_OR_REVERSE")
31229 ", and "
31230 (code "GL_OR_INVERTED")
31231 ". The initial value is "
31232 (code "GL_COPY")
31233 ". ")))
31234 (heading "Description")
31235 (para (code "glLogicOp")
31236 " specifies a logical operation that,
31237 when enabled,
31238 is applied between the incoming color index or RGBA color
31239 and the color index or RGBA color at the corresponding location in the
31240 frame buffer.
31241 To enable or disable the logical operation, call "
31242 (code "glEnable")
31243 " and "
31244 (code "glDisable")
31245 "
31246 using the symbolic constant "
31247 (code "GL_COLOR_LOGIC_OP")
31248 " for RGBA mode or "
31249 (code "GL_INDEX_LOGIC_OP")
31250 " for color index mode. The initial value is
31251 disabled for both operations. ")
31252 (para)
31253 (table (% (formatter (asis)))
31254 (entry (% (heading (strong "Opcode")))
31255 (para (strong "Resulting Operation")))
31256 (entry (% (heading (code "GL_CLEAR")))
31257 (para "
31258 0 "))
31259 (entry (% (heading (code "GL_SET")))
31260 (para "
31261 1 "))
31262 (entry (% (heading (code "GL_COPY")))
31263 (para "
31264 s "))
31265 (entry (% (heading (code "GL_COPY_INVERTED")))
31266 (para "
31267 ~s "))
31268 (entry (% (heading (code "GL_NOOP")))
31269 (para "
31270 d "))
31271 (entry (% (heading (code "GL_INVERT")))
31272 (para "
31273 ~d "))
31274 (entry (% (heading (code "GL_AND")))
31275 (para "
31276 s & d "))
31277 (entry (% (heading (code "GL_NAND")))
31278 (para "
31279 ~(s & d) "))
31280 (entry (% (heading (code "GL_OR")))
31281 (para "
31282 s | d "))
31283 (entry (% (heading (code "GL_NOR")))
31284 (para "
31285 ~(s | d) "))
31286 (entry (% (heading (code "GL_XOR")))
31287 (para "
31288 s ^ d "))
31289 (entry (% (heading (code "GL_EQUIV")))
31290 (para "
31291 ~(s ^ d) "))
31292 (entry (% (heading (code "GL_AND_REVERSE")))
31293 (para "
31294 s & ~d "))
31295 (entry (% (heading (code "GL_AND_INVERTED")))
31296 (para "
31297 ~s & d "))
31298 (entry (% (heading (code "GL_OR_REVERSE")))
31299 (para "
31300 s | ~d "))
31301 (entry (% (heading (code "GL_OR_INVERTED")))
31302 (para "
31303 ~s | d ")))
31304 (para (var "opcode")
31305 " is a symbolic constant chosen from the list above.
31306 In the explanation of the logical operations, "
31307 (var "s")
31308 " represents the incoming color index and "
31309 (var "d")
31310 " represents the index in the frame buffer.
31311 Standard C-language operators are used.
31312 As these bitwise operators suggest,
31313 the logical operation is applied independently to each bit pair of the
31314 source and destination indices or colors. ")
31315 (heading "Errors")
31316 (para (code "GL_INVALID_ENUM")
31317 " is generated if "
31318 (var "opcode")
31319 " is not an accepted value. ")
31320 (para (code "GL_INVALID_OPERATION")
31321 " is generated if "
31322 (code "glLogicOp")
31323 "
31324 is executed between the execution of "
31325 (code "glBegin")
31326 "
31327 and the corresponding execution of "
31328 (code "glEnd")
31329 ". ")))
31330
31331 (define-gl-procedure
31332 glMap1
31333 "glMap1"
31334 (funcsynopsis
31335 (funcprototype
31336 (funcdef "void " (function "glMap1f"))
31337 (paramdef "GLenum " (parameter "target"))
31338 (paramdef "GLfloat " (parameter "u1"))
31339 (paramdef "GLfloat " (parameter "u2"))
31340 (paramdef "GLint " (parameter "stride"))
31341 (paramdef "GLint " (parameter "order"))
31342 (paramdef
31343 "const GLfloat * "
31344 (parameter "points"))))
31345 '(*fragment*
31346 (heading "define a one-dimensional evaluator")
31347 (heading "Parameters")
31348 (table (% (formatter (asis)))
31349 (entry (% (heading (var "target")))
31350 (para "
31351 Specifies the kind of values that are generated by the evaluator.
31352 Symbolic constants "
31353 (code "GL_MAP1_VERTEX_3")
31354 ", "
31355 (code "GL_MAP1_VERTEX_4")
31356 ", "
31357 (code "GL_MAP1_INDEX")
31358 ", "
31359 (code "GL_MAP1_COLOR_4")
31360 ", "
31361 (code "GL_MAP1_NORMAL")
31362 ", "
31363 (code "GL_MAP1_TEXTURE_COORD_1")
31364 ", "
31365 (code "GL_MAP1_TEXTURE_COORD_2")
31366 ", "
31367 (code "GL_MAP1_TEXTURE_COORD_3")
31368 ", and "
31369 (code "GL_MAP1_TEXTURE_COORD_4")
31370 " are accepted. "))
31371 (entry (% (heading (var "u1")))
31372 (itemx (var "u2"))
31373 (para "
31374 Specify a linear mapping of "
31375 (math (var "u"))
31376 ",
31377 as presented to "
31378 (code "glEvalCoord1")
31379 ",
31380 to "
31381 (math (var "u") "^")
31382 ",
31383 the variable that is evaluated by the equations specified by this command. "))
31384 (entry (% (heading (var "stride")))
31385 (para "
31386 Specifies the number of floats or doubles between
31387 the beginning of one control point and the beginning of the next one
31388 in the data structure referenced in "
31389 (var "points")
31390 ".
31391 This allows control points to be embedded in arbitrary data structures.
31392 The only constraint is that the values for a particular control point
31393 must occupy contiguous memory locations. "))
31394 (entry (% (heading (var "order")))
31395 (para "
31396 Specifies the number of control points.
31397 Must be positive. "))
31398 (entry (% (heading (var "points")))
31399 (para "
31400 Specifies a pointer to the array of control points. ")))
31401 (heading "Description")
31402 (para "
31403 Evaluators provide a way to use polynomial or rational polynomial mapping
31404 to produce vertices,
31405 normals,
31406 texture coordinates,
31407 and colors.
31408 The values produced by an evaluator are sent to further stages
31409 of GL processing just as if they had been presented using "
31410 (code "glVertex")
31411 ", "
31412 (code "glNormal")
31413 ", "
31414 (code "glTexCoord")
31415 ", and "
31416 (code "glColor")
31417 " commands,
31418 except that the generated values do not update the current normal,
31419 texture coordinates,
31420 or color. ")
31421 (para "
31422 All polynomial or rational polynomial splines of any degree
31423 (up to the maximum degree supported by the GL implementation)
31424 can be described using evaluators.
31425 These include almost all splines used in computer graphics: B-splines,
31426 Bezier curves, Hermite splines, and so on. ")
31427 (para "
31428 Evaluators define curves based on Bernstein polynomials.
31429 Define "
31430 (math (var "p")
31431 "\u2061"
31432 "("
31433 (var "u")
31434 "^"
31435 ","
31436 ")")
31437 "
31438 as ")
31439 (para (math (var "p")
31440 "\u2061"
31441 "("
31442 (var "u")
31443 "^"
31444 ","
31445 ")"
31446 "="
31447 "Σ"
31448 (var "i")
31449 "="
31450 "0"
31451 (var "n")
31452 (var "B")
31453 "_"
31454 (var "i")
31455 ","
31456 "^"
31457 (var "n")
31458 "\u2061"
31459 "("
31460 (var "u")
31461 "^"
31462 ","
31463 ")"
31464 "\u2062"
31465 (var "R")
31466 "_"
31467 (var "i")))
31468 (para)
31469 (para "
31470 where "
31471 (math (var "R") "_" (var "i"))
31472 "
31473 is a control point and "
31474 (math (var "B")
31475 "_"
31476 (var "i")
31477 ","
31478 "^"
31479 (var "n")
31480 "\u2061"
31481 "("
31482 (var "u")
31483 "^"
31484 ","
31485 ")")
31486 "
31487 is the "
31488 (math (var "i"))
31489 "th
31490 Bernstein polynomial of degree "
31491 (math (var "n"))
31492 "
31493 ("
31494 (var "order")
31495 " = "
31496 (math (var "n") "+" "1")
31497 "): ")
31498 (para (math (var "B")
31499 "_"
31500 (var "i")
31501 ","
31502 "^"
31503 (var "n")
31504 "\u2061"
31505 "("
31506 (var "u")
31507 "^"
31508 ","
31509 ")"
31510 "="
31511 "("
31512 "("
31513 (var "n")
31514 ")"
31515 ", "
31516 "("
31517 (var "i")
31518 ")"
31519 ","
31520 ","
31521 ")"
31522 "\u2062"
31523 (var "u")
31524 "^"
31525 ","
31526 "^"
31527 (var "i")
31528 "\u2062"
31529 "("
31530 "1"
31531 "-"
31532 (var "u")
31533 "^"
31534 ","
31535 ")"
31536 "^"
31537 (var "n")
31538 "-"
31539 (var "i")
31540 ","
31541 ","))
31542 (para "
31543 Recall that ")
31544 (para (math "0" "^" "0" "==" "1")
31545 "
31546 and "
31547 (math "("
31548 "("
31549 (var "n")
31550 ")"
31551 ", "
31552 "("
31553 "0"
31554 ")"
31555 ","
31556 ","
31557 ")"
31558 "=="
31559 "1"))
31560 (para (code "glMap1")
31561 " is used to define the basis and to specify what kind of values
31562 are produced.
31563 Once defined,
31564 a map can be enabled and disabled by calling "
31565 (code "glEnable")
31566 " and "
31567 (code "glDisable")
31568 "
31569 with the map name, one of the nine predefined values for "
31570 (var "target")
31571 "
31572 described below. "
31573 (code "glEvalCoord1")
31574 " evaluates the one-dimensional maps that are enabled.
31575 When "
31576 (code "glEvalCoord1")
31577 " presents a value "
31578 (math (var "u"))
31579 ",
31580 the Bernstein functions are evaluated using "
31581 (math (var "u") "^")
31582 ",
31583 where "
31584 (math (var "u")
31585 "^"
31586 "="
31587 (var "u")
31588 "-"
31589 (var "u1")
31590 ","
31591 "/"
31592 (var "u2")
31593 "-"
31594 (var "u1")
31595 ","))
31596 (para (var "target")
31597 " is a symbolic constant that indicates what kind of control points
31598 are provided in "
31599 (var "points")
31600 ",
31601 and what output is generated when the map is evaluated.
31602 It can assume one of nine predefined values: ")
31603 (table (% (formatter (asis)))
31604 (entry (% (heading (code "GL_MAP1_VERTEX_3")))
31605 (para "
31606 Each control point is three floating-point values representing "
31607 (math (var "x"))
31608 ", "
31609 (math (var "y"))
31610 ",
31611 and "
31612 (math (var "z"))
31613 ".
31614 Internal "
31615 (code "glVertex3")
31616 " commands are generated when the map is evaluated. "))
31617 (entry (% (heading (code "GL_MAP1_VERTEX_4")))
31618 (para "
31619 Each control point is four floating-point values representing "
31620 (math (var "x"))
31621 ", "
31622 (math (var "y"))
31623 ", "
31624 (math (var "z"))
31625 ",
31626 and "
31627 (math (var "w"))
31628 ".
31629 Internal "
31630 (code "glVertex4")
31631 " commands are generated when the map is evaluated. "))
31632 (entry (% (heading (code "GL_MAP1_INDEX")))
31633 (para "
31634 Each control point is a single floating-point value representing a color index.
31635 Internal "
31636 (code "glIndex")
31637 " commands are generated when the map is evaluated
31638 but the current index is not updated with the value of these "
31639 (code "glIndex")
31640 "
31641 commands. "))
31642 (entry (% (heading (code "GL_MAP1_COLOR_4")))
31643 (para "
31644 Each control point is four floating-point values representing
31645 red, green, blue, and alpha.
31646 Internal "
31647 (code "glColor4")
31648 " commands are generated when the map is
31649 evaluated but the current color is not updated with the value of these "
31650 (code "glColor4")
31651 " commands. "))
31652 (entry (% (heading (code "GL_MAP1_NORMAL")))
31653 (para "
31654 Each control point is three floating-point values representing
31655 the "
31656 (math (var "x"))
31657 ", "
31658 (math (var "y"))
31659 ",
31660 and "
31661 (math (var "z"))
31662 "
31663 components of a normal vector.
31664 Internal "
31665 (code "glNormal")
31666 " commands are generated when the map is
31667 evaluated but the current normal is not updated with the value of
31668 these "
31669 (code "glNormal")
31670 " commands. "))
31671 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_1")))
31672 (para "
31673 Each control point is a single floating-point value representing
31674 the "
31675 (math (var "s"))
31676 "
31677 texture coordinate.
31678 Internal "
31679 (code "glTexCoord1")
31680 " commands are generated when the map is
31681 evaluated but the current texture coordinates are not updated with the value
31682 of these "
31683 (code "glTexCoord")
31684 " commands. "))
31685 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_2")))
31686 (para "
31687 Each control point is two floating-point values representing
31688 the "
31689 (math (var "s"))
31690 "
31691 and "
31692 (math (var "t"))
31693 "
31694 texture coordinates.
31695 Internal "
31696 (code "glTexCoord2")
31697 " commands are generated when the map is
31698 evaluated but the current texture coordinates are not updated with the value
31699 of these "
31700 (code "glTexCoord")
31701 " commands. "))
31702 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_3")))
31703 (para "
31704 Each control point is three floating-point values representing
31705 the "
31706 (math (var "s"))
31707 ", "
31708 (math (var "t"))
31709 ",
31710 and "
31711 (math (var "r"))
31712 "
31713 texture coordinates.
31714 Internal "
31715 (code "glTexCoord3")
31716 " commands are generated when the map is
31717 evaluated but the current texture coordinates are not updated with the value
31718 of these "
31719 (code "glTexCoord")
31720 " commands. "))
31721 (entry (% (heading (code "GL_MAP1_TEXTURE_COORD_4")))
31722 (para "
31723 Each control point is four floating-point values representing
31724 the "
31725 (math (var "s"))
31726 ", "
31727 (math (var "t"))
31728 ", "
31729 (math (var "r"))
31730 ",
31731 and "
31732 (math (var "q"))
31733 "
31734 texture coordinates.
31735 Internal "
31736 (code "glTexCoord4")
31737 " commands are generated when the map is evaluated but
31738 the current texture coordinates are not updated with the value
31739 of these "
31740 (code "glTexCoord")
31741 " commands. ")))
31742 (para (var "stride")
31743 ", "
31744 (var "order")
31745 ", and "
31746 (var "points")
31747 " define the array addressing for accessing the control points. "
31748 (var "points")
31749 " is the location of the first control point,
31750 which occupies one, two, three, or four contiguous memory locations,
31751 depending on which map is being defined. "
31752 (var "order")
31753 " is the number of control points in the array. "
31754 (var "stride")
31755 " specifies how many float or double locations to advance the internal
31756 memory pointer to reach the next control point. ")
31757 (heading "Errors")
31758 (para (code "GL_INVALID_ENUM")
31759 " is generated if "
31760 (var "target")
31761 " is not an accepted value. ")
31762 (para (code "GL_INVALID_VALUE")
31763 " is generated if "
31764 (var "u1")
31765 " is equal to "
31766 (var "u2")
31767 ". ")
31768 (para (code "GL_INVALID_VALUE")
31769 " is generated if "
31770 (var "stride")
31771 " is less than the number
31772 of values in a control point. ")
31773 (para (code "GL_INVALID_VALUE")
31774 " is generated if "
31775 (var "order")
31776 " is less than 1 or
31777 greater than the return value of "
31778 (code "GL_MAX_EVAL_ORDER")
31779 ". ")
31780 (para (code "GL_INVALID_OPERATION")
31781 " is generated if "
31782 (code "glMap1")
31783 "
31784 is executed between the execution of "
31785 (code "glBegin")
31786 "
31787 and the corresponding execution of "
31788 (code "glEnd")
31789 ". ")
31790 (para (code "GL_INVALID_OPERATION")
31791 " is generated if "
31792 (code "glMap1")
31793 " is called and the value
31794 of "
31795 (code "GL_ACTIVE_TEXTURE")
31796 " is not "
31797 (code "GL_TEXTURE0")
31798 ". ")))
31799
31800 (define-gl-procedure
31801 glMap2
31802 "glMap2"
31803 (funcsynopsis
31804 (funcprototype
31805 (funcdef "void " (function "glMap2f"))
31806 (paramdef "GLenum " (parameter "target"))
31807 (paramdef "GLfloat " (parameter "u1"))
31808 (paramdef "GLfloat " (parameter "u2"))
31809 (paramdef "GLint " (parameter "ustride"))
31810 (paramdef "GLint " (parameter "uorder"))
31811 (paramdef "GLfloat " (parameter "v1"))
31812 (paramdef "GLfloat " (parameter "v2"))
31813 (paramdef "GLint " (parameter "vstride"))
31814 (paramdef "GLint " (parameter "vorder"))
31815 (paramdef
31816 "const GLfloat * "
31817 (parameter "points"))))
31818 '(*fragment*
31819 (heading "define a two-dimensional evaluator")
31820 (heading "Parameters")
31821 (table (% (formatter (asis)))
31822 (entry (% (heading (var "target")))
31823 (para "
31824 Specifies the kind of values that are generated by the evaluator.
31825 Symbolic constants "
31826 (code "GL_MAP2_VERTEX_3")
31827 ", "
31828 (code "GL_MAP2_VERTEX_4")
31829 ", "
31830 (code "GL_MAP2_INDEX")
31831 ", "
31832 (code "GL_MAP2_COLOR_4")
31833 ", "
31834 (code "GL_MAP2_NORMAL")
31835 ", "
31836 (code "GL_MAP2_TEXTURE_COORD_1")
31837 ", "
31838 (code "GL_MAP2_TEXTURE_COORD_2")
31839 ", "
31840 (code "GL_MAP2_TEXTURE_COORD_3")
31841 ", and "
31842 (code "GL_MAP2_TEXTURE_COORD_4")
31843 " are accepted. "))
31844 (entry (% (heading (var "u1")))
31845 (itemx (var "u2"))
31846 (para "
31847 Specify a linear mapping of "
31848 (math (var "u"))
31849 ",
31850 as presented to "
31851 (code "glEvalCoord2")
31852 ",
31853 to "
31854 (math (var "u") "^")
31855 ",
31856 one of the two variables that are evaluated by the equations specified
31857 by this command. Initially, "
31858 (var "u1")
31859 " is 0 and "
31860 (var "u2")
31861 " is 1. "))
31862 (entry (% (heading (var "ustride")))
31863 (para "
31864 Specifies the number of floats or doubles between
31865 the beginning of control point "
31866 (math (var "R") "_" (var "ij"))
31867 "
31868 and the beginning of control point "
31869 (math (var "R")
31870 "_"
31871 "("
31872 (var "i")
31873 "+"
31874 "1"
31875 ","
31876 ")"
31877 "\u2062"
31878 (var "j")
31879 ",")
31880 ",
31881 where "
31882 (math (var "i"))
31883 "
31884 and "
31885 (math (var "j"))
31886 "
31887 are the "
31888 (math (var "u"))
31889 "
31890 and "
31891 (math (var "v"))
31892 "
31893 control point indices, respectively.
31894 This allows control points to be embedded in arbitrary data structures.
31895 The only constraint is that the values for a particular control point
31896 must occupy contiguous memory locations. The initial value of "
31897 (var "ustride")
31898 " is 0. "))
31899 (entry (% (heading (var "uorder")))
31900 (para "
31901 Specifies the dimension of the control point array in the "
31902 (math (var "u"))
31903 "
31904 axis.
31905 Must be positive. The initial value is 1. "))
31906 (entry (% (heading (var "v1")))
31907 (itemx (var "v2"))
31908 (para "
31909 Specify a linear mapping of "
31910 (math (var "v"))
31911 ",
31912 as presented to "
31913 (code "glEvalCoord2")
31914 ",
31915 to "
31916 (math (var "v") "^")
31917 ",
31918 one of the two variables that are evaluated by the equations specified
31919 by this command. Initially, "
31920 (var "v1")
31921 " is 0 and "
31922 (var "v2")
31923 " is 1. "))
31924 (entry (% (heading (var "vstride")))
31925 (para "
31926 Specifies the number of floats or doubles between
31927 the beginning of control point "
31928 (math (var "R") "_" (var "ij"))
31929 "
31930 and the beginning of control point "
31931 (math (var "R")
31932 "_"
31933 (var "i")
31934 "\u2061"
31935 "("
31936 (var "j")
31937 "+"
31938 "1"
31939 ","
31940 ")"
31941 ",")
31942 ",
31943 where "
31944 (math (var "i"))
31945 "
31946 and "
31947 (math (var "j"))
31948 "
31949 are the "
31950 (math (var "u"))
31951 "
31952 and "
31953 (math (var "v"))
31954 "
31955 control point indices, respectively.
31956 This allows control points to be embedded in arbitrary data structures.
31957 The only constraint is that the values for a particular control point
31958 must occupy contiguous memory locations. The initial value of "
31959 (var "vstride")
31960 " is 0. "))
31961 (entry (% (heading (var "vorder")))
31962 (para "
31963 Specifies the dimension of the control point array in the "
31964 (math (var "v"))
31965 "
31966 axis.
31967 Must be positive. The initial value is 1. "))
31968 (entry (% (heading (var "points")))
31969 (para "
31970 Specifies a pointer to the array of control points. ")))
31971 (heading "Description")
31972 (para "
31973 Evaluators provide a way to use polynomial or rational polynomial mapping
31974 to produce vertices,
31975 normals,
31976 texture coordinates,
31977 and colors.
31978 The values produced by an evaluator are sent on to further stages
31979 of GL processing just as if they had been presented using "
31980 (code "glVertex")
31981 ", "
31982 (code "glNormal")
31983 ", "
31984 (code "glTexCoord")
31985 ", and "
31986 (code "glColor")
31987 " commands,
31988 except that the generated values do not update the current normal,
31989 texture coordinates,
31990 or color. ")
31991 (para "
31992 All polynomial or rational polynomial splines of any degree
31993 (up to the maximum degree supported by the GL implementation)
31994 can be described using evaluators.
31995 These include almost all surfaces used in computer graphics,
31996 including B-spline surfaces,
31997 NURBS surfaces,
31998 Bezier surfaces, and so on. ")
31999 (para "
32000 Evaluators define surfaces based on bivariate Bernstein polynomials.
32001 Define "
32002 (math (var "p")
32003 "\u2061"
32004 "("
32005 (var "u")
32006 "^"
32007 ","
32008 (var "v")
32009 "^"
32010 ")")
32011 "
32012 as ")
32013 (para (math (var "p")
32014 "\u2061"
32015 "("
32016 (var "u")
32017 "^"
32018 ","
32019 (var "v")
32020 "^"
32021 ")"
32022 "="
32023 "Σ"
32024 (var "i")
32025 "="
32026 "0"
32027 (var "n")
32028 "Σ"
32029 (var "j")
32030 "="
32031 "0"
32032 (var "m")
32033 (var "B")
32034 "_"
32035 (var "i")
32036 ","
32037 "^"
32038 (var "n")
32039 "\u2061"
32040 "("
32041 (var "u")
32042 "^"
32043 ","
32044 ")"
32045 "\u2062"
32046 (var "B")
32047 "_"
32048 (var "j")
32049 ","
32050 "^"
32051 (var "m")
32052 "\u2061"
32053 "("
32054 (var "v")
32055 "^"
32056 ","
32057 ")"
32058 "\u2062"
32059 (var "R")
32060 "_"
32061 (var "ij")))
32062 (para)
32063 (para "
32064 where "
32065 (math (var "R") "_" (var "ij"))
32066 "
32067 is a control point, "
32068 (math (var "B")
32069 "_"
32070 (var "i")
32071 ","
32072 "^"
32073 (var "n")
32074 "\u2061"
32075 "("
32076 (var "u")
32077 "^"
32078 ","
32079 ")")
32080 "
32081 is the "
32082 (math (var "i"))
32083 "th
32084 Bernstein polynomial of degree "
32085 (math (var "n"))
32086 "
32087 ("
32088 (var "uorder")
32089 " = "
32090 (math (var "n") "+" "1")
32091 ") ")
32092 (para (math (var "B")
32093 "_"
32094 (var "i")
32095 ","
32096 "^"
32097 (var "n")
32098 "\u2061"
32099 "("
32100 (var "u")
32101 "^"
32102 ","
32103 ")"
32104 "="
32105 "("
32106 "("
32107 (var "n")
32108 ")"
32109 ", "
32110 "("
32111 (var "i")
32112 ")"
32113 ","
32114 ","
32115 ")"
32116 "\u2062"
32117 (var "u")
32118 "^"
32119 ","
32120 "^"
32121 (var "i")
32122 "\u2062"
32123 "("
32124 "1"
32125 "-"
32126 (var "u")
32127 "^"
32128 ","
32129 ")"
32130 "^"
32131 (var "n")
32132 "-"
32133 (var "i")
32134 ","
32135 ","))
32136 (para "
32137 and "
32138 (math (var "B")
32139 "_"
32140 (var "j")
32141 ","
32142 "^"
32143 (var "m")
32144 "\u2061"
32145 "("
32146 (var "v")
32147 "^"
32148 ","
32149 ")")
32150 "
32151 is the "
32152 (math (var "j"))
32153 "th
32154 Bernstein polynomial of degree "
32155 (math (var "m"))
32156 "
32157 ("
32158 (var "vorder")
32159 " = "
32160 (math (var "m") "+" "1")
32161 ") ")
32162 (para (math (var "B")
32163 "_"
32164 (var "j")
32165 ","
32166 "^"
32167 (var "m")
32168 "\u2061"
32169 "("
32170 (var "v")
32171 "^"
32172 ","
32173 ")"
32174 "="
32175 "("
32176 "("
32177 (var "m")
32178 ")"
32179 ", "
32180 "("
32181 (var "j")
32182 ")"
32183 ","
32184 ","
32185 ")"
32186 "\u2062"
32187 (var "v")
32188 "^"
32189 ","
32190 "^"
32191 (var "j")
32192 "\u2062"
32193 "("
32194 "1"
32195 "-"
32196 (var "v")
32197 "^"
32198 ","
32199 ")"
32200 "^"
32201 (var "m")
32202 "-"
32203 (var "j")
32204 ","
32205 ","))
32206 (para "
32207 Recall that "
32208 (math "0" "^" "0" "==" "1")
32209 "
32210 and "
32211 (math "("
32212 "("
32213 (var "n")
32214 ")"
32215 ", "
32216 "("
32217 "0"
32218 ")"
32219 ","
32220 ","
32221 ")"
32222 "=="
32223 "1"))
32224 (para (code "glMap2")
32225 " is used to define the basis and to specify what kind of values
32226 are produced.
32227 Once defined,
32228 a map can be enabled and disabled by calling "
32229 (code "glEnable")
32230 " and "
32231 (code "glDisable")
32232 "
32233 with the map name, one of the nine predefined values for "
32234 (var "target")
32235 ",
32236 described below.
32237 When "
32238 (code "glEvalCoord2")
32239 " presents values "
32240 (math (var "u"))
32241 "
32242 and "
32243 (math (var "v"))
32244 ",
32245 the bivariate Bernstein polynomials are evaluated using "
32246 (math (var "u") "^")
32247 "
32248 and "
32249 (math (var "v") "^")
32250 ",
32251 where ")
32252 (para (math (var "u")
32253 "^"
32254 "="
32255 (var "u")
32256 "-"
32257 (var "u1")
32258 ","
32259 "/"
32260 (var "u2")
32261 "-"
32262 (var "u1")
32263 ","))
32264 (para (math (var "v")
32265 "^"
32266 "="
32267 (var "v")
32268 "-"
32269 (var "v1")
32270 ","
32271 "/"
32272 (var "v2")
32273 "-"
32274 (var "v1")
32275 ","))
32276 (para (var "target")
32277 " is a symbolic constant that indicates what kind of control points
32278 are provided in "
32279 (var "points")
32280 ",
32281 and what output is generated when the map is evaluated.
32282 It can assume one of nine predefined values: ")
32283 (table (% (formatter (asis)))
32284 (entry (% (heading (code "GL_MAP2_VERTEX_3")))
32285 (para "
32286 Each control point is three floating-point values representing "
32287 (math (var "x"))
32288 ", "
32289 (math (var "y"))
32290 ",
32291 and "
32292 (math (var "z"))
32293 ".
32294 Internal "
32295 (code "glVertex3")
32296 " commands are generated when the map is evaluated. "))
32297 (entry (% (heading (code "GL_MAP2_VERTEX_4")))
32298 (para "
32299 Each control point is four floating-point values representing "
32300 (math (var "x"))
32301 ", "
32302 (math (var "y"))
32303 ", "
32304 (math (var "z"))
32305 ",
32306 and "
32307 (math (var "w"))
32308 ".
32309 Internal "
32310 (code "glVertex4")
32311 " commands are generated when the map is evaluated. "))
32312 (entry (% (heading (code "GL_MAP2_INDEX")))
32313 (para "
32314 Each control point is a single floating-point value representing a color index.
32315 Internal "
32316 (code "glIndex")
32317 " commands are generated when the map is evaluated
32318 but the current index is not updated with the value of these "
32319 (code "glIndex")
32320 " commands. "))
32321 (entry (% (heading (code "GL_MAP2_COLOR_4")))
32322 (para "
32323 Each control point is four floating-point values representing
32324 red, green, blue, and alpha.
32325 Internal "
32326 (code "glColor4")
32327 " commands are generated when the map is
32328 evaluated but the current color is not updated with the value of
32329 these "
32330 (code "glColor4")
32331 " commands. "))
32332 (entry (% (heading (code "GL_MAP2_NORMAL")))
32333 (para "
32334 Each control point is three floating-point values representing
32335 the "
32336 (math (var "x"))
32337 ", "
32338 (math (var "y"))
32339 ",
32340 and "
32341 (math (var "z"))
32342 "
32343 components of a normal vector.
32344 Internal "
32345 (code "glNormal")
32346 " commands are generated when the map is
32347 evaluated but the current normal is not updated with the value of
32348 these "
32349 (code "glNormal")
32350 " commands. "))
32351 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_1")))
32352 (para "
32353 Each control point is a single floating-point value representing
32354 the "
32355 (math (var "s"))
32356 "
32357 texture coordinate.
32358 Internal "
32359 (code "glTexCoord1")
32360 " commands are generated when the map is evaluated but
32361 the current texture coordinates are not updated with the value
32362 of these "
32363 (code "glTexCoord")
32364 " commands. "))
32365 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_2")))
32366 (para "
32367 Each control point is two floating-point values representing
32368 the "
32369 (math (var "s"))
32370 "
32371 and "
32372 (math (var "t"))
32373 "
32374 texture coordinates.
32375 Internal "
32376 (code "glTexCoord2")
32377 " commands are generated when the map is evaluated but
32378 the current texture coordinates are not updated with the value
32379 of these "
32380 (code "glTexCoord")
32381 " commands. "))
32382 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_3")))
32383 (para "
32384 Each control point is three floating-point values representing
32385 the "
32386 (math (var "s"))
32387 ", "
32388 (math (var "t"))
32389 ",
32390 and "
32391 (math (var "r"))
32392 "
32393 texture coordinates.
32394 Internal "
32395 (code "glTexCoord3")
32396 " commands are generated when the map is
32397 evaluated but the current texture coordinates are not updated with the value
32398 of these "
32399 (code "glTexCoord")
32400 " commands. "))
32401 (entry (% (heading (code "GL_MAP2_TEXTURE_COORD_4")))
32402 (para "
32403 Each control point is four floating-point values representing
32404 the "
32405 (math (var "s"))
32406 ", "
32407 (math (var "t"))
32408 ", "
32409 (math (var "r"))
32410 ",
32411 and "
32412 (math (var "q"))
32413 "
32414 texture coordinates.
32415 Internal "
32416 (code "glTexCoord4")
32417 " commands are generated when the map is evaluated but the current texture coordinates are not updated with the value
32418 of these "
32419 (code "glTexCoord")
32420 " commands. ")))
32421 (para (var "ustride")
32422 ", "
32423 (var "uorder")
32424 ", "
32425 (var "vstride")
32426 ", "
32427 (var "vorder")
32428 ", and "
32429 (var "points")
32430 " define the array addressing for accessing the control points. "
32431 (var "points")
32432 " is the location of the first control point,
32433 which occupies one, two, three, or four contiguous memory locations,
32434 depending on which map is being defined.
32435 There are "
32436 (math (var "uorder") "×" (var "vorder"))
32437 "
32438 control points in the array. "
32439 (var "ustride")
32440 " specifies how many float or double locations are skipped to advance
32441 the internal memory pointer from control point "
32442 (math (var "R")
32443 "_"
32444 (var "i")
32445 "\u2062"
32446 (var "j")
32447 ",")
32448 "
32449 to control point "
32450 (math (var "R")
32451 "_"
32452 "("
32453 (var "i")
32454 "+"
32455 "1"
32456 ","
32457 ")"
32458 "\u2062"
32459 (var "j")
32460 ",")
32461 ". "
32462 (var "vstride")
32463 " specifies how many float or double locations are skipped to advance
32464 the internal memory pointer from control point "
32465 (math (var "R")
32466 "_"
32467 (var "i")
32468 "\u2062"
32469 (var "j")
32470 ",")
32471 "
32472 to control point "
32473 (math (var "R")
32474 "_"
32475 (var "i")
32476 "\u2061"
32477 "("
32478 (var "j")
32479 "+"
32480 "1"
32481 ","
32482 ")"
32483 ",")
32484 ". ")
32485 (heading "Errors")
32486 (para (code "GL_INVALID_ENUM")
32487 " is generated if "
32488 (var "target")
32489 " is not an accepted value. ")
32490 (para (code "GL_INVALID_VALUE")
32491 " is generated if "
32492 (var "u1")
32493 " is equal to "
32494 (var "u2")
32495 ",
32496 or if "
32497 (var "v1")
32498 " is equal to "
32499 (var "v2")
32500 ". ")
32501 (para (code "GL_INVALID_VALUE")
32502 " is generated if either "
32503 (var "ustride")
32504 " or "
32505 (var "vstride")
32506 "
32507 is less than the number of values in a control point. ")
32508 (para (code "GL_INVALID_VALUE")
32509 " is generated if either "
32510 (var "uorder")
32511 " or "
32512 (var "vorder")
32513 "
32514 is less than 1 or greater than the return value of "
32515 (code "GL_MAX_EVAL_ORDER")
32516 ". ")
32517 (para (code "GL_INVALID_OPERATION")
32518 " is generated if "
32519 (code "glMap2")
32520 "
32521 is executed between the execution of "
32522 (code "glBegin")
32523 "
32524 and the corresponding execution of "
32525 (code "glEnd")
32526 ". ")
32527 (para (code "GL_INVALID_OPERATION")
32528 " is generated if "
32529 (code "glMap2")
32530 " is called and the value
32531 of "
32532 (code "GL_ACTIVE_TEXTURE")
32533 " is not "
32534 (code "GL_TEXTURE0")
32535 ". ")))
32536
32537 (define-gl-procedure
32538 glMapBuffer
32539 "glMapBuffer"
32540 (funcsynopsis
32541 (funcprototype
32542 (funcdef "void * " (function "glMapBuffer"))
32543 (paramdef "GLenum " (parameter "target"))
32544 (paramdef "GLenum " (parameter "access"))))
32545 '(*fragment*
32546 (heading "map a buffer object's data store")
32547 (heading "Parameters")
32548 (table (% (formatter (asis)))
32549 (entry (% (heading (var "target")))
32550 (para "
32551 Specifies the target buffer object being mapped.
32552 The symbolic constant must be "
32553 (code "GL_ARRAY_BUFFER")
32554 ", "
32555 (code "GL_ELEMENT_ARRAY_BUFFER")
32556 ", "
32557 (code "GL_PIXEL_PACK_BUFFER")
32558 ", or "
32559 (code "GL_PIXEL_UNPACK_BUFFER")
32560 ". "))
32561 (entry (% (heading (var "access")))
32562 (para "
32563 Specifies the access policy, indicating whether it will be possible to read from, write to,
32564 or both read from and write to the buffer object's mapped data store. The symbolic constant must be "
32565 (code "GL_READ_ONLY")
32566 ", "
32567 (code "GL_WRITE_ONLY")
32568 ", or "
32569 (code "GL_READ_WRITE")
32570 ". ")))
32571 (heading "Description")
32572 (para (code "glMapBuffer")
32573 " maps to the client's address space the entire data store of the buffer object
32574 currently bound to "
32575 (var "target")
32576 ". The data can then be directly read and/or written relative to
32577 the returned pointer, depending on the specified "
32578 (var "access")
32579 " policy. If the GL is unable to
32580 map the buffer object's data store, "
32581 (code "glMapBuffer")
32582 " generates an error and returns "
32583 (code "NULL")
32584 ". This may occur for system-specific reasons, such as low virtual memory availability. ")
32585 (para "
32586 If a mapped data store is accessed in a way inconsistent with the specified "
32587 (var "access")
32588 " policy,
32589 no error is generated, but performance may be negatively impacted and system errors, including program
32590 termination, may result. Unlike the "
32591 (var "usage")
32592 " parameter of "
32593 (code "glBufferData")
32594 ", "
32595 (var "access")
32596 " is not a hint, and does in fact constrain the usage of the mapped data store on
32597 some GL implementations. In order to achieve the highest performance available, a buffer object's data store
32598 should be used in ways consistent with both its specified "
32599 (var "usage")
32600 " and "
32601 (var "access")
32602 " parameters. ")
32603 (para "
32604 A mapped data store must be unmapped with "
32605 (code "glUnmapBuffer")
32606 " before its buffer object is used.
32607 Otherwise an error will be generated by any GL command that attempts to dereference the buffer object's data store.
32608 When a data store is unmapped, the pointer to its data store becomes invalid. "
32609 (code "glUnmapBuffer")
32610 "
32611 returns "
32612 (code "GL_TRUE")
32613 " unless the data store contents have become corrupt during the time
32614 the data store was mapped. This can occur for system-specific reasons that affect the availability of graphics
32615 memory, such as screen mode changes. In such situations, "
32616 (code "GL_FALSE")
32617 " is returned and the
32618 data store contents are undefined. An application must detect this rare condition and reinitialize the data store. ")
32619 (para "
32620 A buffer object's mapped data store is automatically unmapped when the buffer object is deleted or its data store
32621 is recreated with "
32622 (code "glBufferData")
32623 ". ")
32624 (heading "Errors")
32625 (para (code "GL_INVALID_ENUM")
32626 " is generated if "
32627 (var "target")
32628 " is not "
32629 (code "GL_ARRAY_BUFFER")
32630 ", "
32631 (code "GL_ELEMENT_ARRAY_BUFFER")
32632 ", "
32633 (code "GL_PIXEL_PACK_BUFFER")
32634 ", or "
32635 (code "GL_PIXEL_UNPACK_BUFFER")
32636 ". ")
32637 (para (code "GL_INVALID_ENUM")
32638 " is generated if "
32639 (var "access")
32640 " is not "
32641 (code "GL_READ_ONLY")
32642 ", "
32643 (code "GL_WRITE_ONLY")
32644 ", or "
32645 (code "GL_READ_WRITE")
32646 ". ")
32647 (para (code "GL_OUT_OF_MEMORY")
32648 " is generated when "
32649 (code "glMapBuffer")
32650 " is executed
32651 if the GL is unable to map the buffer object's data store. This may occur for a variety of system-specific
32652 reasons, such as the absence of sufficient remaining virtual memory. ")
32653 (para (code "GL_INVALID_OPERATION")
32654 " is generated if the reserved buffer object name 0 is bound to "
32655 (var "target")
32656 ". ")
32657 (para (code "GL_INVALID_OPERATION")
32658 " is generated if "
32659 (code "glMapBuffer")
32660 " is executed for
32661 a buffer object whose data store is already mapped. ")
32662 (para (code "GL_INVALID_OPERATION")
32663 " is generated if "
32664 (code "glUnmapBuffer")
32665 " is executed for
32666 a buffer object whose data store is not currently mapped. ")
32667 (para (code "GL_INVALID_OPERATION")
32668 " is generated if "
32669 (code "glMapBuffer")
32670 " or "
32671 (code "glUnmapBuffer")
32672 " is executed
32673 between the execution of "
32674 (code "glBegin")
32675 " and the corresponding
32676 execution of "
32677 (code "glEnd")
32678 ". ")))
32679
32680 (define-gl-procedure
32681 glMapGrid
32682 "glMapGrid"
32683 (funcsynopsis
32684 (funcprototype
32685 (funcdef "void " (function "glMapGrid1d"))
32686 (paramdef "GLint " (parameter "un"))
32687 (paramdef "GLdouble " (parameter "u1"))
32688 (paramdef "GLdouble " (parameter "u2"))))
32689 '(*fragment*
32690 (heading "define a one- or two-dimensional mesh")
32691 (heading "Parameters")
32692 (table (% (formatter (asis)))
32693 (entry (% (heading (var "un")))
32694 (para "
32695 Specifies the number of partitions in the grid range interval
32696 ["
32697 (var "u1")
32698 ", "
32699 (var "u2")
32700 "].
32701 Must be positive. "))
32702 (entry (% (heading (var "u1")))
32703 (itemx (var "u2"))
32704 (para "
32705 Specify the mappings for integer grid domain values "
32706 (math (var "i") "=" "0")
32707 "
32708 and "
32709 (math (var "i") "=" (var "un"))
32710 ". "))
32711 (entry (% (heading (var "vn")))
32712 (para "
32713 Specifies the number of partitions in the grid range interval
32714 ["
32715 (var "v1")
32716 ", "
32717 (var "v2")
32718 "]
32719 ("
32720 (code "glMapGrid2")
32721 " only). "))
32722 (entry (% (heading (var "v1")))
32723 (itemx (var "v2"))
32724 (para "
32725 Specify the mappings for integer grid domain values "
32726 (math (var "j") "=" "0")
32727 "
32728 and "
32729 (math (var "j") "=" (var "vn"))
32730 "
32731 ("
32732 (code "glMapGrid2")
32733 " only). ")))
32734 (heading "Description")
32735 (para (code "glMapGrid")
32736 " and "
32737 (code "glEvalMesh")
32738 " are used together to efficiently
32739 generate and evaluate a series of evenly-spaced map domain values. "
32740 (code "glEvalMesh")
32741 " steps through the integer domain
32742 of a one- or two-dimensional grid,
32743 whose range is the domain of the evaluation maps specified by "
32744 (code "glMap1")
32745 " and "
32746 (code "glMap2")
32747 ". ")
32748 (para (code "glMapGrid1")
32749 " and "
32750 (code "glMapGrid2")
32751 " specify the linear grid mappings
32752 between the "
32753 (math (var "i"))
32754 "
32755 (or "
32756 (math (var "i"))
32757 "
32758 and "
32759 (math (var "j"))
32760 ")
32761 integer grid coordinates,
32762 to the "
32763 (math (var "u"))
32764 "
32765 (or "
32766 (math (var "u"))
32767 "
32768 and "
32769 (math (var "v"))
32770 ")
32771 floating-point evaluation map coordinates.
32772 See "
32773 (code "glMap1")
32774 " and "
32775 (code "glMap2")
32776 " for details of how "
32777 (math (var "u"))
32778 "
32779 and "
32780 (math (var "v"))
32781 "
32782 coordinates
32783 are evaluated. ")
32784 (para (code "glMapGrid1")
32785 " specifies a single linear mapping
32786 such that integer grid coordinate 0 maps exactly to "
32787 (var "u1")
32788 ",
32789 and integer grid coordinate "
32790 (var "un")
32791 " maps exactly to "
32792 (var "u2")
32793 ".
32794 All other integer grid coordinates "
32795 (math (var "i"))
32796 "
32797 are mapped so that ")
32798 (para (math (var "u")
32799 "="
32800 (var "i")
32801 "\u2061"
32802 "("
32803 (var "u2")
32804 "-"
32805 (var "u1")
32806 ","
32807 ")"
32808 "/"
32809 (var "un")
32810 "+"
32811 (var "u1")))
32812 (para (code "glMapGrid2")
32813 " specifies two such linear mappings.
32814 One maps integer grid coordinate "
32815 (math (var "i") "=" "0")
32816 "
32817 exactly to "
32818 (var "u1")
32819 ",
32820 and integer grid coordinate "
32821 (math (var "i") "=" (var "un"))
32822 "
32823 exactly to "
32824 (var "u2")
32825 ".
32826 The other maps integer grid coordinate "
32827 (math (var "j") "=" "0")
32828 "
32829 exactly to "
32830 (var "v1")
32831 ",
32832 and integer grid coordinate "
32833 (math (var "j") "=" (var "vn"))
32834 "
32835 exactly to "
32836 (var "v2")
32837 ".
32838 Other integer grid coordinates "
32839 (math (var "i"))
32840 "
32841 and "
32842 (math (var "j"))
32843 "
32844 are mapped such that ")
32845 (para (math (var "u")
32846 "="
32847 (var "i")
32848 "\u2061"
32849 "("
32850 (var "u2")
32851 "-"
32852 (var "u1")
32853 ","
32854 ")"
32855 "/"
32856 (var "un")
32857 "+"
32858 (var "u1")))
32859 (para (math (var "v")
32860 "="
32861 (var "j")
32862 "\u2061"
32863 "("
32864 (var "v2")
32865 "-"
32866 (var "v1")
32867 ","
32868 ")"
32869 "/"
32870 (var "vn")
32871 "+"
32872 (var "v1")))
32873 (para "
32874 The mappings specified by "
32875 (code "glMapGrid")
32876 " are used identically by "
32877 (code "glEvalMesh")
32878 " and "
32879 (code "glEvalPoint")
32880 ". ")
32881 (heading "Errors")
32882 (para (code "GL_INVALID_VALUE")
32883 " is generated if either "
32884 (var "un")
32885 " or "
32886 (var "vn")
32887 " is not
32888 positive. ")
32889 (para (code "GL_INVALID_OPERATION")
32890 " is generated if "
32891 (code "glMapGrid")
32892 "
32893 is executed between the execution of "
32894 (code "glBegin")
32895 "
32896 and the corresponding execution of "
32897 (code "glEnd")
32898 ". ")))
32899
32900 (define-gl-procedure
32901 glMaterial
32902 "glMaterial"
32903 (funcsynopsis
32904 (funcprototype
32905 (funcdef "void " (function "glMaterialf"))
32906 (paramdef "GLenum " (parameter "face"))
32907 (paramdef "GLenum " (parameter "pname"))
32908 (paramdef "GLfloat " (parameter "param"))))
32909 '(*fragment*
32910 (heading
32911 "specify material parameters for the lighting model")
32912 (heading "Parameters")
32913 (table (% (formatter (asis)))
32914 (entry (% (heading (var "face")))
32915 (para "
32916 Specifies which face or faces are being updated.
32917 Must be one of "
32918 (code "GL_FRONT")
32919 ", "
32920 (code "GL_BACK")
32921 ", or "
32922 (code "GL_FRONT_AND_BACK")
32923 ". "))
32924 (entry (% (heading (var "pname")))
32925 (para "
32926 Specifies the single-valued material parameter of the face or faces
32927 that is being updated.
32928 Must be "
32929 (code "GL_SHININESS")
32930 ". "))
32931 (entry (% (heading (var "param")))
32932 (para "
32933 Specifies the value that parameter "
32934 (code "GL_SHININESS")
32935 " will be set to. ")))
32936 (heading "Description")
32937 (para (code "glMaterial")
32938 " assigns values to material parameters.
32939 There are two matched sets of material parameters.
32940 One,
32941 the "
32942 (var "front-facing")
32943 " set,
32944 is used to shade points,
32945 lines,
32946 bitmaps,
32947 and all polygons
32948 (when two-sided lighting is disabled),
32949 or just front-facing polygons
32950 (when two-sided lighting is enabled).
32951 The other set, "
32952 (var "back-facing")
32953 ",
32954 is used to shade back-facing polygons only when two-sided lighting is enabled.
32955 Refer to the "
32956 (code "glLightModel")
32957 " reference page for details concerning one- and
32958 two-sided lighting calculations. ")
32959 (para (code "glMaterial")
32960 " takes three arguments.
32961 The first, "
32962 (var "face")
32963 ",
32964 specifies whether the "
32965 (code "GL_FRONT")
32966 " materials, the "
32967 (code "GL_BACK")
32968 " materials, or both "
32969 (code "GL_FRONT_AND_BACK")
32970 " materials will be modified.
32971 The second, "
32972 (var "pname")
32973 ",
32974 specifies which of several parameters in one or both sets will be modified.
32975 The third, "
32976 (var "params")
32977 ",
32978 specifies what value or values will be assigned to the specified parameter. ")
32979 (para "
32980 Material parameters are used in the lighting equation that is optionally
32981 applied to each vertex.
32982 The equation is discussed in the "
32983 (code "glLightModel")
32984 " reference page.
32985 The parameters that can be specified using "
32986 (code "glMaterial")
32987 ",
32988 and their interpretations by the lighting equation, are as follows: ")
32989 (table (% (formatter (asis)))
32990 (entry (% (heading (code "GL_AMBIENT")))
32991 (para (var "params")
32992 " contains four integer or floating-point values that specify
32993 the ambient RGBA reflectance of the material.
32994 Integer values are mapped linearly such that the most positive representable
32995 value maps to 1.0,
32996 and the most negative representable value maps to "
32997 (math "-1.0")
32998 ".
32999 Floating-point values are mapped directly.
33000 Neither integer nor floating-point values are clamped.
33001 The initial ambient reflectance for both front- and back-facing materials
33002 is (0.2, 0.2, 0.2, 1.0). "))
33003 (entry (% (heading (code "GL_DIFFUSE")))
33004 (para (var "params")
33005 " contains four integer or floating-point values that specify
33006 the diffuse RGBA reflectance of the material.
33007 Integer values are mapped linearly such that the most positive representable
33008 value maps to 1.0,
33009 and the most negative representable value maps to "
33010 (math "-1.0")
33011 ".
33012 Floating-point values are mapped directly.
33013 Neither integer nor floating-point values are clamped.
33014 The initial diffuse reflectance for both front- and back-facing materials
33015 is (0.8, 0.8, 0.8, 1.0). "))
33016 (entry (% (heading (code "GL_SPECULAR")))
33017 (para (var "params")
33018 " contains four integer or floating-point values that specify
33019 the specular RGBA reflectance of the material.
33020 Integer values are mapped linearly such that the most positive representable
33021 value maps to 1.0,
33022 and the most negative representable value maps to "
33023 (math "-1.0")
33024 ".
33025 Floating-point values are mapped directly.
33026 Neither integer nor floating-point values are clamped.
33027 The initial specular reflectance for both front- and back-facing materials
33028 is (0, 0, 0, 1). "))
33029 (entry (% (heading (code "GL_EMISSION")))
33030 (para (var "params")
33031 " contains four integer or floating-point values that specify
33032 the RGBA emitted light intensity of the material.
33033 Integer values are mapped linearly such that the most positive representable
33034 value maps to 1.0,
33035 and the most negative representable value maps to "
33036 (math "-1.0")
33037 ".
33038 Floating-point values are mapped directly.
33039 Neither integer nor floating-point values are clamped.
33040 The initial emission intensity for both front- and back-facing materials
33041 is (0, 0, 0, 1). "))
33042 (entry (% (heading (code "GL_SHININESS")))
33043 (para (var "params")
33044 " is a single integer or floating-point value that specifies
33045 the RGBA specular exponent of the material.
33046 Integer and floating-point values are mapped directly.
33047 Only values in the range "
33048 (math "[" "0" "," "128" "]")
33049 "
33050 are accepted.
33051 The initial specular exponent for both front- and back-facing materials
33052 is 0. "))
33053 (entry (% (heading (code "GL_AMBIENT_AND_DIFFUSE")))
33054 (para "
33055 Equivalent to calling "
33056 (code "glMaterial")
33057 " twice with the same parameter values,
33058 once with "
33059 (code "GL_AMBIENT")
33060 " and once with "
33061 (code "GL_DIFFUSE")
33062 ". "))
33063 (entry (% (heading (code "GL_COLOR_INDEXES")))
33064 (para (var "params")
33065 " contains three integer or floating-point values specifying
33066 the color indices for ambient,
33067 diffuse,
33068 and specular lighting.
33069 These three values,
33070 and "
33071 (code "GL_SHININESS")
33072 ",
33073 are the only material values used by the color index mode lighting equation.
33074 Refer to the "
33075 (code "glLightModel")
33076 " reference page for a discussion
33077 of color index lighting. ")))
33078 (heading "Errors")
33079 (para (code "GL_INVALID_ENUM")
33080 " is generated if either "
33081 (var "face")
33082 " or "
33083 (var "pname")
33084 " is not
33085 an accepted value. ")
33086 (para (code "GL_INVALID_VALUE")
33087 " is generated if a specular exponent outside the range "
33088 (math "[" "0" "," "128" "]")
33089 "
33090 is specified. ")))
33091
33092 (define-gl-procedure
33093 glMatrixMode
33094 "glMatrixMode"
33095 (funcsynopsis
33096 (funcprototype
33097 (funcdef "void " (function "glMatrixMode"))
33098 (paramdef "GLenum " (parameter "mode"))))
33099 '(*fragment*
33100 (heading
33101 "specify which matrix is the current matrix")
33102 (heading "Parameters")
33103 (table (% (formatter (asis)))
33104 (entry (% (heading (var "mode")))
33105 (para "
33106 Specifies which matrix stack is the target
33107 for subsequent matrix operations.
33108 Three values are accepted: "
33109 (code "GL_MODELVIEW")
33110 ", "
33111 (code "GL_PROJECTION")
33112 ", and "
33113 (code "GL_TEXTURE")
33114 ".
33115 The initial value is "
33116 (code "GL_MODELVIEW")
33117 ".
33118 Additionally, if the "
33119 (code "ARB_imaging")
33120 " extension is supported, "
33121 (code "GL_COLOR")
33122 " is also accepted. ")))
33123 (heading "Description")
33124 (para (code "glMatrixMode")
33125 " sets the current matrix mode. "
33126 (var "mode")
33127 " can assume one of four values: ")
33128 (table (% (formatter (asis)))
33129 (entry (% (heading (code "GL_MODELVIEW")))
33130 (para "
33131 Applies subsequent matrix operations to the modelview matrix stack. "))
33132 (entry (% (heading (code "GL_PROJECTION")))
33133 (para "
33134 Applies subsequent matrix operations to the projection matrix stack. "))
33135 (entry (% (heading (code "GL_TEXTURE")))
33136 (para "
33137 Applies subsequent matrix operations to the texture matrix stack. "))
33138 (entry (% (heading (code "GL_COLOR")))
33139 (para "
33140 Applies subsequent matrix operations to the color matrix stack. ")))
33141 (para "
33142 To find out which matrix stack is currently the target of all matrix
33143 operations, call "
33144 (code "glGet")
33145 " with argument "
33146 (code "GL_MATRIX_MODE")
33147 ". The initial
33148 value is "
33149 (code "GL_MODELVIEW")
33150 ". ")
33151 (heading "Errors")
33152 (para (code "GL_INVALID_ENUM")
33153 " is generated if "
33154 (var "mode")
33155 " is not an accepted value. ")
33156 (para (code "GL_INVALID_OPERATION")
33157 " is generated if "
33158 (code "glMatrixMode")
33159 "
33160 is executed between the execution of "
33161 (code "glBegin")
33162 "
33163 and the corresponding execution of "
33164 (code "glEnd")
33165 ". ")))
33166
33167 (define-gl-procedure
33168 glMinmax
33169 "glMinmax"
33170 (funcsynopsis
33171 (funcprototype
33172 (funcdef "void " (function "glMinmax"))
33173 (paramdef "GLenum " (parameter "target"))
33174 (paramdef "GLenum " (parameter "internalformat"))
33175 (paramdef "GLboolean " (parameter "sink"))))
33176 '(*fragment*
33177 (heading "define minmax table")
33178 (heading "Parameters")
33179 (table (% (formatter (asis)))
33180 (entry (% (heading (var "target")))
33181 (para "
33182 The minmax table whose parameters are to be set.
33183 Must be "
33184 (code "GL_MINMAX")
33185 ". "))
33186 (entry (% (heading (var "internalformat")))
33187 (para "
33188 The format of entries in the minmax table.
33189 Must be one of "
33190 (code "GL_ALPHA")
33191 ", "
33192 (code "GL_ALPHA4")
33193 ", "
33194 (code "GL_ALPHA8")
33195 ", "
33196 (code "GL_ALPHA12")
33197 ", "
33198 (code "GL_ALPHA16")
33199 ", "
33200 (code "GL_LUMINANCE")
33201 ", "
33202 (code "GL_LUMINANCE4")
33203 ", "
33204 (code "GL_LUMINANCE8")
33205 ", "
33206 (code "GL_LUMINANCE12")
33207 ", "
33208 (code "GL_LUMINANCE16")
33209 ", "
33210 (code "GL_LUMINANCE_ALPHA")
33211 ", "
33212 (code "GL_LUMINANCE4_ALPHA4")
33213 ", "
33214 (code "GL_LUMINANCE6_ALPHA2")
33215 ", "
33216 (code "GL_LUMINANCE8_ALPHA8")
33217 ", "
33218 (code "GL_LUMINANCE12_ALPHA4")
33219 ", "
33220 (code "GL_LUMINANCE12_ALPHA12")
33221 ", "
33222 (code "GL_LUMINANCE16_ALPHA16")
33223 ", "
33224 (code "GL_R3_G3_B2")
33225 ", "
33226 (code "GL_RGB")
33227 ", "
33228 (code "GL_RGB4")
33229 ", "
33230 (code "GL_RGB5")
33231 ", "
33232 (code "GL_RGB8")
33233 ", "
33234 (code "GL_RGB10")
33235 ", "
33236 (code "GL_RGB12")
33237 ", "
33238 (code "GL_RGB16")
33239 ", "
33240 (code "GL_RGBA")
33241 ", "
33242 (code "GL_RGBA2")
33243 ", "
33244 (code "GL_RGBA4")
33245 ", "
33246 (code "GL_RGB5_A1")
33247 ", "
33248 (code "GL_RGBA8")
33249 ", "
33250 (code "GL_RGB10_A2")
33251 ", "
33252 (code "GL_RGBA12")
33253 ", or "
33254 (code "GL_RGBA16")
33255 ". "))
33256 (entry (% (heading (var "sink")))
33257 (para "
33258 If "
33259 (code "GL_TRUE")
33260 ", pixels will be consumed by the minmax
33261 process and no drawing or texture loading will take place.
33262 If "
33263 (code "GL_FALSE")
33264 ", pixels will proceed to the final conversion process after
33265 minmax. ")))
33266 (heading "Description")
33267 (para "
33268 When "
33269 (code "GL_MINMAX")
33270 " is enabled, the RGBA components of incoming pixels are
33271 compared to the minimum and maximum values for each component, which are
33272 stored in the two-element minmax table.
33273 (The first element stores the minima, and the second element stores
33274 the maxima.)
33275 If a pixel component is greater than the corresponding component
33276 in the maximum element, then the maximum element is updated with the
33277 pixel component value.
33278 If a pixel component is less than the corresponding component in
33279 the minimum element, then the minimum element is updated with the
33280 pixel component value.
33281 (In both cases, if the internal format of the minmax table includes
33282 luminance, then the R color component of incoming pixels is used
33283 for comparison.)
33284 The contents of the minmax table may be retrieved at a later time
33285 by calling "
33286 (code "glGetMinmax")
33287 ".
33288 The minmax operation is enabled or disabled by calling "
33289 (code "glEnable")
33290 " or "
33291 (code "glDisable")
33292 ", respectively, with an argument of "
33293 (code "GL_MINMAX")
33294 ". ")
33295 (para (code "glMinmax")
33296 " redefines the current minmax table to have entries of the format
33297 specified by "
33298 (var "internalformat")
33299 ".
33300 The maximum element is initialized with the smallest possible component
33301 values, and the minimum element is initialized with the largest possible
33302 component values.
33303 The values in the previous minmax table, if any, are lost.
33304 If "
33305 (var "sink")
33306 " is "
33307 (code "GL_TRUE")
33308 ", then pixels are discarded after minmax;
33309 no further processing of the pixels takes place, and no drawing,
33310 texture loading, or pixel readback will result. ")
33311 (para)
33312 (heading "Errors")
33313 (para (code "GL_INVALID_ENUM")
33314 " is generated if "
33315 (var "target")
33316 " is not one of the allowable
33317 values. ")
33318 (para (code "GL_INVALID_ENUM")
33319 " is generated if "
33320 (var "internalformat")
33321 " is not one of the
33322 allowable values. ")
33323 (para (code "GL_INVALID_OPERATION")
33324 " is generated if "
33325 (code "glMinmax")
33326 " is executed
33327 between the execution of "
33328 (code "glBegin")
33329 " and the corresponding
33330 execution of "
33331 (code "glEnd")
33332 ". ")))
33333
33334 (define-gl-procedure
33335 glMultiDrawArrays
33336 "glMultiDrawArrays"
33337 (funcsynopsis
33338 (funcprototype
33339 (funcdef "void " (function "glMultiDrawArrays"))
33340 (paramdef "GLenum " (parameter "mode"))
33341 (paramdef "GLint * " (parameter "first"))
33342 (paramdef "GLsizei * " (parameter "count"))
33343 (paramdef "GLsizei " (parameter "primcount"))))
33344 '(*fragment*
33345 (heading
33346 "render multiple sets of primitives from array data")
33347 (heading "Parameters")
33348 (table (% (formatter (asis)))
33349 (entry (% (heading (var "mode")))
33350 (para "
33351 Specifies what kind of primitives to render.
33352 Symbolic constants "
33353 (code "GL_POINTS")
33354 ", "
33355 (code "GL_LINE_STRIP")
33356 ", "
33357 (code "GL_LINE_LOOP")
33358 ", "
33359 (code "GL_LINES")
33360 ", "
33361 (code "GL_TRIANGLE_STRIP")
33362 ", "
33363 (code "GL_TRIANGLE_FAN")
33364 ", "
33365 (code "GL_TRIANGLES")
33366 ", "
33367 (code "GL_QUAD_STRIP")
33368 ", "
33369 (code "GL_QUADS")
33370 ",
33371 and "
33372 (code "GL_POLYGON")
33373 " are accepted. "))
33374 (entry (% (heading (var "first")))
33375 (para "
33376 Points to an array of starting indices in the enabled arrays. "))
33377 (entry (% (heading (var "count")))
33378 (para "
33379 Points to an array of the number of indices to be rendered. "))
33380 (entry (% (heading (var "primcount")))
33381 (para "
33382 Specifies the size of the first and count ")))
33383 (heading "Description")
33384 (para (code "glMultiDrawArrays")
33385 " specifies multiple sets of geometric primitives
33386 with very few subroutine calls. Instead of calling a GL procedure
33387 to pass each individual vertex, normal, texture coordinate, edge
33388 flag, or color, you can prespecify
33389 separate arrays of vertices, normals, and colors and use them to
33390 construct a sequence of primitives with a single
33391 call to "
33392 (code "glMultiDrawArrays")
33393 ". ")
33394 (para (code "glMultiDrawArrays")
33395 " behaves identically to "
33396 (code "glDrawArrays")
33397 " except that "
33398 (var "primcount")
33399 "
33400 separate ranges of elements are specified instead. ")
33401 (para "
33402 When "
33403 (code "glMultiDrawArrays")
33404 " is called, it uses "
33405 (var "count")
33406 " sequential elements from each
33407 enabled array to construct a sequence of geometric primitives,
33408 beginning with element "
33409 (var "first")
33410 ". "
33411 (var "mode")
33412 " specifies what kind of
33413 primitives are constructed, and how the array elements
33414 construct those primitives. If "
33415 (code "GL_VERTEX_ARRAY")
33416 " is not enabled, no
33417 geometric primitives are generated. ")
33418 (para "
33419 Vertex attributes that are modified by "
33420 (code "glMultiDrawArrays")
33421 " have an
33422 unspecified value after "
33423 (code "glMultiDrawArrays")
33424 " returns. For example, if "
33425 (code "GL_COLOR_ARRAY")
33426 " is enabled, the value of the current color is
33427 undefined after "
33428 (code "glMultiDrawArrays")
33429 " executes. Attributes that aren't
33430 modified remain well defined. ")
33431 (heading "Errors")
33432 (para (code "GL_INVALID_ENUM")
33433 " is generated if "
33434 (var "mode")
33435 " is not an accepted value. ")
33436 (para (code "GL_INVALID_VALUE")
33437 " is generated if "
33438 (var "primcount")
33439 " is negative. ")
33440 (para (code "GL_INVALID_OPERATION")
33441 " is generated if a non-zero buffer object name is bound to an
33442 enabled array and the buffer object's data store is currently mapped. ")
33443 (para (code "GL_INVALID_OPERATION")
33444 " is generated if "
33445 (code "glMultiDrawArrays")
33446 " is executed between
33447 the execution of "
33448 (code "glBegin")
33449 " and the corresponding "
33450 (code "glEnd")
33451 ". ")))
33452
33453 (define-gl-procedure
33454 glMultiDrawElements
33455 "glMultiDrawElements"
33456 (funcsynopsis
33457 (funcprototype
33458 (funcdef
33459 "void "
33460 (function "glMultiDrawElements"))
33461 (paramdef "GLenum " (parameter "mode"))
33462 (paramdef "const GLsizei * " (parameter "count"))
33463 (paramdef "GLenum " (parameter "type"))
33464 (paramdef
33465 "const GLvoid ** "
33466 (parameter "indices"))
33467 (paramdef "GLsizei " (parameter "primcount"))))
33468 '(*fragment*
33469 (heading
33470 "render multiple sets of primitives by specifying indices of array data elements")
33471 (heading "Parameters")
33472 (table (% (formatter (asis)))
33473 (entry (% (heading (var "mode")))
33474 (para "
33475 Specifies what kind of primitives to render.
33476 Symbolic constants "
33477 (code "GL_POINTS")
33478 ", "
33479 (code "GL_LINE_STRIP")
33480 ", "
33481 (code "GL_LINE_LOOP")
33482 ", "
33483 (code "GL_LINES")
33484 ", "
33485 (code "GL_TRIANGLE_STRIP")
33486 ", "
33487 (code "GL_TRIANGLE_FAN")
33488 ", "
33489 (code "GL_TRIANGLES")
33490 ", "
33491 (code "GL_QUAD_STRIP")
33492 ", "
33493 (code "GL_QUADS")
33494 ",
33495 and "
33496 (code "GL_POLYGON")
33497 " are accepted. "))
33498 (entry (% (heading (var "count")))
33499 (para "
33500 Points to an array of the elements counts. "))
33501 (entry (% (heading (var "type")))
33502 (para "
33503 Specifies the type of the values in "
33504 (var "indices")
33505 ". Must be one of "
33506 (code "GL_UNSIGNED_BYTE")
33507 ", "
33508 (code "GL_UNSIGNED_SHORT")
33509 ", or "
33510 (code "GL_UNSIGNED_INT")
33511 ". "))
33512 (entry (% (heading (var "indices")))
33513 (para "
33514 Specifies a pointer to the location where the indices are stored. "))
33515 (entry (% (heading (var "primcount")))
33516 (para "
33517 Specifies the size of the "
33518 (var "count")
33519 " array. ")))
33520 (heading "Description")
33521 (para (code "glMultiDrawElements")
33522 " specifies multiple sets of geometric primitives with very few subroutine
33523 calls. Instead of calling a GL function to pass each individual vertex,
33524 normal, texture coordinate, edge flag, or color, you can prespecify
33525 separate arrays of vertices, normals, and so on, and use them to construct a
33526 sequence of primitives with a single call to "
33527 (code "glMultiDrawElements")
33528 ". ")
33529 (para (code "glMultiDrawElements")
33530 " is identical in operation to "
33531 (code "glDrawElements")
33532 " except that "
33533 (var "primcount")
33534 " separate lists of elements are specified. ")
33535 (para "
33536 Vertex attributes that are modified by "
33537 (code "glMultiDrawElements")
33538 " have an
33539 unspecified value after "
33540 (code "glMultiDrawElements")
33541 " returns. For example, if "
33542 (code "GL_COLOR_ARRAY")
33543 " is enabled, the value of the current color is
33544 undefined after "
33545 (code "glMultiDrawElements")
33546 " executes. Attributes that aren't
33547 modified maintain their previous values. ")
33548 (heading "Errors")
33549 (para (code "GL_INVALID_ENUM")
33550 " is generated if "
33551 (var "mode")
33552 " is not an accepted value. ")
33553 (para (code "GL_INVALID_VALUE")
33554 " is generated if "
33555 (var "primcount")
33556 " is negative. ")
33557 (para (code "GL_INVALID_OPERATION")
33558 " is generated if a non-zero buffer object name is bound to an
33559 enabled array or the element array and the buffer object's data store is currently mapped. ")
33560 (para (code "GL_INVALID_OPERATION")
33561 " is generated if "
33562 (code "glMultiDrawElements")
33563 " is executed between
33564 the execution of "
33565 (code "glBegin")
33566 " and the corresponding "
33567 (code "glEnd")
33568 ". ")))
33569
33570 (define-gl-procedure
33571 glMultiTexCoord
33572 "glMultiTexCoord"
33573 (funcsynopsis
33574 (funcprototype
33575 (funcdef "void " (function "glMultiTexCoord1s"))
33576 (paramdef "GLenum " (parameter "target"))
33577 (paramdef "GLshort " (parameter "s"))))
33578 '(*fragment*
33579 (heading "set the current texture coordinates")
33580 (heading "Parameters")
33581 (table (% (formatter (asis)))
33582 (entry (% (heading (var "target")))
33583 (para "
33584 Specifies the texture unit whose coordinates should be modified. The number
33585 of texture units is implementation dependent, but must be at least
33586 two. Symbolic constant must be one of "
33587 (code "GL_TEXTURE")
33588 (math (var "i"))
33589 ",
33590 where i ranges from 0 to "
33591 (code "GL_MAX_TEXTURE_COORDS")
33592 " - 1,
33593 which is an implementation-dependent value. "))
33594 (entry (% (heading (var "s")))
33595 (itemx (var "t"))
33596 (itemx (var "r"))
33597 (itemx (var "q"))
33598 (para "
33599 Specify "
33600 (var "s")
33601 ", "
33602 (var "t")
33603 ", "
33604 (var "r")
33605 ", and "
33606 (var "q")
33607 " texture coordinates for "
33608 (var "target")
33609 " texture unit. Not all parameters are present in all forms
33610 of the command. ")))
33611 (heading "Description")
33612 (para (code "glMultiTexCoord")
33613 " specifies texture coordinates in one, two, three, or four
33614 dimensions. "
33615 (code "glMultiTexCoord1")
33616 " sets the current texture
33617 coordinates to "
33618 (math "(" (var "s") "," "0" "0" "1" ")")
33619 ";
33620 a call to "
33621 (code "glMultiTexCoord2")
33622 "
33623 sets them to "
33624 (math "(" (var "s") "," (var "t") "0" "1" ")")
33625 ".
33626 Similarly, "
33627 (code "glMultiTexCoord3")
33628 " specifies the texture coordinates as "
33629 (math "("
33630 (var "s")
33631 ","
33632 (var "t")
33633 (var "r")
33634 "1"
33635 ")")
33636 ",
33637 and "
33638 (code "glMultiTexCoord4")
33639 "
33640 defines all four components explicitly as "
33641 (math "("
33642 (var "s")
33643 ","
33644 (var "t")
33645 (var "r")
33646 (var "q")
33647 ")")
33648 ". ")
33649 (para "
33650 The current texture coordinates are part of the data
33651 that is associated with each vertex and with the current
33652 raster position.
33653 Initially, the values for "
33654 (math "("
33655 (var "s")
33656 ","
33657 (var "t")
33658 (var "r")
33659 (var "q")
33660 ")")
33661 "
33662 are "
33663 (math "(" "0" "," "0" "0" "1" ")")
33664 ". ")
33665 (para)))
33666
33667 (define-gl-procedure
33668 glMultMatrix
33669 "glMultMatrix"
33670 (funcsynopsis
33671 (funcprototype
33672 (funcdef "void " (function "glMultMatrixd"))
33673 (paramdef "const GLdouble * " (parameter "m"))))
33674 '(*fragment*
33675 (heading
33676 "multiply the current matrix with the specified matrix")
33677 (heading "Parameters")
33678 (table (% (formatter (asis)))
33679 (entry (% (heading (var "m")))
33680 (para "
33681 Points to 16 consecutive values that are used as the elements of
33682 a "
33683 (math "4" "×" "4")
33684 "
33685 column-major matrix. ")))
33686 (heading "Description")
33687 (para (code "glMultMatrix")
33688 " multiplies the current matrix with the one specified using "
33689 (var "m")
33690 ", and
33691 replaces the current matrix with the product. ")
33692 (para "
33693 The current matrix is determined by the current matrix mode (see "
33694 (code "glMatrixMode")
33695 "). It is either the projection matrix,
33696 modelview matrix,
33697 or the texture matrix. ")
33698 (heading "Errors")
33699 (para (code "GL_INVALID_OPERATION")
33700 " is generated if "
33701 (code "glMultMatrix")
33702 "
33703 is executed between the execution of "
33704 (code "glBegin")
33705 "
33706 and the corresponding execution of "
33707 (code "glEnd")
33708 ". ")))
33709
33710 (define-gl-procedure
33711 glMultTransposeMatrix
33712 "glMultTransposeMatrix"
33713 (funcsynopsis
33714 (funcprototype
33715 (funcdef
33716 "void "
33717 (function "glMultTransposeMatrixd"))
33718 (paramdef "const GLdouble * " (parameter "m"))))
33719 '(*fragment*
33720 (heading
33721 "multiply the current matrix with the specified row-major ordered matrix")
33722 (heading "Parameters")
33723 (table (% (formatter (asis)))
33724 (entry (% (heading (var "m")))
33725 (para "
33726 Points to 16 consecutive values that are used as the elements of
33727 a "
33728 (math "4" "×" "4")
33729 "
33730 row-major matrix. ")))
33731 (heading "Description")
33732 (para (code "glMultTransposeMatrix")
33733 " multiplies the current matrix with the one specified using "
33734 (var "m")
33735 ", and
33736 replaces the current matrix with the product. ")
33737 (para "
33738 The current matrix is determined by the current matrix mode (see "
33739 (code "glMatrixMode")
33740 "). It is either the projection matrix, modelview matrix,
33741 or the texture matrix. ")
33742 (heading "Errors")
33743 (para (code "GL_INVALID_OPERATION")
33744 " is generated if "
33745 (code "glMultTransposeMatrix")
33746 "
33747 is executed between the execution of "
33748 (code "glBegin")
33749 "
33750 and the corresponding execution of "
33751 (code "glEnd")
33752 ". ")))
33753
33754 (define-gl-procedure
33755 glNewList
33756 "glNewList"
33757 (funcsynopsis
33758 (funcprototype
33759 (funcdef "void " (function "glNewList"))
33760 (paramdef "GLuint " (parameter "list"))
33761 (paramdef "GLenum " (parameter "mode"))))
33762 '(*fragment*
33763 (heading "create or replace a display list")
33764 (heading "Parameters")
33765 (table (% (formatter (asis)))
33766 (entry (% (heading (var "list")))
33767 (para "
33768 Specifies the display-list name. "))
33769 (entry (% (heading (var "mode")))
33770 (para "
33771 Specifies the compilation mode,
33772 which can be "
33773 (code "GL_COMPILE")
33774 " or "
33775 (code "GL_COMPILE_AND_EXECUTE")
33776 ". ")))
33777 (heading "Description")
33778 (para "
33779 Display lists are groups of GL commands that have been stored
33780 for subsequent execution.
33781 Display lists are created with "
33782 (code "glNewList")
33783 ".
33784 All subsequent commands are placed in the display list,
33785 in the order issued,
33786 until "
33787 (code "glEndList")
33788 " is called. ")
33789 (para (code "glNewList")
33790 " has two arguments.
33791 The first argument, "
33792 (var "list")
33793 ",
33794 is a positive integer that becomes the unique name for the display list.
33795 Names can be created and reserved with "
33796 (code "glGenLists")
33797 "
33798 and tested for uniqueness with "
33799 (code "glIsList")
33800 ".
33801 The second argument, "
33802 (var "mode")
33803 ",
33804 is a symbolic constant that can assume one of two values: ")
33805 (table (% (formatter (asis)))
33806 (entry (% (heading (code "GL_COMPILE")))
33807 (para "
33808 Commands are merely compiled. "))
33809 (entry (% (heading (code "GL_COMPILE_AND_EXECUTE")))
33810 (para "
33811 Commands are executed as they are compiled into the display list. ")))
33812 (para "
33813 Certain commands are not compiled into the display list
33814 but are executed immediately,
33815 regardless of the display-list mode.
33816 These commands are "
33817 (code "glAreTexturesResident")
33818 ", "
33819 (code "glColorPointer")
33820 ", "
33821 (code "glDeleteLists")
33822 ", "
33823 (code "glDeleteTextures")
33824 ", "
33825 (code "glDisableClientState")
33826 ", "
33827 (code "glEdgeFlagPointer")
33828 ", "
33829 (code "glEnableClientState")
33830 ", "
33831 (code "glFeedbackBuffer")
33832 ", "
33833 (code "glFinish")
33834 ", "
33835 (code "glFlush")
33836 ", "
33837 (code "glGenLists")
33838 ", "
33839 (code "glGenTextures")
33840 ", "
33841 (code "glIndexPointer")
33842 ", "
33843 (code "glInterleavedArrays")
33844 ", "
33845 (code "glIsEnabled")
33846 ", "
33847 (code "glIsList")
33848 ", "
33849 (code "glIsTexture")
33850 ", "
33851 (code "glNormalPointer")
33852 ", "
33853 (code "glPopClientAttrib")
33854 ", "
33855 (code "glPixelStore")
33856 ", "
33857 (code "glPushClientAttrib")
33858 ", "
33859 (code "glReadPixels")
33860 ", "
33861 (code "glRenderMode")
33862 ", "
33863 (code "glSelectBuffer")
33864 ", "
33865 (code "glTexCoordPointer")
33866 ", "
33867 (code "glVertexPointer")
33868 ",
33869 and all of the "
33870 (code "glGet")
33871 " commands. ")
33872 (para "
33873 Similarly, "
33874 (code "glTexImage1D")
33875 ", "
33876 (code "glTexImage2D")
33877 ", and "
33878 (code "glTexImage3D")
33879 "
33880 are executed immediately and not compiled into the display list when their
33881 first argument is "
33882 (code "GL_PROXY_TEXTURE_1D")
33883 ", "
33884 (code "GL_PROXY_TEXTURE_1D")
33885 ", or "
33886 (code "GL_PROXY_TEXTURE_3D")
33887 ", respectively. ")
33888 (para "
33889 When the "
33890 (code "ARB_imaging")
33891 " extension is supported, "
33892 (code "glHistogram")
33893 " executes immediately when its argument is "
33894 (code "GL_PROXY_HISTOGRAM")
33895 ". Similarly, "
33896 (code "glColorTable")
33897 " executes
33898 immediately when its first argument is "
33899 (code "GL_PROXY_COLOR_TABLE")
33900 ", "
33901 (code "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE")
33902 ", or "
33903 (code "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE")
33904 ". ")
33905 (para "
33906 For OpenGL versions 1.3 and greater, or when the "
33907 (code "ARB_multitexture")
33908 " extension is supported, "
33909 (code "glClientActiveTexture")
33910 " is not compiled into display lists, but
33911 executed immediately. ")
33912 (para "
33913 When "
33914 (code "glEndList")
33915 " is encountered,
33916 the display-list definition is completed by associating the list
33917 with the unique name "
33918 (var "list")
33919 "
33920 (specified in the "
33921 (code "glNewList")
33922 " command).
33923 If a display list with name "
33924 (var "list")
33925 " already exists,
33926 it is replaced only when "
33927 (code "glEndList")
33928 " is called. ")
33929 (heading "Errors")
33930 (para (code "GL_INVALID_VALUE")
33931 " is generated if "
33932 (var "list")
33933 " is 0. ")
33934 (para (code "GL_INVALID_ENUM")
33935 " is generated if "
33936 (var "mode")
33937 " is not an accepted value. ")
33938 (para (code "GL_INVALID_OPERATION")
33939 " is generated if "
33940 (code "glEndList")
33941 " is called
33942 without a preceding "
33943 (code "glNewList")
33944 ",
33945 or if "
33946 (code "glNewList")
33947 " is called while a display list is being defined. ")
33948 (para (code "GL_INVALID_OPERATION")
33949 " is generated if "
33950 (code "glNewList")
33951 " or "
33952 (code "glEndList")
33953 "
33954 is executed between the execution of "
33955 (code "glBegin")
33956 "
33957 and the corresponding execution of "
33958 (code "glEnd")
33959 ". ")
33960 (para (code "GL_OUT_OF_MEMORY")
33961 " is generated if there is insufficient memory to
33962 compile the display list. If the GL version is 1.1 or greater, no
33963 change is made to the previous contents of the display list, if any,
33964 and no other change is made to the GL state. (It is as if no attempt
33965 had been made to create the new display list.) ")))
33966
33967 (define-gl-procedure
33968 glNormalPointer
33969 "glNormalPointer"
33970 (funcsynopsis
33971 (funcprototype
33972 (funcdef "void " (function "glNormalPointer"))
33973 (paramdef "GLenum " (parameter "type"))
33974 (paramdef "GLsizei " (parameter "stride"))
33975 (paramdef
33976 "const GLvoid * "
33977 (parameter "pointer"))))
33978 '(*fragment*
33979 (heading "define an array of normals")
33980 (heading "Parameters")
33981 (table (% (formatter (asis)))
33982 (entry (% (heading (var "type")))
33983 (para "
33984 Specifies the data type of each coordinate in the array.
33985 Symbolic constants "
33986 (code "GL_BYTE")
33987 ", "
33988 (code "GL_SHORT")
33989 ", "
33990 (code "GL_INT")
33991 ", "
33992 (code "GL_FLOAT")
33993 ", and "
33994 (code "GL_DOUBLE")
33995 "
33996 are accepted. The initial value is "
33997 (code "GL_FLOAT")
33998 ". "))
33999 (entry (% (heading (var "stride")))
34000 (para "
34001 Specifies the byte offset between consecutive normals. If "
34002 (var "stride")
34003 " is
34004 0, the normals are understood to be tightly packed in
34005 the array. The initial value is 0. "))
34006 (entry (% (heading (var "pointer")))
34007 (para "
34008 Specifies a pointer to the first coordinate of the first normal in the
34009 array. The initial value is 0. ")))
34010 (heading "Description")
34011 (para (code "glNormalPointer")
34012 " specifies the location and data format of an array of normals
34013 to use when rendering. "
34014 (var "type")
34015 " specifies the data type of each normal coordinate,
34016 and "
34017 (var "stride")
34018 " specifies the byte stride from one
34019 normal to the next, allowing vertices and attributes
34020 to be packed into a single array or stored in separate arrays.
34021 (Single-array storage may be more efficient on some implementations;
34022 see "
34023 (code "glInterleavedArrays")
34024 ".) ")
34025 (para "
34026 If a non-zero named buffer object is bound to the "
34027 (code "GL_ARRAY_BUFFER")
34028 " target
34029 (see "
34030 (code "glBindBuffer")
34031 ") while a normal array is
34032 specified, "
34033 (var "pointer")
34034 " is treated as a byte offset into the buffer object's data store.
34035 Also, the buffer object binding ("
34036 (code "GL_ARRAY_BUFFER_BINDING")
34037 ") is saved as normal vertex array
34038 client-side state ("
34039 (code "GL_NORMAL_ARRAY_BUFFER_BINDING")
34040 "). ")
34041 (para "
34042 When a normal array is specified, "
34043 (var "type")
34044 ", "
34045 (var "stride")
34046 ", and "
34047 (var "pointer")
34048 " are saved as client-side
34049 state, in addition to the current vertex array buffer object binding. ")
34050 (para "
34051 To enable and disable the normal array, call "
34052 (code "glEnableClientState")
34053 " and "
34054 (code "glDisableClientState")
34055 " with the argument "
34056 (code "GL_NORMAL_ARRAY")
34057 ". If
34058 enabled, the normal array is used
34059 when "
34060 (code "glDrawArrays")
34061 ", "
34062 (code "glMultiDrawArrays")
34063 ", "
34064 (code "glDrawElements")
34065 ", "
34066 (code "glMultiDrawElements")
34067 ", "
34068 (code "glDrawRangeElements")
34069 ", or "
34070 (code "glArrayElement")
34071 " is called. ")
34072 (heading "Errors")
34073 (para (code "GL_INVALID_ENUM")
34074 " is generated if "
34075 (var "type")
34076 " is not an accepted value. ")
34077 (para (code "GL_INVALID_VALUE")
34078 " is generated if "
34079 (var "stride")
34080 " is negative. ")))
34081
34082 (define-gl-procedure
34083 glNormal
34084 "glNormal"
34085 (funcsynopsis
34086 (funcprototype
34087 (funcdef "void " (function "glNormal3b"))
34088 (paramdef "GLbyte " (parameter "nx"))
34089 (paramdef "GLbyte " (parameter "ny"))
34090 (paramdef "GLbyte " (parameter "nz"))))
34091 '(*fragment*
34092 (heading "set the current normal vector")
34093 (heading "Parameters")
34094 (table (% (formatter (asis)))
34095 (entry (% (heading (var "nx")))
34096 (itemx (var "ny"))
34097 (itemx (var "nz"))
34098 (para "
34099 Specify the "
34100 (math (var "x"))
34101 ", "
34102 (math (var "y"))
34103 ",
34104 and "
34105 (math (var "z"))
34106 "
34107 coordinates of the new current normal.
34108 The initial value of the current normal is the unit vector, (0, 0, 1). ")
34109 (para)))
34110 (heading "Description")
34111 (para "
34112 The current normal is set to the given coordinates
34113 whenever "
34114 (code "glNormal")
34115 " is issued.
34116 Byte, short, or integer arguments are converted to floating-point
34117 format with a linear mapping that maps the most positive representable integer
34118 value to 1.0
34119 and the most negative representable integer value to "
34120 (math "-1.0")
34121 ". ")
34122 (para "
34123 Normals specified with "
34124 (code "glNormal")
34125 " need not have unit length.
34126 If "
34127 (code "GL_NORMALIZE")
34128 " is enabled,
34129 then normals of any length specified with "
34130 (code "glNormal")
34131 " are normalized after transformation.
34132 If "
34133 (code "GL_RESCALE_NORMAL")
34134 " is enabled, normals are scaled by a scaling factor
34135 derived from the modelview matrix. "
34136 (code "GL_RESCALE_NORMAL")
34137 " requires that the
34138 originally specified normals were of unit length, and that the modelview
34139 matrix contain only uniform scales for proper results.
34140 To enable and disable normalization, call "
34141 (code "glEnable")
34142 " and "
34143 (code "glDisable")
34144 "
34145 with either "
34146 (code "GL_NORMALIZE")
34147 " or "
34148 (code "GL_RESCALE_NORMAL")
34149 ".
34150 Normalization is initially disabled. ")))
34151
34152 (define-gl-procedure
34153 glOrtho
34154 "glOrtho"
34155 (funcsynopsis
34156 (funcprototype
34157 (funcdef "void " (function "glOrtho"))
34158 (paramdef "GLdouble " (parameter "left"))
34159 (paramdef "GLdouble " (parameter "right"))
34160 (paramdef "GLdouble " (parameter "bottom"))
34161 (paramdef "GLdouble " (parameter "top"))
34162 (paramdef "GLdouble " (parameter "nearVal"))
34163 (paramdef "GLdouble " (parameter "farVal"))))
34164 '(*fragment*
34165 (heading
34166 "multiply the current matrix with an orthographic matrix")
34167 (heading "Parameters")
34168 (table (% (formatter (asis)))
34169 (entry (% (heading (var "left")))
34170 (itemx (var "right"))
34171 (para "
34172 Specify the coordinates for the left and right vertical clipping planes. "))
34173 (entry (% (heading (var "bottom")))
34174 (itemx (var "top"))
34175 (para "
34176 Specify the coordinates for the bottom and top horizontal clipping planes. "))
34177 (entry (% (heading (var "nearVal")))
34178 (itemx (var "farVal"))
34179 (para "
34180 Specify the distances to the nearer and farther depth clipping planes.
34181 These values are negative if the plane is to be behind the viewer. ")))
34182 (heading "Description")
34183 (para (code "glOrtho")
34184 " describes a transformation that produces a parallel projection.
34185 The current matrix (see "
34186 (code "glMatrixMode")
34187 ") is multiplied by this matrix
34188 and the result replaces the current matrix, as if "
34189 (code "glMultMatrix")
34190 " were called with the following matrix
34191 as its argument: ")
34192 (para (math "("
34193 "("
34194 "2"
34195 "/"
34196 (var "right")
34197 "-"
34198 (var "left")
34199 ","
34200 ","
34201 " "
34202 "0"
34203 " "
34204 "0"
34205 " "
34206 (var "t")
34207 "_"
34208 (var "x")
34209 ","
34210 ")"
34211 ", "
34212 "("
34213 "0"
34214 " "
34215 "2"
34216 "/"
34217 (var "top")
34218 "-"
34219 (var "bottom")
34220 ","
34221 ","
34222 " "
34223 "0"
34224 " "
34225 (var "t")
34226 "_"
34227 (var "y")
34228 ","
34229 ")"
34230 ", "
34231 "("
34232 "0"
34233 " "
34234 "0"
34235 " "
34236 "-2"
34237 "/"
34238 (var "farVal")
34239 "-"
34240 (var "nearVal")
34241 ","
34242 ","
34243 " "
34244 (var "t")
34245 "_"
34246 (var "z")
34247 ","
34248 ")"
34249 ", "
34250 "("
34251 "0"
34252 " "
34253 "0"
34254 " "
34255 "0"
34256 " "
34257 "1"
34258 ")"
34259 ","
34260 ")"))
34261 (para "
34262 where "
34263 (math (var "t")
34264 "_"
34265 (var "x")
34266 "="
34267 "-"
34268 (var "right")
34269 "+"
34270 (var "left")
34271 ","
34272 "/"
34273 (var "right")
34274 "-"
34275 (var "left")
34276 ","
34277 ",")
34278 (math (var "t")
34279 "_"
34280 (var "y")
34281 "="
34282 "-"
34283 (var "top")
34284 "+"
34285 (var "bottom")
34286 ","
34287 "/"
34288 (var "top")
34289 "-"
34290 (var "bottom")
34291 ","
34292 ",")
34293 (math (var "t")
34294 "_"
34295 (var "z")
34296 "="
34297 "-"
34298 (var "farVal")
34299 "+"
34300 (var "nearVal")
34301 ","
34302 "/"
34303 (var "farVal")
34304 "-"
34305 (var "nearVal")
34306 ","
34307 ","))
34308 (para "
34309 Typically, the matrix mode is "
34310 (code "GL_PROJECTION")
34311 ", and "
34312 (math "("
34313 (var "left")
34314 ","
34315 (var "bottom")
34316 "-"
34317 (var "nearVal")
34318 ")")
34319 "
34320 and "
34321 (math "("
34322 (var "right")
34323 ","
34324 (var "top")
34325 "-"
34326 (var "nearVal")
34327 ")")
34328 "
34329 specify the points on the near clipping plane that are mapped
34330 to the lower left and upper right corners of the window,
34331 respectively,
34332 assuming that the eye is located at (0, 0, 0). "
34333 (math "-" (var "farVal"))
34334 "
34335 specifies the location of the far clipping plane.
34336 Both "
34337 (var "nearVal")
34338 " and "
34339 (var "farVal")
34340 " can be either positive or negative. ")
34341 (para "
34342 Use "
34343 (code "glPushMatrix")
34344 " and "
34345 (code "glPopMatrix")
34346 " to save and restore
34347 the current matrix stack. ")
34348 (heading "Errors")
34349 (para (code "GL_INVALID_VALUE")
34350 " is generated if "
34351 (var "left")
34352 " = "
34353 (var "right")
34354 ", or "
34355 (var "bottom")
34356 " = "
34357 (var "top")
34358 ", or "
34359 (var "near")
34360 " = "
34361 (var "far")
34362 ". ")
34363 (para (code "GL_INVALID_OPERATION")
34364 " is generated if "
34365 (code "glOrtho")
34366 "
34367 is executed between the execution of "
34368 (code "glBegin")
34369 "
34370 and the corresponding execution of "
34371 (code "glEnd")
34372 ". ")))
34373
34374 (define-gl-procedure
34375 glPassThrough
34376 "glPassThrough"
34377 (funcsynopsis
34378 (funcprototype
34379 (funcdef "void " (function "glPassThrough"))
34380 (paramdef "GLfloat " (parameter "token"))))
34381 '(*fragment*
34382 (heading "place a marker in the feedback buffer")
34383 (heading "Parameters")
34384 (table (% (formatter (asis)))
34385 (entry (% (heading (var "token")))
34386 (para "
34387 Specifies a marker value to be placed in the feedback buffer
34388 following a "
34389 (code "GL_PASS_THROUGH_TOKEN")
34390 ". ")))
34391 (heading "Description")
34392 (para)
34393 (para "
34394 Feedback is a GL render mode.
34395 The mode is selected by calling "
34396 (code "glRenderMode")
34397 " with "
34398 (code "GL_FEEDBACK")
34399 ".
34400 When the GL is in feedback mode,
34401 no pixels are produced by rasterization.
34402 Instead,
34403 information about primitives that would have been rasterized
34404 is fed back to the application using the GL.
34405 See the "
34406 (code "glFeedbackBuffer")
34407 " reference page for a description of the
34408 feedback buffer and the values in it. ")
34409 (para (code "glPassThrough")
34410 " inserts a user-defined marker in the feedback buffer
34411 when it is executed in feedback mode. "
34412 (var "token")
34413 " is returned as if it were a primitive;
34414 it is indicated with its own unique identifying value: "
34415 (code "GL_PASS_THROUGH_TOKEN")
34416 ".
34417 The order of "
34418 (code "glPassThrough")
34419 " commands with respect to the specification
34420 of graphics primitives is maintained. ")
34421 (heading "Errors")
34422 (para (code "GL_INVALID_OPERATION")
34423 " is generated if "
34424 (code "glPassThrough")
34425 " is executed between
34426 the execution of "
34427 (code "glBegin")
34428 " and the corresponding execution of "
34429 (code "glEnd")
34430 ". ")))
34431
34432 (define-gl-procedure
34433 glPixelMap
34434 "glPixelMap"
34435 (funcsynopsis
34436 (funcprototype
34437 (funcdef "void " (function "glPixelMapfv"))
34438 (paramdef "GLenum " (parameter "map"))
34439 (paramdef "GLsizei " (parameter "mapsize"))
34440 (paramdef
34441 "const GLfloat * "
34442 (parameter "values"))))
34443 '(*fragment*
34444 (heading "set up pixel transfer maps")
34445 (heading "Parameters")
34446 (table (% (formatter (asis)))
34447 (entry (% (heading (var "map")))
34448 (para "
34449 Specifies a symbolic map name.
34450 Must be one of the following: "
34451 (code "GL_PIXEL_MAP_I_TO_I")
34452 ", "
34453 (code "GL_PIXEL_MAP_S_TO_S")
34454 ", "
34455 (code "GL_PIXEL_MAP_I_TO_R")
34456 ", "
34457 (code "GL_PIXEL_MAP_I_TO_G")
34458 ", "
34459 (code "GL_PIXEL_MAP_I_TO_B")
34460 ", "
34461 (code "GL_PIXEL_MAP_I_TO_A")
34462 ", "
34463 (code "GL_PIXEL_MAP_R_TO_R")
34464 ", "
34465 (code "GL_PIXEL_MAP_G_TO_G")
34466 ", "
34467 (code "GL_PIXEL_MAP_B_TO_B")
34468 ", or "
34469 (code "GL_PIXEL_MAP_A_TO_A")
34470 ". "))
34471 (entry (% (heading (var "mapsize")))
34472 (para "
34473 Specifies the size of the map being defined. "))
34474 (entry (% (heading (var "values")))
34475 (para "
34476 Specifies an array of "
34477 (var "mapsize")
34478 " values. ")))
34479 (heading "Description")
34480 (para (code "glPixelMap")
34481 " sets up translation tables,
34482 or "
34483 (var "maps")
34484 ",
34485 used by "
34486 (code "glCopyPixels")
34487 ", "
34488 (code "glCopyTexImage1D")
34489 ", "
34490 (code "glCopyTexImage2D")
34491 ", "
34492 (code "glCopyTexSubImage1D")
34493 ", "
34494 (code "glCopyTexSubImage2D")
34495 ", "
34496 (code "glCopyTexSubImage3D")
34497 ", "
34498 (code "glDrawPixels")
34499 ", "
34500 (code "glReadPixels")
34501 ", "
34502 (code "glTexImage1D")
34503 ", "
34504 (code "glTexImage2D")
34505 ", "
34506 (code "glTexImage3D")
34507 ", "
34508 (code "glTexSubImage1D")
34509 ", "
34510 (code "glTexSubImage2D")
34511 ", and "
34512 (code "glTexSubImage3D")
34513 ".
34514 Additionally, if the "
34515 (code "ARB_imaging")
34516 " subset is supported, the
34517 routines "
34518 (code "glColorTable")
34519 ", "
34520 (code "glColorSubTable")
34521 ", "
34522 (code "glConvolutionFilter1D")
34523 ", "
34524 (code "glConvolutionFilter2D")
34525 ", "
34526 (code "glHistogram")
34527 ", "
34528 (code "glMinmax")
34529 ", and "
34530 (code "glSeparableFilter2D")
34531 ".
34532 Use of these maps is described completely in the "
34533 (code "glPixelTransfer")
34534 " reference page,
34535 and partly in the reference pages for the pixel and texture image commands.
34536 Only the specification of the maps is described in this reference page. ")
34537 (para (var "map")
34538 " is a symbolic map name,
34539 indicating one of ten maps to set. "
34540 (var "mapsize")
34541 " specifies the number of entries in the map,
34542 and "
34543 (var "values")
34544 " is a pointer to an array of "
34545 (var "mapsize")
34546 " map values. ")
34547 (para "
34548 If a non-zero named buffer object is bound to the "
34549 (code "GL_PIXEL_UNPACK_BUFFER")
34550 " target
34551 (see "
34552 (code "glBindBuffer")
34553 ") while a pixel transfer map is
34554 specified, "
34555 (var "values")
34556 " is treated as a byte offset into the buffer object's data store. ")
34557 (para "
34558 The ten maps are as follows: ")
34559 (table (% (formatter (asis)))
34560 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_I")))
34561 (para "
34562 Maps color indices to color indices. "))
34563 (entry (% (heading (code "GL_PIXEL_MAP_S_TO_S")))
34564 (para "
34565 Maps stencil indices to stencil indices. "))
34566 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_R")))
34567 (para "
34568 Maps color indices to red components. "))
34569 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_G")))
34570 (para "
34571 Maps color indices to green components. "))
34572 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_B")))
34573 (para "
34574 Maps color indices to blue components. "))
34575 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_A")))
34576 (para "
34577 Maps color indices to alpha components. "))
34578 (entry (% (heading (code "GL_PIXEL_MAP_R_TO_R")))
34579 (para "
34580 Maps red components to red components. "))
34581 (entry (% (heading (code "GL_PIXEL_MAP_G_TO_G")))
34582 (para "
34583 Maps green components to green components. "))
34584 (entry (% (heading (code "GL_PIXEL_MAP_B_TO_B")))
34585 (para "
34586 Maps blue components to blue components. "))
34587 (entry (% (heading (code "GL_PIXEL_MAP_A_TO_A")))
34588 (para "
34589 Maps alpha components to alpha components. ")))
34590 (para "
34591 The entries in a map can be specified as single-precision
34592 floating-point numbers,
34593 unsigned short integers,
34594 or unsigned int integers.
34595 Maps that store color component values
34596 (all but "
34597 (code "GL_PIXEL_MAP_I_TO_I")
34598 " and "
34599 (code "GL_PIXEL_MAP_S_TO_S")
34600 ")
34601 retain their values in floating-point format,
34602 with unspecified mantissa and exponent sizes.
34603 Floating-point values specified by "
34604 (code "glPixelMapfv")
34605 " are converted directly
34606 to the internal floating-point format of these maps,
34607 then clamped to the range [0,1].
34608 Unsigned integer values specified by "
34609 (code "glPixelMapusv")
34610 " and "
34611 (code "glPixelMapuiv")
34612 " are converted linearly such that
34613 the largest representable integer maps to 1.0,
34614 and 0 maps to 0.0. ")
34615 (para "
34616 Maps that store indices, "
34617 (code "GL_PIXEL_MAP_I_TO_I")
34618 " and "
34619 (code "GL_PIXEL_MAP_S_TO_S")
34620 ",
34621 retain their values in fixed-point format,
34622 with an unspecified number of bits to the right of the binary point.
34623 Floating-point values specified by "
34624 (code "glPixelMapfv")
34625 " are converted directly
34626 to the internal fixed-point format of these maps.
34627 Unsigned integer values specified by "
34628 (code "glPixelMapusv")
34629 " and "
34630 (code "glPixelMapuiv")
34631 " specify integer values,
34632 with all 0's to the right of the binary point. ")
34633 (para "
34634 The following table shows the initial sizes and values for each of the maps.
34635 Maps that are indexed by either color or stencil indices must have "
34636 (var "mapsize")
34637 " = "
34638 (math "2" "^" (var "n"))
34639 "
34640 for some "
34641 (math (var "n"))
34642 "
34643 or the results are undefined.
34644 The maximum allowable size for each map depends on the implementation
34645 and can be determined by calling "
34646 (code "glGet")
34647 " with argument "
34648 (code "GL_MAX_PIXEL_MAP_TABLE")
34649 ".
34650 The single maximum applies to all maps; it is at
34651 least 32. ")
34652 (table (% (formatter (asis)))
34653 (entry (% (heading (strong (var "map"))))
34654 (para (strong "Lookup Index")
34655 ", "
34656 (strong "Lookup Value")
34657 ", "
34658 (strong "Initial Size")
34659 ", "
34660 (strong "Initial Value")))
34661 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_I")))
34662 (para "
34663 color index "
34664 ", "
34665 "
34666 color index "
34667 ", "
34668 "
34669 1 "
34670 ", "
34671 "
34672 0 "))
34673 (entry (% (heading (code "GL_PIXEL_MAP_S_TO_S")))
34674 (para "
34675 stencil index "
34676 ", "
34677 "
34678 stencil index "
34679 ", "
34680 "
34681 1 "
34682 ", "
34683 "
34684 0 "))
34685 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_R")))
34686 (para "
34687 color index "
34688 ", "
34689 "
34690 R "
34691 ", "
34692 "
34693 1 "
34694 ", "
34695 "
34696 0 "))
34697 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_G")))
34698 (para "
34699 color index "
34700 ", "
34701 "
34702 G "
34703 ", "
34704 "
34705 1 "
34706 ", "
34707 "
34708 0 "))
34709 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_B")))
34710 (para "
34711 color index "
34712 ", "
34713 "
34714 B "
34715 ", "
34716 "
34717 1 "
34718 ", "
34719 "
34720 0 "))
34721 (entry (% (heading (code "GL_PIXEL_MAP_I_TO_A")))
34722 (para "
34723 color index "
34724 ", "
34725 "
34726 A "
34727 ", "
34728 "
34729 1 "
34730 ", "
34731 "
34732 0 "))
34733 (entry (% (heading (code "GL_PIXEL_MAP_R_TO_R")))
34734 (para "
34735 R " ", " "
34736 R " ", " "
34737 1 " ", " "
34738 0 "))
34739 (entry (% (heading (code "GL_PIXEL_MAP_G_TO_G")))
34740 (para "
34741 G " ", " "
34742 G " ", " "
34743 1 " ", " "
34744 0 "))
34745 (entry (% (heading (code "GL_PIXEL_MAP_B_TO_B")))
34746 (para "
34747 B " ", " "
34748 B " ", " "
34749 1 " ", " "
34750 0 "))
34751 (entry (% (heading (code "GL_PIXEL_MAP_A_TO_A")))
34752 (para "
34753 A " ", " "
34754 A " ", " "
34755 1 " ", " "
34756 0 ")))
34757 (heading "Errors")
34758 (para (code "GL_INVALID_ENUM")
34759 " is generated if "
34760 (var "map")
34761 " is not an accepted value. ")
34762 (para (code "GL_INVALID_VALUE")
34763 " is generated if "
34764 (var "mapsize")
34765 " is less than one
34766 or larger than "
34767 (code "GL_MAX_PIXEL_MAP_TABLE")
34768 ". ")
34769 (para (code "GL_INVALID_VALUE")
34770 " is generated if "
34771 (var "map")
34772 " is "
34773 (code "GL_PIXEL_MAP_I_TO_I")
34774 ", "
34775 (code "GL_PIXEL_MAP_S_TO_S")
34776 ", "
34777 (code "GL_PIXEL_MAP_I_TO_R")
34778 ", "
34779 (code "GL_PIXEL_MAP_I_TO_G")
34780 ", "
34781 (code "GL_PIXEL_MAP_I_TO_B")
34782 ", or "
34783 (code "GL_PIXEL_MAP_I_TO_A")
34784 ",
34785 and "
34786 (var "mapsize")
34787 " is not a power of two. ")
34788 (para (code "GL_INVALID_OPERATION")
34789 " is generated if a non-zero buffer object name is bound to the "
34790 (code "GL_PIXEL_UNPACK_BUFFER")
34791 " target and the buffer object's data store is currently mapped. ")
34792 (para (code "GL_INVALID_OPERATION")
34793 " is generated if a non-zero buffer object name is bound to the "
34794 (code "GL_PIXEL_UNPACK_BUFFER")
34795 " target and the data would be unpacked from the buffer
34796 object such that the memory reads required would exceed the data store size. ")
34797 (para (code "GL_INVALID_OPERATION")
34798 " is generated by "
34799 (code "glPixelMapfv")
34800 " if a non-zero buffer object name is bound to the "
34801 (code "GL_PIXEL_UNPACK_BUFFER")
34802 " target and "
34803 (var "values")
34804 " is not evenly divisible
34805 into the number of bytes needed to store in memory a GLfloat datum. ")
34806 (para (code "GL_INVALID_OPERATION")
34807 " is generated by "
34808 (code "glPixelMapuiv")
34809 " if a non-zero buffer object name is bound to the "
34810 (code "GL_PIXEL_UNPACK_BUFFER")
34811 " target and "
34812 (var "values")
34813 " is not evenly divisible
34814 into the number of bytes needed to store in memory a GLuint datum. ")
34815 (para (code "GL_INVALID_OPERATION")
34816 " is generated by "
34817 (code "glPixelMapusv")
34818 " if a non-zero buffer object name is bound to the "
34819 (code "GL_PIXEL_UNPACK_BUFFER")
34820 " target and "
34821 (var "values")
34822 " is not evenly divisible
34823 into the number of bytes needed to store in memory a GLushort datum. ")
34824 (para (code "GL_INVALID_OPERATION")
34825 " is generated if "
34826 (code "glPixelMap")
34827 "
34828 is executed between the execution of "
34829 (code "glBegin")
34830 "
34831 and the corresponding execution of "
34832 (code "glEnd")
34833 ". ")))
34834
34835 (define-gl-procedure
34836 glPixelStore
34837 "glPixelStore"
34838 (funcsynopsis
34839 (funcprototype
34840 (funcdef "void " (function "glPixelStoref"))
34841 (paramdef "GLenum " (parameter "pname"))
34842 (paramdef "GLfloat " (parameter "param"))))
34843 '(*fragment*
34844 (heading "set pixel storage modes")
34845 (heading "Parameters")
34846 (table (% (formatter (asis)))
34847 (entry (% (heading (var "pname")))
34848 (para "
34849 Specifies the symbolic name of the parameter to be set.
34850 Six values affect the packing of pixel data into memory: "
34851 (code "GL_PACK_SWAP_BYTES")
34852 ", "
34853 (code "GL_PACK_LSB_FIRST")
34854 ", "
34855 (code "GL_PACK_ROW_LENGTH")
34856 ", "
34857 (code "GL_PACK_IMAGE_HEIGHT")
34858 ", "
34859 (code "GL_PACK_SKIP_PIXELS")
34860 ", "
34861 (code "GL_PACK_SKIP_ROWS")
34862 ", "
34863 (code "GL_PACK_SKIP_IMAGES")
34864 ", and "
34865 (code "GL_PACK_ALIGNMENT")
34866 ".
34867 Six more affect the unpacking of pixel data "
34868 (var "from")
34869 " memory: "
34870 (code "GL_UNPACK_SWAP_BYTES")
34871 ", "
34872 (code "GL_UNPACK_LSB_FIRST")
34873 ", "
34874 (code "GL_UNPACK_ROW_LENGTH")
34875 ", "
34876 (code "GL_UNPACK_IMAGE_HEIGHT")
34877 ", "
34878 (code "GL_UNPACK_SKIP_PIXELS")
34879 ", "
34880 (code "GL_UNPACK_SKIP_ROWS")
34881 ", "
34882 (code "GL_UNPACK_SKIP_IMAGES")
34883 ", and "
34884 (code "GL_UNPACK_ALIGNMENT")
34885 ". "))
34886 (entry (% (heading (var "param")))
34887 (para "
34888 Specifies the value that "
34889 (var "pname")
34890 " is set to. ")))
34891 (heading "Description")
34892 (para (code "glPixelStore")
34893 " sets pixel storage modes that affect the operation of subsequent "
34894 (code "glDrawPixels")
34895 " and "
34896 (code "glReadPixels")
34897 " as well as the unpacking of
34898 polygon stipple patterns (see "
34899 (code "glPolygonStipple")
34900 "), bitmaps (see "
34901 (code "glBitmap")
34902 "), texture patterns (see "
34903 (code "glTexImage1D")
34904 ", "
34905 (code "glTexImage2D")
34906 ", "
34907 (code "glTexImage3D")
34908 ", "
34909 (code "glTexSubImage1D")
34910 ", "
34911 (code "glTexSubImage2D")
34912 ", "
34913 (code "glTexSubImage3D")
34914 ").
34915 Additionally, if the "
34916 (code "ARB_imaging")
34917 " extension is supported, pixel
34918 storage modes affect convolution filters
34919 (see "
34920 (code "glConvolutionFilter1D")
34921 ", "
34922 (code "glConvolutionFilter2D")
34923 ", and "
34924 (code "glSeparableFilter2D")
34925 ", color table (see "
34926 (code "glColorTable")
34927 ", and "
34928 (code "glColorSubTable")
34929 ", and unpacking histogram (See "
34930 (code "glHistogram")
34931 "),
34932 and minmax (See "
34933 (code "glMinmax")
34934 ") data. ")
34935 (para (var "pname")
34936 " is a symbolic constant indicating the parameter to be set, and "
34937 (var "param")
34938 " is the new value. Six of the twelve storage parameters affect
34939 how pixel data is returned to client memory.
34940 They are as follows: ")
34941 (table (% (formatter (asis)))
34942 (entry (% (heading (code "GL_PACK_SWAP_BYTES")))
34943 (para "
34944 If true,
34945 byte ordering for multibyte color components,
34946 depth components,
34947 color indices,
34948 or stencil indices
34949 is reversed.
34950 That is,
34951 if a four-byte component consists of bytes "
34952 (math (var "b") "_" "0")
34953 ", "
34954 (math (var "b") "_" "1")
34955 ", "
34956 (math (var "b") "_" "2")
34957 ", "
34958 (math (var "b") "_" "3")
34959 ",
34960 it is stored in memory as "
34961 (math (var "b") "_" "3")
34962 ", "
34963 (math (var "b") "_" "2")
34964 ", "
34965 (math (var "b") "_" "1")
34966 ", "
34967 (math (var "b") "_" "0")
34968 "
34969 if "
34970 (code "GL_PACK_SWAP_BYTES")
34971 " is true. "
34972 (code "GL_PACK_SWAP_BYTES")
34973 " has no effect on the memory order of components
34974 within a pixel,
34975 only on the order of bytes within components or indices.
34976 For example,
34977 the three components of a "
34978 (code "GL_RGB")
34979 " format pixel are always stored with
34980 red first,
34981 green second,
34982 and blue third,
34983 regardless of the value of "
34984 (code "GL_PACK_SWAP_BYTES")
34985 ". "))
34986 (entry (% (heading (code "GL_PACK_LSB_FIRST")))
34987 (para "
34988 If true,
34989 bits are ordered within a byte from least significant to most significant;
34990 otherwise,
34991 the first bit in each byte is the most significant one.
34992 This parameter is significant for bitmap data only. "))
34993 (entry (% (heading (code "GL_PACK_ROW_LENGTH")))
34994 (para "
34995 If greater than 0, "
34996 (code "GL_PACK_ROW_LENGTH")
34997 " defines the number of pixels in a row.
34998 If the first pixel of a row is placed at location "
34999 (math (var "p"))
35000 "
35001 in memory,
35002 then the location of the first pixel of the next row is obtained by skipping ")
35003 (para (math (var "k")
35004 "="
35005 "{"
35006 "("
35007 (var "n")
35008 "\u2062"
35009 (var "l")
35010 ")"
35011 ", "
35012 "("
35013 (var "a")
35014 "/"
35015 (var "s")
35016 ","
35017 "\u2062"
35018 "⌈"
35019 (var "s")
35020 "\u2062"
35021 (var "n")
35022 "\u2062"
35023 (var "l")
35024 ","
35025 "/"
35026 (var "a")
35027 ","
35028 "⌉"
35029 ")"
35030 "\u2062"
35031 "("
35032 (var "s")
35033 ">="
35034 (var "a")
35035 ")"
35036 ", "
35037 "("
35038 (var "s")
35039 "<"
35040 (var "a")
35041 ")"
35042 ","))
35043 (para "
35044 components or indices,
35045 where "
35046 (math (var "n"))
35047 "
35048 is the number of components or indices in a pixel, "
35049 (math (var "l"))
35050 "
35051 is the number of pixels in a row
35052 ("
35053 (code "GL_PACK_ROW_LENGTH")
35054 " if it is greater than 0,
35055 the "
35056 (math (var "width"))
35057 "
35058 argument to the pixel routine otherwise), "
35059 (math (var "a"))
35060 "
35061 is the value of "
35062 (code "GL_PACK_ALIGNMENT")
35063 ", and "
35064 (math (var "s"))
35065 "
35066 is the size, in bytes, of a single component
35067 (if "
35068 (math (var "a") "<" (var "s"))
35069 ",
35070 then it is as if "
35071 (math (var "a") "=" (var "s"))
35072 ").
35073 In the case of 1-bit values,
35074 the location of the next row is obtained by skipping ")
35075 (para (math (var "k")
35076 "="
35077 "8"
35078 "\u2062"
35079 (var "a")
35080 "\u2062"
35081 "⌈"
35082 (var "n")
35083 "\u2062"
35084 (var "l")
35085 ","
35086 "/"
35087 "8"
35088 "\u2062"
35089 (var "a")
35090 ","
35091 ","
35092 "⌉"))
35093 (para "
35094 components or indices. ")
35095 (para "
35096 The word "
35097 (var "component")
35098 " in this description refers to the nonindex values
35099 red,
35100 green,
35101 blue,
35102 alpha,
35103 and depth.
35104 Storage format "
35105 (code "GL_RGB")
35106 ",
35107 for example,
35108 has three components per pixel:
35109 first red,
35110 then green,
35111 and finally blue. "))
35112 (entry (% (heading (code "GL_PACK_IMAGE_HEIGHT")))
35113 (para "
35114 If greater than 0, "
35115 (code "GL_PACK_IMAGE_HEIGHT")
35116 " defines the number of pixels in an image
35117 three-dimensional texture volume, where ``image'' is defined by all pixels
35118 sharing the same third dimension index.
35119 If the first pixel of a row is placed at location "
35120 (math (var "p"))
35121 "
35122 in memory,
35123 then the location of the first pixel of the next row is obtained by skipping ")
35124 (para (math (var "k")
35125 "="
35126 "{"
35127 "("
35128 (var "n")
35129 "\u2062"
35130 (var "l")
35131 "\u2062"
35132 (var "h")
35133 ")"
35134 ", "
35135 "("
35136 (var "a")
35137 "/"
35138 (var "s")
35139 ","
35140 "\u2062"
35141 "⌈"
35142 (var "s")
35143 "\u2062"
35144 (var "n")
35145 "\u2062"
35146 (var "l")
35147 "\u2062"
35148 (var "h")
35149 ","
35150 "/"
35151 (var "a")
35152 ","
35153 "⌉"
35154 ")"
35155 "\u2062"
35156 "("
35157 (var "s")
35158 ">="
35159 (var "a")
35160 ")"
35161 ", "
35162 "("
35163 (var "s")
35164 "<"
35165 (var "a")
35166 ")"
35167 ","))
35168 (para "
35169 components or indices, where "
35170 (math (var "n"))
35171 "
35172 is the number of components or indices
35173 in a pixel, "
35174 (math (var "l"))
35175 "
35176 is the number of pixels in a row
35177 ("
35178 (code "GL_PACK_ROW_LENGTH")
35179 " if it is greater than 0, the "
35180 (math (var "width"))
35181 "
35182 argument to "
35183 (code "glTexImage3D")
35184 " otherwise), "
35185 (math (var "h"))
35186 "
35187 is the number of
35188 rows in a pixel image ("
35189 (code "GL_PACK_IMAGE_HEIGHT")
35190 " if it is greater than
35191 0, the "
35192 (math (var "height"))
35193 "
35194 argument to the "
35195 (code "glTexImage3D")
35196 " routine otherwise), "
35197 (math (var "a"))
35198 "
35199 is the value of "
35200 (code "GL_PACK_ALIGNMENT")
35201 ", and "
35202 (math (var "s"))
35203 "
35204 is the size, in bytes, of a single
35205 component (if "
35206 (math (var "a") "<" (var "s"))
35207 ",
35208 then it is as if "
35209 (math (var "a") "=" (var "s"))
35210 "). ")
35211 (para "
35212 The word "
35213 (var "component")
35214 " in this description refers to the nonindex values
35215 red,
35216 green,
35217 blue,
35218 alpha,
35219 and depth.
35220 Storage format "
35221 (code "GL_RGB")
35222 ",
35223 for example,
35224 has three components per pixel:
35225 first red,
35226 then green,
35227 and finally blue. "))
35228 (entry (% (heading
35229 (code "GL_PACK_SKIP_PIXELS")
35230 ", "
35231 (code "GL_PACK_SKIP_ROWS")
35232 ", and "
35233 (code "GL_PACK_SKIP_IMAGES")))
35234 (para "
35235 These values are provided as a convenience to the programmer;
35236 they provide no functionality that cannot be duplicated simply by
35237 incrementing the pointer passed to "
35238 (code "glReadPixels")
35239 ".
35240 Setting "
35241 (code "GL_PACK_SKIP_PIXELS")
35242 " to "
35243 (math (var "i"))
35244 "
35245 is equivalent to incrementing
35246 the pointer by "
35247 (math (var "i") "\u2062" (var "n"))
35248 "
35249 components or indices,
35250 where "
35251 (math (var "n"))
35252 "
35253 is the number of components or indices in each pixel.
35254 Setting "
35255 (code "GL_PACK_SKIP_ROWS")
35256 " to "
35257 (math (var "j"))
35258 "
35259 is equivalent to incrementing
35260 the pointer by "
35261 (math (var "j") "\u2062" (var "m"))
35262 "
35263 components or indices,
35264 where "
35265 (math (var "m"))
35266 "
35267 is the number of components or indices per row,
35268 as just computed in the "
35269 (code "GL_PACK_ROW_LENGTH")
35270 " section.
35271 Setting "
35272 (code "GL_PACK_SKIP_IMAGES")
35273 " to "
35274 (math (var "k"))
35275 "
35276 is equivalent to incrementing
35277 the pointer by "
35278 (math (var "k") "\u2062" (var "p"))
35279 ",
35280 where "
35281 (math (var "p"))
35282 "
35283 is the number of components or indices
35284 per image, as computed in the "
35285 (code "GL_PACK_IMAGE_HEIGHT")
35286 " section. "))
35287 (entry (% (heading (code "GL_PACK_ALIGNMENT")))
35288 (para "
35289 Specifies the alignment requirements for the start of each pixel row in memory.
35290 The allowable values are
35291 1 (byte-alignment),
35292 2 (rows aligned to even-numbered bytes),
35293 4 (word-alignment), and
35294 8 (rows start on double-word boundaries). ")))
35295 (para "
35296 The other six of the twelve storage parameters affect how pixel data is
35297 read from client memory.
35298 These values are significant for "
35299 (code "glDrawPixels")
35300 ", "
35301 (code "glTexImage1D")
35302 ", "
35303 (code "glTexImage2D")
35304 ", "
35305 (code "glTexImage3D")
35306 ", "
35307 (code "glTexSubImage1D")
35308 ", "
35309 (code "glTexSubImage2D")
35310 ", "
35311 (code "glTexSubImage3D")
35312 ", "
35313 (code "glBitmap")
35314 ", and "
35315 (code "glPolygonStipple")
35316 ". ")
35317 (para "
35318 Additionally, if the "
35319 (code "ARB_imaging")
35320 " extension is supported, "
35321 (code "glColorTable")
35322 ", "
35323 (code "glColorSubTable")
35324 ", "
35325 (code "glConvolutionFilter1D")
35326 ", "
35327 (code "glConvolutionFilter2D")
35328 ", and "
35329 (code "glSeparableFilter2D")
35330 ".
35331 They are as follows: ")
35332 (table (% (formatter (asis)))
35333 (entry (% (heading (code "GL_UNPACK_SWAP_BYTES")))
35334 (para "
35335 If true,
35336 byte ordering for multibyte color components,
35337 depth components,
35338 color indices,
35339 or stencil indices
35340 is reversed.
35341 That is,
35342 if a four-byte component consists of bytes "
35343 (math (var "b") "_" "0")
35344 ", "
35345 (math (var "b") "_" "1")
35346 ", "
35347 (math (var "b") "_" "2")
35348 ", "
35349 (math (var "b") "_" "3")
35350 ",
35351 it is taken from memory as "
35352 (math (var "b") "_" "3")
35353 ", "
35354 (math (var "b") "_" "2")
35355 ", "
35356 (math (var "b") "_" "1")
35357 ", "
35358 (math (var "b") "_" "0")
35359 "
35360 if "
35361 (code "GL_UNPACK_SWAP_BYTES")
35362 " is true. "
35363 (code "GL_UNPACK_SWAP_BYTES")
35364 " has no effect on the memory order of components
35365 within a pixel,
35366 only on the order of bytes within components or indices.
35367 For example,
35368 the three components of a "
35369 (code "GL_RGB")
35370 " format pixel are always stored with
35371 red first,
35372 green second,
35373 and blue third,
35374 regardless of the value of "
35375 (code "GL_UNPACK_SWAP_BYTES")
35376 ". "))
35377 (entry (% (heading (code "GL_UNPACK_LSB_FIRST")))
35378 (para "
35379 If true,
35380 bits are ordered within a byte from least significant to most significant;
35381 otherwise,
35382 the first bit in each byte is the most significant one.
35383 This is relevant only for bitmap data. "))
35384 (entry (% (heading (code "GL_UNPACK_ROW_LENGTH")))
35385 (para "
35386 If greater than 0, "
35387 (code "GL_UNPACK_ROW_LENGTH")
35388 " defines the number of pixels in a row.
35389 If the first pixel of a row is placed at location "
35390 (math (var "p"))
35391 "
35392 in memory,
35393 then the location of the first pixel of the next row is obtained by skipping ")
35394 (para (math (var "k")
35395 "="
35396 "{"
35397 "("
35398 (var "n")
35399 "\u2062"
35400 (var "l")
35401 ")"
35402 ", "
35403 "("
35404 (var "a")
35405 "/"
35406 (var "s")
35407 ","
35408 "\u2062"
35409 "⌈"
35410 (var "s")
35411 "\u2062"
35412 (var "n")
35413 "\u2062"
35414 (var "l")
35415 ","
35416 "/"
35417 (var "a")
35418 ","
35419 "⌉"
35420 ")"
35421 "\u2062"
35422 "("
35423 (var "s")
35424 ">="
35425 (var "a")
35426 ")"
35427 ", "
35428 "("
35429 (var "s")
35430 "<"
35431 (var "a")
35432 ")"
35433 ","))
35434 (para "
35435 components or indices,
35436 where "
35437 (math (var "n"))
35438 "
35439 is the number of components or indices in a pixel, "
35440 (math (var "l"))
35441 "
35442 is the number of pixels in a row
35443 ("
35444 (code "GL_UNPACK_ROW_LENGTH")
35445 " if it is greater than 0,
35446 the "
35447 (math (var "width"))
35448 "
35449 argument to the pixel routine otherwise), "
35450 (math (var "a"))
35451 "
35452 is the value of "
35453 (code "GL_UNPACK_ALIGNMENT")
35454 ", and "
35455 (math (var "s"))
35456 "
35457 is the size, in bytes, of a single component
35458 (if "
35459 (math (var "a") "<" (var "s"))
35460 ",
35461 then it is as if "
35462 (math (var "a") "=" (var "s"))
35463 ").
35464 In the case of 1-bit values,
35465 the location of the next row is obtained by skipping ")
35466 (para (math (var "k")
35467 "="
35468 "8"
35469 "\u2062"
35470 (var "a")
35471 "\u2062"
35472 "⌈"
35473 (var "n")
35474 "\u2062"
35475 (var "l")
35476 ","
35477 "/"
35478 "8"
35479 "\u2062"
35480 (var "a")
35481 ","
35482 ","
35483 "⌉"))
35484 (para "
35485 components or indices. ")
35486 (para "
35487 The word "
35488 (var "component")
35489 " in this description refers to the nonindex values
35490 red,
35491 green,
35492 blue,
35493 alpha,
35494 and depth.
35495 Storage format "
35496 (code "GL_RGB")
35497 ",
35498 for example,
35499 has three components per pixel:
35500 first red,
35501 then green,
35502 and finally blue. "))
35503 (entry (% (heading (code "GL_UNPACK_IMAGE_HEIGHT")))
35504 (para "
35505 If greater than 0, "
35506 (code "GL_UNPACK_IMAGE_HEIGHT")
35507 " defines the number of pixels in an image of
35508 a three-dimensional texture volume. Where ``image'' is defined by all
35509 pixel sharing the same third dimension index.
35510 If the first pixel of a row is placed at location "
35511 (math (var "p"))
35512 "
35513 in memory,
35514 then the location of the first pixel of the next row is obtained by skipping ")
35515 (para (math (var "k")
35516 "="
35517 "{"
35518 "("
35519 (var "n")
35520 "\u2062"
35521 (var "l")
35522 "\u2062"
35523 (var "h")
35524 ")"
35525 ", "
35526 "("
35527 (var "a")
35528 "/"
35529 (var "s")
35530 ","
35531 "\u2062"
35532 "⌈"
35533 (var "s")
35534 "\u2062"
35535 (var "n")
35536 "\u2062"
35537 (var "l")
35538 "\u2062"
35539 (var "h")
35540 ","
35541 "/"
35542 (var "a")
35543 ","
35544 "⌉"
35545 ")"
35546 "\u2062"
35547 "("
35548 (var "s")
35549 ">="
35550 (var "a")
35551 ")"
35552 ", "
35553 "("
35554 (var "s")
35555 "<"
35556 (var "a")
35557 ")"
35558 ","))
35559 (para "
35560 components or indices,
35561 where "
35562 (math (var "n"))
35563 "
35564 is the number of components or indices in a pixel, "
35565 (math (var "l"))
35566 "
35567 is the number of pixels in a row
35568 ("
35569 (code "GL_UNPACK_ROW_LENGTH")
35570 " if it is greater than 0,
35571 the "
35572 (math (var "width"))
35573 "
35574 argument to "
35575 (code "glTexImage3D")
35576 " otherwise), "
35577 (math (var "h"))
35578 "
35579 is the number of rows in an image ("
35580 (code "GL_UNPACK_IMAGE_HEIGHT")
35581 " if
35582 it is greater than 0, the "
35583 (math (var "height"))
35584 "
35585 argument to "
35586 (code "glTexImage3D")
35587 " otherwise), "
35588 (math (var "a"))
35589 "
35590 is the value of "
35591 (code "GL_UNPACK_ALIGNMENT")
35592 ", and "
35593 (math (var "s"))
35594 "
35595 is the size, in bytes, of a single component
35596 (if "
35597 (math (var "a") "<" (var "s"))
35598 ",
35599 then it is as if "
35600 (math (var "a") "=" (var "s"))
35601 "). ")
35602 (para "
35603 The word "
35604 (var "component")
35605 " in this description refers to the nonindex values
35606 red,
35607 green,
35608 blue,
35609 alpha,
35610 and depth.
35611 Storage format "
35612 (code "GL_RGB")
35613 ",
35614 for example,
35615 has three components per pixel:
35616 first red,
35617 then green,
35618 and finally blue. "))
35619 (entry (% (heading
35620 (code "GL_UNPACK_SKIP_PIXELS")
35621 " and "
35622 (code "GL_UNPACK_SKIP_ROWS")))
35623 (para "
35624 These values are provided as a convenience to the programmer;
35625 they provide no functionality that cannot be duplicated by
35626 incrementing the pointer passed to "
35627 (code "glDrawPixels")
35628 ", "
35629 (code "glTexImage1D")
35630 ", "
35631 (code "glTexImage2D")
35632 ", "
35633 (code "glTexSubImage1D")
35634 ", "
35635 (code "glTexSubImage2D")
35636 ", "
35637 (code "glBitmap")
35638 ", or "
35639 (code "glPolygonStipple")
35640 ".
35641 Setting "
35642 (code "GL_UNPACK_SKIP_PIXELS")
35643 " to "
35644 (math (var "i"))
35645 "
35646 is equivalent to incrementing
35647 the pointer by "
35648 (math (var "i") "\u2062" (var "n"))
35649 "
35650 components or indices,
35651 where "
35652 (math (var "n"))
35653 "
35654 is the number of components or indices in each pixel.
35655 Setting "
35656 (code "GL_UNPACK_SKIP_ROWS")
35657 " to "
35658 (math (var "j"))
35659 "
35660 is equivalent to incrementing
35661 the pointer by "
35662 (math (var "j") "\u2062" (var "k"))
35663 "
35664 components or indices,
35665 where "
35666 (math (var "k"))
35667 "
35668 is the number of components or indices per row,
35669 as just computed in the "
35670 (code "GL_UNPACK_ROW_LENGTH")
35671 " section. "))
35672 (entry (% (heading (code "GL_UNPACK_ALIGNMENT")))
35673 (para "
35674 Specifies the alignment requirements for the start of each pixel row in memory.
35675 The allowable values are
35676 1 (byte-alignment),
35677 2 (rows aligned to even-numbered bytes),
35678 4 (word-alignment), and
35679 8 (rows start on double-word boundaries). ")))
35680 (para "
35681 The following table gives the type,
35682 initial value,
35683 and range of valid values for each storage parameter
35684 that can be set with "
35685 (code "glPixelStore")
35686 ". ")
35687 (para)
35688 (table (% (formatter (asis)))
35689 (entry (% (heading (strong (var "pname"))))
35690 (para (strong "Type")
35691 ", "
35692 (strong "Initial Value")
35693 ", "
35694 (strong "Valid Range")))
35695 (entry (% (heading (code "GL_PACK_SWAP_BYTES")))
35696 (para "
35697 boolean "
35698 ", "
35699 "
35700 false "
35701 ", "
35702 "
35703 true or false "))
35704 (entry (% (heading (code "GL_PACK_LSB_FIRST")))
35705 (para "
35706 boolean "
35707 ", "
35708 "
35709 false "
35710 ", "
35711 "
35712 true or false "))
35713 (entry (% (heading (code "GL_PACK_ROW_LENGTH")))
35714 (para "
35715 integer "
35716 ", "
35717 "
35718 0 "
35719 ", "
35720 (math "[" "0" "," "∞" ")")))
35721 (entry (% (heading (code "GL_PACK_IMAGE_HEIGHT")))
35722 (para "
35723 integer "
35724 ", "
35725 "
35726 0 "
35727 ", "
35728 (math "[" "0" "," "∞" ")")))
35729 (entry (% (heading (code "GL_PACK_SKIP_ROWS")))
35730 (para "
35731 integer "
35732 ", "
35733 "
35734 0 "
35735 ", "
35736 (math "[" "0" "," "∞" ")")))
35737 (entry (% (heading (code "GL_PACK_SKIP_PIXELS")))
35738 (para "
35739 integer "
35740 ", "
35741 "
35742 0 "
35743 ", "
35744 (math "[" "0" "," "∞" ")")))
35745 (entry (% (heading (code "GL_PACK_SKIP_IMAGES")))
35746 (para "
35747 integer "
35748 ", "
35749 "
35750 0 "
35751 ", "
35752 (math "[" "0" "," "∞" ")")))
35753 (entry (% (heading (code "GL_PACK_ALIGNMENT")))
35754 (para "
35755 integer "
35756 ", "
35757 "
35758 4 "
35759 ", "
35760 "
35761 1, 2, 4, or 8 "))
35762 (entry (% (heading (code "GL_UNPACK_SWAP_BYTES")))
35763 (para "
35764 boolean "
35765 ", "
35766 "
35767 false "
35768 ", "
35769 "
35770 true or false "))
35771 (entry (% (heading (code "GL_UNPACK_LSB_FIRST")))
35772 (para "
35773 boolean "
35774 ", "
35775 "
35776 false "
35777 ", "
35778 "
35779 true or false "))
35780 (entry (% (heading (code "GL_UNPACK_ROW_LENGTH")))
35781 (para "
35782 integer "
35783 ", "
35784 "
35785 0 "
35786 ", "
35787 (math "[" "0" "," "∞" ")")))
35788 (entry (% (heading (code "GL_UNPACK_IMAGE_HEIGHT")))
35789 (para "
35790 integer "
35791 ", "
35792 "
35793 0 "
35794 ", "
35795 (math "[" "0" "," "∞" ")")))
35796 (entry (% (heading (code "GL_UNPACK_SKIP_ROWS")))
35797 (para "
35798 integer "
35799 ", "
35800 "
35801 0 "
35802 ", "
35803 (math "[" "0" "," "∞" ")")))
35804 (entry (% (heading (code "GL_UNPACK_SKIP_PIXELS")))
35805 (para "
35806 integer "
35807 ", "
35808 "
35809 0 "
35810 ", "
35811 (math "[" "0" "," "∞" ")")))
35812 (entry (% (heading (code "GL_UNPACK_SKIP_IMAGES")))
35813 (para "
35814 integer "
35815 ", "
35816 "
35817 0 "
35818 ", "
35819 (math "[" "0" "," "∞" ")")))
35820 (entry (% (heading (code "GL_UNPACK_ALIGNMENT")))
35821 (para "
35822 integer "
35823 ", "
35824 "
35825 4 "
35826 ", "
35827 "
35828 1, 2, 4, or 8 ")))
35829 (para (code "glPixelStoref")
35830 " can be used to set any pixel store parameter.
35831 If the parameter type is boolean,
35832 then if "
35833 (var "param")
35834 " is 0,
35835 the parameter is false;
35836 otherwise it is set to true.
35837 If "
35838 (var "pname")
35839 " is a integer type parameter, "
35840 (var "param")
35841 " is rounded to the nearest integer. ")
35842 (para "
35843 Likewise, "
35844 (code "glPixelStorei")
35845 " can also be used to set any of the
35846 pixel store parameters.
35847 Boolean parameters are set to false if "
35848 (var "param")
35849 " is 0 and true otherwise. ")
35850 (heading "Errors")
35851 (para (code "GL_INVALID_ENUM")
35852 " is generated if "
35853 (var "pname")
35854 " is not an accepted value. ")
35855 (para (code "GL_INVALID_VALUE")
35856 " is generated if a negative row length,
35857 pixel skip,
35858 or row skip value is specified,
35859 or if alignment is specified as other than 1, 2, 4, or 8. ")
35860 (para (code "GL_INVALID_OPERATION")
35861 " is generated if "
35862 (code "glPixelStore")
35863 "
35864 is executed between the execution of "
35865 (code "glBegin")
35866 "
35867 and the corresponding execution of "
35868 (code "glEnd")
35869 ". ")))
35870
35871 (define-gl-procedure
35872 glPixelTransfer
35873 "glPixelTransfer"
35874 (funcsynopsis
35875 (funcprototype
35876 (funcdef "void " (function "glPixelTransferf"))
35877 (paramdef "GLenum " (parameter "pname"))
35878 (paramdef "GLfloat " (parameter "param"))))
35879 '(*fragment*
35880 (heading "set pixel transfer modes")
35881 (heading "Parameters")
35882 (table (% (formatter (asis)))
35883 (entry (% (heading (var "pname")))
35884 (para "
35885 Specifies the symbolic name of the pixel transfer parameter to be set.
35886 Must be one of the following: "
35887 (code "GL_MAP_COLOR")
35888 ", "
35889 (code "GL_MAP_STENCIL")
35890 ", "
35891 (code "GL_INDEX_SHIFT")
35892 ", "
35893 (code "GL_INDEX_OFFSET")
35894 ", "
35895 (code "GL_RED_SCALE")
35896 ", "
35897 (code "GL_RED_BIAS")
35898 ", "
35899 (code "GL_GREEN_SCALE")
35900 ", "
35901 (code "GL_GREEN_BIAS")
35902 ", "
35903 (code "GL_BLUE_SCALE")
35904 ", "
35905 (code "GL_BLUE_BIAS")
35906 ", "
35907 (code "GL_ALPHA_SCALE")
35908 ", "
35909 (code "GL_ALPHA_BIAS")
35910 ", "
35911 (code "GL_DEPTH_SCALE")
35912 ", or "
35913 (code "GL_DEPTH_BIAS")
35914 ". ")
35915 (para "
35916 Additionally, if the "
35917 (code "ARB_imaging")
35918 " extension is supported, the
35919 following symbolic names are accepted: "
35920 (code "GL_POST_COLOR_MATRIX_RED_SCALE")
35921 ", "
35922 (code "GL_POST_COLOR_MATRIX_GREEN_SCALE")
35923 ", "
35924 (code "GL_POST_COLOR_MATRIX_BLUE_SCALE")
35925 ", "
35926 (code "GL_POST_COLOR_MATRIX_ALPHA_SCALE")
35927 ", "
35928 (code "GL_POST_COLOR_MATRIX_RED_BIAS")
35929 ", "
35930 (code "GL_POST_COLOR_MATRIX_GREEN_BIAS")
35931 ", "
35932 (code "GL_POST_COLOR_MATRIX_BLUE_BIAS")
35933 ", "
35934 (code "GL_POST_COLOR_MATRIX_ALPHA_BIAS")
35935 ", "
35936 (code "GL_POST_CONVOLUTION_RED_SCALE")
35937 ", "
35938 (code "GL_POST_CONVOLUTION_GREEN_SCALE")
35939 ", "
35940 (code "GL_POST_CONVOLUTION_BLUE_SCALE")
35941 ", "
35942 (code "GL_POST_CONVOLUTION_ALPHA_SCALE")
35943 ", "
35944 (code "GL_POST_CONVOLUTION_RED_BIAS")
35945 ", "
35946 (code "GL_POST_CONVOLUTION_GREEN_BIAS")
35947 ", "
35948 (code "GL_POST_CONVOLUTION_BLUE_BIAS")
35949 ", and "
35950 (code "GL_POST_CONVOLUTION_ALPHA_BIAS")
35951 ". "))
35952 (entry (% (heading (var "param")))
35953 (para "
35954 Specifies the value that "
35955 (var "pname")
35956 " is set to. ")))
35957 (heading "Description")
35958 (para (code "glPixelTransfer")
35959 " sets pixel transfer modes that affect the operation of subsequent "
35960 (code "glCopyPixels")
35961 ", "
35962 (code "glCopyTexImage1D")
35963 ", "
35964 (code "glCopyTexImage2D")
35965 ", "
35966 (code "glCopyTexSubImage1D")
35967 ", "
35968 (code "glCopyTexSubImage2D")
35969 ", "
35970 (code "glCopyTexSubImage3D")
35971 ", "
35972 (code "glDrawPixels")
35973 ", "
35974 (code "glReadPixels")
35975 ", "
35976 (code "glTexImage1D")
35977 ", "
35978 (code "glTexImage2D")
35979 ", "
35980 (code "glTexImage3D")
35981 ", "
35982 (code "glTexSubImage1D")
35983 ", "
35984 (code "glTexSubImage2D")
35985 ", and "
35986 (code "glTexSubImage3D")
35987 " commands.
35988 Additionally, if the "
35989 (code "ARB_imaging")
35990 " subset is supported, the
35991 routines "
35992 (code "glColorTable")
35993 ", "
35994 (code "glColorSubTable")
35995 ", "
35996 (code "glConvolutionFilter1D")
35997 ", "
35998 (code "glConvolutionFilter2D")
35999 ", "
36000 (code "glHistogram")
36001 ", "
36002 (code "glMinmax")
36003 ", and "
36004 (code "glSeparableFilter2D")
36005 " are also affected.
36006 The algorithms that are specified by pixel transfer modes operate on
36007 pixels after they are read from the frame buffer
36008 ("
36009 (code "glCopyPixels")
36010 (code "glCopyTexImage1D")
36011 ", "
36012 (code "glCopyTexImage2D")
36013 ", "
36014 (code "glCopyTexSubImage1D")
36015 ", "
36016 (code "glCopyTexSubImage2D")
36017 ", "
36018 (code "glCopyTexSubImage3D")
36019 ", and "
36020 (code "glReadPixels")
36021 "),
36022 or unpacked from client memory
36023 ("
36024 (code "glDrawPixels")
36025 ", "
36026 (code "glTexImage1D")
36027 ", "
36028 (code "glTexImage2D")
36029 ", "
36030 (code "glTexImage3D")
36031 ", "
36032 (code "glTexSubImage1D")
36033 ", "
36034 (code "glTexSubImage2D")
36035 ", and "
36036 (code "glTexSubImage3D")
36037 ").
36038 Pixel transfer operations happen in the same order,
36039 and in the same manner,
36040 regardless of the command that resulted in the pixel operation.
36041 Pixel storage modes
36042 (see "
36043 (code "glPixelStore")
36044 ")
36045 control the unpacking of pixels being read from client memory
36046 and the packing of pixels being written back into client memory. ")
36047 (para "
36048 Pixel transfer operations handle four fundamental pixel types: "
36049 (var "color")
36050 ", "
36051 (var "color index")
36052 ", "
36053 (var "depth")
36054 ", and "
36055 (var "stencil")
36056 ". "
36057 (var "Color")
36058 " pixels consist of four floating-point values
36059 with unspecified mantissa and exponent sizes,
36060 scaled such that 0 represents zero intensity
36061 and 1 represents full intensity. "
36062 (var "Color indices")
36063 " comprise a single fixed-point value,
36064 with unspecified precision to the right of the binary point. "
36065 (var "Depth")
36066 " pixels comprise a single floating-point value,
36067 with unspecified mantissa and exponent sizes,
36068 scaled such that 0.0 represents the minimum depth buffer value,
36069 and 1.0 represents the maximum depth buffer value.
36070 Finally, "
36071 (var "stencil")
36072 " pixels comprise a single fixed-point value,
36073 with unspecified precision to the right of the binary point. ")
36074 (para "
36075 The pixel transfer operations performed on the four basic pixel types are
36076 as follows: ")
36077 (table (% (formatter (asis)))
36078 (entry (% (heading (var "Color")))
36079 (para "
36080 Each of the four color components is multiplied by a scale factor,
36081 then added to a bias factor.
36082 That is,
36083 the red component is multiplied by "
36084 (code "GL_RED_SCALE")
36085 ",
36086 then added to "
36087 (code "GL_RED_BIAS")
36088 ";
36089 the green component is multiplied by "
36090 (code "GL_GREEN_SCALE")
36091 ",
36092 then added to "
36093 (code "GL_GREEN_BIAS")
36094 ";
36095 the blue component is multiplied by "
36096 (code "GL_BLUE_SCALE")
36097 ",
36098 then added to "
36099 (code "GL_BLUE_BIAS")
36100 "; and
36101 the alpha component is multiplied by "
36102 (code "GL_ALPHA_SCALE")
36103 ",
36104 then added to "
36105 (code "GL_ALPHA_BIAS")
36106 ".
36107 After all four color components are scaled and biased,
36108 each is clamped to the range "
36109 (math "[" "0" "," "1" "]")
36110 ".
36111 All color, scale, and bias values are specified with "
36112 (code "glPixelTransfer")
36113 ". ")
36114 (para "
36115 If "
36116 (code "GL_MAP_COLOR")
36117 " is true,
36118 each color component is scaled by the size of the corresponding
36119 color-to-color map,
36120 then replaced by the contents of that map indexed by the scaled component.
36121 That is,
36122 the red component is scaled by "
36123 (code "GL_PIXEL_MAP_R_TO_R_SIZE")
36124 ",
36125 then replaced by the contents of "
36126 (code "GL_PIXEL_MAP_R_TO_R")
36127 " indexed by itself.
36128 The green component is scaled by "
36129 (code "GL_PIXEL_MAP_G_TO_G_SIZE")
36130 ",
36131 then replaced by the contents of "
36132 (code "GL_PIXEL_MAP_G_TO_G")
36133 " indexed by itself.
36134 The blue component is scaled by "
36135 (code "GL_PIXEL_MAP_B_TO_B_SIZE")
36136 ",
36137 then replaced by the contents of "
36138 (code "GL_PIXEL_MAP_B_TO_B")
36139 " indexed by itself.
36140 And
36141 the alpha component is scaled by "
36142 (code "GL_PIXEL_MAP_A_TO_A_SIZE")
36143 ",
36144 then replaced by the contents of "
36145 (code "GL_PIXEL_MAP_A_TO_A")
36146 " indexed by itself.
36147 All components taken from the maps are then clamped to the range "
36148 (math "[" "0" "," "1" "]")
36149 ". "
36150 (code "GL_MAP_COLOR")
36151 " is specified with "
36152 (code "glPixelTransfer")
36153 ".
36154 The contents of the various maps are specified with "
36155 (code "glPixelMap")
36156 ". ")
36157 (para "
36158 If the "
36159 (code "ARB_imaging")
36160 " extension is supported, each of the four
36161 color components may be scaled and biased after transformation by the
36162 color matrix.
36163 That is,
36164 the red component is multiplied by "
36165 (code "GL_POST_COLOR_MATRIX_RED_SCALE")
36166 ",
36167 then added to "
36168 (code "GL_POST_COLOR_MATRIX_RED_BIAS")
36169 ";
36170 the green component is multiplied by "
36171 (code "GL_POST_COLOR_MATRIX_GREEN_SCALE")
36172 ",
36173 then added to "
36174 (code "GL_POST_COLOR_MATRIX_GREEN_BIAS")
36175 ";
36176 the blue component is multiplied by "
36177 (code "GL_POST_COLOR_MATRIX_BLUE_SCALE")
36178 ",
36179 then added to "
36180 (code "GL_POST_COLOR_MATRIX_BLUE_BIAS")
36181 "; and
36182 the alpha component is multiplied by "
36183 (code "GL_POST_COLOR_MATRIX_ALPHA_SCALE")
36184 ",
36185 then added to "
36186 (code "GL_POST_COLOR_MATRIX_ALPHA_BIAS")
36187 ".
36188 After all four color components are scaled and biased,
36189 each is clamped to the range "
36190 (math "[" "0" "," "1" "]")
36191 ". ")
36192 (para "
36193 Similarly, if the "
36194 (code "ARB_imaging")
36195 " extension is supported, each of
36196 the four color components may be scaled and biased after processing by
36197 the enabled convolution filter.
36198 That is,
36199 the red component is multiplied by "
36200 (code "GL_POST_CONVOLUTION_RED_SCALE")
36201 ",
36202 then added to "
36203 (code "GL_POST_CONVOLUTION_RED_BIAS")
36204 ";
36205 the green component is multiplied by "
36206 (code "GL_POST_CONVOLUTION_GREEN_SCALE")
36207 ",
36208 then added to "
36209 (code "GL_POST_CONVOLUTION_GREEN_BIAS")
36210 ";
36211 the blue component is multiplied by "
36212 (code "GL_POST_CONVOLUTION_BLUE_SCALE")
36213 ",
36214 then added to "
36215 (code "GL_POST_CONVOLUTION_BLUE_BIAS")
36216 "; and
36217 the alpha component is multiplied by "
36218 (code "GL_POST_CONVOLUTION_ALPHA_SCALE")
36219 ",
36220 then added to "
36221 (code "GL_POST_CONVOLUTION_ALPHA_BIAS")
36222 ".
36223 After all four color components are scaled and biased,
36224 each is clamped to the range "
36225 (math "[" "0" "," "1" "]")
36226 ". "))
36227 (entry (% (heading (var "Color index")))
36228 (para "
36229 Each color index is shifted left by "
36230 (code "GL_INDEX_SHIFT")
36231 " bits; any bits
36232 beyond the number of fraction bits carried
36233 by the fixed-point index are filled with zeros.
36234 If "
36235 (code "GL_INDEX_SHIFT")
36236 " is negative,
36237 the shift is to the right,
36238 again zero filled.
36239 Then "
36240 (code "GL_INDEX_OFFSET")
36241 " is added to the index. "
36242 (code "GL_INDEX_SHIFT")
36243 " and "
36244 (code "GL_INDEX_OFFSET")
36245 " are specified with "
36246 (code "glPixelTransfer")
36247 ". ")
36248 (para "
36249 From this point, operation diverges depending on the required format of
36250 the resulting pixels.
36251 If the resulting pixels are to be written to a color index buffer,
36252 or if they are being read back to client memory in "
36253 (code "GL_COLOR_INDEX")
36254 " format,
36255 the pixels continue to be treated as indices.
36256 If "
36257 (code "GL_MAP_COLOR")
36258 " is true,
36259 each index is masked by "
36260 (math "2" "^" (var "n") "-" "1")
36261 ",
36262 where "
36263 (math (var "n"))
36264 "
36265 is "
36266 (code "GL_PIXEL_MAP_I_TO_I_SIZE")
36267 ",
36268 then replaced by the contents of "
36269 (code "GL_PIXEL_MAP_I_TO_I")
36270 " indexed by the
36271 masked value. "
36272 (code "GL_MAP_COLOR")
36273 " is specified with "
36274 (code "glPixelTransfer")
36275 ".
36276 The contents of the index map is specified with "
36277 (code "glPixelMap")
36278 ". ")
36279 (para "
36280 If the resulting pixels are to be written to an RGBA color buffer,
36281 or if they are read back to client memory in a format other than "
36282 (code "GL_COLOR_INDEX")
36283 ",
36284 the pixels are converted from indices to colors by referencing the
36285 four maps "
36286 (code "GL_PIXEL_MAP_I_TO_R")
36287 ", "
36288 (code "GL_PIXEL_MAP_I_TO_G")
36289 ", "
36290 (code "GL_PIXEL_MAP_I_TO_B")
36291 ", and "
36292 (code "GL_PIXEL_MAP_I_TO_A")
36293 ".
36294 Before being dereferenced,
36295 the index is masked by "
36296 (math "2" "^" (var "n") "-" "1")
36297 ",
36298 where "
36299 (math (var "n"))
36300 "
36301 is "
36302 (code "GL_PIXEL_MAP_I_TO_R_SIZE")
36303 " for the red map, "
36304 (code "GL_PIXEL_MAP_I_TO_G_SIZE")
36305 " for the green map, "
36306 (code "GL_PIXEL_MAP_I_TO_B_SIZE")
36307 " for the blue map, and "
36308 (code "GL_PIXEL_MAP_I_TO_A_SIZE")
36309 " for the alpha map.
36310 All components taken from the maps are then clamped to the range "
36311 (math "[" "0" "," "1" "]")
36312 ".
36313 The contents of the four maps is specified with "
36314 (code "glPixelMap")
36315 ". "))
36316 (entry (% (heading (var "Depth")))
36317 (para "
36318 Each depth value is multiplied by "
36319 (code "GL_DEPTH_SCALE")
36320 ",
36321 added to "
36322 (code "GL_DEPTH_BIAS")
36323 ",
36324 then clamped to the range "
36325 (math "[" "0" "," "1" "]")
36326 ". "))
36327 (entry (% (heading (var "Stencil")))
36328 (para "
36329 Each index is shifted "
36330 (code "GL_INDEX_SHIFT")
36331 " bits just as a color index is,
36332 then added to "
36333 (code "GL_INDEX_OFFSET")
36334 ".
36335 If "
36336 (code "GL_MAP_STENCIL")
36337 " is true,
36338 each index is masked by "
36339 (math "2" "^" (var "n") "-" "1")
36340 ",
36341 where "
36342 (math (var "n"))
36343 "
36344 is "
36345 (code "GL_PIXEL_MAP_S_TO_S_SIZE")
36346 ",
36347 then replaced by the contents of "
36348 (code "GL_PIXEL_MAP_S_TO_S")
36349 " indexed by the
36350 masked value. ")))
36351 (para "
36352 The following table gives the type,
36353 initial value,
36354 and range of valid values for each of the pixel transfer parameters
36355 that are set with "
36356 (code "glPixelTransfer")
36357 ". ")
36358 (para)
36359 (table (% (formatter (asis)))
36360 (entry (% (heading (strong (var "pname"))))
36361 (para (strong "Type")
36362 ", "
36363 (strong "Initial Value")
36364 ", "
36365 (strong "Valid Range")))
36366 (entry (% (heading (code "GL_MAP_COLOR")))
36367 (para "
36368 boolean "
36369 ", "
36370 "
36371 false "
36372 ", "
36373 "
36374 true/false "))
36375 (entry (% (heading (code "GL_MAP_STENCIL")))
36376 (para "
36377 boolean "
36378 ", "
36379 "
36380 false "
36381 ", "
36382 "
36383 true/false "))
36384 (entry (% (heading (code "GL_INDEX_SHIFT")))
36385 (para "
36386 integer "
36387 ", "
36388 "
36389 0 "
36390 ", "
36391 (math "(" "-" "∞" "," "∞" ")")))
36392 (entry (% (heading (code "GL_INDEX_OFFSET")))
36393 (para "
36394 integer "
36395 ", "
36396 "
36397 0 "
36398 ", "
36399 (math "(" "-" "∞" "," "∞" ")")))
36400 (entry (% (heading (code "GL_RED_SCALE")))
36401 (para "
36402 float "
36403 ", "
36404 "
36405 1 "
36406 ", "
36407 (math "(" "-" "∞" "," "∞" ")")))
36408 (entry (% (heading (code "GL_GREEN_SCALE")))
36409 (para "
36410 float "
36411 ", "
36412 "
36413 1 "
36414 ", "
36415 (math "(" "-" "∞" "," "∞" ")")))
36416 (entry (% (heading (code "GL_BLUE_SCALE")))
36417 (para "
36418 float "
36419 ", "
36420 "
36421 1 "
36422 ", "
36423 (math "(" "-" "∞" "," "∞" ")")))
36424 (entry (% (heading (code "GL_ALPHA_SCALE")))
36425 (para "
36426 float "
36427 ", "
36428 "
36429 1 "
36430 ", "
36431 (math "(" "-" "∞" "," "∞" ")")))
36432 (entry (% (heading (code "GL_DEPTH_SCALE")))
36433 (para "
36434 float "
36435 ", "
36436 "
36437 1 "
36438 ", "
36439 (math "(" "-" "∞" "," "∞" ")")))
36440 (entry (% (heading (code "GL_RED_BIAS")))
36441 (para "
36442 float "
36443 ", "
36444 "
36445 0 "
36446 ", "
36447 (math "(" "-" "∞" "," "∞" ")")))
36448 (entry (% (heading (code "GL_GREEN_BIAS")))
36449 (para "
36450 float "
36451 ", "
36452 "
36453 0 "
36454 ", "
36455 (math "(" "-" "∞" "," "∞" ")")))
36456 (entry (% (heading (code "GL_BLUE_BIAS")))
36457 (para "
36458 float "
36459 ", "
36460 "
36461 0 "
36462 ", "
36463 (math "(" "-" "∞" "," "∞" ")")))
36464 (entry (% (heading (code "GL_ALPHA_BIAS")))
36465 (para "
36466 float "
36467 ", "
36468 "
36469 0 "
36470 ", "
36471 (math "(" "-" "∞" "," "∞" ")")))
36472 (entry (% (heading (code "GL_DEPTH_BIAS")))
36473 (para "
36474 float "
36475 ", "
36476 "
36477 0 "
36478 ", "
36479 (math "(" "-" "∞" "," "∞" ")")))
36480 (entry (% (heading (code "GL_POST_COLOR_MATRIX_RED_SCALE")))
36481 (para "
36482 float "
36483 ", "
36484 "
36485 1 "
36486 ", "
36487 (math "(" "-" "∞" "," "∞" ")")))
36488 (entry (% (heading
36489 (code "GL_POST_COLOR_MATRIX_GREEN_SCALE")))
36490 (para "
36491 float "
36492 ", "
36493 "
36494 1 "
36495 ", "
36496 (math "(" "-" "∞" "," "∞" ")")))
36497 (entry (% (heading
36498 (code "GL_POST_COLOR_MATRIX_BLUE_SCALE")))
36499 (para "
36500 float "
36501 ", "
36502 "
36503 1 "
36504 ", "
36505 (math "(" "-" "∞" "," "∞" ")")))
36506 (entry (% (heading
36507 (code "GL_POST_COLOR_MATRIX_ALPHA_SCALE")))
36508 (para "
36509 float "
36510 ", "
36511 "
36512 1 "
36513 ", "
36514 (math "(" "-" "∞" "," "∞" ")")))
36515 (entry (% (heading (code "GL_POST_COLOR_MATRIX_RED_BIAS")))
36516 (para "
36517 float "
36518 ", "
36519 "
36520 0 "
36521 ", "
36522 (math "(" "-" "∞" "," "∞" ")")))
36523 (entry (% (heading
36524 (code "GL_POST_COLOR_MATRIX_GREEN_BIAS")))
36525 (para "
36526 float "
36527 ", "
36528 "
36529 0 "
36530 ", "
36531 (math "(" "-" "∞" "," "∞" ")")))
36532 (entry (% (heading (code "GL_POST_COLOR_MATRIX_BLUE_BIAS")))
36533 (para "
36534 float "
36535 ", "
36536 "
36537 0 "
36538 ", "
36539 (math "(" "-" "∞" "," "∞" ")")))
36540 (entry (% (heading
36541 (code "GL_POST_COLOR_MATRIX_ALPHA_BIAS")))
36542 (para "
36543 float "
36544 ", "
36545 "
36546 0 "
36547 ", "
36548 (math "(" "-" "∞" "," "∞" ")")))
36549 (entry (% (heading (code "GL_POST_CONVOLUTION_RED_SCALE")))
36550 (para "
36551 float "
36552 ", "
36553 "
36554 1 "
36555 ", "
36556 (math "(" "-" "∞" "," "∞" ")")))
36557 (entry (% (heading
36558 (code "GL_POST_CONVOLUTION_GREEN_SCALE")))
36559 (para "
36560 float "
36561 ", "
36562 "
36563 1 "
36564 ", "
36565 (math "(" "-" "∞" "," "∞" ")")))
36566 (entry (% (heading (code "GL_POST_CONVOLUTION_BLUE_SCALE")))
36567 (para "
36568 float "
36569 ", "
36570 "
36571 1 "
36572 ", "
36573 (math "(" "-" "∞" "," "∞" ")")))
36574 (entry (% (heading
36575 (code "GL_POST_CONVOLUTION_ALPHA_SCALE")))
36576 (para "
36577 float "
36578 ", "
36579 "
36580 1 "
36581 ", "
36582 (math "(" "-" "∞" "," "∞" ")")))
36583 (entry (% (heading (code "GL_POST_CONVOLUTION_RED_BIAS")))
36584 (para "
36585 float "
36586 ", "
36587 "
36588 0 "
36589 ", "
36590 (math "(" "-" "∞" "," "∞" ")")))
36591 (entry (% (heading (code "GL_POST_CONVOLUTION_GREEN_BIAS")))
36592 (para "
36593 float "
36594 ", "
36595 "
36596 0 "
36597 ", "
36598 (math "(" "-" "∞" "," "∞" ")")))
36599 (entry (% (heading (code "GL_POST_CONVOLUTION_BLUE_BIAS")))
36600 (para "
36601 float "
36602 ", "
36603 "
36604 0 "
36605 ", "
36606 (math "(" "-" "∞" "," "∞" ")")))
36607 (entry (% (heading (code "GL_POST_CONVOLUTION_ALPHA_BIAS")))
36608 (para "
36609 float "
36610 ", "
36611 "
36612 0 "
36613 ", "
36614 (math "(" "-" "∞" "," "∞" ")"))))
36615 (para (code "glPixelTransferf")
36616 " can be used to set any pixel transfer parameter.
36617 If the parameter type is boolean,
36618 0 implies false and any other value implies true.
36619 If "
36620 (var "pname")
36621 " is an integer parameter, "
36622 (var "param")
36623 " is rounded to the nearest integer. ")
36624 (para "
36625 Likewise, "
36626 (code "glPixelTransferi")
36627 " can be used to set any of the
36628 pixel transfer parameters.
36629 Boolean parameters are set to false if "
36630 (var "param")
36631 " is 0 and to true otherwise. "
36632 (var "param")
36633 " is converted to floating point before being assigned to real-valued parameters. ")
36634 (heading "Errors")
36635 (para (code "GL_INVALID_ENUM")
36636 " is generated if "
36637 (var "pname")
36638 " is not an accepted value. ")
36639 (para (code "GL_INVALID_OPERATION")
36640 " is generated if "
36641 (code "glPixelTransfer")
36642 "
36643 is executed between the execution of "
36644 (code "glBegin")
36645 "
36646 and the corresponding execution of "
36647 (code "glEnd")
36648 ". ")))
36649
36650 (define-gl-procedure
36651 glPixelZoom
36652 "glPixelZoom"
36653 (funcsynopsis
36654 (funcprototype
36655 (funcdef "void " (function "glPixelZoom"))
36656 (paramdef "GLfloat " (parameter "xfactor"))
36657 (paramdef "GLfloat " (parameter "yfactor"))))
36658 '(*fragment*
36659 (heading "specify the pixel zoom factors")
36660 (heading "Parameters")
36661 (table (% (formatter (asis)))
36662 (entry (% (heading (var "xfactor")))
36663 (itemx (var "yfactor"))
36664 (para "
36665 Specify the "
36666 (math (var "x"))
36667 "
36668 and "
36669 (math (var "y"))
36670 "
36671 zoom factors for pixel write operations. ")))
36672 (heading "Description")
36673 (para (code "glPixelZoom")
36674 " specifies values for the "
36675 (math (var "x"))
36676 "
36677 and "
36678 (math (var "y"))
36679 "
36680 zoom factors.
36681 During the execution of "
36682 (code "glDrawPixels")
36683 " or "
36684 (code "glCopyPixels")
36685 ",
36686 if
36687 ("
36688 (math (var "xr"))
36689 ", "
36690 (math (var "yr"))
36691 ")
36692 is the current raster position,
36693 and a given element is in the "
36694 (math (var "m"))
36695 "th
36696 row and "
36697 (math (var "n"))
36698 "th
36699 column of the pixel rectangle,
36700 then pixels whose centers are in the rectangle with corners at ")
36701 (para "
36702 ("
36703 (math (var "xr")
36704 "+"
36705 (var "n")
36706 "·"
36707 (var "xfactor"))
36708 ", "
36709 (math (var "yr")
36710 "+"
36711 (var "m")
36712 "·"
36713 (var "yfactor"))
36714 ") ")
36715 (para "
36716 ("
36717 (math (var "xr")
36718 "+"
36719 "("
36720 (var "n")
36721 "+"
36722 "1"
36723 ","
36724 ")"
36725 "·"
36726 (var "xfactor"))
36727 ", "
36728 (math (var "yr")
36729 "+"
36730 "("
36731 (var "m")
36732 "+"
36733 "1"
36734 ","
36735 ")"
36736 "·"
36737 (var "yfactor"))
36738 ") ")
36739 (para "
36740 are candidates for replacement.
36741 Any pixel whose center lies on the bottom or left edge of this rectangular
36742 region is also modified. ")
36743 (para "
36744 Pixel zoom factors are not limited to positive values.
36745 Negative zoom factors reflect the resulting image about the current
36746 raster position. ")
36747 (heading "Errors")
36748 (para (code "GL_INVALID_OPERATION")
36749 " is generated if "
36750 (code "glPixelZoom")
36751 "
36752 is executed between the execution of "
36753 (code "glBegin")
36754 "
36755 and the corresponding execution of "
36756 (code "glEnd")
36757 ". ")))
36758
36759 (define-gl-procedure
36760 glPointParameter
36761 "glPointParameter"
36762 (funcsynopsis
36763 (funcprototype
36764 (funcdef "void " (function "glPointParameterf"))
36765 (paramdef "GLenum " (parameter "pname"))
36766 (paramdef "GLfloat " (parameter "param"))))
36767 '(*fragment*
36768 (heading "specify point parameters")
36769 (heading "Parameters")
36770 (table (% (formatter (asis)))
36771 (entry (% (heading (var "pname")))
36772 (para "
36773 Specifies a single-valued point parameter. "
36774 (code "GL_POINT_SIZE_MIN")
36775 ", "
36776 (code "GL_POINT_SIZE_MAX")
36777 ", "
36778 (code "GL_POINT_FADE_THRESHOLD_SIZE")
36779 ", and "
36780 (code "GL_POINT_SPRITE_COORD_ORIGIN")
36781 "
36782 are accepted. "))
36783 (entry (% (heading (var "param")))
36784 (para "
36785 Specifies the value that "
36786 (var "pname")
36787 " will be set to. ")))
36788 (heading "Description")
36789 (para "
36790 The following values are accepted for "
36791 (var "pname")
36792 ": ")
36793 (table (% (formatter (asis)))
36794 (entry (% (heading (code "GL_POINT_SIZE_MIN")))
36795 (para)
36796 (para (var "params")
36797 " is a single floating-point value that specifies the minimum point size. The default value is 0.0. "))
36798 (entry (% (heading (code "GL_POINT_SIZE_MAX")))
36799 (para)
36800 (para (var "params")
36801 " is a single floating-point value that specifies the maximum point size. The default value is 1.0. "))
36802 (entry (% (heading (code "GL_POINT_FADE_THRESHOLD_SIZE")))
36803 (para)
36804 (para (var "params")
36805 " is a single floating-point value that specifies the threshold value
36806 to which point sizes are clamped if they exceed the specified value. The
36807 default value is 1.0. "))
36808 (entry (% (heading (code "GL_POINT_DISTANCE_ATTENUATION")))
36809 (para)
36810 (para (var "params")
36811 " is an array of three floating-point values that specify the
36812 coefficients used for scaling the computed point size. The default values
36813 are "
36814 (math "(" "1" "," "0" "0" ")")
36815 ". "))
36816 (entry (% (heading (code "GL_POINT_SPRITE_COORD_ORIGIN")))
36817 (para)
36818 (para (var "params")
36819 " is a single enum specifying the point sprite texture coordinate origin, either "
36820 (code "GL_LOWER_LEFT")
36821 " or "
36822 (code "GL_UPPER_LEFT")
36823 ".
36824 The default value is "
36825 (code "GL_UPPER_LEFT")
36826 ". ")))
36827 (heading "Errors")
36828 (para (code "GL_INVALID_VALUE")
36829 " is generated If the value specified for "
36830 (code "GL_POINT_SIZE_MIN")
36831 ", "
36832 (code "GL_POINT_SIZE_MAX")
36833 ", or "
36834 (code "GL_POINT_FADE_THRESHOLD_SIZE")
36835 " is less than zero. ")
36836 (para (code "GL_INVALID_ENUM")
36837 " is generated If the value specified for "
36838 (code "GL_POINT_SPRITE_COORD_ORIGIN")
36839 " is not "
36840 (code "GL_LOWER_LEFT")
36841 " or "
36842 (code "GL_UPPER_LEFT")
36843 ". ")
36844 (para "
36845 If the value for "
36846 (code "GL_POINT_SIZE_MIN")
36847 " is greater than "
36848 (code "GL_POINT_SIZE_MAX")
36849 ", the point size after clamping is undefined, but no
36850 error is generated. ")
36851 (para)))
36852
36853 (define-gl-procedure
36854 glPointSize
36855 "glPointSize"
36856 (funcsynopsis
36857 (funcprototype
36858 (funcdef "void " (function "glPointSize"))
36859 (paramdef "GLfloat " (parameter "size"))))
36860 '(*fragment*
36861 (heading
36862 "specify the diameter of rasterized points")
36863 (heading "Parameters")
36864 (table (% (formatter (asis)))
36865 (entry (% (heading (var "size")))
36866 (para "
36867 Specifies the diameter of rasterized points.
36868 The initial value is 1. ")))
36869 (heading "Description")
36870 (para (code "glPointSize")
36871 " specifies the rasterized diameter of both aliased and antialiased
36872 points. Using a point size other than 1 has different effects, depending
36873 on whether point antialiasing is enabled. To enable and disable point
36874 antialiasing, call "
36875 (code "glEnable")
36876 " and "
36877 (code "glDisable")
36878 " with argument "
36879 (code "GL_POINT_SMOOTH")
36880 ". Point antialiasing is initially disabled. ")
36881 (para "
36882 The specified point size is multiplied with a distance attenuation factor
36883 and clamped to the specified point size range, and further clamped to the
36884 implementation-dependent point size range to produce the derived point size
36885 using ")
36886 (para (math (var "pointSize")
36887 "="
36888 (var "clamp")
36889 "\u2062"
36890 "("
36891 (var "size")
36892 "×"
36893 "√"
36894 "("
36895 "1"
36896 "/"
36897 (var "a")
36898 "+"
36899 (var "b")
36900 "×"
36901 (var "d")
36902 "+"
36903 (var "c")
36904 "×"
36905 (var "d")
36906 "^"
36907 "2"
36908 ","
36909 ","
36910 ","
36911 ")"
36912 ","
36913 ","
36914 ")"))
36915 (para "
36916 where "
36917 (math (var "d"))
36918 "
36919 is the eye-coordinate distance from the eye to the vertex, and "
36920 (math (var "a"))
36921 ", "
36922 (math (var "b"))
36923 ",
36924 and "
36925 (math (var "c"))
36926 "
36927 are the distance attenuation coefficients (see "
36928 (code "glPointParameter")
36929 "). ")
36930 (para "
36931 If multisampling is disabled, the computed point size is used as the
36932 point's width. ")
36933 (para "
36934 If multisampling is enabled, the point may be faded by modifying the point
36935 alpha value (see "
36936 (code "glSampleCoverage")
36937 ") instead of allowing the point width
36938 to go below a given threshold (see "
36939 (code "glPointParameter")
36940 "). In this case,
36941 the width is further modified in the following manner: ")
36942 (para (math (var "pointWidth")
36943 "="
36944 "{"
36945 "("
36946 (var "pointSize")
36947 ")"
36948 ", "
36949 "("
36950 (var "threshold")
36951 ")"
36952 "\u2062"
36953 "("
36954 (var "pointSize")
36955 ">="
36956 (var "threshold")
36957 ")"
36958 ", "
36959 "("
36960 (var "otherwise")
36961 ")"
36962 ","))
36963 (para "
36964 The point alpha value is modified by computing: ")
36965 (para (math (var "pointAlpha")
36966 "="
36967 "{"
36968 "("
36969 "1"
36970 ")"
36971 ", "
36972 "("
36973 "("
36974 (var "pointSize")
36975 "/"
36976 (var "threshold")
36977 ","
36978 ")"
36979 "^"
36980 "2"
36981 ")"
36982 "\u2062"
36983 "("
36984 (var "pointSize")
36985 ">="
36986 (var "threshold")
36987 ")"
36988 ", "
36989 "("
36990 (var "otherwise")
36991 ")"
36992 ","))
36993 (para "
36994 If point antialiasing is disabled, the actual size is determined by
36995 rounding the supplied size to the nearest integer. (If the rounding
36996 results in the value 0, it is as if the point size were 1.) If the rounded
36997 size is odd, then the center point
36998 ("
36999 (math (var "x"))
37000 ", "
37001 (math (var "y"))
37002 ")
37003 of the pixel fragment
37004 that represents the point is computed as ")
37005 (para (math "("
37006 "⌊"
37007 (var "x")
37008 "_"
37009 (var "w")
37010 ","
37011 "⌋"
37012 "+"
37013 ".5"
37014 ","
37015 "⌊"
37016 (var "y")
37017 "_"
37018 (var "w")
37019 ","
37020 "⌋"
37021 "+"
37022 ".5"
37023 ")"))
37024 (para "
37025 where "
37026 (math (var "w"))
37027 "
37028 subscripts indicate window coordinates. All pixels that lie
37029 within the square grid of the rounded size centered at
37030 ("
37031 (math (var "x"))
37032 ", "
37033 (math (var "y"))
37034 ")
37035 make
37036 up the fragment. If the size is even, the center point is ")
37037 (para (math "("
37038 "⌊"
37039 (var "x")
37040 "_"
37041 (var "w")
37042 "+"
37043 ".5"
37044 ","
37045 "⌋"
37046 ","
37047 "⌊"
37048 (var "y")
37049 "_"
37050 (var "w")
37051 "+"
37052 ".5"
37053 ","
37054 "⌋"
37055 ")"))
37056 (para "
37057 and the rasterized fragment's centers are the half-integer window
37058 coordinates within the square of the rounded size centered at "
37059 (math "(" (var "x") "," (var "y") ")")
37060 ".
37061 All pixel fragments produced in rasterizing a nonantialiased point are
37062 assigned the same associated data, that of the vertex corresponding to the
37063 point. ")
37064 (para "
37065 If antialiasing is enabled, then point rasterization produces a fragment
37066 for each pixel square that intersects the region lying within the circle
37067 having diameter equal to the current point size and centered at the point's "
37068 (math "("
37069 (var "x")
37070 "_"
37071 (var "w")
37072 ","
37073 (var "y")
37074 "_"
37075 (var "w")
37076 ")")
37077 ".
37078 The coverage value for each fragment is the
37079 window coordinate area of the intersection of the circular region with the
37080 corresponding pixel square. This value is saved and used in the final
37081 rasterization step. The data associated with each fragment is the data
37082 associated with the point being rasterized. ")
37083 (para "
37084 Not all sizes are supported when point antialiasing is enabled. If an
37085 unsupported size is requested, the nearest supported size is used. Only
37086 size 1 is guaranteed to be supported; others depend on the implementation.
37087 To query the range of supported sizes and the size difference between
37088 supported sizes within the range, call "
37089 (code "glGet")
37090 " with arguments "
37091 (code "GL_SMOOTH_POINT_SIZE_RANGE")
37092 " and "
37093 (code "GL_SMOOTH_POINT_SIZE_GRANULARITY")
37094 ".
37095 For aliased points, query the supported ranges and granularity with "
37096 (code "glGet")
37097 " with arguments "
37098 (code "GL_ALIASED_POINT_SIZE_RANGE")
37099 ". ")
37100 (heading "Errors")
37101 (para (code "GL_INVALID_VALUE")
37102 " is generated if "
37103 (var "size")
37104 " is less than or equal to 0. ")
37105 (para (code "GL_INVALID_OPERATION")
37106 " is generated if "
37107 (code "glPointSize")
37108 "
37109 is executed between the execution of "
37110 (code "glBegin")
37111 "
37112 and the corresponding execution of "
37113 (code "glEnd")
37114 ". ")))
37115
37116 (define-gl-procedure
37117 glPolygonMode
37118 "glPolygonMode"
37119 (funcsynopsis
37120 (funcprototype
37121 (funcdef "void " (function "glPolygonMode"))
37122 (paramdef "GLenum " (parameter "face"))
37123 (paramdef "GLenum " (parameter "mode"))))
37124 '(*fragment*
37125 (heading "select a polygon rasterization mode")
37126 (heading "Parameters")
37127 (table (% (formatter (asis)))
37128 (entry (% (heading (var "face")))
37129 (para "
37130 Specifies the polygons that "
37131 (var "mode")
37132 " applies to.
37133 Must be "
37134 (code "GL_FRONT")
37135 " for front-facing polygons, "
37136 (code "GL_BACK")
37137 " for back-facing polygons,
37138 or "
37139 (code "GL_FRONT_AND_BACK")
37140 " for front- and back-facing polygons. "))
37141 (entry (% (heading (var "mode")))
37142 (para "
37143 Specifies how polygons will be rasterized.
37144 Accepted values are "
37145 (code "GL_POINT")
37146 ", "
37147 (code "GL_LINE")
37148 ", and "
37149 (code "GL_FILL")
37150 ".
37151 The initial value is "
37152 (code "GL_FILL")
37153 " for both front- and back-facing polygons. ")))
37154 (heading "Description")
37155 (para (code "glPolygonMode")
37156 " controls the interpretation of polygons for rasterization. "
37157 (var "face")
37158 " describes which polygons "
37159 (var "mode")
37160 " applies to:
37161 front-facing polygons ("
37162 (code "GL_FRONT")
37163 "),
37164 back-facing polygons ("
37165 (code "GL_BACK")
37166 "),
37167 or both ("
37168 (code "GL_FRONT_AND_BACK")
37169 ").
37170 The polygon mode affects only the final rasterization of polygons.
37171 In particular,
37172 a polygon's vertices are lit and
37173 the polygon is clipped and possibly culled before these modes are applied. ")
37174 (para "
37175 Three modes are defined and can be specified in "
37176 (var "mode")
37177 ": ")
37178 (table (% (formatter (asis)))
37179 (entry (% (heading (code "GL_POINT")))
37180 (para "
37181 Polygon vertices that are marked as the start of a boundary edge
37182 are drawn as points.
37183 Point attributes such as "
37184 (code "GL_POINT_SIZE")
37185 " and "
37186 (code "GL_POINT_SMOOTH")
37187 " control
37188 the rasterization of the points.
37189 Polygon rasterization attributes other than "
37190 (code "GL_POLYGON_MODE")
37191 " have no effect. "))
37192 (entry (% (heading (code "GL_LINE")))
37193 (para "
37194 Boundary edges of the polygon are drawn as line segments.
37195 They are treated as connected line segments for line stippling;
37196 the line stipple counter and pattern are not reset between segments
37197 (see "
37198 (code "glLineStipple")
37199 ").
37200 Line attributes such as "
37201 (code "GL_LINE_WIDTH")
37202 " and "
37203 (code "GL_LINE_SMOOTH")
37204 " control
37205 the rasterization of the lines.
37206 Polygon rasterization attributes other than "
37207 (code "GL_POLYGON_MODE")
37208 " have no effect. "))
37209 (entry (% (heading (code "GL_FILL")))
37210 (para "
37211 The interior of the polygon is filled.
37212 Polygon attributes such as "
37213 (code "GL_POLYGON_STIPPLE")
37214 " and "
37215 (code "GL_POLYGON_SMOOTH")
37216 " control the rasterization of the polygon. ")))
37217 (heading "Errors")
37218 (para (code "GL_INVALID_ENUM")
37219 " is generated if either "
37220 (var "face")
37221 " or "
37222 (var "mode")
37223 " is not
37224 an accepted value. ")
37225 (para (code "GL_INVALID_OPERATION")
37226 " is generated if "
37227 (code "glPolygonMode")
37228 "
37229 is executed between the execution of "
37230 (code "glBegin")
37231 "
37232 and the corresponding execution of "
37233 (code "glEnd")
37234 ". ")))
37235
37236 (define-gl-procedure
37237 glPolygonOffset
37238 "glPolygonOffset"
37239 (funcsynopsis
37240 (funcprototype
37241 (funcdef "void " (function "glPolygonOffset"))
37242 (paramdef "GLfloat " (parameter "factor"))
37243 (paramdef "GLfloat " (parameter "units"))))
37244 '(*fragment*
37245 (heading
37246 "set the scale and units used to calculate depth values")
37247 (heading "Parameters")
37248 (table (% (formatter (asis)))
37249 (entry (% (heading (var "factor")))
37250 (para "
37251 Specifies a scale factor that is used to create a variable
37252 depth offset for each polygon. The initial value is 0. "))
37253 (entry (% (heading (var "units")))
37254 (para "
37255 Is multiplied by an implementation-specific value to
37256 create a constant depth offset. The initial value is 0. ")))
37257 (heading "Description")
37258 (para "
37259 When "
37260 (code "GL_POLYGON_OFFSET_FILL")
37261 ", "
37262 (code "GL_POLYGON_OFFSET_LINE")
37263 ", or "
37264 (code "GL_POLYGON_OFFSET_POINT")
37265 " is enabled, each
37266 fragment's "
37267 (var "depth")
37268 " value will be offset after it is interpolated
37269 from the "
37270 (var "depth")
37271 " values of the appropriate vertices.
37272 The value of the offset is "
37273 (math (var "factor")
37274 "×"
37275 (var "DZ")
37276 "+"
37277 (var "r")
37278 "×"
37279 (var "units"))
37280 ",
37281 where "
37282 (math (var "DZ"))
37283 "
37284 is a measurement of the change in depth relative to the screen
37285 area of the polygon, and "
37286 (math (var "r"))
37287 "
37288 is the smallest value that is guaranteed to
37289 produce a resolvable offset for a given implementation.
37290 The offset is added before the depth test is performed and before
37291 the value is written into the depth buffer. ")
37292 (para (code "glPolygonOffset")
37293 " is useful for rendering hidden-line images, for applying decals
37294 to surfaces, and for rendering solids with highlighted edges. ")
37295 (heading "Errors")
37296 (para (code "GL_INVALID_OPERATION")
37297 " is generated if "
37298 (code "glPolygonOffset")
37299 " is executed
37300 between the execution of "
37301 (code "glBegin")
37302 " and the corresponding
37303 execution of "
37304 (code "glEnd")
37305 ". ")))
37306
37307 (define-gl-procedure
37308 glPolygonStipple
37309 "glPolygonStipple"
37310 (funcsynopsis
37311 (funcprototype
37312 (funcdef "void " (function "glPolygonStipple"))
37313 (paramdef
37314 "const GLubyte * "
37315 (parameter "pattern"))))
37316 '(*fragment*
37317 (heading "set the polygon stippling pattern")
37318 (heading "Parameters")
37319 (table (% (formatter (asis)))
37320 (entry (% (heading (var "pattern")))
37321 (para "
37322 Specifies a pointer to a "
37323 (math "32" "×" "32")
37324 "
37325 stipple pattern that will be unpacked
37326 from memory in the same way that "
37327 (code "glDrawPixels")
37328 " unpacks pixels. ")))
37329 (heading "Description")
37330 (para "
37331 Polygon stippling,
37332 like line stippling
37333 (see "
37334 (code "glLineStipple")
37335 "),
37336 masks out certain fragments produced by rasterization,
37337 creating a pattern.
37338 Stippling is independent of polygon antialiasing. ")
37339 (para (var "pattern")
37340 " is a pointer to a "
37341 (math "32" "×" "32")
37342 "
37343 stipple pattern that is stored
37344 in memory just like the pixel data supplied to a "
37345 (code "glDrawPixels")
37346 "
37347 call with "
37348 ""
37349 "
37350 height
37351 and "
37352 (var "width")
37353 "
37354 both equal to 32, a pixel format
37355 of "
37356 (code "GL_COLOR_INDEX")
37357 ", and data type
37358 of "
37359 (code "GL_BITMAP")
37360 ".
37361 That is,
37362 the stipple pattern is represented as a "
37363 (math "32" "×" "32")
37364 "
37365 array
37366 of 1-bit color indices packed in unsigned bytes. "
37367 (code "glPixelStore")
37368 " parameters like "
37369 (code "GL_UNPACK_SWAP_BYTES")
37370 "
37371 and "
37372 (code "GL_UNPACK_LSB_FIRST")
37373 " affect the assembling of the bits into a
37374 stipple pattern.
37375 Pixel transfer operations
37376 (shift, offset, pixel map)
37377 are not applied to the stipple image,
37378 however. ")
37379 (para "
37380 If a non-zero named buffer object is bound to the "
37381 (code "GL_PIXEL_UNPACK_BUFFER")
37382 " target
37383 (see "
37384 (code "glBindBuffer")
37385 ") while a stipple pattern is
37386 specified, "
37387 (var "pattern")
37388 " is treated as a byte offset into the buffer object's data store. ")
37389 (para "
37390 To enable and disable polygon stippling, call "
37391 (code "glEnable")
37392 " and "
37393 (code "glDisable")
37394 "
37395 with argument "
37396 (code "GL_POLYGON_STIPPLE")
37397 ". Polygon stippling is initially
37398 disabled. If it's enabled,
37399 a rasterized polygon fragment with window coordinates "
37400 (math (var "x") "_" (var "w"))
37401 "
37402 and "
37403 (math (var "y") "_" (var "w"))
37404 "
37405 is sent to the next stage of the GL if and only if the
37406 ("
37407 (math (var "x") "_" (var "w") "%" "32")
37408 ")th
37409 bit in the
37410 ("
37411 (math (var "y") "_" (var "w") "%" "32")
37412 ")th
37413 row
37414 of the stipple pattern is 1 (one).
37415 When polygon stippling is disabled, it is as if the stipple pattern
37416 consists of all 1's. ")
37417 (heading "Errors")
37418 (para (code "GL_INVALID_OPERATION")
37419 " is generated if a non-zero buffer object name is bound to the "
37420 (code "GL_PIXEL_UNPACK_BUFFER")
37421 " target and the buffer object's data store is currently mapped. ")
37422 (para (code "GL_INVALID_OPERATION")
37423 " is generated if a non-zero buffer object name is bound to the "
37424 (code "GL_PIXEL_UNPACK_BUFFER")
37425 " target and the data would be unpacked from the buffer
37426 object such that the memory reads required would exceed the data store size. ")
37427 (para (code "GL_INVALID_OPERATION")
37428 " is generated if "
37429 (code "glPolygonStipple")
37430 "
37431 is executed between the execution of "
37432 (code "glBegin")
37433 "
37434 and the corresponding execution of "
37435 (code "glEnd")
37436 ". ")))
37437
37438 (define-gl-procedure
37439 glPrioritizeTextures
37440 "glPrioritizeTextures"
37441 (funcsynopsis
37442 (funcprototype
37443 (funcdef
37444 "void "
37445 (function "glPrioritizeTextures"))
37446 (paramdef "GLsizei " (parameter "n"))
37447 (paramdef
37448 "const GLuint * "
37449 (parameter "textures"))
37450 (paramdef
37451 "const GLclampf * "
37452 (parameter "priorities"))))
37453 '(*fragment*
37454 (heading "set texture residence priority")
37455 (heading "Parameters")
37456 (table (% (formatter (asis)))
37457 (entry (% (heading (var "n")))
37458 (para "
37459 Specifies the number of textures to be prioritized. "))
37460 (entry (% (heading (var "textures")))
37461 (para "
37462 Specifies an array containing the names of the textures to be prioritized. "))
37463 (entry (% (heading (var "priorities")))
37464 (para "
37465 Specifies an array containing the texture priorities.
37466 A priority given in an element of "
37467 (var "priorities")
37468 " applies to the texture
37469 named by the corresponding element of "
37470 (var "textures")
37471 ". ")))
37472 (heading "Description")
37473 (para (code "glPrioritizeTextures")
37474 " assigns the "
37475 (var "n")
37476 " texture priorities given in "
37477 (var "priorities")
37478 " to the "
37479 (var "n")
37480 " textures named in "
37481 (var "textures")
37482 ". ")
37483 (para "
37484 The GL establishes
37485 a ``working set'' of textures that are resident in texture memory.
37486 These textures may be bound to a texture target much more efficiently
37487 than textures that are not resident.
37488 By specifying a priority for each texture, "
37489 (code "glPrioritizeTextures")
37490 " allows applications to guide the GL implementation in determining
37491 which textures should be resident. ")
37492 (para "
37493 The priorities given in "
37494 (var "priorities")
37495 " are clamped to the range "
37496 (math "[" "0" "," "1" "]")
37497 "
37498 before they are assigned.
37499 0 indicates the lowest priority; textures with priority 0
37500 are least likely to be resident.
37501 1 indicates the highest priority; textures with priority 1
37502 are most likely to be resident.
37503 However, textures are not guaranteed to be resident until they are used. ")
37504 (para (code "glPrioritizeTextures")
37505 " silently ignores attempts to prioritize texture 0 or any texture
37506 name that does not correspond to an existing texture. ")
37507 (para (code "glPrioritizeTextures")
37508 " does not require that any of the textures named by "
37509 (var "textures")
37510 "
37511 be bound to a texture target. "
37512 (code "glTexParameter")
37513 " may also be used to set a texture's priority,
37514 but only if the texture is currently bound.
37515 This is the only way to set the priority of a default texture. ")
37516 (heading "Errors")
37517 (para (code "GL_INVALID_VALUE")
37518 " is generated if "
37519 (var "n")
37520 " is negative. ")
37521 (para (code "GL_INVALID_OPERATION")
37522 " is generated if "
37523 (code "glPrioritizeTextures")
37524 " is executed
37525 between the execution of "
37526 (code "glBegin")
37527 " and the corresponding
37528 execution of "
37529 (code "glEnd")
37530 ". ")))
37531
37532 (define-gl-procedure
37533 glPushAttrib
37534 "glPushAttrib"
37535 (funcsynopsis
37536 (funcprototype
37537 (funcdef "void " (function "glPushAttrib"))
37538 (paramdef "GLbitfield " (parameter "mask"))))
37539 '(*fragment*
37540 (heading
37541 "push and pop the server attribute stack")
37542 (heading "Parameters")
37543 (table (% (formatter (asis)))
37544 (entry (% (heading (var "mask")))
37545 (para "
37546 Specifies a mask that indicates which attributes to save. Values for "
37547 (var "mask")
37548 " are listed below. ")))
37549 (heading "Description")
37550 (para (code "glPushAttrib")
37551 " takes one argument,
37552 a mask that indicates which groups of state variables
37553 to save on the attribute stack.
37554 Symbolic constants are used to set bits in the mask. "
37555 (var "mask")
37556 "
37557 is typically constructed by specifying the bitwise-or of several
37558 of these constants together.
37559 The special mask "
37560 (code "GL_ALL_ATTRIB_BITS")
37561 "
37562 can be used to save all stackable states. ")
37563 (para "
37564 The symbolic mask constants and their associated GL state are as follows
37565 (the second column lists which attributes are saved): ")
37566 (para)
37567 (table (% (formatter (asis)))
37568 (entry (% (heading (code "GL_ACCUM_BUFFER_BIT")))
37569 (para "
37570 Accumulation buffer clear value "))
37571 (entry (% (heading (code "GL_COLOR_BUFFER_BIT")))
37572 (para (code "GL_ALPHA_TEST") " enable bit "))
37573 (entry (% (heading))
37574 (para "
37575 Alpha test function and reference value "))
37576 (entry (% (heading))
37577 (para (code "GL_BLEND") " enable bit "))
37578 (entry (% (heading))
37579 (para "
37580 Blending source and destination functions "))
37581 (entry (% (heading))
37582 (para "
37583 Constant blend color "))
37584 (entry (% (heading))
37585 (para "
37586 Blending equation "))
37587 (entry (% (heading))
37588 (para (code "GL_DITHER") " enable bit "))
37589 (entry (% (heading))
37590 (para (code "GL_DRAW_BUFFER") " setting "))
37591 (entry (% (heading))
37592 (para (code "GL_COLOR_LOGIC_OP") " enable bit "))
37593 (entry (% (heading))
37594 (para (code "GL_INDEX_LOGIC_OP") " enable bit "))
37595 (entry (% (heading))
37596 (para "
37597 Logic op function "))
37598 (entry (% (heading))
37599 (para "
37600 Color mode and index mode clear values "))
37601 (entry (% (heading))
37602 (para "
37603 Color mode and index mode writemasks "))
37604 (entry (% (heading (code "GL_CURRENT_BIT")))
37605 (para "
37606 Current RGBA color "))
37607 (entry (% (heading))
37608 (para "
37609 Current color index "))
37610 (entry (% (heading))
37611 (para "
37612 Current normal vector "))
37613 (entry (% (heading))
37614 (para "
37615 Current texture coordinates "))
37616 (entry (% (heading))
37617 (para "
37618 Current raster position "))
37619 (entry (% (heading))
37620 (para (code "GL_CURRENT_RASTER_POSITION_VALID")
37621 " flag "))
37622 (entry (% (heading))
37623 (para "
37624 RGBA color associated with current raster position "))
37625 (entry (% (heading))
37626 (para "
37627 Color index associated with current raster position "))
37628 (entry (% (heading))
37629 (para "
37630 Texture coordinates associated with current raster position "))
37631 (entry (% (heading))
37632 (para (code "GL_EDGE_FLAG") " flag "))
37633 (entry (% (heading (code "GL_DEPTH_BUFFER_BIT")))
37634 (para (code "GL_DEPTH_TEST") " enable bit "))
37635 (entry (% (heading))
37636 (para "
37637 Depth buffer test function "))
37638 (entry (% (heading))
37639 (para "
37640 Depth buffer clear value "))
37641 (entry (% (heading))
37642 (para (code "GL_DEPTH_WRITEMASK") " enable bit "))
37643 (entry (% (heading (code "GL_ENABLE_BIT")))
37644 (para (code "GL_ALPHA_TEST") " flag "))
37645 (entry (% (heading))
37646 (para (code "GL_AUTO_NORMAL") " flag "))
37647 (entry (% (heading))
37648 (para (code "GL_BLEND") " flag "))
37649 (entry (% (heading))
37650 (para "
37651 Enable bits for the user-definable clipping planes "))
37652 (entry (% (heading))
37653 (para (code "GL_COLOR_MATERIAL")))
37654 (entry (% (heading))
37655 (para (code "GL_CULL_FACE") " flag "))
37656 (entry (% (heading))
37657 (para (code "GL_DEPTH_TEST") " flag "))
37658 (entry (% (heading))
37659 (para (code "GL_DITHER") " flag "))
37660 (entry (% (heading))
37661 (para (code "GL_FOG") " flag "))
37662 (entry (% (heading))
37663 (para (code "GL_LIGHT")
37664 (var "i")
37665 "
37666 where "
37667 (code "0")
37668 " <= "
37669 (var "i")
37670 " < "
37671 (code "GL_MAX_LIGHTS")))
37672 (entry (% (heading))
37673 (para (code "GL_LIGHTING") " flag "))
37674 (entry (% (heading))
37675 (para (code "GL_LINE_SMOOTH") " flag "))
37676 (entry (% (heading))
37677 (para (code "GL_LINE_STIPPLE") " flag "))
37678 (entry (% (heading))
37679 (para (code "GL_COLOR_LOGIC_OP") " flag "))
37680 (entry (% (heading))
37681 (para (code "GL_INDEX_LOGIC_OP") " flag "))
37682 (entry (% (heading))
37683 (para (code "GL_MAP1_")
37684 (var "x")
37685 " where "
37686 (var "x")
37687 " is a map type "))
37688 (entry (% (heading))
37689 (para (code "GL_MAP2_")
37690 (var "x")
37691 " where "
37692 (var "x")
37693 " is a map type "))
37694 (entry (% (heading))
37695 (para (code "GL_MULTISAMPLE") " flag "))
37696 (entry (% (heading))
37697 (para (code "GL_NORMALIZE") " flag "))
37698 (entry (% (heading))
37699 (para (code "GL_POINT_SMOOTH") " flag "))
37700 (entry (% (heading))
37701 (para (code "GL_POLYGON_OFFSET_LINE") " flag "))
37702 (entry (% (heading))
37703 (para (code "GL_POLYGON_OFFSET_FILL") " flag "))
37704 (entry (% (heading))
37705 (para (code "GL_POLYGON_OFFSET_POINT") " flag "))
37706 (entry (% (heading))
37707 (para (code "GL_POLYGON_SMOOTH") " flag "))
37708 (entry (% (heading))
37709 (para (code "GL_POLYGON_STIPPLE") " flag "))
37710 (entry (% (heading))
37711 (para (code "GL_SAMPLE_ALPHA_TO_COVERAGE")
37712 " flag "))
37713 (entry (% (heading))
37714 (para (code "GL_SAMPLE_ALPHA_TO_ONE") " flag "))
37715 (entry (% (heading))
37716 (para (code "GL_SAMPLE_COVERAGE") " flag "))
37717 (entry (% (heading))
37718 (para (code "GL_SCISSOR_TEST") " flag "))
37719 (entry (% (heading))
37720 (para (code "GL_STENCIL_TEST") " flag "))
37721 (entry (% (heading))
37722 (para (code "GL_TEXTURE_1D") " flag "))
37723 (entry (% (heading))
37724 (para (code "GL_TEXTURE_2D") " flag "))
37725 (entry (% (heading))
37726 (para (code "GL_TEXTURE_3D") " flag "))
37727 (entry (% (heading))
37728 (para "
37729 Flags "
37730 (code "GL_TEXTURE_GEN_")
37731 (var "x")
37732 " where "
37733 (var "x")
37734 " is S, T, R, or Q "))
37735 (entry (% (heading (code "GL_EVAL_BIT")))
37736 (para (code "GL_MAP1_")
37737 (var "x")
37738 " enable bits, where "
37739 (var "x")
37740 " is a map type "))
37741 (entry (% (heading))
37742 (para (code "GL_MAP2_")
37743 (var "x")
37744 " enable bits, where "
37745 (var "x")
37746 " is a map type "))
37747 (entry (% (heading))
37748 (para "
37749 1D grid endpoints and divisions "))
37750 (entry (% (heading))
37751 (para "
37752 2D grid endpoints and divisions "))
37753 (entry (% (heading))
37754 (para (code "GL_AUTO_NORMAL") " enable bit "))
37755 (entry (% (heading (code "GL_FOG_BIT")))
37756 (para (code "GL_FOG") " enable bit "))
37757 (entry (% (heading)) (para "
37758 Fog color "))
37759 (entry (% (heading)) (para "
37760 Fog density "))
37761 (entry (% (heading)) (para "
37762 Linear fog start "))
37763 (entry (% (heading)) (para "
37764 Linear fog end "))
37765 (entry (% (heading)) (para "
37766 Fog index "))
37767 (entry (% (heading))
37768 (para (code "GL_FOG_MODE") " value "))
37769 (entry (% (heading (code "GL_HINT_BIT")))
37770 (para (code "GL_PERSPECTIVE_CORRECTION_HINT")
37771 " setting "))
37772 (entry (% (heading))
37773 (para (code "GL_POINT_SMOOTH_HINT") " setting "))
37774 (entry (% (heading))
37775 (para (code "GL_LINE_SMOOTH_HINT") " setting "))
37776 (entry (% (heading))
37777 (para (code "GL_POLYGON_SMOOTH_HINT")
37778 " setting "))
37779 (entry (% (heading))
37780 (para (code "GL_FOG_HINT") " setting "))
37781 (entry (% (heading))
37782 (para (code "GL_GENERATE_MIPMAP_HINT")
37783 " setting "))
37784 (entry (% (heading))
37785 (para (code "GL_TEXTURE_COMPRESSION_HINT")
37786 " setting "))
37787 (entry (% (heading (code "GL_LIGHTING_BIT")))
37788 (para (code "GL_COLOR_MATERIAL") " enable bit "))
37789 (entry (% (heading))
37790 (para (code "GL_COLOR_MATERIAL_FACE") " value "))
37791 (entry (% (heading))
37792 (para "
37793 Color material parameters that are tracking the current color "))
37794 (entry (% (heading))
37795 (para "
37796 Ambient scene color "))
37797 (entry (% (heading))
37798 (para (code "GL_LIGHT_MODEL_LOCAL_VIEWER")
37799 " value "))
37800 (entry (% (heading))
37801 (para (code "GL_LIGHT_MODEL_TWO_SIDE")
37802 " setting "))
37803 (entry (% (heading))
37804 (para (code "GL_LIGHTING") " enable bit "))
37805 (entry (% (heading))
37806 (para "
37807 Enable bit for each light "))
37808 (entry (% (heading))
37809 (para "
37810 Ambient, diffuse, and specular intensity for each light "))
37811 (entry (% (heading))
37812 (para "
37813 Direction, position, exponent, and cutoff angle for each light "))
37814 (entry (% (heading))
37815 (para "
37816 Constant, linear, and quadratic attenuation factors for each light "))
37817 (entry (% (heading))
37818 (para "
37819 Ambient, diffuse, specular, and emissive color for each material "))
37820 (entry (% (heading))
37821 (para "
37822 Ambient, diffuse, and specular color indices for each material "))
37823 (entry (% (heading))
37824 (para "
37825 Specular exponent for each material "))
37826 (entry (% (heading))
37827 (para (code "GL_SHADE_MODEL") " setting "))
37828 (entry (% (heading (code "GL_LINE_BIT")))
37829 (para (code "GL_LINE_SMOOTH") " flag "))
37830 (entry (% (heading))
37831 (para (code "GL_LINE_STIPPLE") " enable bit "))
37832 (entry (% (heading))
37833 (para "
37834 Line stipple pattern and repeat counter "))
37835 (entry (% (heading)) (para "
37836 Line width "))
37837 (entry (% (heading (code "GL_LIST_BIT")))
37838 (para (code "GL_LIST_BASE") " setting "))
37839 (entry (% (heading (code "GL_MULTISAMPLE_BIT")))
37840 (para (code "GL_MULTISAMPLE") " flag "))
37841 (entry (% (heading))
37842 (para (code "GL_SAMPLE_ALPHA_TO_COVERAGE")
37843 " flag "))
37844 (entry (% (heading))
37845 (para (code "GL_SAMPLE_ALPHA_TO_ONE") " flag "))
37846 (entry (% (heading))
37847 (para (code "GL_SAMPLE_COVERAGE") " flag "))
37848 (entry (% (heading))
37849 (para (code "GL_SAMPLE_COVERAGE_VALUE")
37850 " value "))
37851 (entry (% (heading))
37852 (para (code "GL_SAMPLE_COVERAGE_INVERT")
37853 " value "))
37854 (entry (% (heading (code "GL_PIXEL_MODE_BIT")))
37855 (para (code "GL_RED_BIAS")
37856 " and "
37857 (code "GL_RED_SCALE")
37858 " settings "))
37859 (entry (% (heading))
37860 (para (code "GL_GREEN_BIAS")
37861 " and "
37862 (code "GL_GREEN_SCALE")
37863 " values "))
37864 (entry (% (heading))
37865 (para (code "GL_BLUE_BIAS")
37866 " and "
37867 (code "GL_BLUE_SCALE")))
37868 (entry (% (heading))
37869 (para (code "GL_ALPHA_BIAS")
37870 " and "
37871 (code "GL_ALPHA_SCALE")))
37872 (entry (% (heading))
37873 (para (code "GL_DEPTH_BIAS")
37874 " and "
37875 (code "GL_DEPTH_SCALE")))
37876 (entry (% (heading))
37877 (para (code "GL_INDEX_OFFSET")
37878 " and "
37879 (code "GL_INDEX_SHIFT")
37880 " values "))
37881 (entry (% (heading))
37882 (para (code "GL_MAP_COLOR")
37883 " and "
37884 (code "GL_MAP_STENCIL")
37885 " flags "))
37886 (entry (% (heading))
37887 (para (code "GL_ZOOM_X")
37888 " and "
37889 (code "GL_ZOOM_Y")
37890 " factors "))
37891 (entry (% (heading))
37892 (para (code "GL_READ_BUFFER") " setting "))
37893 (entry (% (heading (code "GL_POINT_BIT")))
37894 (para (code "GL_POINT_SMOOTH") " flag "))
37895 (entry (% (heading)) (para "
37896 Point size "))
37897 (entry (% (heading (code "GL_POLYGON_BIT")))
37898 (para (code "GL_CULL_FACE") " enable bit "))
37899 (entry (% (heading))
37900 (para (code "GL_CULL_FACE_MODE") " value "))
37901 (entry (% (heading))
37902 (para (code "GL_FRONT_FACE") " indicator "))
37903 (entry (% (heading))
37904 (para (code "GL_POLYGON_MODE") " setting "))
37905 (entry (% (heading))
37906 (para (code "GL_POLYGON_SMOOTH") " flag "))
37907 (entry (% (heading))
37908 (para (code "GL_POLYGON_STIPPLE") " enable bit "))
37909 (entry (% (heading))
37910 (para (code "GL_POLYGON_OFFSET_FILL") " flag "))
37911 (entry (% (heading))
37912 (para (code "GL_POLYGON_OFFSET_LINE") " flag "))
37913 (entry (% (heading))
37914 (para (code "GL_POLYGON_OFFSET_POINT") " flag "))
37915 (entry (% (heading))
37916 (para (code "GL_POLYGON_OFFSET_FACTOR")))
37917 (entry (% (heading))
37918 (para (code "GL_POLYGON_OFFSET_UNITS")))
37919 (entry (% (heading (code "GL_POLYGON_STIPPLE_BIT")))
37920 (para "
37921 Polygon stipple image "))
37922 (entry (% (heading (code "GL_SCISSOR_BIT")))
37923 (para (code "GL_SCISSOR_TEST") " flag "))
37924 (entry (% (heading)) (para "
37925 Scissor box "))
37926 (entry (% (heading (code "GL_STENCIL_BUFFER_BIT")))
37927 (para (code "GL_STENCIL_TEST") " enable bit "))
37928 (entry (% (heading))
37929 (para "
37930 Stencil function and reference value "))
37931 (entry (% (heading))
37932 (para "
37933 Stencil value mask "))
37934 (entry (% (heading))
37935 (para "
37936 Stencil fail, pass, and depth buffer pass actions "))
37937 (entry (% (heading))
37938 (para "
37939 Stencil buffer clear value "))
37940 (entry (% (heading))
37941 (para "
37942 Stencil buffer writemask "))
37943 (entry (% (heading (code "GL_TEXTURE_BIT")))
37944 (para "
37945 Enable bits for the four texture coordinates "))
37946 (entry (% (heading))
37947 (para "
37948 Border color for each texture image "))
37949 (entry (% (heading))
37950 (para "
37951 Minification function for each texture image "))
37952 (entry (% (heading))
37953 (para "
37954 Magnification function for each texture image "))
37955 (entry (% (heading))
37956 (para "
37957 Texture coordinates and wrap mode for each texture image "))
37958 (entry (% (heading))
37959 (para "
37960 Color and mode for each texture environment "))
37961 (entry (% (heading))
37962 (para "
37963 Enable bits "
37964 (code "GL_TEXTURE_GEN_")
37965 (var "x")
37966 ", "
37967 (var "x")
37968 " is S, T, R, and Q "))
37969 (entry (% (heading))
37970 (para (code "GL_TEXTURE_GEN_MODE")
37971 " setting for S, T, R, and Q "))
37972 (entry (% (heading))
37973 (para (code "glTexGen")
37974 " plane equations for S, T, R, and Q "))
37975 (entry (% (heading))
37976 (para "
37977 Current texture bindings (for example, "
37978 (code "GL_TEXTURE_BINDING_2D")
37979 ") "))
37980 (entry (% (heading (code "GL_TRANSFORM_BIT")))
37981 (para "
37982 Coefficients of the six clipping planes "))
37983 (entry (% (heading))
37984 (para "
37985 Enable bits for the user-definable clipping planes "))
37986 (entry (% (heading))
37987 (para (code "GL_MATRIX_MODE") " value "))
37988 (entry (% (heading))
37989 (para (code "GL_NORMALIZE") " flag "))
37990 (entry (% (heading))
37991 (para (code "GL_RESCALE_NORMAL") " flag "))
37992 (entry (% (heading (code "GL_VIEWPORT_BIT")))
37993 (para "
37994 Depth range (near and far) "))
37995 (entry (% (heading))
37996 (para "
37997 Viewport origin and extent ")))
37998 (para (code "glPopAttrib")
37999 " restores the values of the state variables saved with the last "
38000 (code "glPushAttrib")
38001 " command.
38002 Those not saved are left unchanged. ")
38003 (para "
38004 It is an error to push attributes onto a full stack
38005 or to pop attributes off an empty stack.
38006 In either case, the error flag is set
38007 and no other change is made to GL state. ")
38008 (para "
38009 Initially, the attribute stack is empty. ")
38010 (heading "Errors")
38011 (para (code "GL_STACK_OVERFLOW")
38012 " is generated if "
38013 (code "glPushAttrib")
38014 " is called while
38015 the attribute stack is full. ")
38016 (para (code "GL_STACK_UNDERFLOW")
38017 " is generated if "
38018 (code "glPopAttrib")
38019 " is called while
38020 the attribute stack is empty. ")
38021 (para (code "GL_INVALID_OPERATION")
38022 " is generated if "
38023 (code "glPushAttrib")
38024 " or "
38025 (code "glPopAttrib")
38026 "
38027 is executed between the execution of "
38028 (code "glBegin")
38029 "
38030 and the corresponding execution of "
38031 (code "glEnd")
38032 ". ")))
38033
38034 (define-gl-procedure
38035 glPushClientAttrib
38036 "glPushClientAttrib"
38037 (funcsynopsis
38038 (funcprototype
38039 (funcdef "void " (function "glPushClientAttrib"))
38040 (paramdef "GLbitfield " (parameter "mask"))))
38041 '(*fragment*
38042 (heading
38043 "push and pop the client attribute stack")
38044 (heading "Parameters")
38045 (table (% (formatter (asis)))
38046 (entry (% (heading (var "mask")))
38047 (para "
38048 Specifies a mask that indicates which attributes to save. Values for "
38049 (var "mask")
38050 " are listed below. ")))
38051 (heading "Description")
38052 (para (code "glPushClientAttrib")
38053 " takes one argument,
38054 a mask that indicates which groups of client-state variables
38055 to save on the client attribute stack.
38056 Symbolic constants are used to set bits in the mask. "
38057 (var "mask")
38058 "
38059 is typically constructed by specifying the bitwise-or of several
38060 \t of these constants together.
38061 The special mask "
38062 (code "GL_CLIENT_ALL_ATTRIB_BITS")
38063 "
38064 can be used to save all stackable client state. ")
38065 (para "
38066 The symbolic mask constants and their associated GL client state are as follows
38067 (the second column lists which attributes are saved): ")
38068 (para (code "GL_CLIENT_PIXEL_STORE_BIT")
38069 "\tPixel storage modes "
38070 (code "GL_CLIENT_VERTEX_ARRAY_BIT")
38071 "\tVertex arrays (and enables) ")
38072 (para (code "glPopClientAttrib")
38073 " restores the values of the client-state variables
38074 saved with the last "
38075 (code "glPushClientAttrib")
38076 ".
38077 Those not saved are left unchanged. ")
38078 (para "
38079 It is an error to push attributes onto a full client attribute stack
38080 or to pop attributes off an empty stack.
38081 In either case, the error flag is set,
38082 and no other change is made to GL state. ")
38083 (para "
38084 Initially, the client attribute stack is empty. ")
38085 (heading "Errors")
38086 (para (code "GL_STACK_OVERFLOW")
38087 " is generated if "
38088 (code "glPushClientAttrib")
38089 " is called while
38090 the attribute stack is full. ")
38091 (para (code "GL_STACK_UNDERFLOW")
38092 " is generated if "
38093 (code "glPopClientAttrib")
38094 " is called while
38095 the attribute stack is empty. ")))
38096
38097 (define-gl-procedure
38098 glPushMatrix
38099 "glPushMatrix"
38100 (funcsynopsis
38101 (funcprototype
38102 (funcdef "void " (function "glPushMatrix"))
38103 (paramdef (parameter "void"))))
38104 '(*fragment*
38105 (heading "push and pop the current matrix stack")
38106 (heading "Description")
38107 (para "
38108 There is a stack of matrices for each of the matrix modes.
38109 In "
38110 (code "GL_MODELVIEW")
38111 " mode,
38112 the stack depth is at least 32.
38113 In the other modes, "
38114 (code "GL_COLOR")
38115 ", "
38116 (code "GL_PROJECTION")
38117 ", and "
38118 (code "GL_TEXTURE")
38119 ",
38120 the depth is at least 2.
38121 The current matrix in any mode is the matrix on the top of the stack
38122 for that mode. ")
38123 (para (code "glPushMatrix")
38124 " pushes the current matrix stack down by one,
38125 duplicating the current matrix.
38126 That is,
38127 after a "
38128 (code "glPushMatrix")
38129 " call,
38130 the matrix on top of the stack is identical to the one below it. ")
38131 (para (code "glPopMatrix")
38132 " pops the current matrix stack,
38133 replacing the current matrix with the one below it on the stack. ")
38134 (para "
38135 Initially, each of the stacks contains one matrix, an identity matrix. ")
38136 (para "
38137 It is an error to push a full matrix stack
38138 or to pop a matrix stack that contains only a single matrix.
38139 In either case, the error flag is set
38140 and no other change is made to GL state. ")
38141 (heading "Errors")
38142 (para (code "GL_STACK_OVERFLOW")
38143 " is generated if "
38144 (code "glPushMatrix")
38145 " is called while
38146 the current matrix stack is full. ")
38147 (para (code "GL_STACK_UNDERFLOW")
38148 " is generated if "
38149 (code "glPopMatrix")
38150 " is called while
38151 the current matrix stack contains only a single matrix. ")
38152 (para (code "GL_INVALID_OPERATION")
38153 " is generated if "
38154 (code "glPushMatrix")
38155 " or "
38156 (code "glPopMatrix")
38157 "
38158 is executed between the execution of "
38159 (code "glBegin")
38160 "
38161 and the corresponding execution of "
38162 (code "glEnd")
38163 ". ")))
38164
38165 (define-gl-procedure
38166 glPushName
38167 "glPushName"
38168 (funcsynopsis
38169 (funcprototype
38170 (funcdef "void " (function "glPushName"))
38171 (paramdef "GLuint " (parameter "name"))))
38172 '(*fragment*
38173 (heading "push and pop the name stack")
38174 (heading "Parameters")
38175 (table (% (formatter (asis)))
38176 (entry (% (heading (var "name")))
38177 (para "
38178 Specifies a name that will be pushed onto the name stack. ")))
38179 (heading "Description")
38180 (para "
38181 The name stack is used during selection mode to allow sets of rendering
38182 commands to be uniquely identified.
38183 It consists of an ordered set of unsigned integers and is initially empty. ")
38184 (para (code "glPushName")
38185 " causes "
38186 (var "name")
38187 " to be pushed onto the name stack. "
38188 (code "glPopName")
38189 " pops one name off the top of the stack. ")
38190 (para "
38191 The maximum name stack depth is implementation-dependent; call "
38192 (code "GL_MAX_NAME_STACK_DEPTH")
38193 " to find out the value for a particular
38194 implementation. It is an
38195 error to push a name onto a full stack
38196 or to pop a name off an empty stack.
38197 It is also an error to manipulate the name stack between the execution of "
38198 (code "glBegin")
38199 " and the corresponding execution of "
38200 (code "glEnd")
38201 ".
38202 In any of these cases, the error flag is set and no other change is
38203 made to GL state. ")
38204 (para "
38205 The name stack is always empty while the render mode is not "
38206 (code "GL_SELECT")
38207 ".
38208 Calls to "
38209 (code "glPushName")
38210 " or "
38211 (code "glPopName")
38212 " while the render mode is not "
38213 (code "GL_SELECT")
38214 " are ignored. ")
38215 (heading "Errors")
38216 (para (code "GL_STACK_OVERFLOW")
38217 " is generated if "
38218 (code "glPushName")
38219 " is called while the
38220 name stack is full. ")
38221 (para (code "GL_STACK_UNDERFLOW")
38222 " is generated if "
38223 (code "glPopName")
38224 " is called while the
38225 name stack is empty. ")
38226 (para (code "GL_INVALID_OPERATION")
38227 " is generated if "
38228 (code "glPushName")
38229 " or "
38230 (code "glPopName")
38231 "
38232 is executed between a call to "
38233 (code "glBegin")
38234 " and the corresponding call to "
38235 (code "glEnd")
38236 ". ")))
38237
38238 (define-gl-procedure
38239 glRasterPos
38240 "glRasterPos"
38241 (funcsynopsis
38242 (funcprototype
38243 (funcdef "void " (function "glRasterPos2s"))
38244 (paramdef "GLshort " (parameter "x"))
38245 (paramdef "GLshort " (parameter "y"))))
38246 '(*fragment*
38247 (heading
38248 "specify the raster position for pixel operations")
38249 (heading "Parameters")
38250 (table (% (formatter (asis)))
38251 (entry (% (heading (var "x")))
38252 (itemx (var "y"))
38253 (itemx (var "z"))
38254 (itemx (var "w"))
38255 (para "
38256 Specify the "
38257 (math (var "x"))
38258 ", "
38259 (math (var "y"))
38260 ", "
38261 (math (var "z"))
38262 ",
38263 and "
38264 (math (var "w"))
38265 "
38266 object coordinates
38267 (if present)
38268 for the raster
38269 position. ")))
38270 (heading "Description")
38271 (para "
38272 The GL maintains a 3D position in window coordinates.
38273 This position,
38274 called the raster position,
38275 is used to position pixel and bitmap write operations. It is
38276 maintained with subpixel accuracy.
38277 See "
38278 (code "glBitmap")
38279 ", "
38280 (code "glDrawPixels")
38281 ", and "
38282 (code "glCopyPixels")
38283 ". ")
38284 (para "
38285 The current raster position consists of three window coordinates
38286 ("
38287 (math (var "x"))
38288 ", "
38289 (math (var "y"))
38290 ", "
38291 (math (var "z"))
38292 "),
38293 a clip coordinate value
38294 ("
38295 (math (var "w"))
38296 "),
38297 an eye coordinate distance,
38298 a valid bit,
38299 and associated color data and texture coordinates.
38300 The "
38301 (math (var "w"))
38302 "
38303 coordinate is a clip coordinate,
38304 because "
38305 (math (var "w"))
38306 "
38307 is not projected to window coordinates. "
38308 (code "glRasterPos4")
38309 " specifies object coordinates "
38310 (math (var "x"))
38311 ", "
38312 (math (var "y"))
38313 ", "
38314 (math (var "z"))
38315 ",
38316 and "
38317 (math (var "w"))
38318 "
38319 explicitly. "
38320 (code "glRasterPos3")
38321 " specifies object coordinate "
38322 (math (var "x"))
38323 ", "
38324 (math (var "y"))
38325 ",
38326 and "
38327 (math (var "z"))
38328 "
38329 explicitly,
38330 while "
38331 (math (var "w"))
38332 "
38333 is implicitly set to 1. "
38334 (code "glRasterPos2")
38335 " uses the argument values for "
38336 (math (var "x"))
38337 "
38338 and "
38339 (math (var "y"))
38340 "
38341 while
38342 implicitly setting "
38343 (math (var "z"))
38344 "
38345 and "
38346 (math (var "w"))
38347 "
38348 to 0 and 1. ")
38349 (para "
38350 The object coordinates presented by "
38351 (code "glRasterPos")
38352 " are treated just like those
38353 of a "
38354 (code "glVertex")
38355 " command:
38356 They are transformed by the current modelview and projection matrices
38357 and passed to the clipping stage.
38358 If the vertex is not culled,
38359 then it is projected and scaled to window coordinates,
38360 which become the new current raster position,
38361 and the "
38362 (code "GL_CURRENT_RASTER_POSITION_VALID")
38363 " flag is set.
38364 If the vertex "
38365 (var "is")
38366 "
38367 culled,
38368 then the valid bit is cleared and the current raster position
38369 and associated color and texture coordinates are undefined. ")
38370 (para "
38371 The current raster position also includes some associated color data
38372 and texture coordinates.
38373 If lighting is enabled,
38374 then "
38375 (code "GL_CURRENT_RASTER_COLOR")
38376 "
38377 (in RGBA mode)
38378 or "
38379 (code "GL_CURRENT_RASTER_INDEX")
38380 "
38381 (in color index mode)
38382 is set to the color produced by the lighting calculation
38383 (see "
38384 (code "glLight")
38385 ", "
38386 (code "glLightModel")
38387 ", and "
38388 (code "glShadeModel")
38389 ").
38390 If lighting is disabled,
38391 current color
38392 (in RGBA mode, state variable "
38393 (code "GL_CURRENT_COLOR")
38394 ")
38395 or color index
38396 (in color index mode, state variable "
38397 (code "GL_CURRENT_INDEX")
38398 ")
38399 is used to update the current raster color. "
38400 (code "GL_CURRENT_RASTER_SECONDARY_COLOR")
38401 " (in RGBA mode) is likewise updated. ")
38402 (para "
38403 Likewise, "
38404 (code "GL_CURRENT_RASTER_TEXTURE_COORDS")
38405 " is updated as a function
38406 of "
38407 (code "GL_CURRENT_TEXTURE_COORDS")
38408 ",
38409 based on the texture matrix and the texture generation functions
38410 (see "
38411 (code "glTexGen")
38412 ").
38413 Finally,
38414 the distance from the origin of the eye coordinate system to the
38415 vertex as transformed by only the modelview matrix replaces "
38416 (code "GL_CURRENT_RASTER_DISTANCE")
38417 ". ")
38418 (para "
38419 Initially, the current raster position is (0, 0, 0, 1),
38420 the current raster distance is 0,
38421 the valid bit is set,
38422 the associated RGBA color is (1, 1, 1, 1),
38423 the associated color index is 1,
38424 and the associated texture coordinates are (0, 0, 0, 1).
38425 In RGBA mode, "
38426 (code "GL_CURRENT_RASTER_INDEX")
38427 " is always 1;
38428 in color index mode,
38429 the current raster RGBA color always maintains its initial value. ")
38430 (heading "Errors")
38431 (para (code "GL_INVALID_OPERATION")
38432 " is generated if "
38433 (code "glRasterPos")
38434 "
38435 is executed between the execution of "
38436 (code "glBegin")
38437 "
38438 and the corresponding execution of "
38439 (code "glEnd")
38440 ". ")))
38441
38442 (define-gl-procedure
38443 glReadBuffer
38444 "glReadBuffer"
38445 (funcsynopsis
38446 (funcprototype
38447 (funcdef "void " (function "glReadBuffer"))
38448 (paramdef "GLenum " (parameter "mode"))))
38449 '(*fragment*
38450 (heading
38451 "select a color buffer source for pixels")
38452 (heading "Parameters")
38453 (table (% (formatter (asis)))
38454 (entry (% (heading (var "mode")))
38455 (para "
38456 Specifies a color buffer.
38457 Accepted values are "
38458 (code "GL_FRONT_LEFT")
38459 ", "
38460 (code "GL_FRONT_RIGHT")
38461 ", "
38462 (code "GL_BACK_LEFT")
38463 ", "
38464 (code "GL_BACK_RIGHT")
38465 ", "
38466 (code "GL_FRONT")
38467 ", "
38468 (code "GL_BACK")
38469 ", "
38470 (code "GL_LEFT")
38471 ", "
38472 (code "GL_RIGHT")
38473 ", and "
38474 (code "GL_AUX")
38475 (var "i")
38476 ",
38477 where "
38478 (var "i")
38479 " is between 0 and the value of "
38480 (code "GL_AUX_BUFFERS")
38481 " minus 1. ")))
38482 (heading "Description")
38483 (para (code "glReadBuffer")
38484 " specifies a color buffer as the source for subsequent "
38485 (code "glReadPixels")
38486 ", "
38487 (code "glCopyTexImage1D")
38488 ", "
38489 (code "glCopyTexImage2D")
38490 ", "
38491 (code "glCopyTexSubImage1D")
38492 ", "
38493 (code "glCopyTexSubImage2D")
38494 ", "
38495 (code "glCopyTexSubImage3D")
38496 ", and "
38497 (code "glCopyPixels")
38498 " commands. "
38499 (var "mode")
38500 " accepts one of twelve or more predefined values.
38501 ("
38502 (code "GL_AUX0")
38503 " through "
38504 (code "GL_AUX3")
38505 " are always defined.)
38506 In a fully configured system, "
38507 (code "GL_FRONT")
38508 ", "
38509 (code "GL_LEFT")
38510 ", and "
38511 (code "GL_FRONT_LEFT")
38512 " all name the front left buffer, "
38513 (code "GL_FRONT_RIGHT")
38514 " and "
38515 (code "GL_RIGHT")
38516 " name the front right buffer, and "
38517 (code "GL_BACK_LEFT")
38518 " and "
38519 (code "GL_BACK")
38520 " name the back left buffer. ")
38521 (para "
38522 Nonstereo double-buffered configurations have only a front left and a
38523 back left buffer.
38524 Single-buffered configurations have a front left and a front right
38525 buffer if stereo, and only a front left buffer if nonstereo.
38526 It is an error to specify a nonexistent buffer to "
38527 (code "glReadBuffer")
38528 ". ")
38529 (para (var "mode")
38530 " is initially "
38531 (code "GL_FRONT")
38532 " in single-buffered configurations
38533 and "
38534 (code "GL_BACK")
38535 " in double-buffered configurations. ")
38536 (heading "Errors")
38537 (para (code "GL_INVALID_ENUM")
38538 " is generated if "
38539 (var "mode")
38540 " is not one of the twelve
38541 (or more) accepted values. ")
38542 (para (code "GL_INVALID_OPERATION")
38543 " is generated if "
38544 (var "mode")
38545 " specifies a buffer
38546 that does not exist. ")
38547 (para (code "GL_INVALID_OPERATION")
38548 " is generated if "
38549 (code "glReadBuffer")
38550 "
38551 is executed between the execution of "
38552 (code "glBegin")
38553 "
38554 and the corresponding execution of "
38555 (code "glEnd")
38556 ". ")))
38557
38558 (define-gl-procedure
38559 glReadPixels
38560 "glReadPixels"
38561 (funcsynopsis
38562 (funcprototype
38563 (funcdef "void " (function "glReadPixels"))
38564 (paramdef "GLint " (parameter "x"))
38565 (paramdef "GLint " (parameter "y"))
38566 (paramdef "GLsizei " (parameter "width"))
38567 (paramdef "GLsizei " (parameter "height"))
38568 (paramdef "GLenum " (parameter "format"))
38569 (paramdef "GLenum " (parameter "type"))
38570 (paramdef "GLvoid * " (parameter "data"))))
38571 '(*fragment*
38572 (heading
38573 "read a block of pixels from the frame buffer")
38574 (heading "Parameters")
38575 (table (% (formatter (asis)))
38576 (entry (% (heading (var "x")))
38577 (itemx (var "y"))
38578 (para "
38579 Specify the window coordinates of the first pixel
38580 that is read from the frame buffer.
38581 This location is the lower left corner of a rectangular block of pixels. "))
38582 (entry (% (heading (var "width")))
38583 (itemx (var "height"))
38584 (para "
38585 Specify the dimensions of the pixel rectangle. "
38586 (var "width")
38587 " and "
38588 (var "height")
38589 " of one correspond to a single pixel. "))
38590 (entry (% (heading (var "format")))
38591 (para "
38592 Specifies the format of the pixel data.
38593 The following symbolic values are accepted: "
38594 (code "GL_COLOR_INDEX")
38595 ", "
38596 (code "GL_STENCIL_INDEX")
38597 ", "
38598 (code "GL_DEPTH_COMPONENT")
38599 ", "
38600 (code "GL_RED")
38601 ", "
38602 (code "GL_GREEN")
38603 ", "
38604 (code "GL_BLUE")
38605 ", "
38606 (code "GL_ALPHA")
38607 ", "
38608 (code "GL_RGB")
38609 ", "
38610 (code "GL_BGR")
38611 ", "
38612 (code "GL_RGBA")
38613 ", "
38614 (code "GL_BGRA")
38615 ", "
38616 (code "GL_LUMINANCE")
38617 ", and "
38618 (code "GL_LUMINANCE_ALPHA")
38619 ". "))
38620 (entry (% (heading (var "type")))
38621 (para "
38622 Specifies the data type of the pixel data.
38623 Must be one of "
38624 (code "GL_UNSIGNED_BYTE")
38625 ", "
38626 (code "GL_BYTE")
38627 ", "
38628 (code "GL_BITMAP")
38629 ", "
38630 (code "GL_UNSIGNED_SHORT")
38631 ", "
38632 (code "GL_SHORT")
38633 ", "
38634 (code "GL_UNSIGNED_INT")
38635 ", "
38636 (code "GL_INT")
38637 ", "
38638 (code "GL_FLOAT")
38639 ", "
38640 (code "GL_UNSIGNED_BYTE_3_3_2")
38641 ", "
38642 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
38643 ", "
38644 (code "GL_UNSIGNED_SHORT_5_6_5")
38645 ", "
38646 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
38647 ", "
38648 (code "GL_UNSIGNED_SHORT_4_4_4_4")
38649 ", "
38650 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
38651 ", "
38652 (code "GL_UNSIGNED_SHORT_5_5_5_1")
38653 ", "
38654 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
38655 ", "
38656 (code "GL_UNSIGNED_INT_8_8_8_8")
38657 ", "
38658 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
38659 ", "
38660 (code "GL_UNSIGNED_INT_10_10_10_2")
38661 ", or "
38662 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
38663 ". "))
38664 (entry (% (heading (var "data")))
38665 (para "
38666 Returns the pixel data. ")))
38667 (heading "Description")
38668 (para (code "glReadPixels")
38669 " returns pixel data from the frame buffer,
38670 starting with the pixel whose lower left corner
38671 is at location ("
38672 (var "x")
38673 ", "
38674 (var "y")
38675 "),
38676 into client memory starting at location "
38677 (var "data")
38678 ".
38679 Several parameters control the processing of the pixel data before
38680 it is placed into client memory.
38681 These parameters are set with three commands: "
38682 (code "glPixelStore")
38683 ", "
38684 (code "glPixelTransfer")
38685 ", and "
38686 (code "glPixelMap")
38687 ".
38688 This reference page describes the effects on "
38689 (code "glReadPixels")
38690 " of most,
38691 but not all of the parameters specified by these three commands. ")
38692 (para "
38693 If a non-zero named buffer object is bound to the "
38694 (code "GL_PIXEL_PACK_BUFFER")
38695 " target
38696 (see "
38697 (code "glBindBuffer")
38698 ") while a block of pixels is
38699 requested, "
38700 (var "data")
38701 " is treated as a byte offset into the buffer object's data store
38702 rather than a pointer to client memory. ")
38703 (para "
38704 When the "
38705 (code "ARB_imaging")
38706 " extension is supported, the pixel data may
38707 be processed by additional operations including color table lookup,
38708 color matrix transformations, convolutions, histograms, and minimum and
38709 maximum pixel value computations. ")
38710 (para (code "glReadPixels")
38711 " returns values from each pixel with lower left corner at "
38712 (math "("
38713 (var "x")
38714 "+"
38715 (var "i")
38716 ","
38717 (var "y")
38718 "+"
38719 (var "j")
38720 ")")
38721 "
38722 for "
38723 (math "0" "<=" (var "i") "<" (var "width"))
38724 "
38725 and "
38726 (math "0" "<=" (var "j") "<" (var "height"))
38727 ".
38728 This pixel is said to be the "
38729 (math (var "i"))
38730 "th
38731 pixel in the "
38732 (math (var "j"))
38733 "th
38734 row.
38735 Pixels are returned in row order from the lowest to the highest row,
38736 left to right in each row. ")
38737 (para (var "format")
38738 " specifies the format for the returned pixel values;
38739 accepted values are: ")
38740 (table (% (formatter (asis)))
38741 (entry (% (heading (code "GL_COLOR_INDEX")))
38742 (para "
38743 Color indices are read from the color buffer
38744 selected by "
38745 (code "glReadBuffer")
38746 ".
38747 Each index is converted to fixed point,
38748 shifted left or right depending on the value and sign of "
38749 (code "GL_INDEX_SHIFT")
38750 ",
38751 and added to "
38752 (code "GL_INDEX_OFFSET")
38753 ".
38754 If "
38755 (code "GL_MAP_COLOR")
38756 " is "
38757 (code "GL_TRUE")
38758 ",
38759 indices are replaced by their mappings in the table "
38760 (code "GL_PIXEL_MAP_I_TO_I")
38761 ". "))
38762 (entry (% (heading (code "GL_STENCIL_INDEX")))
38763 (para "
38764 Stencil values are read from the stencil buffer.
38765 Each index is converted to fixed point,
38766 shifted left or right depending on the value and sign of "
38767 (code "GL_INDEX_SHIFT")
38768 ",
38769 and added to "
38770 (code "GL_INDEX_OFFSET")
38771 ".
38772 If "
38773 (code "GL_MAP_STENCIL")
38774 " is "
38775 (code "GL_TRUE")
38776 ",
38777 indices are replaced by their mappings in the table "
38778 (code "GL_PIXEL_MAP_S_TO_S")
38779 ". "))
38780 (entry (% (heading (code "GL_DEPTH_COMPONENT")))
38781 (para "
38782 Depth values are read from the depth buffer.
38783 Each component is converted to floating point such that the minimum depth
38784 value maps to 0 and the maximum value maps to 1.
38785 Each component is then multiplied by "
38786 (code "GL_DEPTH_SCALE")
38787 ",
38788 added to "
38789 (code "GL_DEPTH_BIAS")
38790 ",
38791 and finally clamped to the range "
38792 (math "[" "0" "," "1" "]")
38793 ". "))
38794 (entry (% (heading (code "GL_RED"))))
38795 (entry (% (heading (code "GL_GREEN"))))
38796 (entry (% (heading (code "GL_BLUE"))))
38797 (entry (% (heading (code "GL_ALPHA"))))
38798 (entry (% (heading (code "GL_RGB"))))
38799 (entry (% (heading (code "GL_BGR"))))
38800 (entry (% (heading (code "GL_RGBA"))))
38801 (entry (% (heading (code "GL_BGRA"))))
38802 (entry (% (heading (code "GL_LUMINANCE"))))
38803 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
38804 (para "
38805 Processing differs depending on whether color buffers store color indices
38806 or RGBA color components.
38807 If color indices are stored,
38808 they are read from the color buffer selected by "
38809 (code "glReadBuffer")
38810 ".
38811 Each index is converted to fixed point,
38812 shifted left or right depending on the value and sign of "
38813 (code "GL_INDEX_SHIFT")
38814 ",
38815 and added to "
38816 (code "GL_INDEX_OFFSET")
38817 ".
38818 Indices are then replaced by the red,
38819 green,
38820 blue,
38821 and alpha values obtained by indexing the tables "
38822 (code "GL_PIXEL_MAP_I_TO_R")
38823 ", "
38824 (code "GL_PIXEL_MAP_I_TO_G")
38825 ", "
38826 (code "GL_PIXEL_MAP_I_TO_B")
38827 ", and "
38828 (code "GL_PIXEL_MAP_I_TO_A")
38829 ".
38830 Each table must be of size "
38831 (math "2" "^" (var "n"))
38832 ",
38833 but "
38834 (math (var "n"))
38835 "
38836 may be different for
38837 different tables.
38838 Before an index is used to look up a value in a table of
38839 size "
38840 (math "2" "^" (var "n"))
38841 ",
38842 it must be masked against "
38843 (math "2" "^" (var "n") "-" "1")
38844 ". ")
38845 (para "
38846 If RGBA color components are stored in the color buffers,
38847 they are read from the color buffer selected by "
38848 (code "glReadBuffer")
38849 ".
38850 Each color component is converted to floating point such that zero intensity
38851 maps to 0.0 and full intensity maps to 1.0.
38852 Each component is then multiplied by "
38853 (code "GL_c_SCALE")
38854 " and
38855 added to "
38856 (code "GL_c_BIAS")
38857 ",
38858 where "
38859 (var "c")
38860 " is RED, GREEN, BLUE, or ALPHA.
38861 Finally,
38862 if "
38863 (code "GL_MAP_COLOR")
38864 " is "
38865 (code "GL_TRUE")
38866 ",
38867 each component is clamped to the range "
38868 (math "[" "0" "," "1" "]")
38869 ",
38870 scaled to the size of its corresponding table, and is then
38871 replaced by its mapping in the table "
38872 (code "GL_PIXEL_MAP_c_TO_c")
38873 ",
38874 where "
38875 (var "c")
38876 " is R, G, B, or A. ")
38877 (para "
38878 Unneeded data is then discarded.
38879 For example, "
38880 (code "GL_RED")
38881 " discards the green, blue, and alpha components,
38882 while "
38883 (code "GL_RGB")
38884 " discards only the alpha component. "
38885 (code "GL_LUMINANCE")
38886 " computes a single-component value as the sum of
38887 the red,
38888 green,
38889 and blue components,
38890 and "
38891 (code "GL_LUMINANCE_ALPHA")
38892 " does the same,
38893 while keeping alpha as a second value.
38894 The final values are clamped to the range "
38895 (math "[" "0" "," "1" "]")
38896 ". ")))
38897 (para "
38898 The shift,
38899 scale,
38900 bias,
38901 and lookup factors just described are all specified by "
38902 (code "glPixelTransfer")
38903 ".
38904 The lookup table contents themselves are specified by "
38905 (code "glPixelMap")
38906 ". ")
38907 (para "
38908 Finally, the indices or components
38909 are converted to the proper format,
38910 as specified by "
38911 (var "type")
38912 ".
38913 If "
38914 (var "format")
38915 " is "
38916 (code "GL_COLOR_INDEX")
38917 " or "
38918 (code "GL_STENCIL_INDEX")
38919 "
38920 and "
38921 (var "type")
38922 " is not "
38923 (code "GL_FLOAT")
38924 ",
38925 each index is masked with the mask value given in the following table.
38926 If "
38927 (var "type")
38928 " is "
38929 (code "GL_FLOAT")
38930 ", then each integer index is converted to
38931 single-precision floating-point format. ")
38932 (para "
38933 If "
38934 (var "format")
38935 " is "
38936 (code "GL_RED")
38937 ", "
38938 (code "GL_GREEN")
38939 ", "
38940 (code "GL_BLUE")
38941 ", "
38942 (code "GL_ALPHA")
38943 ", "
38944 (code "GL_RGB")
38945 ", "
38946 (code "GL_BGR")
38947 ", "
38948 (code "GL_RGBA")
38949 ", "
38950 (code "GL_BGRA")
38951 ", "
38952 (code "GL_LUMINANCE")
38953 ", or "
38954 (code "GL_LUMINANCE_ALPHA")
38955 " and "
38956 (var "type")
38957 " is not "
38958 (code "GL_FLOAT")
38959 ",
38960 each component is multiplied by the multiplier shown in the following table.
38961 If type is "
38962 (code "GL_FLOAT")
38963 ", then each component is passed as is
38964 (or converted to the client's single-precision floating-point format if
38965 it is different from the one used by the GL). ")
38966 (para)
38967 (table (% (formatter (asis)))
38968 (entry (% (heading (var "type")))
38969 (para (strong "Index Mask")
38970 ", "
38971 (strong "Component Conversion")))
38972 (entry (% (heading (code "GL_UNSIGNED_BYTE")))
38973 (para (math "2" "^" "8" "-" "1")
38974 ", "
38975 (math "("
38976 "2"
38977 "^"
38978 "8"
38979 "-"
38980 "1"
38981 ","
38982 ")"
38983 "\u2062"
38984 (var "c"))))
38985 (entry (% (heading (code "GL_BYTE")))
38986 (para (math "2" "^" "7" "-" "1")
38987 ", "
38988 (math "("
38989 "2"
38990 "^"
38991 "8"
38992 "-"
38993 "1"
38994 ","
38995 ")"
38996 "\u2062"
38997 (var "c")
38998 "-"
38999 "1"
39000 ","
39001 "/"
39002 "2")))
39003 (entry (% (heading (code "GL_BITMAP")))
39004 (para (math "1") ", " (math "1")))
39005 (entry (% (heading (code "GL_UNSIGNED_SHORT")))
39006 (para (math "2" "^" "16" "-" "1")
39007 ", "
39008 (math "("
39009 "2"
39010 "^"
39011 "16"
39012 "-"
39013 "1"
39014 ","
39015 ")"
39016 "\u2062"
39017 (var "c"))))
39018 (entry (% (heading (code "GL_SHORT")))
39019 (para (math "2" "^" "15" "-" "1")
39020 ", "
39021 (math "("
39022 "2"
39023 "^"
39024 "16"
39025 "-"
39026 "1"
39027 ","
39028 ")"
39029 "\u2062"
39030 (var "c")
39031 "-"
39032 "1"
39033 ","
39034 "/"
39035 "2")))
39036 (entry (% (heading (code "GL_UNSIGNED_INT")))
39037 (para (math "2" "^" "32" "-" "1")
39038 ", "
39039 (math "("
39040 "2"
39041 "^"
39042 "32"
39043 "-"
39044 "1"
39045 ","
39046 ")"
39047 "\u2062"
39048 (var "c"))))
39049 (entry (% (heading (code "GL_INT")))
39050 (para (math "2" "^" "31" "-" "1")
39051 ", "
39052 (math "("
39053 "2"
39054 "^"
39055 "32"
39056 "-"
39057 "1"
39058 ","
39059 ")"
39060 "\u2062"
39061 (var "c")
39062 "-"
39063 "1"
39064 ","
39065 "/"
39066 "2")))
39067 (entry (% (heading (code "GL_FLOAT")))
39068 (para "
39069 none " ", " (math (var "c")))))
39070 (para "
39071 Return values are placed in memory as follows.
39072 If "
39073 (var "format")
39074 " is "
39075 (code "GL_COLOR_INDEX")
39076 ", "
39077 (code "GL_STENCIL_INDEX")
39078 ", "
39079 (code "GL_DEPTH_COMPONENT")
39080 ", "
39081 (code "GL_RED")
39082 ", "
39083 (code "GL_GREEN")
39084 ", "
39085 (code "GL_BLUE")
39086 ", "
39087 (code "GL_ALPHA")
39088 ", or "
39089 (code "GL_LUMINANCE")
39090 ",
39091 a single value is returned and the data for the "
39092 (math (var "i"))
39093 "th
39094 pixel in the "
39095 (math (var "j"))
39096 "th
39097 row
39098 is placed in location "
39099 (math "("
39100 (var "j")
39101 ","
39102 ")"
39103 "\u2062"
39104 (var "width")
39105 "+"
39106 (var "i"))
39107 ". "
39108 (code "GL_RGB")
39109 " and "
39110 (code "GL_BGR")
39111 " return three values, "
39112 (code "GL_RGBA")
39113 " and "
39114 (code "GL_BGRA")
39115 " return four values,
39116 and "
39117 (code "GL_LUMINANCE_ALPHA")
39118 " returns two values for each pixel,
39119 with all values corresponding to a single pixel occupying contiguous space
39120 in "
39121 (var "data")
39122 ".
39123 Storage parameters set by "
39124 (code "glPixelStore")
39125 ",
39126 such as "
39127 (code "GL_PACK_LSB_FIRST")
39128 " and "
39129 (code "GL_PACK_SWAP_BYTES")
39130 ",
39131 affect the way that data is written into memory.
39132 See "
39133 (code "glPixelStore")
39134 " for a description. ")
39135 (heading "Errors")
39136 (para (code "GL_INVALID_ENUM")
39137 " is generated if "
39138 (var "format")
39139 " or "
39140 (var "type")
39141 " is not an
39142 accepted value. ")
39143 (para (code "GL_INVALID_ENUM")
39144 " is generated if "
39145 (var "type")
39146 " is "
39147 (code "GL_BITMAP")
39148 " and "
39149 (var "format")
39150 " is
39151 not "
39152 (code "GL_COLOR_INDEX")
39153 " or "
39154 (code "GL_STENCIL_INDEX")
39155 ". ")
39156 (para (code "GL_INVALID_VALUE")
39157 " is generated if either "
39158 (var "width")
39159 " or "
39160 (var "height")
39161 " is negative. ")
39162 (para (code "GL_INVALID_OPERATION")
39163 " is generated if "
39164 (var "format")
39165 " is "
39166 (code "GL_COLOR_INDEX")
39167 "
39168 and the color buffers store RGBA color components. ")
39169 (para (code "GL_INVALID_OPERATION")
39170 " is generated if "
39171 (var "format")
39172 " is "
39173 (code "GL_STENCIL_INDEX")
39174 "
39175 and there is no stencil buffer. ")
39176 (para (code "GL_INVALID_OPERATION")
39177 " is generated if "
39178 (var "format")
39179 " is "
39180 (code "GL_DEPTH_COMPONENT")
39181 "
39182 and there is no depth buffer. ")
39183 (para (code "GL_INVALID_OPERATION")
39184 " is generated if "
39185 (var "type")
39186 " is one of "
39187 (code "GL_UNSIGNED_BYTE_3_3_2")
39188 ", "
39189 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
39190 ", "
39191 (code "GL_UNSIGNED_SHORT_5_6_5")
39192 ", or "
39193 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
39194 "
39195 and "
39196 (var "format")
39197 " is not "
39198 (code "GL_RGB")
39199 ". ")
39200 (para (code "GL_INVALID_OPERATION")
39201 " is generated if "
39202 (var "type")
39203 " is one of "
39204 (code "GL_UNSIGNED_SHORT_4_4_4_4")
39205 ", "
39206 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
39207 ", "
39208 (code "GL_UNSIGNED_SHORT_5_5_5_1")
39209 ", "
39210 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
39211 ", "
39212 (code "GL_UNSIGNED_INT_8_8_8_8")
39213 ", "
39214 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
39215 ", "
39216 (code "GL_UNSIGNED_INT_10_10_10_2")
39217 ", or "
39218 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
39219 "
39220 and "
39221 (var "format")
39222 " is neither "
39223 (code "GL_RGBA")
39224 " nor "
39225 (code "GL_BGRA")
39226 ". ")
39227 (para "
39228 The formats "
39229 (code "GL_BGR")
39230 ", and "
39231 (code "GL_BGRA")
39232 " and types "
39233 (code "GL_UNSIGNED_BYTE_3_3_2")
39234 ", "
39235 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
39236 ", "
39237 (code "GL_UNSIGNED_SHORT_5_6_5")
39238 ", "
39239 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
39240 ", "
39241 (code "GL_UNSIGNED_SHORT_4_4_4_4")
39242 ", "
39243 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
39244 ", "
39245 (code "GL_UNSIGNED_SHORT_5_5_5_1")
39246 ", "
39247 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
39248 ", "
39249 (code "GL_UNSIGNED_INT_8_8_8_8")
39250 ", "
39251 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
39252 ", "
39253 (code "GL_UNSIGNED_INT_10_10_10_2")
39254 ", and "
39255 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
39256 " are available only if the GL version
39257 is 1.2 or greater. ")
39258 (para (code "GL_INVALID_OPERATION")
39259 " is generated if a non-zero buffer object name is bound to the "
39260 (code "GL_PIXEL_PACK_BUFFER")
39261 " target and the buffer object's data store is currently mapped. ")
39262 (para (code "GL_INVALID_OPERATION")
39263 " is generated if a non-zero buffer object name is bound to the "
39264 (code "GL_PIXEL_PACK_BUFFER")
39265 " target and the data would be packed to the buffer
39266 object such that the memory writes required would exceed the data store size. ")
39267 (para (code "GL_INVALID_OPERATION")
39268 " is generated if a non-zero buffer object name is bound to the "
39269 (code "GL_PIXEL_PACK_BUFFER")
39270 " target and "
39271 (var "data")
39272 " is not evenly divisible
39273 into the number of bytes needed to store in memory a datum indicated by "
39274 (var "type")
39275 ". ")
39276 (para (code "GL_INVALID_OPERATION")
39277 " is generated if "
39278 (code "glReadPixels")
39279 "
39280 is executed between the execution of "
39281 (code "glBegin")
39282 "
39283 and the corresponding execution of "
39284 (code "glEnd")
39285 ". ")))
39286
39287 (define-gl-procedure
39288 glRect
39289 "glRect"
39290 (funcsynopsis
39291 (funcprototype
39292 (funcdef "void " (function "glRectd"))
39293 (paramdef "GLdouble " (parameter "x1"))
39294 (paramdef "GLdouble " (parameter "y1"))
39295 (paramdef "GLdouble " (parameter "x2"))
39296 (paramdef "GLdouble " (parameter "y2"))))
39297 '(*fragment*
39298 (heading "draw a rectangle")
39299 (heading "Parameters")
39300 (table (% (formatter (asis)))
39301 (entry (% (heading (var "x1")))
39302 (itemx (var "y1"))
39303 (para "
39304 Specify one vertex of a rectangle. "))
39305 (entry (% (heading (var "x2")))
39306 (itemx (var "y2"))
39307 (para "
39308 Specify the opposite vertex of the rectangle. ")))
39309 (heading "Description")
39310 (para (code "glRect")
39311 " supports efficient specification of rectangles as two corner points.
39312 Each
39313 rectangle command takes four arguments,
39314 organized either as two consecutive pairs of "
39315 (math "(" (var "x") "," (var "y") ")")
39316 "
39317 coordinates
39318 or as two pointers to arrays,
39319 each containing an "
39320 (math "(" (var "x") "," (var "y") ")")
39321 "
39322 pair.
39323 The resulting rectangle is defined in the "
39324 (math (var "z") "=" "0")
39325 "
39326 plane. ")
39327 (para (code "glRect")
39328 "("
39329 (var "x1")
39330 ", "
39331 (var "y1")
39332 ", "
39333 (var "x2")
39334 ", "
39335 (var "y2")
39336 ")
39337 is exactly equivalent to the following sequence: "
39338 "
39339 Note that if the second vertex is above and to the right of the first vertex,
39340 the rectangle is constructed with a counterclockwise winding. ")
39341 (example
39342 "
39343 glBegin("
39344 (code "GL_POLYGON")
39345 ");
39346 glVertex2("
39347 (var "x1")
39348 ", "
39349 (var "y1")
39350 ");
39351 glVertex2("
39352 (var "x2")
39353 ", "
39354 (var "y1")
39355 ");
39356 glVertex2("
39357 (var "x2")
39358 ", "
39359 (var "y2")
39360 ");
39361 glVertex2("
39362 (var "x1")
39363 ", "
39364 (var "y2")
39365 ");
39366 glEnd(); ")
39367 (heading "Errors")
39368 (para (code "GL_INVALID_OPERATION")
39369 " is generated if "
39370 (code "glRect")
39371 "
39372 is executed between the execution of "
39373 (code "glBegin")
39374 "
39375 and the corresponding execution of "
39376 (code "glEnd")
39377 ". ")))
39378
39379 (define-gl-procedure
39380 glRenderMode
39381 "glRenderMode"
39382 (funcsynopsis
39383 (funcprototype
39384 (funcdef "GLint " (function "glRenderMode"))
39385 (paramdef "GLenum " (parameter "mode"))))
39386 '(*fragment*
39387 (heading "set rasterization mode")
39388 (heading "Parameters")
39389 (table (% (formatter (asis)))
39390 (entry (% (heading (var "mode")))
39391 (para "
39392 Specifies the rasterization mode.
39393 Three values are accepted: "
39394 (code "GL_RENDER")
39395 ", "
39396 (code "GL_SELECT")
39397 ", and "
39398 (code "GL_FEEDBACK")
39399 ".
39400 The initial value is "
39401 (code "GL_RENDER")
39402 ". ")))
39403 (heading "Description")
39404 (para (code "glRenderMode")
39405 " sets the rasterization mode.
39406 It takes one argument, "
39407 (var "mode")
39408 ",
39409 which can assume one of three predefined values: ")
39410 (table (% (formatter (asis)))
39411 (entry (% (heading (code "GL_RENDER")))
39412 (para "
39413 Render mode. Primitives are rasterized,
39414 producing pixel fragments,
39415 which are written into the frame buffer.
39416 This is the normal mode
39417 and also the default mode. "))
39418 (entry (% (heading (code "GL_SELECT")))
39419 (para "
39420 Selection mode.
39421 No pixel fragments are produced,
39422 and no change to the frame buffer contents is made.
39423 Instead,
39424 a record of the names of primitives that would have been drawn
39425 if the render mode had been "
39426 (code "GL_RENDER")
39427 " is returned in a select buffer,
39428 which must be created (see "
39429 (code "glSelectBuffer")
39430 ") before selection mode
39431 is entered. "))
39432 (entry (% (heading (code "GL_FEEDBACK")))
39433 (para "
39434 Feedback mode.
39435 No pixel fragments are produced,
39436 and no change to the frame buffer contents is made.
39437 Instead,
39438 the coordinates and attributes of vertices that would have been drawn
39439 if the render mode had been "
39440 (code "GL_RENDER")
39441 " is returned in a feedback buffer,
39442 which must be created (see "
39443 (code "glFeedbackBuffer")
39444 ") before feedback mode
39445 is entered. ")))
39446 (para "
39447 The return value of "
39448 (code "glRenderMode")
39449 " is determined by the render mode at the time "
39450 (code "glRenderMode")
39451 " is called,
39452 rather than by "
39453 (var "mode")
39454 ".
39455 The values returned for the three render modes are as follows: ")
39456 (table (% (formatter (asis)))
39457 (entry (% (heading (code "GL_RENDER")))
39458 (para "
39459 0. "))
39460 (entry (% (heading (code "GL_SELECT")))
39461 (para "
39462 The number of hit records transferred to the select buffer. "))
39463 (entry (% (heading (code "GL_FEEDBACK")))
39464 (para "
39465 The number of values (not vertices) transferred to the feedback buffer. ")))
39466 (para "
39467 See the "
39468 (code "glSelectBuffer")
39469 " and "
39470 (code "glFeedbackBuffer")
39471 " reference pages for
39472 more details concerning selection and feedback operation. ")
39473 (heading "Errors")
39474 (para (code "GL_INVALID_ENUM")
39475 " is generated if "
39476 (var "mode")
39477 " is not one of the three
39478 accepted values. ")
39479 (para (code "GL_INVALID_OPERATION")
39480 " is generated if "
39481 (code "glSelectBuffer")
39482 " is called
39483 while the render mode is "
39484 (code "GL_SELECT")
39485 ",
39486 or if "
39487 (code "glRenderMode")
39488 " is called with argument "
39489 (code "GL_SELECT")
39490 " before "
39491 (code "glSelectBuffer")
39492 " is called at least once. ")
39493 (para (code "GL_INVALID_OPERATION")
39494 " is generated if "
39495 (code "glFeedbackBuffer")
39496 " is called
39497 while the render mode is "
39498 (code "GL_FEEDBACK")
39499 ",
39500 or if "
39501 (code "glRenderMode")
39502 " is called with argument "
39503 (code "GL_FEEDBACK")
39504 " before "
39505 (code "glFeedbackBuffer")
39506 " is called at least once. ")
39507 (para (code "GL_INVALID_OPERATION")
39508 " is generated if "
39509 (code "glRenderMode")
39510 "
39511 is executed between the execution of "
39512 (code "glBegin")
39513 "
39514 and the corresponding execution of "
39515 (code "glEnd")
39516 ". ")))
39517
39518 (define-gl-procedure
39519 glResetHistogram
39520 "glResetHistogram"
39521 (funcsynopsis
39522 (funcprototype
39523 (funcdef "void " (function "glResetHistogram"))
39524 (paramdef "GLenum " (parameter "target"))))
39525 '(*fragment*
39526 (heading "reset histogram table entries to zero")
39527 (heading "Parameters")
39528 (table (% (formatter (asis)))
39529 (entry (% (heading (var "target")))
39530 (para "
39531 Must be " (code "GL_HISTOGRAM") ". ")))
39532 (heading "Description")
39533 (para (code "glResetHistogram")
39534 " resets all the elements of the current histogram table to zero. ")
39535 (heading "Errors")
39536 (para (code "GL_INVALID_ENUM")
39537 " is generated if "
39538 (var "target")
39539 " is not "
39540 (code "GL_HISTOGRAM")
39541 ". ")
39542 (para (code "GL_INVALID_OPERATION")
39543 " is generated if "
39544 (code "glResetHistogram")
39545 " is executed
39546 between the execution of "
39547 (code "glBegin")
39548 " and the corresponding
39549 execution of "
39550 (code "glEnd")
39551 ". ")))
39552
39553 (define-gl-procedure
39554 glResetMinmax
39555 "glResetMinmax"
39556 (funcsynopsis
39557 (funcprototype
39558 (funcdef "void " (function "glResetMinmax"))
39559 (paramdef "GLenum " (parameter "target"))))
39560 '(*fragment*
39561 (heading
39562 "reset minmax table entries to initial values")
39563 (heading "Parameters")
39564 (table (% (formatter (asis)))
39565 (entry (% (heading (var "target")))
39566 (para "
39567 Must be " (code "GL_MINMAX") ". ")))
39568 (heading "Description")
39569 (para (code "glResetMinmax")
39570 " resets the elements of the current minmax table to their
39571 initial values: the ``maximum'' element receives the minimum possible
39572 component values, and the ``minimum'' element receives the maximum
39573 possible component values. ")
39574 (heading "Errors")
39575 (para (code "GL_INVALID_ENUM")
39576 " is generated if "
39577 (var "target")
39578 " is not "
39579 (code "GL_MINMAX")
39580 ". ")
39581 (para (code "GL_INVALID_OPERATION")
39582 " is generated if "
39583 (code "glResetMinmax")
39584 " is executed
39585 between the execution of "
39586 (code "glBegin")
39587 " and the corresponding
39588 execution of "
39589 (code "glEnd")
39590 ". ")))
39591
39592 (define-gl-procedure
39593 glRotate
39594 "glRotate"
39595 (funcsynopsis
39596 (funcprototype
39597 (funcdef "void " (function "glRotated"))
39598 (paramdef "GLdouble " (parameter "angle"))
39599 (paramdef "GLdouble " (parameter "x"))
39600 (paramdef "GLdouble " (parameter "y"))
39601 (paramdef "GLdouble " (parameter "z"))))
39602 '(*fragment*
39603 (heading
39604 "multiply the current matrix by a rotation matrix")
39605 (heading "Parameters")
39606 (table (% (formatter (asis)))
39607 (entry (% (heading (var "angle")))
39608 (para "
39609 Specifies the angle of rotation, in degrees. "))
39610 (entry (% (heading (var "x")))
39611 (itemx (var "y"))
39612 (itemx (var "z"))
39613 (para "
39614 Specify the "
39615 (var "x")
39616 ", "
39617 (var "y")
39618 ", and "
39619 (var "z")
39620 " coordinates of a vector, respectively. ")))
39621 (heading "Description")
39622 (para (code "glRotate")
39623 " produces a rotation of "
39624 (var "angle")
39625 " degrees around
39626 the vector "
39627 (math "(" (var "x") "," (var "y") (var "z") ")")
39628 ".
39629 The current matrix (see "
39630 (code "glMatrixMode")
39631 ") is multiplied by a rotation
39632 matrix with the product
39633 replacing the current matrix, as if "
39634 (code "glMultMatrix")
39635 " were called
39636 with the following matrix as its argument: ")
39637 (para (math "("
39638 "("
39639 (var "x")
39640 "^"
39641 "2"
39642 "\u2061"
39643 "("
39644 "1"
39645 "-"
39646 (var "c")
39647 ","
39648 ")"
39649 "+"
39650 (var "c")
39651 " "
39652 (var "x")
39653 "\u2062"
39654 (var "y")
39655 "\u2061"
39656 "("
39657 "1"
39658 "-"
39659 (var "c")
39660 ","
39661 ")"
39662 "-"
39663 (var "z")
39664 "\u2062"
39665 (var "s")
39666 " "
39667 (var "x")
39668 "\u2062"
39669 (var "z")
39670 "\u2061"
39671 "("
39672 "1"
39673 "-"
39674 (var "c")
39675 ","
39676 ")"
39677 "+"
39678 (var "y")
39679 "\u2062"
39680 (var "s")
39681 " "
39682 "0"
39683 ")"
39684 ", "
39685 "("
39686 (var "y")
39687 "\u2062"
39688 (var "x")
39689 "\u2061"
39690 "("
39691 "1"
39692 "-"
39693 (var "c")
39694 ","
39695 ")"
39696 "+"
39697 (var "z")
39698 "\u2062"
39699 (var "s")
39700 " "
39701 (var "y")
39702 "^"
39703 "2"
39704 "\u2061"
39705 "("
39706 "1"
39707 "-"
39708 (var "c")
39709 ","
39710 ")"
39711 "+"
39712 (var "c")
39713 " "
39714 (var "y")
39715 "\u2062"
39716 (var "z")
39717 "\u2061"
39718 "("
39719 "1"
39720 "-"
39721 (var "c")
39722 ","
39723 ")"
39724 "-"
39725 (var "x")
39726 "\u2062"
39727 (var "s")
39728 " "
39729 "0"
39730 ")"
39731 ", "
39732 "("
39733 (var "x")
39734 "\u2062"
39735 (var "z")
39736 "\u2061"
39737 "("
39738 "1"
39739 "-"
39740 (var "c")
39741 ","
39742 ")"
39743 "-"
39744 (var "y")
39745 "\u2062"
39746 (var "s")
39747 " "
39748 (var "y")
39749 "\u2062"
39750 (var "z")
39751 "\u2061"
39752 "("
39753 "1"
39754 "-"
39755 (var "c")
39756 ","
39757 ")"
39758 "+"
39759 (var "x")
39760 "\u2062"
39761 (var "s")
39762 " "
39763 (var "z")
39764 "^"
39765 "2"
39766 "\u2061"
39767 "("
39768 "1"
39769 "-"
39770 (var "c")
39771 ","
39772 ")"
39773 "+"
39774 (var "c")
39775 " "
39776 "0"
39777 ")"
39778 ", "
39779 "("
39780 "0"
39781 " "
39782 "0"
39783 " "
39784 "0"
39785 " "
39786 "1"
39787 ")"
39788 ","
39789 ")"))
39790 (para)
39791 (para "
39792 Where "
39793 (math (var "c")
39794 "="
39795 (var "cos")
39796 "\u2061"
39797 "("
39798 (var "angle")
39799 ","
39800 ")")
39801 ", "
39802 (math (var "s")
39803 "="
39804 (var "sin")
39805 "\u2061"
39806 "("
39807 (var "angle")
39808 ","
39809 ")")
39810 ",
39811 and "
39812 (math "∥"
39813 "("
39814 (var "x")
39815 ","
39816 (var "y")
39817 (var "z")
39818 ")"
39819 ","
39820 "∥"
39821 "="
39822 "1")
39823 "
39824 (if not, the GL
39825 will normalize this vector). ")
39826 (para)
39827 (para)
39828 (para "
39829 If the matrix mode is either "
39830 (code "GL_MODELVIEW")
39831 " or "
39832 (code "GL_PROJECTION")
39833 ",
39834 all objects drawn after "
39835 (code "glRotate")
39836 " is called are rotated.
39837 Use "
39838 (code "glPushMatrix")
39839 " and "
39840 (code "glPopMatrix")
39841 " to save and restore
39842 the unrotated coordinate system. ")
39843 (heading "Errors")
39844 (para (code "GL_INVALID_OPERATION")
39845 " is generated if "
39846 (code "glRotate")
39847 "
39848 is executed between the execution of "
39849 (code "glBegin")
39850 "
39851 and the corresponding execution of "
39852 (code "glEnd")
39853 ". ")))
39854
39855 (define-gl-procedure
39856 glSampleCoverage
39857 "glSampleCoverage"
39858 (funcsynopsis
39859 (funcprototype
39860 (funcdef "void " (function "glSampleCoverage"))
39861 (paramdef "GLclampf " (parameter "value"))
39862 (paramdef "GLboolean " (parameter "invert"))))
39863 '(*fragment*
39864 (heading
39865 "specify multisample coverage parameters")
39866 (heading "Parameters")
39867 (table (% (formatter (asis)))
39868 (entry (% (heading (var "value")))
39869 (para "
39870 Specify a single floating-point sample coverage value. The value is
39871 clamped to the range "
39872 (math "[" "0" "," "1" "]")
39873 ".
39874 The initial value is 1.0. "))
39875 (entry (% (heading (var "invert")))
39876 (para "
39877 Specify a single boolean value representing if the coverage masks should be
39878 inverted. "
39879 (code "GL_TRUE")
39880 " and "
39881 (code "GL_FALSE")
39882 " are accepted. The initial value
39883 is "
39884 (code "GL_FALSE")
39885 ". ")))
39886 (heading "Description")
39887 (para "
39888 Multisampling samples a pixel multiple times at various
39889 implementation-dependent subpixel locations to generate antialiasing
39890 effects. Multisampling transparently antialiases points, lines, polygons,
39891 bitmaps, and images if it is enabled. ")
39892 (para (var "value")
39893 " is used in constructing a temporary mask used in determining which
39894 samples will be used in resolving the final fragment color. This mask is
39895 bitwise-anded with the coverage mask generated from the multisampling
39896 computation. If the "
39897 (var "invert")
39898 " flag is set, the temporary mask is inverted
39899 (all bits flipped) and then the bitwise-and is computed. ")
39900 (para "
39901 If an implementation does not have any multisample buffers available, or
39902 multisampling is disabled, rasterization occurs with only a single sample
39903 computing a pixel's final RGB color. ")
39904 (para "
39905 Provided an implementation supports multisample buffers, and multisampling
39906 is enabled, then a pixel's final color is generated by combining several
39907 samples per pixel. Each sample contains color, depth, and stencil
39908 information, allowing those operations to be performed on each sample. ")
39909 (heading "Errors")
39910 (para (code "GL_INVALID_OPERATION")
39911 " is generated if "
39912 (code "glSampleCoverage")
39913 " is executed between the
39914 execution of "
39915 (code "glBegin")
39916 " and the corresponding execution of "
39917 (code "glEnd")
39918 ". ")))
39919
39920 (define-gl-procedure
39921 glScale
39922 "glScale"
39923 (funcsynopsis
39924 (funcprototype
39925 (funcdef "void " (function "glScaled"))
39926 (paramdef "GLdouble " (parameter "x"))
39927 (paramdef "GLdouble " (parameter "y"))
39928 (paramdef "GLdouble " (parameter "z"))))
39929 '(*fragment*
39930 (heading
39931 "multiply the current matrix by a general scaling matrix")
39932 (heading "Parameters")
39933 (table (% (formatter (asis)))
39934 (entry (% (heading (var "x")))
39935 (itemx (var "y"))
39936 (itemx (var "z"))
39937 (para "
39938 Specify scale factors along the "
39939 (var "x")
39940 ", "
39941 (var "y")
39942 ", and "
39943 (var "z")
39944 " axes, respectively. ")))
39945 (heading "Description")
39946 (para (code "glScale")
39947 " produces a nonuniform scaling along the "
39948 (var "x")
39949 ", "
39950 (var "y")
39951 ", and "
39952 (var "z")
39953 " axes.
39954 The three parameters indicate the desired scale factor along
39955 each of the three axes. ")
39956 (para "
39957 The current matrix
39958 (see "
39959 (code "glMatrixMode")
39960 ")
39961 is multiplied by this scale matrix,
39962 and the product replaces the current matrix
39963 as if "
39964 (code "glMultMatrix")
39965 " were called with the following matrix
39966 as its argument: ")
39967 (para (math "("
39968 "("
39969 (var "x")
39970 " "
39971 "0"
39972 " "
39973 "0"
39974 " "
39975 "0"
39976 ")"
39977 ", "
39978 "("
39979 "0"
39980 " "
39981 (var "y")
39982 " "
39983 "0"
39984 " "
39985 "0"
39986 ")"
39987 ", "
39988 "("
39989 "0"
39990 " "
39991 "0"
39992 " "
39993 (var "z")
39994 " "
39995 "0"
39996 ")"
39997 ", "
39998 "("
39999 "0"
40000 " "
40001 "0"
40002 " "
40003 "0"
40004 " "
40005 "1"
40006 ")"
40007 ","
40008 ")"))
40009 (para "
40010 If the matrix mode is either "
40011 (code "GL_MODELVIEW")
40012 " or "
40013 (code "GL_PROJECTION")
40014 ",
40015 all objects drawn after "
40016 (code "glScale")
40017 " is called are scaled. ")
40018 (para "
40019 Use "
40020 (code "glPushMatrix")
40021 " and "
40022 (code "glPopMatrix")
40023 " to save and restore
40024 the unscaled coordinate
40025 system. ")
40026 (heading "Errors")
40027 (para (code "GL_INVALID_OPERATION")
40028 " is generated if "
40029 (code "glScale")
40030 "
40031 is executed between the execution of "
40032 (code "glBegin")
40033 "
40034 and the corresponding execution of "
40035 (code "glEnd")
40036 ". ")))
40037
40038 (define-gl-procedure
40039 glScissor
40040 "glScissor"
40041 (funcsynopsis
40042 (funcprototype
40043 (funcdef "void " (function "glScissor"))
40044 (paramdef "GLint " (parameter "x"))
40045 (paramdef "GLint " (parameter "y"))
40046 (paramdef "GLsizei " (parameter "width"))
40047 (paramdef "GLsizei " (parameter "height"))))
40048 '(*fragment*
40049 (heading "define the scissor box")
40050 (heading "Parameters")
40051 (table (% (formatter (asis)))
40052 (entry (% (heading (var "x")))
40053 (itemx (var "y"))
40054 (para "
40055 Specify the lower left corner of the scissor box.
40056 Initially (0, 0). "))
40057 (entry (% (heading (var "width")))
40058 (itemx (var "height"))
40059 (para "
40060 Specify the width and height of the scissor box.
40061 When a GL context is first attached to a window, "
40062 (var "width")
40063 " and "
40064 (var "height")
40065 " are set to the dimensions of that
40066 window. ")))
40067 (heading "Description")
40068 (para (code "glScissor")
40069 " defines a rectangle, called the scissor box,
40070 in window coordinates.
40071 The first two arguments, "
40072 (var "x")
40073 " and "
40074 (var "y")
40075 ",
40076 specify the lower left corner of the box. "
40077 (var "width")
40078 " and "
40079 (var "height")
40080 " specify the width and height of the box. ")
40081 (para "
40082 To enable and disable the scissor test, call "
40083 (code "glEnable")
40084 " and "
40085 (code "glDisable")
40086 " with argument "
40087 (code "GL_SCISSOR_TEST")
40088 ". The test is initially disabled.
40089 While the test is enabled, only pixels that lie within the scissor box
40090 can be modified by drawing commands.
40091 Window coordinates have integer values at the shared corners of
40092 frame buffer pixels. "
40093 (code "glScissor(0,0,1,1)")
40094 " allows modification of only the lower left
40095 pixel in the window, and "
40096 (code "glScissor(0,0,0,0)")
40097 " doesn't allow
40098 modification of any pixels in the window. ")
40099 (para "
40100 When the scissor test is disabled,
40101 it is as though the scissor box includes the entire window. ")
40102 (heading "Errors")
40103 (para (code "GL_INVALID_VALUE")
40104 " is generated if either "
40105 (var "width")
40106 " or "
40107 (var "height")
40108 " is negative. ")
40109 (para (code "GL_INVALID_OPERATION")
40110 " is generated if "
40111 (code "glScissor")
40112 "
40113 is executed between the execution of "
40114 (code "glBegin")
40115 "
40116 and the corresponding execution of "
40117 (code "glEnd")
40118 ". ")))
40119
40120 (define-gl-procedure
40121 glSecondaryColorPointer
40122 "glSecondaryColorPointer"
40123 (funcsynopsis
40124 (funcprototype
40125 (funcdef
40126 "void "
40127 (function "glSecondaryColorPointer"))
40128 (paramdef "GLint " (parameter "size"))
40129 (paramdef "GLenum " (parameter "type"))
40130 (paramdef "GLsizei " (parameter "stride"))
40131 (paramdef
40132 "const GLvoid * "
40133 (parameter "pointer"))))
40134 '(*fragment*
40135 (heading "define an array of secondary colors")
40136 (heading "Parameters")
40137 (table (% (formatter (asis)))
40138 (entry (% (heading (var "size")))
40139 (para "
40140 Specifies the number of components per color. Must be 3. "))
40141 (entry (% (heading (var "type")))
40142 (para "
40143 Specifies the data type of each color component in the array.
40144 Symbolic constants "
40145 (code "GL_BYTE")
40146 ", "
40147 (code "GL_UNSIGNED_BYTE")
40148 ", "
40149 (code "GL_SHORT")
40150 ", "
40151 (code "GL_UNSIGNED_SHORT")
40152 ", "
40153 (code "GL_INT")
40154 ", "
40155 (code "GL_UNSIGNED_INT")
40156 ", "
40157 (code "GL_FLOAT")
40158 ",
40159 or "
40160 (code "GL_DOUBLE")
40161 "
40162 are accepted.
40163 The initial value is "
40164 (code "GL_FLOAT")
40165 ". "))
40166 (entry (% (heading (var "stride")))
40167 (para "
40168 Specifies the byte offset between consecutive colors.
40169 If "
40170 (var "stride")
40171 " is 0, the colors are understood to be
40172 tightly packed in the array. The initial value is 0. "))
40173 (entry (% (heading (var "pointer")))
40174 (para "
40175 Specifies a pointer to the first component of the first color element
40176 in the array. The initial value is 0. ")))
40177 (heading "Description")
40178 (para (code "glSecondaryColorPointer")
40179 " specifies the location and data format of an array of color components
40180 to use when rendering. "
40181 (var "size")
40182 " specifies the number of components per color, and must be 3. "
40183 (var "type")
40184 " specifies the data type of each color component, and "
40185 (var "stride")
40186 "
40187 specifies the byte stride from one color to the next, allowing vertices and
40188 attributes to be packed into a single array or stored in separate arrays. ")
40189 (para "
40190 If a non-zero named buffer object is bound to the "
40191 (code "GL_ARRAY_BUFFER")
40192 " target
40193 (see "
40194 (code "glBindBuffer")
40195 ") while a secondary color array is
40196 specified, "
40197 (var "pointer")
40198 " is treated as a byte offset into the buffer object's data store.
40199 Also, the buffer object binding ("
40200 (code "GL_ARRAY_BUFFER_BINDING")
40201 ") is saved as secondary color vertex array
40202 client-side state ("
40203 (code "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING")
40204 "). ")
40205 (para "
40206 When a secondary color array is specified, "
40207 (var "size")
40208 ", "
40209 (var "type")
40210 ", "
40211 (var "stride")
40212 ", and "
40213 (var "pointer")
40214 " are saved as client-side
40215 state, in addition to the current vertex array buffer object binding. ")
40216 (para "
40217 To enable and disable the secondary color array, call "
40218 (code "glEnableClientState")
40219 " and "
40220 (code "glDisableClientState")
40221 " with the argument "
40222 (code "GL_SECONDARY_COLOR_ARRAY")
40223 ". If enabled, the secondary color array is used when "
40224 (code "glArrayElement")
40225 ", "
40226 (code "glDrawArrays")
40227 ", "
40228 (code "glMultiDrawArrays")
40229 ", "
40230 (code "glDrawElements")
40231 ", "
40232 (code "glMultiDrawElements")
40233 ", or "
40234 (code "glDrawRangeElements")
40235 "
40236 is called. ")
40237 (heading "Errors")
40238 (para (code "GL_INVALID_VALUE")
40239 " is generated if "
40240 (var "size")
40241 " is not 3. ")
40242 (para (code "GL_INVALID_ENUM")
40243 " is generated if "
40244 (var "type")
40245 " is not an accepted value. ")
40246 (para (code "GL_INVALID_VALUE")
40247 " is generated if "
40248 (var "stride")
40249 " is negative. ")))
40250
40251 (define-gl-procedure
40252 glSecondaryColor
40253 "glSecondaryColor"
40254 (funcsynopsis
40255 (funcprototype
40256 (funcdef "void " (function "glSecondaryColor3b"))
40257 (paramdef "GLbyte " (parameter "red"))
40258 (paramdef "GLbyte " (parameter "green"))
40259 (paramdef "GLbyte " (parameter "blue"))))
40260 '(*fragment*
40261 (heading "set the current secondary color")
40262 (heading "Parameters")
40263 (table (% (formatter (asis)))
40264 (entry (% (heading (var "red")))
40265 (itemx (var "green"))
40266 (itemx (var "blue"))
40267 (para "
40268 Specify new red, green, and blue values for the current secondary color. ")))
40269 (heading "Description")
40270 (para "
40271 The GL stores both a primary four-valued RGBA color and a
40272 secondary four-valued RGBA color (where alpha is always set to 0.0) that is
40273 associated with every vertex. ")
40274 (para "
40275 The secondary color is interpolated and applied to each fragment during
40276 rasterization when "
40277 (code "GL_COLOR_SUM")
40278 " is enabled. When lighting is enabled,
40279 and "
40280 (code "GL_SEPARATE_SPECULAR_COLOR")
40281 " is specified, the value of the
40282 secondary color is assigned the value computed from the specular term of
40283 the lighting computation. Both the primary and secondary current colors are
40284 applied to each fragment, regardless of the state of "
40285 (code "GL_COLOR_SUM")
40286 ",
40287 under such conditions. When "
40288 (code "GL_SEPARATE_SPECULAR_COLOR")
40289 " is specified,
40290 the value returned from querying the current secondary color is undefined. ")
40291 (para (code "glSecondaryColor3b")
40292 ", "
40293 (code "glSecondaryColor3s")
40294 ", and "
40295 (code "glSecondaryColor3i")
40296 " take three signed byte, short, or long integers as
40297 arguments. When "
40298 (strong "v")
40299 " is appended to the name, the color commands can
40300 take a pointer to an array of such values. ")
40301 (para "
40302 Color values are stored in floating-point format, with
40303 unspecified mantissa and exponent sizes. Unsigned integer color
40304 components, when specified, are linearly mapped to floating-point values
40305 such that the largest representable value maps to 1.0 (full intensity), and
40306 0 maps to 0.0 (zero intensity). Signed integer color components, when
40307 specified, are linearly mapped to floating-point values such that the most
40308 positive representable value maps to 1.0, and the most negative
40309 representable value maps to "
40310 (math "-1.0")
40311 ".
40312 (Note that this mapping does not convert
40313 0 precisely to 0.0). Floating-point values are mapped directly. ")
40314 (para "
40315 Neither floating-point nor signed integer values are clamped to the range "
40316 (math "[" "0" "," "1" "]")
40317 "
40318 before the current color is updated. However, color components are
40319 clamped to this range before they are interpolated or written into a color
40320 buffer. ")))
40321
40322 (define-gl-procedure
40323 glSelectBuffer
40324 "glSelectBuffer"
40325 (funcsynopsis
40326 (funcprototype
40327 (funcdef "void " (function "glSelectBuffer"))
40328 (paramdef "GLsizei " (parameter "size"))
40329 (paramdef "GLuint * " (parameter "buffer"))))
40330 '(*fragment*
40331 (heading
40332 "establish a buffer for selection mode values")
40333 (heading "Parameters")
40334 (table (% (formatter (asis)))
40335 (entry (% (heading (var "size")))
40336 (para "
40337 Specifies the size of "
40338 (var "buffer")
40339 ". "))
40340 (entry (% (heading (var "buffer")))
40341 (para "
40342 Returns the selection data. ")))
40343 (heading "Description")
40344 (para (code "glSelectBuffer")
40345 " has two arguments: "
40346 (var "buffer")
40347 " is a pointer to an array of unsigned integers,
40348 and "
40349 (var "size")
40350 " indicates the size of the array. "
40351 (var "buffer")
40352 " returns values from the name stack
40353 (see "
40354 (code "glInitNames")
40355 ", "
40356 (code "glLoadName")
40357 ", "
40358 (code "glPushName")
40359 ")
40360 when the rendering mode is "
40361 (code "GL_SELECT")
40362 " (see "
40363 (code "glRenderMode")
40364 "). "
40365 (code "glSelectBuffer")
40366 " must be issued before selection mode is enabled,
40367 and it must not be issued while the rendering mode is "
40368 (code "GL_SELECT")
40369 ". ")
40370 (para "
40371 A programmer can use selection to determine which primitives
40372 are drawn into some region of a window.
40373 The region is defined by the current modelview and perspective matrices. ")
40374 (para "
40375 In selection mode, no pixel fragments are produced from rasterization.
40376 Instead,
40377 if a primitive or a raster position intersects the clipping
40378 volume defined by the viewing frustum
40379 and the user-defined clipping planes,
40380 this primitive causes a selection hit.
40381 (With polygons, no hit occurs if the polygon is culled.)
40382 When a change is made to the name stack,
40383 or when "
40384 (code "glRenderMode")
40385 " is called,
40386 a hit record is copied to "
40387 (var "buffer")
40388 " if any hits have occurred since the
40389 last such event
40390 (name stack change or "
40391 (code "glRenderMode")
40392 " call).
40393 The hit record consists of the number of names in the name stack at the
40394 time of the event, followed by the minimum and maximum depth values
40395 of all vertices that hit since the previous event,
40396 followed by the name stack contents,
40397 bottom name first. ")
40398 (para "
40399 Depth values (which are in the range [0,1]) are multiplied by "
40400 (math "2" "^" "32" "-" "1")
40401 ",
40402 before being placed in the hit record. ")
40403 (para "
40404 An internal index into "
40405 (var "buffer")
40406 " is reset to 0 whenever selection mode
40407 is entered.
40408 Each time a hit record is copied into "
40409 (var "buffer")
40410 ",
40411 the index is incremented to point to the cell just past the end
40412 of the block of names\\(emthat is, to the next available cell
40413 If the hit record is larger than the number of remaining locations in "
40414 (var "buffer")
40415 ",
40416 as much data as can fit is copied,
40417 and the overflow flag is set.
40418 If the name stack is empty when a hit record is copied,
40419 that record consists of 0 followed by the minimum and maximum depth values. ")
40420 (para "
40421 To exit selection mode, call "
40422 (code "glRenderMode")
40423 " with an argument
40424 other than "
40425 (code "GL_SELECT")
40426 ".
40427 Whenever "
40428 (code "glRenderMode")
40429 " is called while the render mode is "
40430 (code "GL_SELECT")
40431 ",
40432 it returns the number of hit records copied to "
40433 (var "buffer")
40434 ",
40435 resets the overflow flag and the selection buffer pointer,
40436 and initializes the name stack to be empty.
40437 If the overflow bit was set when "
40438 (code "glRenderMode")
40439 " was called,
40440 a negative hit record count is returned. ")
40441 (heading "Errors")
40442 (para (code "GL_INVALID_VALUE")
40443 " is generated if "
40444 (var "size")
40445 " is negative. ")
40446 (para (code "GL_INVALID_OPERATION")
40447 " is generated if "
40448 (code "glSelectBuffer")
40449 " is called while the
40450 render mode is "
40451 (code "GL_SELECT")
40452 ",
40453 or if "
40454 (code "glRenderMode")
40455 " is called with argument "
40456 (code "GL_SELECT")
40457 " before "
40458 (code "glSelectBuffer")
40459 " is called at least once. ")
40460 (para (code "GL_INVALID_OPERATION")
40461 " is generated if "
40462 (code "glSelectBuffer")
40463 "
40464 is executed between the execution of "
40465 (code "glBegin")
40466 "
40467 and the corresponding execution of "
40468 (code "glEnd")
40469 ". ")))
40470
40471 (define-gl-procedure
40472 glSeparableFilter2D
40473 "glSeparableFilter2D"
40474 (funcsynopsis
40475 (funcprototype
40476 (funcdef
40477 "void "
40478 (function "glSeparableFilter2D"))
40479 (paramdef "GLenum " (parameter "target"))
40480 (paramdef "GLenum " (parameter "internalformat"))
40481 (paramdef "GLsizei " (parameter "width"))
40482 (paramdef "GLsizei " (parameter "height"))
40483 (paramdef "GLenum " (parameter "format"))
40484 (paramdef "GLenum " (parameter "type"))
40485 (paramdef "const GLvoid * " (parameter "row"))
40486 (paramdef "const GLvoid * " (parameter "column"))))
40487 '(*fragment*
40488 (heading
40489 "define a separable two-dimensional convolution filter")
40490 (heading "Parameters")
40491 (table (% (formatter (asis)))
40492 (entry (% (heading (var "target")))
40493 (para "
40494 Must be " (code "GL_SEPARABLE_2D") ". "))
40495 (entry (% (heading (var "internalformat")))
40496 (para "
40497 The internal format of the convolution filter kernel.
40498 The allowable values are "
40499 (code "GL_ALPHA")
40500 ", "
40501 (code "GL_ALPHA4")
40502 ", "
40503 (code "GL_ALPHA8")
40504 ", "
40505 (code "GL_ALPHA12")
40506 ", "
40507 (code "GL_ALPHA16")
40508 ", "
40509 (code "GL_LUMINANCE")
40510 ", "
40511 (code "GL_LUMINANCE4")
40512 ", "
40513 (code "GL_LUMINANCE8")
40514 ", "
40515 (code "GL_LUMINANCE12")
40516 ", "
40517 (code "GL_LUMINANCE16")
40518 ", "
40519 (code "GL_LUMINANCE_ALPHA")
40520 ", "
40521 (code "GL_LUMINANCE4_ALPHA4")
40522 ", "
40523 (code "GL_LUMINANCE6_ALPHA2")
40524 ", "
40525 (code "GL_LUMINANCE8_ALPHA8")
40526 ", "
40527 (code "GL_LUMINANCE12_ALPHA4")
40528 ", "
40529 (code "GL_LUMINANCE12_ALPHA12")
40530 ", "
40531 (code "GL_LUMINANCE16_ALPHA16")
40532 ", "
40533 (code "GL_INTENSITY")
40534 ", "
40535 (code "GL_INTENSITY4")
40536 ", "
40537 (code "GL_INTENSITY8")
40538 ", "
40539 (code "GL_INTENSITY12")
40540 ", "
40541 (code "GL_INTENSITY16")
40542 ", "
40543 (code "GL_R3_G3_B2")
40544 ", "
40545 (code "GL_RGB")
40546 ", "
40547 (code "GL_RGB4")
40548 ", "
40549 (code "GL_RGB5")
40550 ", "
40551 (code "GL_RGB8")
40552 ", "
40553 (code "GL_RGB10")
40554 ", "
40555 (code "GL_RGB12")
40556 ", "
40557 (code "GL_RGB16")
40558 ", "
40559 (code "GL_RGBA")
40560 ", "
40561 (code "GL_RGBA2")
40562 ", "
40563 (code "GL_RGBA4")
40564 ", "
40565 (code "GL_RGB5_A1")
40566 ", "
40567 (code "GL_RGBA8")
40568 ", "
40569 (code "GL_RGB10_A2")
40570 ", "
40571 (code "GL_RGBA12")
40572 ", or "
40573 (code "GL_RGBA16")
40574 ". "))
40575 (entry (% (heading (var "width")))
40576 (para "
40577 The number of elements in the pixel array referenced by "
40578 (var "row")
40579 ".
40580 (This is the width of the separable filter kernel.) "))
40581 (entry (% (heading (var "height")))
40582 (para "
40583 The number of elements in the pixel array referenced by "
40584 (var "column")
40585 ".
40586 (This is the height of the separable filter kernel.) "))
40587 (entry (% (heading (var "format")))
40588 (para "
40589 The format of the pixel data in "
40590 (var "row")
40591 " and "
40592 (var "column")
40593 ".
40594 The allowable values are "
40595 (code "GL_RED")
40596 ", "
40597 (code "GL_GREEN")
40598 ", "
40599 (code "GL_BLUE")
40600 ", "
40601 (code "GL_ALPHA")
40602 ", "
40603 (code "GL_RGB")
40604 ", "
40605 (code "GL_BGR")
40606 ", "
40607 (code "GL_RGBA")
40608 ", "
40609 (code "GL_BGRA")
40610 ", "
40611 (code "GL_INTENSITY")
40612 ", "
40613 (code "GL_LUMINANCE")
40614 ", and "
40615 (code "GL_LUMINANCE_ALPHA")
40616 ". "))
40617 (entry (% (heading (var "type")))
40618 (para "
40619 The type of the pixel data in "
40620 (var "row")
40621 " and "
40622 (var "column")
40623 ".
40624 Symbolic constants "
40625 (code "GL_UNSIGNED_BYTE")
40626 ", "
40627 (code "GL_BYTE")
40628 ", "
40629 (code "GL_BITMAP")
40630 ", "
40631 (code "GL_UNSIGNED_SHORT")
40632 ", "
40633 (code "GL_SHORT")
40634 ", "
40635 (code "GL_UNSIGNED_INT")
40636 ", "
40637 (code "GL_INT")
40638 ", "
40639 (code "GL_FLOAT")
40640 ", "
40641 (code "GL_UNSIGNED_BYTE_3_3_2")
40642 ", "
40643 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
40644 ", "
40645 (code "GL_UNSIGNED_SHORT_5_6_5")
40646 ", "
40647 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
40648 ", "
40649 (code "GL_UNSIGNED_SHORT_4_4_4_4")
40650 ", "
40651 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
40652 ", "
40653 (code "GL_UNSIGNED_SHORT_5_5_5_1")
40654 ", "
40655 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
40656 ", "
40657 (code "GL_UNSIGNED_INT_8_8_8_8")
40658 ", "
40659 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
40660 ", "
40661 (code "GL_UNSIGNED_INT_10_10_10_2")
40662 ", and "
40663 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
40664 "
40665 are accepted. "))
40666 (entry (% (heading (var "row")))
40667 (para "
40668 Pointer to a one-dimensional array of pixel data that is processed to
40669 build the row filter kernel. "))
40670 (entry (% (heading (var "column")))
40671 (para "
40672 Pointer to a one-dimensional array of pixel data that is processed to
40673 build the column filter kernel. ")))
40674 (heading "Description")
40675 (para (code "glSeparableFilter2D")
40676 " builds a two-dimensional separable convolution filter kernel from
40677 two arrays of pixels. ")
40678 (para "
40679 The pixel arrays specified by ("
40680 (var "width")
40681 ", "
40682 (var "format")
40683 ", "
40684 (var "type")
40685 ", "
40686 (var "row")
40687 ")
40688 and ("
40689 (var "height")
40690 ", "
40691 (var "format")
40692 ", "
40693 (var "type")
40694 ", "
40695 (var "column")
40696 ") are processed just as if
40697 they had been passed to "
40698 (code "glDrawPixels")
40699 ",
40700 but processing stops after the final expansion to RGBA is completed. ")
40701 (para "
40702 If a non-zero named buffer object is bound to the "
40703 (code "GL_PIXEL_UNPACK_BUFFER")
40704 " target
40705 (see "
40706 (code "glBindBuffer")
40707 ") while a convolution filter is
40708 specified, "
40709 (var "row")
40710 " and "
40711 (var "column")
40712 " are treated as byte offsets into the buffer object's data store. ")
40713 (para "
40714 Next, the R, G, B, and A components of all pixels in both arrays are scaled
40715 by the four separable 2D "
40716 (code "GL_CONVOLUTION_FILTER_SCALE")
40717 " parameters and
40718 biased by the four separable 2D "
40719 (code "GL_CONVOLUTION_FILTER_BIAS")
40720 " parameters.
40721 (The scale and bias parameters are set by "
40722 (code "glConvolutionParameter")
40723 "
40724 using the "
40725 (code "GL_SEPARABLE_2D")
40726 " target and the names "
40727 (code "GL_CONVOLUTION_FILTER_SCALE")
40728 " and "
40729 (code "GL_CONVOLUTION_FILTER_BIAS")
40730 ".
40731 The parameters themselves are vectors of four values that are applied to red,
40732 green, blue, and alpha, in that order.)
40733 The R, G, B, and A values are not clamped to [0,1] at any time during this
40734 process. ")
40735 (para "
40736 Each pixel is then converted to the internal format specified by "
40737 (var "internalformat")
40738 ".
40739 This conversion simply maps the component values of the pixel (R, G, B,
40740 and A) to the values included in the internal format (red, green, blue,
40741 alpha, luminance, and intensity). The mapping is as follows: ")
40742 (table (% (formatter (asis)))
40743 (entry (% (heading (strong "Internal Format")))
40744 (para (strong "Red")
40745 ", "
40746 (strong "Green")
40747 ", "
40748 (strong "Blue")
40749 ", "
40750 (strong "Alpha")
40751 ", "
40752 (strong "Luminance")
40753 ", "
40754 (strong "Intensity")))
40755 (entry (% (heading (code "GL_LUMINANCE")))
40756 (para ", " ", " ", " ", " "
40757 R " ", "))
40758 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
40759 (para ", " ", " ", " "
40760 A " ", " "
40761 R " ", "))
40762 (entry (% (heading (code "GL_INTENSITY")))
40763 (para ", " ", " ", " ", " ", " "
40764 R "))
40765 (entry (% (heading (code "GL_RGB")))
40766 (para "
40767 R " ", " "
40768 G " ", " "
40769 B " ", " ", " ", "))
40770 (entry (% (heading (code "GL_RGBA")))
40771 (para "
40772 R "
40773 ", "
40774 "
40775 G "
40776 ", "
40777 "
40778 B "
40779 ", "
40780 "
40781 A "
40782 ", "
40783 ", ")))
40784 (para "
40785 The red, green, blue, alpha, luminance, and/or intensity components of
40786 the resulting pixels are stored in floating-point rather than integer
40787 format.
40788 They form two one-dimensional filter kernel images.
40789 The row image is indexed by coordinate "
40790 (var "i")
40791 " starting at zero and
40792 increasing from left to right.
40793 Each location in the row image is derived from element "
40794 (var "i")
40795 " of "
40796 (var "row")
40797 ".
40798 The column image is indexed by coordinate "
40799 (var "j")
40800 " starting at zero
40801 and increasing from bottom to top.
40802 Each location in the column image is derived from element "
40803 (var "j")
40804 " of "
40805 (var "column")
40806 ". ")
40807 (para "
40808 Note that after a convolution is performed, the resulting color
40809 components are also scaled by their corresponding "
40810 (code "GL_POST_CONVOLUTION_c_SCALE")
40811 " parameters and biased by their
40812 corresponding "
40813 (code "GL_POST_CONVOLUTION_c_BIAS")
40814 " parameters (where "
40815 (var "c")
40816 " takes on the values "
40817 (strong "RED")
40818 ", "
40819 (strong "GREEN")
40820 ", "
40821 (strong "BLUE")
40822 ", and "
40823 (strong "ALPHA")
40824 ").
40825 These parameters are set by "
40826 (code "glPixelTransfer")
40827 ". ")
40828 (heading "Errors")
40829 (para (code "GL_INVALID_ENUM")
40830 " is generated if "
40831 (var "target")
40832 " is not "
40833 (code "GL_SEPARABLE_2D")
40834 ". ")
40835 (para (code "GL_INVALID_ENUM")
40836 " is generated if "
40837 (var "internalformat")
40838 " is not one of the
40839 allowable values. ")
40840 (para (code "GL_INVALID_ENUM")
40841 " is generated if "
40842 (var "format")
40843 " is not one of the allowable
40844 values. ")
40845 (para (code "GL_INVALID_ENUM")
40846 " is generated if "
40847 (var "type")
40848 " is not one of the allowable
40849 values. ")
40850 (para (code "GL_INVALID_VALUE")
40851 " is generated if "
40852 (var "width")
40853 " is less than zero or greater
40854 than the maximum supported value.
40855 This value may be queried with "
40856 (code "glGetConvolutionParameter")
40857 "
40858 using target "
40859 (code "GL_SEPARABLE_2D")
40860 " and name "
40861 (code "GL_MAX_CONVOLUTION_WIDTH")
40862 ". ")
40863 (para (code "GL_INVALID_VALUE")
40864 " is generated if "
40865 (var "height")
40866 " is less than zero or greater
40867 than the maximum supported value.
40868 This value may be queried with "
40869 (code "glGetConvolutionParameter")
40870 "
40871 using target "
40872 (code "GL_SEPARABLE_2D")
40873 " and name "
40874 (code "GL_MAX_CONVOLUTION_HEIGHT")
40875 ". ")
40876 (para (code "GL_INVALID_OPERATION")
40877 " is generated if "
40878 (var "height")
40879 " is one of "
40880 (code "GL_UNSIGNED_BYTE_3_3_2")
40881 ", "
40882 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
40883 ", "
40884 (code "GL_UNSIGNED_SHORT_5_6_5")
40885 ", or "
40886 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
40887 "
40888 and "
40889 (var "format")
40890 " is not "
40891 (code "GL_RGB")
40892 ". ")
40893 (para (code "GL_INVALID_OPERATION")
40894 " is generated if "
40895 (var "height")
40896 " is one of "
40897 (code "GL_UNSIGNED_SHORT_4_4_4_4")
40898 ", "
40899 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
40900 ", "
40901 (code "GL_UNSIGNED_SHORT_5_5_5_1")
40902 ", "
40903 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
40904 ", "
40905 (code "GL_UNSIGNED_INT_8_8_8_8")
40906 ", "
40907 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
40908 ", "
40909 (code "GL_UNSIGNED_INT_10_10_10_2")
40910 ", or "
40911 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
40912 "
40913 and "
40914 (var "format")
40915 " is neither "
40916 (code "GL_RGBA")
40917 " nor "
40918 (code "GL_BGRA")
40919 ". ")
40920 (para (code "GL_INVALID_OPERATION")
40921 " is generated if a non-zero buffer object name is bound to the "
40922 (code "GL_PIXEL_UNPACK_BUFFER")
40923 " target and the buffer object's data store is currently mapped. ")
40924 (para (code "GL_INVALID_OPERATION")
40925 " is generated if a non-zero buffer object name is bound to the "
40926 (code "GL_PIXEL_UNPACK_BUFFER")
40927 " target and the data would be unpacked from the buffer
40928 object such that the memory reads required would exceed the data store size. ")
40929 (para (code "GL_INVALID_OPERATION")
40930 " is generated if a non-zero buffer object name is bound to the "
40931 (code "GL_PIXEL_UNPACK_BUFFER")
40932 " target and "
40933 (var "row")
40934 " or "
40935 (var "column")
40936 " is not evenly divisible
40937 into the number of bytes needed to store in memory a datum indicated by "
40938 (var "type")
40939 ". ")
40940 (para (code "GL_INVALID_OPERATION")
40941 " is generated if "
40942 (code "glSeparableFilter2D")
40943 " is executed
40944 between the execution of "
40945 (code "glBegin")
40946 " and the corresponding
40947 execution of "
40948 (code "glEnd")
40949 ". ")))
40950
40951 (define-gl-procedure
40952 glShadeModel
40953 "glShadeModel"
40954 (funcsynopsis
40955 (funcprototype
40956 (funcdef "void " (function "glShadeModel"))
40957 (paramdef "GLenum " (parameter "mode"))))
40958 '(*fragment*
40959 (heading "select flat or smooth shading")
40960 (heading "Parameters")
40961 (table (% (formatter (asis)))
40962 (entry (% (heading (var "mode")))
40963 (para "
40964 Specifies a symbolic value representing a shading technique.
40965 Accepted values are "
40966 (code "GL_FLAT")
40967 " and "
40968 (code "GL_SMOOTH")
40969 ".
40970 The initial value is "
40971 (code "GL_SMOOTH")
40972 ". ")))
40973 (heading "Description")
40974 (para "
40975 GL primitives can have either flat or smooth shading.
40976 Smooth shading,
40977 the default,
40978 causes the computed colors of vertices to be interpolated as the
40979 primitive is rasterized,
40980 typically assigning different colors to each resulting pixel fragment.
40981 Flat shading selects the computed color of just one vertex
40982 and assigns it to all the pixel fragments
40983 generated by rasterizing a single primitive.
40984 In either case, the computed color of a vertex is the result of
40985 lighting if lighting is enabled,
40986 or it is the current color at the time the vertex was specified if
40987 lighting is disabled. ")
40988 (para "
40989 Flat and smooth shading are indistinguishable for points.
40990 Starting when "
40991 (code "glBegin")
40992 " is issued and counting vertices and
40993 primitives from 1, the GL gives each flat-shaded line segment "
40994 (math (var "i"))
40995 "
40996 the
40997 computed color of vertex "
40998 (math (var "i") "+" "1")
40999 ",
41000 its second vertex.
41001 Counting similarly from 1,
41002 the GL gives each flat-shaded polygon the computed color of the vertex listed
41003 in the following table.
41004 This is the last vertex to specify the polygon in all cases except single
41005 polygons,
41006 where the first vertex specifies the flat-shaded color. ")
41007 (para)
41008 (table (% (formatter (asis)))
41009 (entry (% (heading
41010 (strong
41011 "
41012 Primitive Type of Polygon "
41013 (math (var "i")))))
41014 (para (strong "Vertex")))
41015 (entry (% (heading
41016 "
41017 Single polygon
41018 ("
41019 (math (var "i") "==" "1")
41020 ") "))
41021 (para "
41022 1 "))
41023 (entry (% (heading "
41024 Triangle strip "))
41025 (para (math (var "i") "+" "2")))
41026 (entry (% (heading "
41027 Triangle fan "))
41028 (para (math (var "i") "+" "2")))
41029 (entry (% (heading "
41030 Independent triangle "))
41031 (para (math "3" "\u2062" (var "i"))))
41032 (entry (% (heading "
41033 Quad strip "))
41034 (para (math "2" "\u2062" (var "i") "+" "2")))
41035 (entry (% (heading "
41036 Independent quad "))
41037 (para (math "4" "\u2062" (var "i")))))
41038 (para "
41039 Flat and smooth shading are specified by "
41040 (code "glShadeModel")
41041 " with "
41042 (var "mode")
41043 " set to "
41044 (code "GL_FLAT")
41045 " and "
41046 (code "GL_SMOOTH")
41047 ", respectively. ")
41048 (heading "Errors")
41049 (para (code "GL_INVALID_ENUM")
41050 " is generated if "
41051 (var "mode")
41052 " is any value other than "
41053 (code "GL_FLAT")
41054 " or "
41055 (code "GL_SMOOTH")
41056 ". ")
41057 (para (code "GL_INVALID_OPERATION")
41058 " is generated if "
41059 (code "glShadeModel")
41060 "
41061 is executed between the execution of "
41062 (code "glBegin")
41063 "
41064 and the corresponding execution of "
41065 (code "glEnd")
41066 ". ")))
41067
41068 (define-gl-procedure
41069 glShaderSource
41070 "glShaderSource"
41071 (funcsynopsis
41072 (funcprototype
41073 (funcdef "void " (function "glShaderSource"))
41074 (paramdef "GLuint " (parameter "shader"))
41075 (paramdef "GLsizei " (parameter "count"))
41076 (paramdef "const GLchar **" (parameter "string"))
41077 (paramdef "const GLint *" (parameter "length"))))
41078 '(*fragment*
41079 (heading
41080 "Replaces the source code in a shader object")
41081 (heading "Parameters")
41082 (table (% (formatter (asis)))
41083 (entry (% (heading (var "shader")))
41084 (para "Specifies the handle of the shader object
41085 \t\t whose source code is to be replaced."))
41086 (entry (% (heading (var "count")))
41087 (para "Specifies the number of elements in the "
41088 (var "string")
41089 " and "
41090 (var "length")
41091 "
41092 arrays."))
41093 (entry (% (heading (var "string")))
41094 (para "Specifies an array of pointers to strings
41095 \t\t containing the source code to be loaded into the
41096 \t\t shader."))
41097 (entry (% (heading (var "length")))
41098 (para "Specifies an array of string lengths.")))
41099 (heading "Description")
41100 (para (code "glShaderSource")
41101 " sets the source code
41102 \tin "
41103 (var "shader")
41104 " to the source code in the array
41105 \tof strings specified by "
41106 (var "string")
41107 ". Any
41108 \tsource code previously stored in the shader object is completely
41109 \treplaced. The number of strings in the array is specified by\t"
41110 (var "count")
41111 ". If "
41112 (var "length")
41113 "
41114 is "
41115 (code "NULL")
41116 ", each string is assumed to be null
41117 \tterminated. If "
41118 (var "length")
41119 " is a value other
41120 \tthan "
41121 (code "NULL")
41122 ", it points to an array containing
41123 \ta string length for each of the corresponding elements of\t"
41124 (var "string")
41125 ". Each element in the\t"
41126 (var "length")
41127 " array may contain the length of
41128 \tthe corresponding string (the null character is not counted as
41129 \tpart of the string length) or a value less than 0 to indicate
41130 \tthat the string is null terminated. The source code strings are
41131 \tnot scanned or parsed at this time; they are simply copied into
41132 \tthe specified shader object.")
41133 (heading "Errors")
41134 (para (code "GL_INVALID_VALUE")
41135 " is generated if\t"
41136 (var "shader")
41137 " is not a value generated by
41138 \tOpenGL.")
41139 (para (code "GL_INVALID_OPERATION")
41140 " is generated if\t"
41141 (var "shader")
41142 " is not a shader object.")
41143 (para (code "GL_INVALID_VALUE")
41144 " is generated if\t"
41145 (var "count")
41146 " is less than 0.")
41147 (para (code "GL_INVALID_OPERATION")
41148 " is generated if\t"
41149 (code "glShaderSource")
41150 " is executed between the
41151 \texecution of\t"
41152 (code "glBegin")
41153 "
41154 and the corresponding execution of\t"
41155 (code "glEnd")
41156 ".")))
41157
41158 (define-gl-procedure
41159 glStencilFuncSeparate
41160 "glStencilFuncSeparate"
41161 (funcsynopsis
41162 (funcprototype
41163 (funcdef
41164 "void "
41165 (function "glStencilFuncSeparate"))
41166 (paramdef "GLenum " (parameter "face"))
41167 (paramdef "GLenum " (parameter "func"))
41168 (paramdef "GLint " (parameter "ref"))
41169 (paramdef "GLuint " (parameter "mask"))))
41170 '(*fragment*
41171 (heading
41172 "set front and/or back function and reference value for stencil testing")
41173 (heading "Parameters")
41174 (table (% (formatter (asis)))
41175 (entry (% (heading (var "face")))
41176 (para "
41177 Specifies whether front and/or back stencil state is updated.
41178 Three symbolic constants are valid: "
41179 (code "GL_FRONT")
41180 ", "
41181 (code "GL_BACK")
41182 ", and "
41183 (code "GL_FRONT_AND_BACK")
41184 ". "))
41185 (entry (% (heading (var "func")))
41186 (para "
41187 Specifies the test function.
41188 Eight symbolic constants are valid: "
41189 (code "GL_NEVER")
41190 ", "
41191 (code "GL_LESS")
41192 ", "
41193 (code "GL_LEQUAL")
41194 ", "
41195 (code "GL_GREATER")
41196 ", "
41197 (code "GL_GEQUAL")
41198 ", "
41199 (code "GL_EQUAL")
41200 ", "
41201 (code "GL_NOTEQUAL")
41202 ", and "
41203 (code "GL_ALWAYS")
41204 ". The initial value is "
41205 (code "GL_ALWAYS")
41206 ". "))
41207 (entry (% (heading (var "ref")))
41208 (para "
41209 Specifies the reference value for the stencil test. "
41210 (var "ref")
41211 " is clamped to the range "
41212 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41213 ",
41214 where "
41215 (math (var "n"))
41216 "
41217 is the number of bitplanes in the stencil buffer. The
41218 initial value is 0. "))
41219 (entry (% (heading (var "mask")))
41220 (para "
41221 Specifies a mask that is ANDed with both the reference value
41222 and the stored stencil value when the test is done. The initial value
41223 is all 1's. ")))
41224 (heading "Description")
41225 (para "
41226 Stenciling,
41227 like depth-buffering,
41228 enables and disables drawing on a per-pixel basis.
41229 You draw into the stencil planes using GL drawing primitives,
41230 then render geometry and images,
41231 using the stencil planes to mask out portions of the screen.
41232 Stenciling is typically used in multipass rendering algorithms
41233 to achieve special effects,
41234 such as decals,
41235 outlining,
41236 and constructive solid geometry rendering. ")
41237 (para "
41238 The stencil test conditionally eliminates a pixel based on the outcome
41239 of a comparison between the reference value
41240 and the value in the stencil buffer.
41241 To enable and disable the test, call "
41242 (code "glEnable")
41243 " and "
41244 (code "glDisable")
41245 "
41246 with argument "
41247 (code "GL_STENCIL_TEST")
41248 ".
41249 To specify actions based on the outcome of the stencil test, call "
41250 (code "glStencilOp")
41251 " or "
41252 (code "glStencilOpSeparate")
41253 ". ")
41254 (para "
41255 There can be two separate sets of "
41256 (var "func")
41257 ", "
41258 (var "ref")
41259 ", and "
41260 (var "mask")
41261 " parameters; one affects back-facing polygons, and the other
41262 affects front-facing polygons as well as other non-polygon primitives. "
41263 (code "glStencilFunc")
41264 " sets both front
41265 and back stencil state to the same values, as if "
41266 (code "glStencilFuncSeparate")
41267 " were called
41268 with "
41269 (var "face")
41270 " set to "
41271 (code "GL_FRONT_AND_BACK")
41272 ". ")
41273 (para (var "func")
41274 " is a symbolic constant that determines the stencil comparison function.
41275 It accepts one of eight values,
41276 shown in the following list. "
41277 (var "ref")
41278 " is an integer reference value that is used in the stencil comparison.
41279 It is clamped to the range "
41280 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41281 ",
41282 where "
41283 (math (var "n"))
41284 "
41285 is the number of bitplanes in the stencil buffer. "
41286 (var "mask")
41287 " is bitwise ANDed with both the reference value
41288 and the stored stencil value,
41289 with the ANDed values participating in the comparison. ")
41290 (para "
41291 If "
41292 (var "stencil")
41293 " represents the value stored in the corresponding
41294 stencil buffer location,
41295 the following list shows the effect of each comparison function
41296 that can be specified by "
41297 (var "func")
41298 ".
41299 Only if the comparison succeeds is the pixel passed through
41300 to the next stage in the rasterization process
41301 (see "
41302 (code "glStencilOp")
41303 ").
41304 All tests treat "
41305 (var "stencil")
41306 " values as unsigned integers in the range "
41307 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41308 ",
41309 where "
41310 (math (var "n"))
41311 "
41312 is the number of bitplanes in the stencil buffer. ")
41313 (para "
41314 The following values are accepted by "
41315 (var "func")
41316 ": ")
41317 (table (% (formatter (asis)))
41318 (entry (% (heading (code "GL_NEVER")))
41319 (para "
41320 Always fails. "))
41321 (entry (% (heading (code "GL_LESS")))
41322 (para "
41323 Passes if ( "
41324 (var "ref")
41325 " & "
41326 (var "mask")
41327 " ) < ( "
41328 (var "stencil")
41329 " & "
41330 (var "mask")
41331 " ). "))
41332 (entry (% (heading (code "GL_LEQUAL")))
41333 (para "
41334 Passes if ( "
41335 (var "ref")
41336 " & "
41337 (var "mask")
41338 " ) <= ( "
41339 (var "stencil")
41340 " & "
41341 (var "mask")
41342 " ). "))
41343 (entry (% (heading (code "GL_GREATER")))
41344 (para "
41345 Passes if ( "
41346 (var "ref")
41347 " & "
41348 (var "mask")
41349 " ) > ( "
41350 (var "stencil")
41351 " & "
41352 (var "mask")
41353 " ). "))
41354 (entry (% (heading (code "GL_GEQUAL")))
41355 (para "
41356 Passes if ( "
41357 (var "ref")
41358 " & "
41359 (var "mask")
41360 " ) >= ( "
41361 (var "stencil")
41362 " & "
41363 (var "mask")
41364 " ). "))
41365 (entry (% (heading (code "GL_EQUAL")))
41366 (para "
41367 Passes if ( "
41368 (var "ref")
41369 " & "
41370 (var "mask")
41371 " ) = ( "
41372 (var "stencil")
41373 " & "
41374 (var "mask")
41375 " ). "))
41376 (entry (% (heading (code "GL_NOTEQUAL")))
41377 (para "
41378 Passes if ( "
41379 (var "ref")
41380 " & "
41381 (var "mask")
41382 " ) != ( "
41383 (var "stencil")
41384 " & "
41385 (var "mask")
41386 " ). "))
41387 (entry (% (heading (code "GL_ALWAYS")))
41388 (para "
41389 Always passes. ")))
41390 (heading "Errors")
41391 (para (code "GL_INVALID_ENUM")
41392 " is generated if "
41393 (var "func")
41394 " is not one of the eight
41395 accepted values. ")
41396 (para (code "GL_INVALID_OPERATION")
41397 " is generated if "
41398 (code "glStencilFuncSeparate")
41399 "
41400 is executed between the execution of "
41401 (code "glBegin")
41402 "
41403 and the corresponding execution of "
41404 (code "glEnd")
41405 ". ")))
41406
41407 (define-gl-procedure
41408 glStencilFunc
41409 "glStencilFunc"
41410 (funcsynopsis
41411 (funcprototype
41412 (funcdef "void " (function "glStencilFunc"))
41413 (paramdef "GLenum " (parameter "func"))
41414 (paramdef "GLint " (parameter "ref"))
41415 (paramdef "GLuint " (parameter "mask"))))
41416 '(*fragment*
41417 (heading
41418 "set front and back function and reference value for stencil testing")
41419 (heading "Parameters")
41420 (table (% (formatter (asis)))
41421 (entry (% (heading (var "func")))
41422 (para "
41423 Specifies the test function.
41424 Eight symbolic constants are valid: "
41425 (code "GL_NEVER")
41426 ", "
41427 (code "GL_LESS")
41428 ", "
41429 (code "GL_LEQUAL")
41430 ", "
41431 (code "GL_GREATER")
41432 ", "
41433 (code "GL_GEQUAL")
41434 ", "
41435 (code "GL_EQUAL")
41436 ", "
41437 (code "GL_NOTEQUAL")
41438 ", and "
41439 (code "GL_ALWAYS")
41440 ". The initial value is "
41441 (code "GL_ALWAYS")
41442 ". "))
41443 (entry (% (heading (var "ref")))
41444 (para "
41445 Specifies the reference value for the stencil test. "
41446 (var "ref")
41447 " is clamped to the range "
41448 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41449 ",
41450 where "
41451 (math (var "n"))
41452 "
41453 is the number of bitplanes in the stencil buffer. The
41454 initial value is 0. "))
41455 (entry (% (heading (var "mask")))
41456 (para "
41457 Specifies a mask that is ANDed with both the reference value
41458 and the stored stencil value when the test is done. The initial value
41459 is all 1's. ")))
41460 (heading "Description")
41461 (para "
41462 Stenciling,
41463 like depth-buffering,
41464 enables and disables drawing on a per-pixel basis.
41465 Stencil planes are first drawn into using GL drawing primitives, then
41466 geometry and images are rendered using the stencil planes to mask out
41467 portions of the screen.
41468 Stenciling is typically used in multipass rendering algorithms
41469 to achieve special effects,
41470 such as decals,
41471 outlining,
41472 and constructive solid geometry rendering. ")
41473 (para "
41474 The stencil test conditionally eliminates a pixel based on the outcome
41475 of a comparison between the reference value
41476 and the value in the stencil buffer.
41477 To enable and disable the test, call "
41478 (code "glEnable")
41479 " and "
41480 (code "glDisable")
41481 "
41482 with argument "
41483 (code "GL_STENCIL_TEST")
41484 ".
41485 To specify actions based on the outcome of the stencil test, call "
41486 (code "glStencilOp")
41487 " or "
41488 (code "glStencilOpSeparate")
41489 ". ")
41490 (para "
41491 There can be two separate sets of "
41492 (var "func")
41493 ", "
41494 (var "ref")
41495 ", and "
41496 (var "mask")
41497 " parameters; one affects back-facing polygons, and the other
41498 affects front-facing polygons as well as other non-polygon primitives. "
41499 (code "glStencilFunc")
41500 " sets both front
41501 and back stencil state to the same values. Use "
41502 (code "glStencilFuncSeparate")
41503 "
41504 to set front and back stencil state to different values. ")
41505 (para (var "func")
41506 " is a symbolic constant that determines the stencil comparison function.
41507 It accepts one of eight values,
41508 shown in the following list. "
41509 (var "ref")
41510 " is an integer reference value that is used in the stencil comparison.
41511 It is clamped to the range "
41512 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41513 ",
41514 where "
41515 (math (var "n"))
41516 "
41517 is the number of bitplanes in the stencil buffer. "
41518 (var "mask")
41519 " is bitwise ANDed with both the reference value
41520 and the stored stencil value,
41521 with the ANDed values participating in the comparison. ")
41522 (para "
41523 If "
41524 (var "stencil")
41525 " represents the value stored in the corresponding
41526 stencil buffer location,
41527 the following list shows the effect of each comparison function
41528 that can be specified by "
41529 (var "func")
41530 ".
41531 Only if the comparison succeeds is the pixel passed through
41532 to the next stage in the rasterization process
41533 (see "
41534 (code "glStencilOp")
41535 ").
41536 All tests treat "
41537 (var "stencil")
41538 " values as unsigned integers in the range "
41539 (math "[" "0" "," "2" "^" (var "n") "-" "1" "]")
41540 ",
41541 where "
41542 (math (var "n"))
41543 "
41544 is the number of bitplanes in the stencil buffer. ")
41545 (para "
41546 The following values are accepted by "
41547 (var "func")
41548 ": ")
41549 (table (% (formatter (asis)))
41550 (entry (% (heading (code "GL_NEVER")))
41551 (para "
41552 Always fails. "))
41553 (entry (% (heading (code "GL_LESS")))
41554 (para "
41555 Passes if ( "
41556 (var "ref")
41557 " & "
41558 (var "mask")
41559 " ) < ( "
41560 (var "stencil")
41561 " & "
41562 (var "mask")
41563 " ). "))
41564 (entry (% (heading (code "GL_LEQUAL")))
41565 (para "
41566 Passes if ( "
41567 (var "ref")
41568 " & "
41569 (var "mask")
41570 " ) <= ( "
41571 (var "stencil")
41572 " & "
41573 (var "mask")
41574 " ). "))
41575 (entry (% (heading (code "GL_GREATER")))
41576 (para "
41577 Passes if ( "
41578 (var "ref")
41579 " & "
41580 (var "mask")
41581 " ) > ( "
41582 (var "stencil")
41583 " & "
41584 (var "mask")
41585 " ). "))
41586 (entry (% (heading (code "GL_GEQUAL")))
41587 (para "
41588 Passes if ( "
41589 (var "ref")
41590 " & "
41591 (var "mask")
41592 " ) >= ( "
41593 (var "stencil")
41594 " & "
41595 (var "mask")
41596 " ). "))
41597 (entry (% (heading (code "GL_EQUAL")))
41598 (para "
41599 Passes if ( "
41600 (var "ref")
41601 " & "
41602 (var "mask")
41603 " ) = ( "
41604 (var "stencil")
41605 " & "
41606 (var "mask")
41607 " ). "))
41608 (entry (% (heading (code "GL_NOTEQUAL")))
41609 (para "
41610 Passes if ( "
41611 (var "ref")
41612 " & "
41613 (var "mask")
41614 " ) != ( "
41615 (var "stencil")
41616 " & "
41617 (var "mask")
41618 " ). "))
41619 (entry (% (heading (code "GL_ALWAYS")))
41620 (para "
41621 Always passes. ")))
41622 (heading "Errors")
41623 (para (code "GL_INVALID_ENUM")
41624 " is generated if "
41625 (var "func")
41626 " is not one of the eight
41627 accepted values. ")
41628 (para (code "GL_INVALID_OPERATION")
41629 " is generated if "
41630 (code "glStencilFunc")
41631 "
41632 is executed between the execution of "
41633 (code "glBegin")
41634 "
41635 and the corresponding execution of "
41636 (code "glEnd")
41637 ". ")))
41638
41639 (define-gl-procedure
41640 glStencilMaskSeparate
41641 "glStencilMaskSeparate"
41642 (funcsynopsis
41643 (funcprototype
41644 (funcdef
41645 "void "
41646 (function "glStencilMaskSeparate"))
41647 (paramdef "GLenum " (parameter "face"))
41648 (paramdef "GLuint " (parameter "mask"))))
41649 '(*fragment*
41650 (heading
41651 "control the front and/or back writing of individual bits in the stencil planes")
41652 (heading "Parameters")
41653 (table (% (formatter (asis)))
41654 (entry (% (heading (var "face")))
41655 (para "
41656 Specifies whether the front and/or back stencil writemask is updated.
41657 Three symbolic constants are valid: "
41658 (code "GL_FRONT")
41659 ", "
41660 (code "GL_BACK")
41661 ", and "
41662 (code "GL_FRONT_AND_BACK")
41663 ". "))
41664 (entry (% (heading (var "mask")))
41665 (para "
41666 Specifies a bit mask to enable and disable writing of individual bits
41667 in the stencil planes.
41668 Initially, the mask is all 1's. ")))
41669 (heading "Description")
41670 (para (code "glStencilMaskSeparate")
41671 " controls the writing of individual bits in the stencil planes.
41672 The least significant "
41673 (math (var "n"))
41674 "
41675 bits of "
41676 (var "mask")
41677 ",
41678 where "
41679 (math (var "n"))
41680 "
41681 is the number of bits in the stencil buffer,
41682 specify a mask.
41683 Where a 1 appears in the mask,
41684 it's possible to write to the corresponding bit in the stencil buffer.
41685 Where a 0 appears,
41686 the corresponding bit is write-protected.
41687 Initially, all bits are enabled for writing. ")
41688 (para "
41689 There can be two separate "
41690 (var "mask")
41691 " writemasks; one affects back-facing polygons, and the other
41692 affects front-facing polygons as well as other non-polygon primitives. "
41693 (code "glStencilMask")
41694 " sets both front
41695 and back stencil writemasks to the same values, as if "
41696 (code "glStencilMaskSeparate")
41697 " were called
41698 with "
41699 (var "face")
41700 " set to "
41701 (code "GL_FRONT_AND_BACK")
41702 ". ")
41703 (heading "Errors")
41704 (para (code "GL_INVALID_OPERATION")
41705 " is generated if "
41706 (code "glStencilMaskSeparate")
41707 "
41708 is executed between the execution of "
41709 (code "glBegin")
41710 "
41711 and the corresponding execution of "
41712 (code "glEnd")
41713 ". ")))
41714
41715 (define-gl-procedure
41716 glStencilMask
41717 "glStencilMask"
41718 (funcsynopsis
41719 (funcprototype
41720 (funcdef "void " (function "glStencilMask"))
41721 (paramdef "GLuint " (parameter "mask"))))
41722 '(*fragment*
41723 (heading
41724 "control the front and back writing of individual bits in the stencil planes")
41725 (heading "Parameters")
41726 (table (% (formatter (asis)))
41727 (entry (% (heading (var "mask")))
41728 (para "
41729 Specifies a bit mask to enable and disable writing of individual bits
41730 in the stencil planes.
41731 Initially, the mask is all 1's. ")))
41732 (heading "Description")
41733 (para (code "glStencilMask")
41734 " controls the writing of individual bits in the stencil planes.
41735 The least significant "
41736 (math (var "n"))
41737 "
41738 bits of "
41739 (var "mask")
41740 ",
41741 where "
41742 (math (var "n"))
41743 "
41744 is the number of bits in the stencil buffer,
41745 specify a mask.
41746 Where a 1 appears in the mask,
41747 it's possible to write to the corresponding bit in the stencil buffer.
41748 Where a 0 appears,
41749 the corresponding bit is write-protected.
41750 Initially, all bits are enabled for writing. ")
41751 (para "
41752 There can be two separate "
41753 (var "mask")
41754 " writemasks; one affects back-facing polygons, and the other
41755 affects front-facing polygons as well as other non-polygon primitives. "
41756 (code "glStencilMask")
41757 " sets both front
41758 and back stencil writemasks to the same values. Use "
41759 (code "glStencilMaskSeparate")
41760 "
41761 to set front and back stencil writemasks to different values. ")
41762 (heading "Errors")
41763 (para (code "GL_INVALID_OPERATION")
41764 " is generated if "
41765 (code "glStencilMask")
41766 "
41767 is executed between the execution of "
41768 (code "glBegin")
41769 "
41770 and the corresponding execution of "
41771 (code "glEnd")
41772 ". ")))
41773
41774 (define-gl-procedure
41775 glStencilOpSeparate
41776 "glStencilOpSeparate"
41777 (funcsynopsis
41778 (funcprototype
41779 (funcdef
41780 "void "
41781 (function "glStencilOpSeparate"))
41782 (paramdef "GLenum " (parameter "face"))
41783 (paramdef "GLenum " (parameter "sfail"))
41784 (paramdef "GLenum " (parameter "dpfail"))
41785 (paramdef "GLenum " (parameter "dppass"))))
41786 '(*fragment*
41787 (heading
41788 "set front and/or back stencil test actions")
41789 (heading "Parameters")
41790 (table (% (formatter (asis)))
41791 (entry (% (heading (var "face")))
41792 (para "
41793 Specifies whether front and/or back stencil state is updated.
41794 Three symbolic constants are valid: "
41795 (code "GL_FRONT")
41796 ", "
41797 (code "GL_BACK")
41798 ", and "
41799 (code "GL_FRONT_AND_BACK")
41800 ". "))
41801 (entry (% (heading (var "sfail")))
41802 (para "
41803 Specifies the action to take when the stencil test fails.
41804 Eight symbolic constants are accepted: "
41805 (code "GL_KEEP")
41806 ", "
41807 (code "GL_ZERO")
41808 ", "
41809 (code "GL_REPLACE")
41810 ", "
41811 (code "GL_INCR")
41812 ", "
41813 (code "GL_INCR_WRAP")
41814 ", "
41815 (code "GL_DECR")
41816 ", "
41817 (code "GL_DECR_WRAP")
41818 ", and "
41819 (code "GL_INVERT")
41820 ". The initial value is "
41821 (code "GL_KEEP")
41822 ". "))
41823 (entry (% (heading (var "dpfail")))
41824 (para "
41825 Specifies the stencil action when the stencil test passes,
41826 but the depth test fails. "
41827 (var "dpfail")
41828 " accepts the same symbolic constants as "
41829 (var "sfail")
41830 ". The initial value
41831 is "
41832 (code "GL_KEEP")
41833 ". "))
41834 (entry (% (heading (var "dppass")))
41835 (para "
41836 Specifies the stencil action when both the stencil test and the depth
41837 test pass, or when the stencil test passes and either there is no
41838 depth buffer or depth testing is not enabled. "
41839 (var "dppass")
41840 " accepts the same symbolic constants as "
41841 (var "sfail")
41842 ". The initial value
41843 is "
41844 (code "GL_KEEP")
41845 ". ")))
41846 (heading "Description")
41847 (para "
41848 Stenciling,
41849 like depth-buffering,
41850 enables and disables drawing on a per-pixel basis.
41851 You draw into the stencil planes using GL drawing primitives,
41852 then render geometry and images,
41853 using the stencil planes to mask out portions of the screen.
41854 Stenciling is typically used in multipass rendering algorithms
41855 to achieve special effects,
41856 such as decals,
41857 outlining,
41858 and constructive solid geometry rendering. ")
41859 (para "
41860 The stencil test conditionally eliminates a pixel based on the outcome
41861 of a comparison between the value in the stencil buffer and a
41862 reference value. To enable and disable the test, call "
41863 (code "glEnable")
41864 "
41865 and "
41866 (code "glDisable")
41867 " with argument "
41868 (code "GL_STENCIL_TEST")
41869 "; to control it, call "
41870 (code "glStencilFunc")
41871 " or "
41872 (code "glStencilFuncSeparate")
41873 ". ")
41874 (para "
41875 There can be two separate sets of "
41876 (var "sfail")
41877 ", "
41878 (var "dpfail")
41879 ", and "
41880 (var "dppass")
41881 " parameters; one affects back-facing polygons, and the other
41882 affects front-facing polygons as well as other non-polygon primitives. "
41883 (code "glStencilOp")
41884 " sets both front
41885 and back stencil state to the same values, as if "
41886 (code "glStencilOpSeparate")
41887 " were called
41888 with "
41889 (var "face")
41890 " set to "
41891 (code "GL_FRONT_AND_BACK")
41892 ". ")
41893 (para (code "glStencilOpSeparate")
41894 " takes three arguments that indicate what happens
41895 to the stored stencil value while stenciling is enabled.
41896 If the stencil test fails,
41897 no change is made to the pixel's color or depth buffers,
41898 and "
41899 (var "sfail")
41900 " specifies what happens to the stencil buffer contents.
41901 The following eight actions are possible. ")
41902 (table (% (formatter (asis)))
41903 (entry (% (heading (code "GL_KEEP")))
41904 (para "
41905 Keeps the current value. "))
41906 (entry (% (heading (code "GL_ZERO")))
41907 (para "
41908 Sets the stencil buffer value to 0. "))
41909 (entry (% (heading (code "GL_REPLACE")))
41910 (para "
41911 Sets the stencil buffer value to "
41912 (var "ref")
41913 ",
41914 as specified by "
41915 (code "glStencilFunc")
41916 ". "))
41917 (entry (% (heading (code "GL_INCR")))
41918 (para "
41919 Increments the current stencil buffer value.
41920 Clamps to the maximum representable unsigned value. "))
41921 (entry (% (heading (code "GL_INCR_WRAP")))
41922 (para "
41923 Increments the current stencil buffer value.
41924 Wraps stencil buffer value to zero when incrementing the maximum
41925 representable unsigned value. "))
41926 (entry (% (heading (code "GL_DECR")))
41927 (para "
41928 Decrements the current stencil buffer value.
41929 Clamps to 0. "))
41930 (entry (% (heading (code "GL_DECR_WRAP")))
41931 (para "
41932 Decrements the current stencil buffer value.
41933 Wraps stencil buffer value to the maximum representable unsigned value when
41934 decrementing a stencil buffer value of zero. "))
41935 (entry (% (heading (code "GL_INVERT")))
41936 (para "
41937 Bitwise inverts the current stencil buffer value. ")))
41938 (para "
41939 Stencil buffer values are treated as unsigned integers.
41940 When incremented and decremented,
41941 values are clamped to 0 and "
41942 (math "2" "^" (var "n") "-" "1")
41943 ",
41944 where "
41945 (math (var "n"))
41946 "
41947 is the value returned by querying "
41948 (code "GL_STENCIL_BITS")
41949 ". ")
41950 (para "
41951 The other two arguments to "
41952 (code "glStencilOpSeparate")
41953 " specify stencil buffer actions
41954 that depend on whether subsequent depth buffer tests succeed ("
41955 (var "dppass")
41956 ")
41957 or fail ("
41958 (var "dpfail")
41959 ") (see "
41960 (code "glDepthFunc")
41961 ").
41962 The actions are specified using the same eight symbolic constants as "
41963 (var "sfail")
41964 ".
41965 Note that "
41966 (var "dpfail")
41967 " is ignored when there is no depth buffer,
41968 or when the depth buffer is not enabled.
41969 In these cases, "
41970 (var "sfail")
41971 " and "
41972 (var "dppass")
41973 " specify stencil action when the
41974 stencil test fails and passes,
41975 respectively. ")
41976 (heading "Errors")
41977 (para (code "GL_INVALID_ENUM")
41978 " is generated if "
41979 (var "face")
41980 " is any value
41981 other than "
41982 (code "GL_FRONT")
41983 ", "
41984 (code "GL_BACK")
41985 ", or "
41986 (code "GL_FRONT_AND_BACK")
41987 ". ")
41988 (para (code "GL_INVALID_ENUM")
41989 " is generated if "
41990 (var "sfail")
41991 ", "
41992 (var "dpfail")
41993 ", or "
41994 (var "dppass")
41995 " is any value other than the eight defined constant values. ")
41996 (para (code "GL_INVALID_OPERATION")
41997 " is generated if "
41998 (code "glStencilOpSeparate")
41999 "
42000 is executed between the execution of "
42001 (code "glBegin")
42002 "
42003 and the corresponding execution of "
42004 (code "glEnd")
42005 ". ")))
42006
42007 (define-gl-procedure
42008 glStencilOp
42009 "glStencilOp"
42010 (funcsynopsis
42011 (funcprototype
42012 (funcdef "void " (function "glStencilOp"))
42013 (paramdef "GLenum " (parameter "sfail"))
42014 (paramdef "GLenum " (parameter "dpfail"))
42015 (paramdef "GLenum " (parameter "dppass"))))
42016 '(*fragment*
42017 (heading
42018 "set front and back stencil test actions")
42019 (heading "Parameters")
42020 (table (% (formatter (asis)))
42021 (entry (% (heading (var "sfail")))
42022 (para "
42023 Specifies the action to take when the stencil test fails.
42024 Eight symbolic constants are accepted: "
42025 (code "GL_KEEP")
42026 ", "
42027 (code "GL_ZERO")
42028 ", "
42029 (code "GL_REPLACE")
42030 ", "
42031 (code "GL_INCR")
42032 ", "
42033 (code "GL_INCR_WRAP")
42034 ", "
42035 (code "GL_DECR")
42036 ", "
42037 (code "GL_DECR_WRAP")
42038 ", and "
42039 (code "GL_INVERT")
42040 ". The initial value is "
42041 (code "GL_KEEP")
42042 ". "))
42043 (entry (% (heading (var "dpfail")))
42044 (para "
42045 Specifies the stencil action when the stencil test passes,
42046 but the depth test fails. "
42047 (var "dpfail")
42048 " accepts the same symbolic constants as "
42049 (var "sfail")
42050 ". The initial value
42051 is "
42052 (code "GL_KEEP")
42053 ". "))
42054 (entry (% (heading (var "dppass")))
42055 (para "
42056 Specifies the stencil action when both the stencil test and the depth
42057 test pass, or when the stencil test passes and either there is no
42058 depth buffer or depth testing is not enabled. "
42059 (var "dppass")
42060 " accepts the same symbolic constants as "
42061 (var "sfail")
42062 ". The initial value
42063 is "
42064 (code "GL_KEEP")
42065 ". ")))
42066 (heading "Description")
42067 (para "
42068 Stenciling,
42069 like depth-buffering,
42070 enables and disables drawing on a per-pixel basis.
42071 You draw into the stencil planes using GL drawing primitives,
42072 then render geometry and images,
42073 using the stencil planes to mask out portions of the screen.
42074 Stenciling is typically used in multipass rendering algorithms
42075 to achieve special effects,
42076 such as decals,
42077 outlining,
42078 and constructive solid geometry rendering. ")
42079 (para "
42080 The stencil test conditionally eliminates a pixel based on the outcome
42081 of a comparison between the value in the stencil buffer and a
42082 reference value. To enable and disable the test, call "
42083 (code "glEnable")
42084 "
42085 and "
42086 (code "glDisable")
42087 " with argument "
42088 (code "GL_STENCIL_TEST")
42089 "; to control it, call "
42090 (code "glStencilFunc")
42091 " or "
42092 (code "glStencilFuncSeparate")
42093 ". ")
42094 (para "
42095 There can be two separate sets of "
42096 (var "sfail")
42097 ", "
42098 (var "dpfail")
42099 ", and "
42100 (var "dppass")
42101 " parameters; one affects back-facing polygons, and the other
42102 affects front-facing polygons as well as other non-polygon primitives. "
42103 (code "glStencilOp")
42104 " sets both front
42105 and back stencil state to the same values. Use "
42106 (code "glStencilOpSeparate")
42107 "
42108 to set front and back stencil state to different values. ")
42109 (para (code "glStencilOp")
42110 " takes three arguments that indicate what happens
42111 to the stored stencil value while stenciling is enabled.
42112 If the stencil test fails,
42113 no change is made to the pixel's color or depth buffers,
42114 and "
42115 (var "sfail")
42116 " specifies what happens to the stencil buffer contents.
42117 The following eight actions are possible. ")
42118 (table (% (formatter (asis)))
42119 (entry (% (heading (code "GL_KEEP")))
42120 (para "
42121 Keeps the current value. "))
42122 (entry (% (heading (code "GL_ZERO")))
42123 (para "
42124 Sets the stencil buffer value to 0. "))
42125 (entry (% (heading (code "GL_REPLACE")))
42126 (para "
42127 Sets the stencil buffer value to "
42128 (var "ref")
42129 ",
42130 as specified by "
42131 (code "glStencilFunc")
42132 ". "))
42133 (entry (% (heading (code "GL_INCR")))
42134 (para "
42135 Increments the current stencil buffer value.
42136 Clamps to the maximum representable unsigned value. "))
42137 (entry (% (heading (code "GL_INCR_WRAP")))
42138 (para "
42139 Increments the current stencil buffer value.
42140 Wraps stencil buffer value to zero when incrementing the maximum
42141 representable unsigned value. "))
42142 (entry (% (heading (code "GL_DECR")))
42143 (para "
42144 Decrements the current stencil buffer value.
42145 Clamps to 0. "))
42146 (entry (% (heading (code "GL_DECR_WRAP")))
42147 (para "
42148 Decrements the current stencil buffer value.
42149 Wraps stencil buffer value to the maximum representable unsigned value when
42150 decrementing a stencil buffer value of zero. "))
42151 (entry (% (heading (code "GL_INVERT")))
42152 (para "
42153 Bitwise inverts the current stencil buffer value. ")))
42154 (para "
42155 Stencil buffer values are treated as unsigned integers.
42156 When incremented and decremented,
42157 values are clamped to 0 and "
42158 (math "2" "^" (var "n") "-" "1")
42159 ",
42160 where "
42161 (math (var "n"))
42162 "
42163 is the value returned by querying "
42164 (code "GL_STENCIL_BITS")
42165 ". ")
42166 (para "
42167 The other two arguments to "
42168 (code "glStencilOp")
42169 " specify stencil buffer actions
42170 that depend on whether subsequent depth buffer tests succeed ("
42171 (var "dppass")
42172 ")
42173 or fail ("
42174 (var "dpfail")
42175 ") (see "
42176 (code "glDepthFunc")
42177 ").
42178 The actions are specified using the same eight symbolic constants as "
42179 (var "sfail")
42180 ".
42181 Note that "
42182 (var "dpfail")
42183 " is ignored when there is no depth buffer,
42184 or when the depth buffer is not enabled.
42185 In these cases, "
42186 (var "sfail")
42187 " and "
42188 (var "dppass")
42189 " specify stencil action when the
42190 stencil test fails and passes,
42191 respectively. ")
42192 (heading "Errors")
42193 (para (code "GL_INVALID_ENUM")
42194 " is generated if "
42195 (var "sfail")
42196 ", "
42197 (var "dpfail")
42198 ", or "
42199 (var "dppass")
42200 " is any value other than the eight defined constant values. ")
42201 (para (code "GL_INVALID_OPERATION")
42202 " is generated if "
42203 (code "glStencilOp")
42204 "
42205 is executed between the execution of "
42206 (code "glBegin")
42207 "
42208 and the corresponding execution of "
42209 (code "glEnd")
42210 ". ")))
42211
42212 (define-gl-procedure
42213 glTexCoordPointer
42214 "glTexCoordPointer"
42215 (funcsynopsis
42216 (funcprototype
42217 (funcdef "void " (function "glTexCoordPointer"))
42218 (paramdef "GLint " (parameter "size"))
42219 (paramdef "GLenum " (parameter "type"))
42220 (paramdef "GLsizei " (parameter "stride"))
42221 (paramdef
42222 "const GLvoid * "
42223 (parameter "pointer"))))
42224 '(*fragment*
42225 (heading
42226 "define an array of texture coordinates")
42227 (heading "Parameters")
42228 (table (% (formatter (asis)))
42229 (entry (% (heading (var "size")))
42230 (para "
42231 Specifies the number of coordinates per array element. Must be 1, 2, 3,
42232 or 4. The initial value is 4. "))
42233 (entry (% (heading (var "type")))
42234 (para "
42235 Specifies the data type of each texture coordinate.
42236 Symbolic constants "
42237 (code "GL_SHORT")
42238 ", "
42239 (code "GL_INT")
42240 ", "
42241 (code "GL_FLOAT")
42242 ",
42243 or "
42244 (code "GL_DOUBLE")
42245 "
42246 are accepted. The initial value is "
42247 (code "GL_FLOAT")
42248 ". "))
42249 (entry (% (heading (var "stride")))
42250 (para "
42251 Specifies the byte offset between consecutive texture coordinate sets.
42252 If "
42253 (var "stride")
42254 " is 0, the array elements are understood
42255 to be tightly packed. The initial value is 0. "))
42256 (entry (% (heading (var "pointer")))
42257 (para "
42258 Specifies a pointer to the first coordinate of the first texture coordinate set in the
42259 array. The initial value is 0. ")))
42260 (heading "Description")
42261 (para (code "glTexCoordPointer")
42262 " specifies the location and data format of an array of texture
42263 coordinates to use when rendering. "
42264 (var "size")
42265 " specifies the number of coordinates per
42266 texture coordinate set, and must be 1, 2, 3, or 4. "
42267 (var "type")
42268 " specifies the data type of each texture coordinate,
42269 and "
42270 (var "stride")
42271 " specifies the byte stride from one
42272 texture coordinate set to the next, allowing vertices and attributes
42273 to be packed into a single array or stored in separate arrays.
42274 (Single-array storage may be more efficient on some implementations;
42275 see "
42276 (code "glInterleavedArrays")
42277 ".) ")
42278 (para "
42279 If a non-zero named buffer object is bound to the "
42280 (code "GL_ARRAY_BUFFER")
42281 " target
42282 (see "
42283 (code "glBindBuffer")
42284 ") while a texture coordinate array is
42285 specified, "
42286 (var "pointer")
42287 " is treated as a byte offset into the buffer object's data store.
42288 Also, the buffer object binding ("
42289 (code "GL_ARRAY_BUFFER_BINDING")
42290 ") is saved as texture coordinate vertex array
42291 client-side state ("
42292 (code "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING")
42293 "). ")
42294 (para "
42295 When a texture coordinate array is specified, "
42296 (var "size")
42297 ", "
42298 (var "type")
42299 ", "
42300 (var "stride")
42301 ", and "
42302 (var "pointer")
42303 " are saved as client-side
42304 state, in addition to the current vertex array buffer object binding. ")
42305 (para "
42306 To enable and disable a texture coordinate array, call "
42307 (code "glEnableClientState")
42308 " and "
42309 (code "glDisableClientState")
42310 " with the argument "
42311 (code "GL_TEXTURE_COORD_ARRAY")
42312 ". If enabled, the texture coordinate array is used when "
42313 (code "glArrayElement")
42314 ", "
42315 (code "glDrawArrays")
42316 ", "
42317 (code "glMultiDrawArrays")
42318 ", "
42319 (code "glDrawElements")
42320 ", "
42321 (code "glMultiDrawElements")
42322 ", or "
42323 (code "glDrawRangeElements")
42324 "
42325 is called. ")
42326 (heading "Errors")
42327 (para (code "GL_INVALID_VALUE")
42328 " is generated if "
42329 (var "size")
42330 " is not 1, 2, 3, or 4. ")
42331 (para (code "GL_INVALID_ENUM")
42332 " is generated if "
42333 (var "type")
42334 " is not an accepted value. ")
42335 (para (code "GL_INVALID_VALUE")
42336 " is generated if "
42337 (var "stride")
42338 " is negative. ")))
42339
42340 (define-gl-procedure
42341 glTexCoord
42342 "glTexCoord"
42343 (funcsynopsis
42344 (funcprototype
42345 (funcdef "void " (function "glTexCoord1s"))
42346 (paramdef "GLshort " (parameter "s"))))
42347 '(*fragment*
42348 (heading "set the current texture coordinates")
42349 (heading "Parameters")
42350 (table (% (formatter (asis)))
42351 (entry (% (heading (var "s")))
42352 (itemx (var "t"))
42353 (itemx (var "r"))
42354 (itemx (var "q"))
42355 (para "
42356 Specify "
42357 (var "s")
42358 ", "
42359 (var "t")
42360 ", "
42361 (var "r")
42362 ", and "
42363 (var "q")
42364 " texture coordinates.
42365 Not all parameters are present in all forms of the command. ")))
42366 (heading "Description")
42367 (para (code "glTexCoord")
42368 " specifies texture coordinates in
42369 one,
42370 two,
42371 three, or
42372 four dimensions. "
42373 (code "glTexCoord1")
42374 " sets the current texture coordinates to "
42375 (math "(" (var "s") "," "0" "0" "1" ")")
42376 ";
42377 a call to "
42378 (code "glTexCoord2")
42379 " sets them to "
42380 (math "(" (var "s") "," (var "t") "0" "1" ")")
42381 ".
42382 Similarly, "
42383 (code "glTexCoord3")
42384 " specifies the texture coordinates as "
42385 (math "("
42386 (var "s")
42387 ","
42388 (var "t")
42389 (var "r")
42390 "1"
42391 ")")
42392 ",
42393 and "
42394 (code "glTexCoord4")
42395 " defines all four components explicitly as "
42396 (math "("
42397 (var "s")
42398 ","
42399 (var "t")
42400 (var "r")
42401 (var "q")
42402 ")")
42403 ". ")
42404 (para "
42405 The current texture coordinates are part of the data
42406 that is associated with each vertex and with the current
42407 raster position.
42408 Initially, the values for "
42409 (var "s")
42410 ", "
42411 (var "t")
42412 ", "
42413 (var "r")
42414 ", and "
42415 (var "q")
42416 "
42417 are (0, 0, 0, 1). ")
42418 (para)))
42419
42420 (define-gl-procedure
42421 glTexEnv
42422 "glTexEnv"
42423 (funcsynopsis
42424 (funcprototype
42425 (funcdef "void " (function "glTexEnvf"))
42426 (paramdef "GLenum " (parameter "target"))
42427 (paramdef "GLenum " (parameter "pname"))
42428 (paramdef "GLfloat " (parameter "param"))))
42429 '(*fragment*
42430 (heading "set texture environment parameters")
42431 (heading "Parameters")
42432 (table (% (formatter (asis)))
42433 (entry (% (heading (var "target")))
42434 (para "
42435 Specifies a texture environment.
42436 May be "
42437 (code "GL_TEXTURE_ENV")
42438 ", "
42439 (code "GL_TEXTURE_FILTER_CONTROL")
42440 " or "
42441 (code "GL_POINT_SPRITE")
42442 ". "))
42443 (entry (% (heading (var "pname")))
42444 (para "
42445 Specifies the symbolic name of a single-valued texture environment parameter.
42446 May be either "
42447 (code "GL_TEXTURE_ENV_MODE")
42448 ", "
42449 (code "GL_TEXTURE_LOD_BIAS")
42450 ", "
42451 (code "GL_COMBINE_RGB")
42452 ", "
42453 (code "GL_COMBINE_ALPHA")
42454 ", "
42455 (code "GL_SRC0_RGB")
42456 ", "
42457 (code "GL_SRC1_RGB")
42458 ", "
42459 (code "GL_SRC2_RGB")
42460 ", "
42461 (code "GL_SRC0_ALPHA")
42462 ", "
42463 (code "GL_SRC1_ALPHA")
42464 ", "
42465 (code "GL_SRC2_ALPHA")
42466 ", "
42467 (code "GL_OPERAND0_RGB")
42468 ", "
42469 (code "GL_OPERAND1_RGB")
42470 ", "
42471 (code "GL_OPERAND2_RGB")
42472 ", "
42473 (code "GL_OPERAND0_ALPHA")
42474 ", "
42475 (code "GL_OPERAND1_ALPHA")
42476 ", "
42477 (code "GL_OPERAND2_ALPHA")
42478 ", "
42479 (code "GL_RGB_SCALE")
42480 ", "
42481 (code "GL_ALPHA_SCALE")
42482 ", or "
42483 (code "GL_COORD_REPLACE")
42484 ". "))
42485 (entry (% (heading (var "param")))
42486 (para "
42487 Specifies a single symbolic constant, one of "
42488 (code "GL_ADD")
42489 ", "
42490 (code "GL_ADD_SIGNED")
42491 ", "
42492 (code "GL_INTERPOLATE")
42493 ", "
42494 (code "GL_MODULATE")
42495 ", "
42496 (code "GL_DECAL")
42497 ", "
42498 (code "GL_BLEND")
42499 ", "
42500 (code "GL_REPLACE")
42501 ", "
42502 (code "GL_SUBTRACT")
42503 ", "
42504 (code "GL_COMBINE")
42505 ", "
42506 (code "GL_TEXTURE")
42507 ", "
42508 (code "GL_CONSTANT")
42509 ", "
42510 (code "GL_PRIMARY_COLOR")
42511 ", "
42512 (code "GL_PREVIOUS")
42513 ", "
42514 (code "GL_SRC_COLOR")
42515 ", "
42516 (code "GL_ONE_MINUS_SRC_COLOR")
42517 ", "
42518 (code "GL_SRC_ALPHA")
42519 ", "
42520 (code "GL_ONE_MINUS_SRC_ALPHA")
42521 ",
42522 a single boolean value for the point sprite texture coordinate replacement,
42523 a single floating-point value for the texture level-of-detail bias,
42524 or 1.0, 2.0, or 4.0 when specifying the "
42525 (code "GL_RGB_SCALE")
42526 " or "
42527 (code "GL_ALPHA_SCALE")
42528 ". ")))
42529 (heading "Description")
42530 (para "
42531 A texture environment specifies how texture values are interpreted when a
42532 fragment is textured. When "
42533 (var "target")
42534 " is "
42535 (code "GL_TEXTURE_FILTER_CONTROL")
42536 ", "
42537 (var "pname")
42538 " must be "
42539 (code "GL_TEXTURE_LOD_BIAS")
42540 ". When "
42541 (var "target")
42542 " is "
42543 (code "GL_TEXTURE_ENV")
42544 ", "
42545 (var "pname")
42546 " can be "
42547 (code "GL_TEXTURE_ENV_MODE")
42548 ", "
42549 (code "GL_TEXTURE_ENV_COLOR")
42550 ", "
42551 (code "GL_COMBINE_RGB")
42552 ", "
42553 (code "GL_COMBINE_ALPHA")
42554 ", "
42555 (code "GL_RGB_SCALE")
42556 ", "
42557 (code "GL_ALPHA_SCALE")
42558 ", "
42559 (code "GL_SRC0_RGB")
42560 ", "
42561 (code "GL_SRC1_RGB")
42562 ", "
42563 (code "GL_SRC2_RGB")
42564 ", "
42565 (code "GL_SRC0_ALPHA")
42566 ", "
42567 (code "GL_SRC1_ALPHA")
42568 ", or "
42569 (code "GL_SRC2_ALPHA")
42570 ". ")
42571 (para "
42572 If "
42573 (var "pname")
42574 " is "
42575 (code "GL_TEXTURE_ENV_MODE")
42576 ",
42577 then "
42578 (var "params")
42579 " is (or points to) the symbolic name of a texture function.
42580 Six texture functions may be specified: "
42581 (code "GL_ADD")
42582 ", "
42583 (code "GL_MODULATE")
42584 ", "
42585 (code "GL_DECAL")
42586 ", "
42587 (code "GL_BLEND")
42588 ", "
42589 (code "GL_REPLACE")
42590 ", or "
42591 (code "GL_COMBINE")
42592 ". ")
42593 (para "
42594 The following table shows the correspondence of filtered texture
42595 values "
42596 (math (var "R") "_" (var "t"))
42597 ", "
42598 (math (var "G") "_" (var "t"))
42599 ", "
42600 (math (var "B") "_" (var "t"))
42601 ", "
42602 (math (var "A") "_" (var "t"))
42603 ", "
42604 (math (var "L") "_" (var "t"))
42605 ", "
42606 (math (var "I") "_" (var "t"))
42607 "
42608 to texture source components. "
42609 (math (var "C") "_" (var "s"))
42610 "
42611 and "
42612 (math (var "A") "_" (var "s"))
42613 "
42614 are used by the texture functions described below. ")
42615 (para)
42616 (table (% (formatter (asis)))
42617 (entry (% (heading "
42618 Texture Base Internal Format "))
42619 (para (math (code "C") "_" (var "s"))
42620 ", "
42621 (math (code "A") "_" (var "s"))))
42622 (entry (% (heading (code "GL_ALPHA")))
42623 (para "
42624 (0, 0, 0) "
42625 ", "
42626 (math (var "A") "_" (var "t"))))
42627 (entry (% (heading (code "GL_LUMINANCE")))
42628 (para "
42629 ( "
42630 (math (var "L") "_" (var "t"))
42631 ", "
42632 (math (var "L") "_" (var "t"))
42633 ", "
42634 (math (var "L") "_" (var "t"))
42635 "
42636 ) "
42637 ", "
42638 "
42639 1 "))
42640 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
42641 (para "
42642 ( "
42643 (math (var "L") "_" (var "t"))
42644 ", "
42645 (math (var "L") "_" (var "t"))
42646 ", "
42647 (math (var "L") "_" (var "t"))
42648 "
42649 ) "
42650 ", "
42651 (math (var "A") "_" (var "t"))))
42652 (entry (% (heading (code "GL_INTENSITY")))
42653 (para "
42654 ( "
42655 (math (var "I") "_" (var "t"))
42656 ", "
42657 (math (var "I") "_" (var "t"))
42658 ", "
42659 (math (var "I") "_" (var "t"))
42660 "
42661 ) "
42662 ", "
42663 (math (var "I") "_" (var "t"))))
42664 (entry (% (heading (code "GL_RGB")))
42665 (para "
42666 ( "
42667 (math (var "R") "_" (var "t"))
42668 ", "
42669 (math (var "G") "_" (var "t"))
42670 ", "
42671 (math (var "B") "_" (var "t"))
42672 "
42673 ) "
42674 ", "
42675 "
42676 1 "))
42677 (entry (% (heading (code "GL_RGBA")))
42678 (para "
42679 ( "
42680 (math (var "R") "_" (var "t"))
42681 ", "
42682 (math (var "G") "_" (var "t"))
42683 ", "
42684 (math (var "B") "_" (var "t"))
42685 "
42686 ) "
42687 ", "
42688 (math (var "A") "_" (var "t")))))
42689 (para "
42690 A texture function acts on the fragment to be textured using
42691 the texture image value that applies to the fragment
42692 (see "
42693 (code "glTexParameter")
42694 ")
42695 and produces an RGBA color for that fragment.
42696 The following table shows how the RGBA color is produced for each
42697 of the first five texture functions that can be chosen. "
42698 (math (var "C"))
42699 "
42700 is a triple of color values (RGB) and "
42701 (math (var "A"))
42702 "
42703 is the associated alpha value.
42704 RGBA values extracted from a texture image are in the range [0,1].
42705 The subscript "
42706 (math (var "p"))
42707 "
42708 refers to the color computed from the previous texture stage (or the incoming fragment if processing texture stage 0),
42709 the subscript "
42710 (math (var "s"))
42711 "
42712 to the texture source color,
42713 the subscript "
42714 (math (var "c"))
42715 "
42716 to the texture environment color,
42717 and the subscript "
42718 (math (var "v"))
42719 "
42720 indicates a value produced by the texture function. ")
42721 (para)
42722 (table (% (formatter (asis)))
42723 (entry (% (heading "
42724 Texture Base Internal Format "))
42725 (para (code "Value")
42726 ", "
42727 (code "GL_REPLACE")
42728 " Function "
42729 ", "
42730 (code "GL_MODULATE")
42731 " Function "
42732 ", "
42733 (code "GL_DECAL")
42734 " Function "
42735 ", "
42736 (code "GL_BLEND")
42737 " Function "
42738 ", "
42739 (code "GL_ADD")
42740 " Function "))
42741 (entry (% (heading (code "GL_ALPHA")))
42742 (para (math (var "C") "_" (var "v") "=")
42743 ", "
42744 (math (var "C") "_" (var "p"))
42745 ", "
42746 (math (var "C") "_" (var "p"))
42747 ", "
42748 "
42749 undefined "
42750 ", "
42751 (math (var "C") "_" (var "p"))
42752 ", "
42753 (math (var "C") "_" (var "p"))))
42754 (entry (% (heading))
42755 (para (math (var "A") "_" (var "v") "=")
42756 ", "
42757 (math (var "A") "_" (var "s"))
42758 ", "
42759 (math (var "A")
42760 "_"
42761 (var "p")
42762 "\u2062"
42763 (var "A")
42764 "_"
42765 (var "s"))
42766 ", "
42767 ", "
42768 (math (var "A")
42769 "_"
42770 (var "v")
42771 "="
42772 (var "A")
42773 "_"
42774 (var "p")
42775 "\u2062"
42776 (var "A")
42777 "_"
42778 (var "s"))
42779 ", "
42780 (math (var "A")
42781 "_"
42782 (var "p")
42783 "\u2062"
42784 (var "A")
42785 "_"
42786 (var "s"))))
42787 (entry (% (heading (code "GL_LUMINANCE")))
42788 (para (math (var "C") "_" (var "v") "=")
42789 ", "
42790 (math (var "C") "_" (var "s"))
42791 ", "
42792 (math (var "C")
42793 "_"
42794 (var "p")
42795 "\u2062"
42796 (var "C")
42797 "_"
42798 (var "s"))
42799 ", "
42800 "
42801 undefined "
42802 ", "
42803 (math (var "C")
42804 "_"
42805 (var "p")
42806 "\u2062"
42807 "("
42808 "1"
42809 "-"
42810 (var "C")
42811 "_"
42812 (var "s")
42813 ","
42814 ")"
42815 "+"
42816 (var "C")
42817 "_"
42818 (var "c")
42819 "\u2062"
42820 (var "C")
42821 "_"
42822 (var "s"))
42823 ", "
42824 (math (var "C")
42825 "_"
42826 (var "p")
42827 "+"
42828 (var "C")
42829 "_"
42830 (var "s"))))
42831 (entry (% (heading "
42832 (or 1) "))
42833 (para (math (var "A") "_" (var "v") "=")
42834 ", "
42835 (math (var "A") "_" (var "p"))
42836 ", "
42837 (math (var "A") "_" (var "p"))
42838 ", "
42839 ", "
42840 (math (var "A") "_" (var "p"))
42841 ", "
42842 (math (var "A") "_" (var "p"))))
42843 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
42844 (para (math (var "C") "_" (var "v") "=")
42845 ", "
42846 (math (var "C") "_" (var "s"))
42847 ", "
42848 (math (var "C")
42849 "_"
42850 (var "p")
42851 "\u2062"
42852 (var "C")
42853 "_"
42854 (var "s"))
42855 ", "
42856 "
42857 undefined "
42858 ", "
42859 (math (var "C")
42860 "_"
42861 (var "p")
42862 "\u2062"
42863 "("
42864 "1"
42865 "-"
42866 (var "C")
42867 "_"
42868 (var "s")
42869 ","
42870 ")"
42871 "+"
42872 (var "C")
42873 "_"
42874 (var "c")
42875 "\u2062"
42876 (var "C")
42877 "_"
42878 (var "s"))
42879 ", "
42880 (math (var "C")
42881 "_"
42882 (var "p")
42883 "+"
42884 (var "C")
42885 "_"
42886 (var "s"))))
42887 (entry (% (heading "
42888 (or 2) "))
42889 (para (math (var "A") "_" (var "v") "=")
42890 ", "
42891 (math (var "A") "_" (var "s"))
42892 ", "
42893 (math (var "A")
42894 "_"
42895 (var "p")
42896 "\u2062"
42897 (var "A")
42898 "_"
42899 (var "s"))
42900 ", "
42901 ", "
42902 (math (var "A")
42903 "_"
42904 (var "p")
42905 "\u2062"
42906 (var "A")
42907 "_"
42908 (var "s"))
42909 ", "
42910 (math (var "A")
42911 "_"
42912 (var "p")
42913 "\u2062"
42914 (var "A")
42915 "_"
42916 (var "s"))))
42917 (entry (% (heading (code "GL_INTENSITY")))
42918 (para (math (var "C") "_" (var "v") "=")
42919 ", "
42920 (math (var "C") "_" (var "s"))
42921 ", "
42922 (math (var "C")
42923 "_"
42924 (var "p")
42925 "\u2062"
42926 (var "C")
42927 "_"
42928 (var "s"))
42929 ", "
42930 "
42931 undefined "
42932 ", "
42933 (math (var "C")
42934 "_"
42935 (var "p")
42936 "\u2062"
42937 "("
42938 "1"
42939 "-"
42940 (var "C")
42941 "_"
42942 (var "s")
42943 ","
42944 ")"
42945 "+"
42946 (var "C")
42947 "_"
42948 (var "c")
42949 "\u2062"
42950 (var "C")
42951 "_"
42952 (var "s"))
42953 ", "
42954 (math (var "C")
42955 "_"
42956 (var "p")
42957 "+"
42958 (var "C")
42959 "_"
42960 (var "s"))))
42961 (entry (% (heading))
42962 (para (math (var "A") "_" (var "v") "=")
42963 ", "
42964 (math (var "A") "_" (var "s"))
42965 ", "
42966 (math (var "A")
42967 "_"
42968 (var "p")
42969 "\u2062"
42970 (var "A")
42971 "_"
42972 (var "s"))
42973 ", "
42974 ", "
42975 (math (var "A")
42976 "_"
42977 (var "p")
42978 "\u2062"
42979 "("
42980 "1"
42981 "-"
42982 (var "A")
42983 "_"
42984 (var "s")
42985 ","
42986 ")"
42987 "+"
42988 (var "A")
42989 "_"
42990 (var "c")
42991 "\u2062"
42992 (var "A")
42993 "_"
42994 (var "s"))
42995 ", "
42996 (math (var "A")
42997 "_"
42998 (var "p")
42999 "+"
43000 (var "A")
43001 "_"
43002 (var "s"))))
43003 (entry (% (heading (code "GL_RGB")))
43004 (para (math (var "C") "_" (var "v") "=")
43005 ", "
43006 (math (var "C") "_" (var "s"))
43007 ", "
43008 (math (var "C")
43009 "_"
43010 (var "p")
43011 "\u2062"
43012 (var "C")
43013 "_"
43014 (var "s"))
43015 ", "
43016 (math (var "C") "_" (var "s"))
43017 ", "
43018 (math (var "C")
43019 "_"
43020 (var "p")
43021 "\u2062"
43022 "("
43023 "1"
43024 "-"
43025 (var "C")
43026 "_"
43027 (var "s")
43028 ","
43029 ")"
43030 "+"
43031 (var "C")
43032 "_"
43033 (var "c")
43034 "\u2062"
43035 (var "C")
43036 "_"
43037 (var "s"))
43038 ", "
43039 (math (var "C")
43040 "_"
43041 (var "p")
43042 "+"
43043 (var "C")
43044 "_"
43045 (var "s"))))
43046 (entry (% (heading "
43047 (or 3) "))
43048 (para (math (var "A") "_" (var "v") "=")
43049 ", "
43050 (math (var "A") "_" (var "p"))
43051 ", "
43052 (math (var "A") "_" (var "p"))
43053 ", "
43054 (math (var "A") "_" (var "p"))
43055 ", "
43056 (math (var "A") "_" (var "p"))
43057 ", "
43058 (math (var "A") "_" (var "p"))))
43059 (entry (% (heading (code "GL_RGBA")))
43060 (para (math (var "C") "_" (var "v") "=")
43061 ", "
43062 (math (var "C") "_" (var "s"))
43063 ", "
43064 (math (var "C")
43065 "_"
43066 (var "p")
43067 "\u2062"
43068 (var "C")
43069 "_"
43070 (var "s"))
43071 ", "
43072 (math (var "C")
43073 "_"
43074 (var "p")
43075 "\u2062"
43076 "("
43077 "1"
43078 "-"
43079 (var "A")
43080 "_"
43081 (var "s")
43082 ","
43083 ")"
43084 "+"
43085 (var "C")
43086 "_"
43087 (var "s")
43088 "\u2062"
43089 (var "A")
43090 "_"
43091 (var "s"))
43092 ", "
43093 (math (var "C")
43094 "_"
43095 (var "p")
43096 "\u2062"
43097 "("
43098 "1"
43099 "-"
43100 (var "C")
43101 "_"
43102 (var "s")
43103 ","
43104 ")"
43105 "+"
43106 (var "C")
43107 "_"
43108 (var "c")
43109 "\u2062"
43110 (var "C")
43111 "_"
43112 (var "s"))
43113 ", "
43114 (math (var "C")
43115 "_"
43116 (var "p")
43117 "+"
43118 (var "C")
43119 "_"
43120 (var "s"))))
43121 (entry (% (heading "
43122 (or 4) "))
43123 (para (math (var "A") "_" (var "v") "=")
43124 ", "
43125 (math (var "A") "_" (var "s"))
43126 ", "
43127 (math (var "A")
43128 "_"
43129 (var "p")
43130 "\u2062"
43131 (var "A")
43132 "_"
43133 (var "s"))
43134 ", "
43135 (math (var "A") "_" (var "p"))
43136 ", "
43137 (math (var "A")
43138 "_"
43139 (var "p")
43140 "\u2062"
43141 (var "A")
43142 "_"
43143 (var "s"))
43144 ", "
43145 (math (var "A")
43146 "_"
43147 (var "p")
43148 "\u2062"
43149 (var "A")
43150 "_"
43151 (var "s")))))
43152 (para "
43153 If "
43154 (var "pname")
43155 " is "
43156 (code "GL_TEXTURE_ENV_MODE")
43157 ", and "
43158 (var "params")
43159 " is "
43160 (code "GL_COMBINE")
43161 ", the
43162 form of the texture function depends on the values of "
43163 (code "GL_COMBINE_RGB")
43164 "
43165 and "
43166 (code "GL_COMBINE_ALPHA")
43167 ". ")
43168 (para "
43169 The following describes how the texture sources, as specified by "
43170 (code "GL_SRC0_RGB")
43171 ", "
43172 (code "GL_SRC1_RGB")
43173 ", "
43174 (code "GL_SRC2_RGB")
43175 ", "
43176 (code "GL_SRC0_ALPHA")
43177 ", "
43178 (code "GL_SRC1_ALPHA")
43179 ", and "
43180 (code "GL_SRC2_ALPHA")
43181 ",
43182 are combined to produce a final texture color. In the following tables, "
43183 (code "GL_SRC0_c")
43184 " is represented by "
43185 (math (var "Arg0"))
43186 ", "
43187 (code "GL_SRC1_c")
43188 " is
43189 represented by "
43190 (math (var "Arg1"))
43191 ",
43192 and "
43193 (code "GL_SRC2_c")
43194 " is represented by "
43195 (math (var "Arg2"))
43196 ". ")
43197 (para (code "GL_COMBINE_RGB")
43198 " accepts any of "
43199 (code "GL_REPLACE")
43200 ", "
43201 (code "GL_MODULATE")
43202 ", "
43203 (code "GL_ADD")
43204 ", "
43205 (code "GL_ADD_SIGNED")
43206 ", "
43207 (code "GL_INTERPOLATE")
43208 ", "
43209 (code "GL_SUBTRACT")
43210 ", "
43211 (code "GL_DOT3_RGB")
43212 ", or "
43213 (code "GL_DOT3_RGBA")
43214 ". ")
43215 (para)
43216 (table (% (formatter (asis)))
43217 (entry (% (heading (strong (code "GL_COMBINE_RGB"))))
43218 (para (strong "Texture Function")))
43219 (entry (% (heading (code "GL_REPLACE")))
43220 (para (math (var "Arg0"))))
43221 (entry (% (heading (code "GL_MODULATE")))
43222 (para (math (var "Arg0") "×" (var "Arg1"))))
43223 (entry (% (heading (code "GL_ADD")))
43224 (para (math (var "Arg0") "+" (var "Arg1"))))
43225 (entry (% (heading (code "GL_ADD_SIGNED")))
43226 (para (math (var "Arg0") "+" (var "Arg1") "-" "0.5")))
43227 (entry (% (heading (code "GL_INTERPOLATE")))
43228 (para (math (var "Arg0")
43229 "×"
43230 (var "Arg2")
43231 "+"
43232 (var "Arg1")
43233 "×"
43234 "("
43235 "1"
43236 "-"
43237 (var "Arg2")
43238 ","
43239 ")")))
43240 (entry (% (heading (code "GL_SUBTRACT")))
43241 (para (math (var "Arg0") "-" (var "Arg1"))))
43242 (entry (% (heading
43243 (code "GL_DOT3_RGB")
43244 "
43245 or "
43246 (code "GL_DOT3_RGBA")))
43247 (para (math "4"
43248 "×"
43249 "("
43250 "("
43251 "("
43252 (var "Arg0")
43253 "_"
43254 (var "r")
43255 ","
43256 "-"
43257 "0.5"
43258 ","
43259 ")"
43260 "×"
43261 "("
43262 (var "Arg1")
43263 "_"
43264 (var "r")
43265 ","
43266 "-"
43267 "0.5"
43268 ","
43269 ")"
43270 ","
43271 ")"
43272 "+"
43273 "("
43274 "("
43275 (var "Arg0")
43276 "_"
43277 (var "g")
43278 ","
43279 "-"
43280 "0.5"
43281 ","
43282 ")"
43283 "×"
43284 "("
43285 (var "Arg1")
43286 "_"
43287 (var "g")
43288 ","
43289 "-"
43290 "0.5"
43291 ","
43292 ")"
43293 ","
43294 ")"
43295 "+"
43296 "("
43297 "("
43298 (var "Arg0")
43299 "_"
43300 (var "b")
43301 ","
43302 "-"
43303 "0.5"
43304 ","
43305 ")"
43306 "×"
43307 "("
43308 (var "Arg1")
43309 "_"
43310 (var "b")
43311 ","
43312 "-"
43313 "0.5"
43314 ","
43315 ")"
43316 ","
43317 ")"
43318 ","
43319 ")"))))
43320 (para "
43321 The scalar results for "
43322 (code "GL_DOT3_RGB")
43323 " and "
43324 (code "GL_DOT3_RGBA")
43325 " are placed
43326 into each of the 3 (RGB) or 4 (RGBA) components on output. ")
43327 (para "
43328 Likewise, "
43329 (code "GL_COMBINE_ALPHA")
43330 " accepts any of "
43331 (code "GL_REPLACE")
43332 ", "
43333 (code "GL_MODULATE")
43334 ", "
43335 (code "GL_ADD")
43336 ", "
43337 (code "GL_ADD_SIGNED")
43338 ", "
43339 (code "GL_INTERPOLATE")
43340 ", or "
43341 (code "GL_SUBTRACT")
43342 ". The following table describes how alpha values are
43343 combined: ")
43344 (para)
43345 (table (% (formatter (asis)))
43346 (entry (% (heading (strong (code "GL_COMBINE_ALPHA"))))
43347 (para (strong "Texture Function")))
43348 (entry (% (heading (code "GL_REPLACE")))
43349 (para (math (var "Arg0"))))
43350 (entry (% (heading (code "GL_MODULATE")))
43351 (para (math (var "Arg0") "×" (var "Arg1"))))
43352 (entry (% (heading (code "GL_ADD")))
43353 (para (math (var "Arg0") "+" (var "Arg1"))))
43354 (entry (% (heading (code "GL_ADD_SIGNED")))
43355 (para (math (var "Arg0") "+" (var "Arg1") "-" "0.5")))
43356 (entry (% (heading (code "GL_INTERPOLATE")))
43357 (para (math (var "Arg0")
43358 "×"
43359 (var "Arg2")
43360 "+"
43361 (var "Arg1")
43362 "×"
43363 "("
43364 "1"
43365 "-"
43366 (var "Arg2")
43367 ","
43368 ")")))
43369 (entry (% (heading (code "GL_SUBTRACT")))
43370 (para (math (var "Arg0") "-" (var "Arg1")))))
43371 (para "
43372 In the following tables, the value "
43373 (math (var "C") "_" (var "s"))
43374 "
43375 represents the color sampled
43376 from the currently bound texture, "
43377 (math (var "C") "_" (var "c"))
43378 "
43379 represents the constant
43380 texture-environment color, "
43381 (math (var "C") "_" (var "f"))
43382 "
43383 represents the primary color of the
43384 incoming fragment, and "
43385 (math (var "C") "_" (var "p"))
43386 "
43387 represents the color computed from the
43388 previous texture stage or "
43389 (math (var "C") "_" (var "f"))
43390 "
43391 if processing texture stage 0. Likewise, "
43392 (math (var "A") "_" (var "s"))
43393 ", "
43394 (math (var "A") "_" (var "c"))
43395 ", "
43396 (math (var "A") "_" (var "f"))
43397 ",
43398 and "
43399 (math (var "A") "_" (var "p"))
43400 "
43401 represent the respective
43402 alpha values. ")
43403 (para "
43404 The following table describes the values assigned to "
43405 (math (var "Arg0"))
43406 ", "
43407 (math (var "Arg1"))
43408 ",
43409 and "
43410 (math (var "Arg2"))
43411 "
43412 based upon the RGB sources and operands: ")
43413 (para)
43414 (table (% (formatter (asis)))
43415 (entry (% (heading (strong (code "GL_SRCn_RGB"))))
43416 (para (strong (code "GL_OPERANDn_RGB"))
43417 ", "
43418 (strong "Argument Value")))
43419 (entry (% (heading (code "GL_TEXTURE")))
43420 (para (code "GL_SRC_COLOR")
43421 ", "
43422 (math (var "C") "_" (var "s") ",")))
43423 (entry (% (heading))
43424 (para (code "GL_ONE_MINUS_SRC_COLOR")
43425 ", "
43426 (math "1" "-" (var "C") "_" (var "s") ",")))
43427 (entry (% (heading))
43428 (para (code "GL_SRC_ALPHA")
43429 ", "
43430 (math (var "A") "_" (var "s") ",")))
43431 (entry (% (heading))
43432 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43433 ", "
43434 (math "1" "-" (var "A") "_" (var "s") ",")))
43435 (entry (% (heading (code "GL_TEXTUREn")))
43436 (para (code "GL_SRC_COLOR")
43437 ", "
43438 (math (var "C") "_" (var "s") ",")))
43439 (entry (% (heading))
43440 (para (code "GL_ONE_MINUS_SRC_COLOR")
43441 ", "
43442 (math "1" "-" (var "C") "_" (var "s") ",")))
43443 (entry (% (heading))
43444 (para (code "GL_SRC_ALPHA")
43445 ", "
43446 (math (var "A") "_" (var "s") ",")))
43447 (entry (% (heading))
43448 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43449 ", "
43450 (math "1" "-" (var "A") "_" (var "s") ",")))
43451 (entry (% (heading (code "GL_CONSTANT")))
43452 (para (code "GL_SRC_COLOR")
43453 ", "
43454 (math (var "C") "_" (var "c") ",")))
43455 (entry (% (heading))
43456 (para (code "GL_ONE_MINUS_SRC_COLOR")
43457 ", "
43458 (math "1" "-" (var "C") "_" (var "c") ",")))
43459 (entry (% (heading))
43460 (para (code "GL_SRC_ALPHA")
43461 ", "
43462 (math (var "A") "_" (var "c") ",")))
43463 (entry (% (heading))
43464 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43465 ", "
43466 (math "1" "-" (var "A") "_" (var "c") ",")))
43467 (entry (% (heading (code "GL_PRIMARY_COLOR")))
43468 (para (code "GL_SRC_COLOR")
43469 ", "
43470 (math (var "C") "_" (var "f") ",")))
43471 (entry (% (heading))
43472 (para (code "GL_ONE_MINUS_SRC_COLOR")
43473 ", "
43474 (math "1" "-" (var "C") "_" (var "f") ",")))
43475 (entry (% (heading))
43476 (para (code "GL_SRC_ALPHA")
43477 ", "
43478 (math (var "A") "_" (var "f") ",")))
43479 (entry (% (heading))
43480 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43481 ", "
43482 (math "1" "-" (var "A") "_" (var "f") ",")))
43483 (entry (% (heading (code "GL_PREVIOUS")))
43484 (para (code "GL_SRC_COLOR")
43485 ", "
43486 (math (var "C") "_" (var "p") ",")))
43487 (entry (% (heading))
43488 (para (code "GL_ONE_MINUS_SRC_COLOR")
43489 ", "
43490 (math "1" "-" (var "C") "_" (var "p") ",")))
43491 (entry (% (heading))
43492 (para (code "GL_SRC_ALPHA")
43493 ", "
43494 (math (var "A") "_" (var "p") ",")))
43495 (entry (% (heading))
43496 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43497 ", "
43498 (math "1" "-" (var "A") "_" (var "p") ","))))
43499 (para "
43500 For "
43501 (code "GL_TEXTUREn")
43502 " sources, "
43503 (math (var "C") "_" (var "s"))
43504 "
43505 and "
43506 (math (var "A") "_" (var "s"))
43507 "
43508 represent the color
43509 and alpha, respectively, produced from texture stage "
43510 (math (var "n"))
43511 ". ")
43512 (para "
43513 The follow table describes the values assigned to "
43514 (math (var "Arg0"))
43515 ", "
43516 (math (var "Arg1"))
43517 ",
43518 and "
43519 (math (var "Arg2"))
43520 "
43521 based upon the alpha sources and operands: ")
43522 (para)
43523 (table (% (formatter (asis)))
43524 (entry (% (heading (strong (code "GL_SRCn_ALPHA"))))
43525 (para (strong (code "GL_OPERANDn_ALPHA"))
43526 ", "
43527 (strong "Argument Value")))
43528 (entry (% (heading (code "GL_TEXTURE")))
43529 (para (code "GL_SRC_ALPHA")
43530 ", "
43531 (math (var "A") "_" (var "s") ",")))
43532 (entry (% (heading))
43533 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43534 ", "
43535 (math "1" "-" (var "A") "_" (var "s") ",")))
43536 (entry (% (heading (code "GL_TEXTUREn")))
43537 (para (code "GL_SRC_ALPHA")
43538 ", "
43539 (math (var "A") "_" (var "s") ",")))
43540 (entry (% (heading))
43541 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43542 ", "
43543 (math "1" "-" (var "A") "_" (var "s") ",")))
43544 (entry (% (heading (code "GL_CONSTANT")))
43545 (para (code "GL_SRC_ALPHA")
43546 ", "
43547 (math (var "A") "_" (var "c") ",")))
43548 (entry (% (heading))
43549 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43550 ", "
43551 (math "1" "-" (var "A") "_" (var "c") ",")))
43552 (entry (% (heading (code "GL_PRIMARY_COLOR")))
43553 (para (code "GL_SRC_ALPHA")
43554 ", "
43555 (math (var "A") "_" (var "f") ",")))
43556 (entry (% (heading))
43557 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43558 ", "
43559 (math "1" "-" (var "A") "_" (var "f") ",")))
43560 (entry (% (heading (code "GL_PREVIOUS")))
43561 (para (code "GL_SRC_ALPHA")
43562 ", "
43563 (math (var "A") "_" (var "p") ",")))
43564 (entry (% (heading))
43565 (para (code "GL_ONE_MINUS_SRC_ALPHA")
43566 ", "
43567 (math "1" "-" (var "A") "_" (var "p") ","))))
43568 (para "
43569 The RGB and alpha results of the texture function are multipled by the
43570 values of "
43571 (code "GL_RGB_SCALE")
43572 " and "
43573 (code "GL_ALPHA_SCALE")
43574 ", respectively, and
43575 clamped to the range "
43576 (math "[" "0" "," "1" "]")
43577 ". ")
43578 (para "
43579 If "
43580 (var "pname")
43581 " is "
43582 (code "GL_TEXTURE_ENV_COLOR")
43583 ", "
43584 (var "params")
43585 " is a pointer to an array that holds an RGBA color consisting of four
43586 values.
43587 Integer color components are interpreted linearly such that the most
43588 positive integer maps to 1.0,
43589 and the most negative integer maps to -1.0.
43590 The values are clamped to the range [0,1] when they are specified. "
43591 (math (var "C") "_" (var "c"))
43592 "
43593 takes these four values. ")
43594 (para "
43595 If "
43596 (var "pname")
43597 " is "
43598 (code "GL_TEXTURE_LOD_BIAS")
43599 ", the value specified is added to the
43600 texture level-of-detail parameter, that selects which mipmap, or mipmaps
43601 depending upon the selected "
43602 (code "GL_TEXTURE_MIN_FILTER")
43603 ", will be sampled. ")
43604 (para (code "GL_TEXTURE_ENV_MODE")
43605 " defaults to "
43606 (code "GL_MODULATE")
43607 " and "
43608 (code "GL_TEXTURE_ENV_COLOR")
43609 " defaults to (0, 0, 0, 0). ")
43610 (para "
43611 If "
43612 (var "target")
43613 " is "
43614 (code "GL_POINT_SPRITE")
43615 " and "
43616 (var "pname")
43617 " is "
43618 (code "GL_COORD_REPLACE")
43619 ", the boolean value specified
43620 is used to either enable or disable point sprite texture coordinate replacement. The default value is "
43621 (code "GL_FALSE")
43622 ". ")
43623 (heading "Errors")
43624 (para (code "GL_INVALID_ENUM")
43625 " is generated when "
43626 (var "target")
43627 " or "
43628 (var "pname")
43629 " is not
43630 one of the accepted defined values,
43631 or when "
43632 (var "params")
43633 " should have a defined constant value
43634 (based on the value of "
43635 (var "pname")
43636 ")
43637 and does not. ")
43638 (para (code "GL_INVALID_VALUE")
43639 " is generated if the "
43640 (var "params")
43641 " value for "
43642 (code "GL_RGB_SCALE")
43643 " or "
43644 (code "GL_ALPHA_SCALE")
43645 " are not one of 1.0, 2.0,
43646 or 4.0. ")
43647 (para (code "GL_INVALID_OPERATION")
43648 " is generated if "
43649 (code "glTexEnv")
43650 "
43651 is executed between the execution of "
43652 (code "glBegin")
43653 "
43654 and the corresponding execution of "
43655 (code "glEnd")
43656 ". ")))
43657
43658 (define-gl-procedure
43659 glTexGen
43660 "glTexGen"
43661 (funcsynopsis
43662 (funcprototype
43663 (funcdef "void " (function "glTexGeni"))
43664 (paramdef "GLenum " (parameter "coord"))
43665 (paramdef "GLenum " (parameter "pname"))
43666 (paramdef "GLint " (parameter "param"))))
43667 '(*fragment*
43668 (heading
43669 "control the generation of texture coordinates")
43670 (heading "Parameters")
43671 (table (% (formatter (asis)))
43672 (entry (% (heading (var "coord")))
43673 (para "
43674 Specifies a texture coordinate.
43675 Must be one of "
43676 (code "GL_S")
43677 ", "
43678 (code "GL_T")
43679 ", "
43680 (code "GL_R")
43681 ", or "
43682 (code "GL_Q")
43683 ". "))
43684 (entry (% (heading (var "pname")))
43685 (para "
43686 Specifies the symbolic name of the texture-coordinate generation function.
43687 Must be "
43688 (code "GL_TEXTURE_GEN_MODE")
43689 ". "))
43690 (entry (% (heading (var "param")))
43691 (para "
43692 Specifies a single-valued texture generation parameter,
43693 one of "
43694 (code "GL_OBJECT_LINEAR")
43695 ", "
43696 (code "GL_EYE_LINEAR")
43697 ", "
43698 (code "GL_SPHERE_MAP")
43699 ", "
43700 (code "GL_NORMAL_MAP")
43701 ", or "
43702 (code "GL_REFLECTION_MAP")
43703 ". ")))
43704 (heading "Description")
43705 (para (code "glTexGen")
43706 " selects a texture-coordinate generation function
43707 or supplies coefficients for one of the functions. "
43708 (var "coord")
43709 " names one of the ("
43710 (var "s")
43711 ", "
43712 (var "t")
43713 ", "
43714 (var "r")
43715 ", "
43716 (var "q")
43717 ") texture
43718 coordinates; it must be one of the symbols "
43719 (code "GL_S")
43720 ", "
43721 (code "GL_T")
43722 ", "
43723 (code "GL_R")
43724 ", or "
43725 (code "GL_Q")
43726 ". "
43727 (var "pname")
43728 " must be one of three symbolic constants: "
43729 (code "GL_TEXTURE_GEN_MODE")
43730 ", "
43731 (code "GL_OBJECT_PLANE")
43732 ", or "
43733 (code "GL_EYE_PLANE")
43734 ".
43735 If "
43736 (var "pname")
43737 " is "
43738 (code "GL_TEXTURE_GEN_MODE")
43739 ",
43740 then "
43741 (var "params")
43742 " chooses a mode,
43743 one of "
43744 (code "GL_OBJECT_LINEAR")
43745 ", "
43746 (code "GL_EYE_LINEAR")
43747 ", "
43748 (code "GL_SPHERE_MAP")
43749 ", "
43750 (code "GL_NORMAL_MAP")
43751 ", or "
43752 (code "GL_REFLECTION_MAP")
43753 ".
43754 If "
43755 (var "pname")
43756 " is either "
43757 (code "GL_OBJECT_PLANE")
43758 " or "
43759 (code "GL_EYE_PLANE")
43760 ", "
43761 (var "params")
43762 " contains coefficients for the corresponding
43763 texture generation function. ")
43764 (para "
43765 If the texture generation function is "
43766 (code "GL_OBJECT_LINEAR")
43767 ",
43768 the function ")
43769 (para (math (var "g")
43770 "="
43771 (var "p")
43772 "_"
43773 "1"
43774 "×"
43775 (var "x")
43776 "_"
43777 (var "o")
43778 "+"
43779 (var "p")
43780 "_"
43781 "2"
43782 "×"
43783 (var "y")
43784 "_"
43785 (var "o")
43786 "+"
43787 (var "p")
43788 "_"
43789 "3"
43790 "×"
43791 (var "z")
43792 "_"
43793 (var "o")
43794 "+"
43795 (var "p")
43796 "_"
43797 "4"
43798 "×"
43799 (var "w")
43800 "_"
43801 (var "o")))
43802 (para "
43803 is used, where "
43804 (math (var "g"))
43805 "
43806 is the value computed for the coordinate named in "
43807 (var "coord")
43808 ", "
43809 (math (var "p") "_" "1")
43810 ", "
43811 (math (var "p") "_" "2")
43812 ", "
43813 (math (var "p") "_" "3")
43814 ",
43815 and "
43816 (math (var "p") "_" "4")
43817 "
43818 are the four values supplied in "
43819 (var "params")
43820 ", and "
43821 (math (var "x") "_" (var "o"))
43822 ", "
43823 (math (var "y") "_" (var "o"))
43824 ", "
43825 (math (var "z") "_" (var "o"))
43826 ",
43827 and "
43828 (math (var "w") "_" (var "o"))
43829 "
43830 are the object coordinates of the vertex.
43831 This function can be used, for example, to texture-map terrain using sea level
43832 as a reference plane
43833 (defined by "
43834 (math (var "p") "_" "1")
43835 ", "
43836 (math (var "p") "_" "2")
43837 ", "
43838 (math (var "p") "_" "3")
43839 ",
43840 and "
43841 (math (var "p") "_" "4")
43842 ").
43843 The altitude of a terrain vertex is computed by the "
43844 (code "GL_OBJECT_LINEAR")
43845 "
43846 coordinate generation function as its distance from sea level;
43847 that altitude can then be used to index the texture image to map white snow
43848 onto peaks and green grass onto foothills. ")
43849 (para "
43850 If the texture generation function is "
43851 (code "GL_EYE_LINEAR")
43852 ", the function ")
43853 (para (math (var "g")
43854 "="
43855 (var "p")
43856 "_"
43857 "1"
43858 ","
43859 "^"
43860 "″"
43861 "×"
43862 (var "x")
43863 "_"
43864 (var "e")
43865 "+"
43866 (var "p")
43867 "_"
43868 "2"
43869 ","
43870 "^"
43871 "″"
43872 "×"
43873 (var "y")
43874 "_"
43875 (var "e")
43876 "+"
43877 (var "p")
43878 "_"
43879 "3"
43880 ","
43881 "^"
43882 "″"
43883 "×"
43884 (var "z")
43885 "_"
43886 (var "e")
43887 "+"
43888 (var "p")
43889 "_"
43890 "4"
43891 ","
43892 "^"
43893 "″"
43894 "×"
43895 (var "w")
43896 "_"
43897 (var "e")))
43898 (para "
43899 is used, where ")
43900 (para (math "("
43901 (var "p")
43902 "_"
43903 "1"
43904 ","
43905 "^"
43906 "″"
43907 "\u2062"
43908 (var "p")
43909 "_"
43910 "2"
43911 ","
43912 "^"
43913 "″"
43914 "\u2062"
43915 (var "p")
43916 "_"
43917 "3"
43918 ","
43919 "^"
43920 "″"
43921 "\u2062"
43922 (var "p")
43923 "_"
43924 "4"
43925 ","
43926 "^"
43927 "″"
43928 ","
43929 ")"
43930 "="
43931 "("
43932 (var "p")
43933 "_"
43934 "1"
43935 "\u2062"
43936 (var "p")
43937 "_"
43938 "2"
43939 "\u2062"
43940 (var "p")
43941 "_"
43942 "3"
43943 "\u2062"
43944 (var "p")
43945 "_"
43946 "4"
43947 ","
43948 ")"
43949 "\u2062"
43950 (var "M")
43951 "^"
43952 "-1"))
43953 (para "
43954 and "
43955 (math (var "x") "_" (var "e"))
43956 ", "
43957 (math (var "y") "_" (var "e"))
43958 ", "
43959 (math (var "z") "_" (var "e"))
43960 ",
43961 and "
43962 (math (var "w") "_" (var "e"))
43963 "
43964 are the eye coordinates of the vertex, "
43965 (math (var "p") "_" "1")
43966 ", "
43967 (math (var "p") "_" "2")
43968 ", "
43969 (math (var "p") "_" "3")
43970 ",
43971 and "
43972 (math (var "p") "_" "4")
43973 "
43974 are the values supplied in "
43975 (var "params")
43976 ", and "
43977 (math (var "M"))
43978 "
43979 is the modelview matrix when "
43980 (code "glTexGen")
43981 " is invoked.
43982 If "
43983 (math (var "M"))
43984 "
43985 is poorly conditioned or singular,
43986 texture coordinates generated by the resulting function may be inaccurate
43987 or undefined. ")
43988 (para "
43989 Note that the values in "
43990 (var "params")
43991 " define a reference plane in eye coordinates.
43992 The modelview matrix that is applied to them may not be the same one
43993 in effect when the polygon vertices are transformed.
43994 This function establishes a field of texture coordinates
43995 that can produce dynamic contour lines on moving objects. ")
43996 (para "
43997 If the texture generation function is "
43998 (code "GL_SPHERE_MAP")
43999 " and "
44000 (var "coord")
44001 " is either "
44002 (code "GL_S")
44003 " or "
44004 (code "GL_T")
44005 ", "
44006 (math (var "s"))
44007 "
44008 and "
44009 (math (var "t"))
44010 "
44011 texture coordinates are generated as follows.
44012 Let "
44013 (var "u")
44014 " be the unit vector pointing from the origin to the polygon vertex
44015 (in eye coordinates).
44016 Let "
44017 (var "n")
44018 " sup prime be the current normal,
44019 after transformation to eye coordinates.
44020 Let ")
44021 (para (math (var "f")
44022 "="
44023 "("
44024 (var "f")
44025 "_"
44026 (var "x")
44027 "\u2062"
44028 (var "f")
44029 "_"
44030 (var "y")
44031 "\u2062"
44032 (var "f")
44033 "_"
44034 (var "z")
44035 ","
44036 ")"
44037 "^"
44038 (var "T"))
44039 "
44040 be the reflection vector such that ")
44041 (para (math (var "f")
44042 "="
44043 (var "u")
44044 "-"
44045 "2"
44046 "\u2062"
44047 (var "n")
44048 "^"
44049 "″"
44050 "\u2062"
44051 (var "n")
44052 "^"
44053 "″"
44054 ","
44055 "^"
44056 (var "T")
44057 "\u2062"
44058 (var "u")))
44059 (para "
44060 Finally, let "
44061 (math (var "m")
44062 "="
44063 "2"
44064 "\u2062"
44065 "√"
44066 "("
44067 (var "f")
44068 "_"
44069 (var "x")
44070 ","
44071 "^"
44072 "2"
44073 "+"
44074 (var "f")
44075 "_"
44076 (var "y")
44077 ","
44078 "^"
44079 "2"
44080 "+"
44081 "("
44082 (var "f")
44083 "_"
44084 (var "z")
44085 "+"
44086 "1"
44087 ","
44088 ")"
44089 "^"
44090 "2"
44091 ","
44092 ")")
44093 ".
44094 Then the values assigned to the "
44095 (math (var "s"))
44096 "
44097 and "
44098 (math (var "t"))
44099 "
44100 texture coordinates are ")
44101 (para (math (var "s")
44102 "="
44103 (var "f")
44104 "_"
44105 (var "x")
44106 "/"
44107 (var "m")
44108 "+"
44109 "1"
44110 "/"
44111 "2"))
44112 (para (math (var "t")
44113 "="
44114 (var "f")
44115 "_"
44116 (var "y")
44117 "/"
44118 (var "m")
44119 "+"
44120 "1"
44121 "/"
44122 "2"))
44123 (para "
44124 To enable or disable a texture-coordinate generation function, call "
44125 (code "glEnable")
44126 " or "
44127 (code "glDisable")
44128 "
44129 with one of the symbolic texture-coordinate names
44130 ("
44131 (code "GL_TEXTURE_GEN_S")
44132 ", "
44133 (code "GL_TEXTURE_GEN_T")
44134 ", "
44135 (code "GL_TEXTURE_GEN_R")
44136 ", or "
44137 (code "GL_TEXTURE_GEN_Q")
44138 ") as the argument.
44139 When enabled,
44140 the specified texture coordinate is computed
44141 according to the generating function associated with that coordinate.
44142 When disabled,
44143 subsequent vertices take the specified texture coordinate
44144 from the current set of texture coordinates. Initially, all texture
44145 generation functions are set to "
44146 (code "GL_EYE_LINEAR")
44147 " and are disabled.
44148 Both "
44149 (math (var "s"))
44150 "
44151 plane equations are (1, 0, 0, 0),
44152 both "
44153 (math (var "t"))
44154 "
44155 plane equations are (0, 1, 0, 0),
44156 and all "
44157 (math (var "r"))
44158 "
44159 and "
44160 (math (var "q"))
44161 "
44162 plane equations are (0, 0, 0, 0). ")
44163 (para "
44164 When the "
44165 (code "ARB_multitexture")
44166 " extension is supported, "
44167 (code "glTexGen")
44168 " sets the
44169 texture generation parameters for the currently active texture unit,
44170 selected with "
44171 (code "glActiveTexture")
44172 ". ")
44173 (heading "Errors")
44174 (para (code "GL_INVALID_ENUM")
44175 " is generated when "
44176 (var "coord")
44177 " or "
44178 (var "pname")
44179 " is not an
44180 accepted defined value,
44181 or when "
44182 (var "pname")
44183 " is "
44184 (code "GL_TEXTURE_GEN_MODE")
44185 " and "
44186 (var "params")
44187 " is not an
44188 accepted defined value. ")
44189 (para (code "GL_INVALID_ENUM")
44190 " is generated when "
44191 (var "pname")
44192 " is "
44193 (code "GL_TEXTURE_GEN_MODE")
44194 ", "
44195 (var "params")
44196 " is "
44197 (code "GL_SPHERE_MAP")
44198 ",
44199 and "
44200 (var "coord")
44201 " is either "
44202 (code "GL_R")
44203 " or "
44204 (code "GL_Q")
44205 ". ")
44206 (para (code "GL_INVALID_OPERATION")
44207 " is generated if "
44208 (code "glTexGen")
44209 "
44210 is executed between the execution of "
44211 (code "glBegin")
44212 "
44213 and the corresponding execution of "
44214 (code "glEnd")
44215 ". ")))
44216
44217 (define-gl-procedure
44218 glTexImage1D
44219 "glTexImage1D"
44220 (funcsynopsis
44221 (funcprototype
44222 (funcdef "void " (function "glTexImage1D"))
44223 (paramdef "GLenum " (parameter "target"))
44224 (paramdef "GLint " (parameter "level"))
44225 (paramdef "GLint " (parameter "internalFormat"))
44226 (paramdef "GLsizei " (parameter "width"))
44227 (paramdef "GLint " (parameter "border"))
44228 (paramdef "GLenum " (parameter "format"))
44229 (paramdef "GLenum " (parameter "type"))
44230 (paramdef "const GLvoid * " (parameter "data"))))
44231 '(*fragment*
44232 (heading
44233 "specify a one-dimensional texture image")
44234 (heading "Parameters")
44235 (table (% (formatter (asis)))
44236 (entry (% (heading (var "target")))
44237 (para "
44238 Specifies the target texture.
44239 Must be "
44240 (code "GL_TEXTURE_1D")
44241 " or "
44242 (code "GL_PROXY_TEXTURE_1D")
44243 ". "))
44244 (entry (% (heading (var "level")))
44245 (para "
44246 Specifies the level-of-detail number.
44247 Level 0 is the base image level.
44248 Level "
44249 (var "n")
44250 " is the "
44251 (var "n")
44252 "th mipmap reduction image. "))
44253 (entry (% (heading (var "internalFormat")))
44254 (para "
44255 Specifies the number of color components in the texture.
44256 Must be 1, 2, 3, or 4, or one of the following symbolic constants: "
44257 (code "GL_ALPHA")
44258 ", "
44259 (code "GL_ALPHA4")
44260 ", "
44261 (code "GL_ALPHA8")
44262 ", "
44263 (code "GL_ALPHA12")
44264 ", "
44265 (code "GL_ALPHA16")
44266 ", "
44267 (code "GL_COMPRESSED_ALPHA")
44268 ", "
44269 (code "GL_COMPRESSED_LUMINANCE")
44270 ", "
44271 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
44272 ", "
44273 (code "GL_COMPRESSED_INTENSITY")
44274 ", "
44275 (code "GL_COMPRESSED_RGB")
44276 ", "
44277 (code "GL_COMPRESSED_RGBA")
44278 ", "
44279 (code "GL_DEPTH_COMPONENT")
44280 ", "
44281 (code "GL_DEPTH_COMPONENT16")
44282 ", "
44283 (code "GL_DEPTH_COMPONENT24")
44284 ", "
44285 (code "GL_DEPTH_COMPONENT32")
44286 ", "
44287 (code "GL_LUMINANCE")
44288 ", "
44289 (code "GL_LUMINANCE4")
44290 ", "
44291 (code "GL_LUMINANCE8")
44292 ", "
44293 (code "GL_LUMINANCE12")
44294 ", "
44295 (code "GL_LUMINANCE16")
44296 ", "
44297 (code "GL_LUMINANCE_ALPHA")
44298 ", "
44299 (code "GL_LUMINANCE4_ALPHA4")
44300 ", "
44301 (code "GL_LUMINANCE6_ALPHA2")
44302 ", "
44303 (code "GL_LUMINANCE8_ALPHA8")
44304 ", "
44305 (code "GL_LUMINANCE12_ALPHA4")
44306 ", "
44307 (code "GL_LUMINANCE12_ALPHA12")
44308 ", "
44309 (code "GL_LUMINANCE16_ALPHA16")
44310 ", "
44311 (code "GL_INTENSITY")
44312 ", "
44313 (code "GL_INTENSITY4")
44314 ", "
44315 (code "GL_INTENSITY8")
44316 ", "
44317 (code "GL_INTENSITY12")
44318 ", "
44319 (code "GL_INTENSITY16")
44320 ", "
44321 (code "GL_R3_G3_B2")
44322 ", "
44323 (code "GL_RGB")
44324 ", "
44325 (code "GL_RGB4")
44326 ", "
44327 (code "GL_RGB5")
44328 ", "
44329 (code "GL_RGB8")
44330 ", "
44331 (code "GL_RGB10")
44332 ", "
44333 (code "GL_RGB12")
44334 ", "
44335 (code "GL_RGB16")
44336 ", "
44337 (code "GL_RGBA")
44338 ", "
44339 (code "GL_RGBA2")
44340 ", "
44341 (code "GL_RGBA4")
44342 ", "
44343 (code "GL_RGB5_A1")
44344 ", "
44345 (code "GL_RGBA8")
44346 ", "
44347 (code "GL_RGB10_A2")
44348 ", "
44349 (code "GL_RGBA12")
44350 ", "
44351 (code "GL_RGBA16")
44352 ", "
44353 (code "GL_SLUMINANCE")
44354 ", "
44355 (code "GL_SLUMINANCE8")
44356 ", "
44357 (code "GL_SLUMINANCE_ALPHA")
44358 ", "
44359 (code "GL_SLUMINANCE8_ALPHA8")
44360 ", "
44361 (code "GL_SRGB")
44362 ", "
44363 (code "GL_SRGB8")
44364 ", "
44365 (code "GL_SRGB_ALPHA")
44366 ", or "
44367 (code "GL_SRGB8_ALPHA8")
44368 ". "))
44369 (entry (% (heading (var "width")))
44370 (para "
44371 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
44372 (math "2"
44373 "^"
44374 (var "n")
44375 "+"
44376 "2"
44377 "\u2061"
44378 "("
44379 (var "border")
44380 ","
44381 ")")
44382 "
44383 for some integer "
44384 (math (var "n"))
44385 ".
44386 All
44387 implementations support texture images that are at least 64 texels
44388 wide. The height of the 1D texture image is 1. "))
44389 (entry (% (heading (var "border")))
44390 (para "
44391 Specifies the width of the border.
44392 Must be either 0 or 1. "))
44393 (entry (% (heading (var "format")))
44394 (para "
44395 Specifies the format of the pixel data.
44396 The following symbolic values are accepted: "
44397 (code "GL_COLOR_INDEX")
44398 ", "
44399 (code "GL_RED")
44400 ", "
44401 (code "GL_GREEN")
44402 ", "
44403 (code "GL_BLUE")
44404 ", "
44405 (code "GL_ALPHA")
44406 ", "
44407 (code "GL_RGB")
44408 ", "
44409 (code "GL_BGR")
44410 ", "
44411 (code "GL_RGBA")
44412 ", "
44413 (code "GL_BGRA")
44414 ", "
44415 (code "GL_LUMINANCE")
44416 ", and "
44417 (code "GL_LUMINANCE_ALPHA")
44418 ". "))
44419 (entry (% (heading (var "type")))
44420 (para "
44421 Specifies the data type of the pixel data.
44422 The following symbolic values are accepted: "
44423 (code "GL_UNSIGNED_BYTE")
44424 ", "
44425 (code "GL_BYTE")
44426 ", "
44427 (code "GL_BITMAP")
44428 ", "
44429 (code "GL_UNSIGNED_SHORT")
44430 ", "
44431 (code "GL_SHORT")
44432 ", "
44433 (code "GL_UNSIGNED_INT")
44434 ", "
44435 (code "GL_INT")
44436 ", "
44437 (code "GL_FLOAT")
44438 ", "
44439 (code "GL_UNSIGNED_BYTE_3_3_2")
44440 ", "
44441 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
44442 ", "
44443 (code "GL_UNSIGNED_SHORT_5_6_5")
44444 ", "
44445 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
44446 ", "
44447 (code "GL_UNSIGNED_SHORT_4_4_4_4")
44448 ", "
44449 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
44450 ", "
44451 (code "GL_UNSIGNED_SHORT_5_5_5_1")
44452 ", "
44453 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
44454 ", "
44455 (code "GL_UNSIGNED_INT_8_8_8_8")
44456 ", "
44457 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
44458 ", "
44459 (code "GL_UNSIGNED_INT_10_10_10_2")
44460 ", and "
44461 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
44462 ". "))
44463 (entry (% (heading (var "data")))
44464 (para "
44465 Specifies a pointer to the image data in memory. ")))
44466 (heading "Description")
44467 (para "
44468 Texturing maps a portion of a specified texture image
44469 onto each graphical primitive for which texturing is enabled.
44470 To enable and disable one-dimensional texturing, call "
44471 (code "glEnable")
44472 "
44473 and "
44474 (code "glDisable")
44475 " with argument "
44476 (code "GL_TEXTURE_1D")
44477 ". ")
44478 (para "
44479 Texture images are defined with "
44480 (code "glTexImage1D")
44481 ".
44482 The arguments describe the parameters of the texture image,
44483 such as width,
44484 width of the border,
44485 level-of-detail number
44486 (see "
44487 (code "glTexParameter")
44488 "),
44489 and the internal resolution and format used to store the image.
44490 The last three arguments describe how the image is represented in
44491 memory; they are identical to the pixel formats used for "
44492 (code "glDrawPixels")
44493 ". ")
44494 (para "
44495 If "
44496 (var "target")
44497 " is "
44498 (code "GL_PROXY_TEXTURE_1D")
44499 ", no data is read from "
44500 (var "data")
44501 ", but
44502 all of the texture image state is recalculated, checked for
44503 consistency, and checked against the implementation's capabilities.
44504 If the implementation cannot handle a texture of the
44505 requested texture size, it sets all of the image state to 0,
44506 but does not generate an error (see "
44507 (code "glGetError")
44508 "). To query for an
44509 entire mipmap array, use an image array level greater than or equal to
44510 1. ")
44511 (para "
44512 If "
44513 (var "target")
44514 " is "
44515 (code "GL_TEXTURE_1D")
44516 ",
44517 data is read from "
44518 (var "data")
44519 " as a sequence of signed or unsigned bytes,
44520 shorts,
44521 or longs,
44522 or single-precision floating-point values,
44523 depending on "
44524 (var "type")
44525 ".
44526 These values are grouped into sets of one,
44527 two,
44528 three,
44529 or four values,
44530 depending on "
44531 (var "format")
44532 ",
44533 to form elements.
44534 If "
44535 (var "type")
44536 " is "
44537 (code "GL_BITMAP")
44538 ",
44539 the data is considered as a string of unsigned bytes
44540 (and "
44541 (var "format")
44542 " must be "
44543 (code "GL_COLOR_INDEX")
44544 ").
44545 Each data byte is treated as eight 1-bit elements,
44546 with bit ordering determined by "
44547 (code "GL_UNPACK_LSB_FIRST")
44548 "
44549 (see "
44550 (code "glPixelStore")
44551 "). ")
44552 (para "
44553 If a non-zero named buffer object is bound to the "
44554 (code "GL_PIXEL_UNPACK_BUFFER")
44555 " target
44556 (see "
44557 (code "glBindBuffer")
44558 ") while a texture image is
44559 specified, "
44560 (var "data")
44561 " is treated as a byte offset into the buffer object's data store. ")
44562 (para "
44563 The first element corresponds to the left end of the texture array.
44564 Subsequent elements progress left-to-right through the remaining texels
44565 in the texture array.
44566 The final element corresponds to the right end of the texture array. ")
44567 (para (var "format")
44568 " determines the composition of each element in "
44569 (var "data")
44570 ".
44571 It can assume one of these symbolic values: ")
44572 (table (% (formatter (asis)))
44573 (entry (% (heading (code "GL_COLOR_INDEX")))
44574 (para "
44575 Each element is a single value,
44576 a color index.
44577 The GL converts it to fixed point
44578 (with an unspecified number of zero bits to the right of the binary point),
44579 shifted left or right depending on the value and sign of "
44580 (code "GL_INDEX_SHIFT")
44581 ",
44582 and added to "
44583 (code "GL_INDEX_OFFSET")
44584 "
44585 (see "
44586 (code "glPixelTransfer")
44587 ").
44588 The resulting index is converted to a set of color components
44589 using the "
44590 (code "GL_PIXEL_MAP_I_TO_R")
44591 ", "
44592 (code "GL_PIXEL_MAP_I_TO_G")
44593 ", "
44594 (code "GL_PIXEL_MAP_I_TO_B")
44595 ", and "
44596 (code "GL_PIXEL_MAP_I_TO_A")
44597 " tables,
44598 and clamped to the range [0,1]. "))
44599 (entry (% (heading (code "GL_RED")))
44600 (para "
44601 Each element is a single red component.
44602 The GL converts it to floating point and assembles it into an RGBA element
44603 by attaching 0 for green and blue, and 1 for alpha.
44604 Each component is then multiplied by the signed scale factor "
44605 (code "GL_c_SCALE")
44606 ",
44607 added to the signed bias "
44608 (code "GL_c_BIAS")
44609 ",
44610 and clamped to the range [0,1]
44611 (see "
44612 (code "glPixelTransfer")
44613 "). "))
44614 (entry (% (heading (code "GL_GREEN")))
44615 (para "
44616 Each element is a single green component.
44617 The GL converts it to floating point and assembles it into an RGBA element
44618 by attaching 0 for red and blue, and 1 for alpha.
44619 Each component is then multiplied by the signed scale factor "
44620 (code "GL_c_SCALE")
44621 ",
44622 added to the signed bias "
44623 (code "GL_c_BIAS")
44624 ",
44625 and clamped to the range [0,1]
44626 (see "
44627 (code "glPixelTransfer")
44628 "). "))
44629 (entry (% (heading (code "GL_BLUE")))
44630 (para "
44631 Each element is a single blue component.
44632 The GL converts it to floating point and assembles it into an RGBA element
44633 by attaching 0 for red and green, and 1 for alpha.
44634 Each component is then multiplied by the signed scale factor "
44635 (code "GL_c_SCALE")
44636 ",
44637 added to the signed bias "
44638 (code "GL_c_BIAS")
44639 ",
44640 and clamped to the range [0,1]
44641 (see "
44642 (code "glPixelTransfer")
44643 "). "))
44644 (entry (% (heading (code "GL_ALPHA")))
44645 (para "
44646 Each element is a single alpha component.
44647 The GL converts it to floating point and assembles it into an RGBA element
44648 by attaching 0 for red, green, and blue.
44649 Each component is then multiplied by the signed scale factor "
44650 (code "GL_c_SCALE")
44651 ",
44652 added to the signed bias "
44653 (code "GL_c_BIAS")
44654 ",
44655 and clamped to the range [0,1]
44656 (see "
44657 (code "glPixelTransfer")
44658 "). "))
44659 (entry (% (heading (code "GL_INTENSITY")))
44660 (para "
44661 Each element is a single intensity value.
44662 The GL converts it to floating point,
44663 then assembles it into an RGBA element by replicating the intensity value
44664 three times for red, green, blue, and alpha.
44665 Each component is then multiplied by the signed scale factor "
44666 (code "GL_c_SCALE")
44667 ",
44668 added to the signed bias "
44669 (code "GL_c_BIAS")
44670 ",
44671 and clamped to the range [0,1]
44672 (see "
44673 (code "glPixelTransfer")
44674 "). "))
44675 (entry (% (heading (code "GL_RGB"))))
44676 (entry (% (heading (code "GL_BGR")))
44677 (para "
44678 Each element is an RGB triple.
44679 The GL converts it to floating point and assembles it into an RGBA element
44680 by attaching 1 for alpha.
44681 Each component is then multiplied by the signed scale factor "
44682 (code "GL_c_SCALE")
44683 ",
44684 added to the signed bias "
44685 (code "GL_c_BIAS")
44686 ",
44687 and clamped to the range [0,1]
44688 (see "
44689 (code "glPixelTransfer")
44690 "). "))
44691 (entry (% (heading (code "GL_RGBA"))))
44692 (entry (% (heading (code "GL_BGRA")))
44693 (para "
44694 Each element contains all four components.
44695 Each component is multiplied by the signed scale factor "
44696 (code "GL_c_SCALE")
44697 ",
44698 added to the signed bias "
44699 (code "GL_c_BIAS")
44700 ",
44701 and clamped to the range [0,1]
44702 (see "
44703 (code "glPixelTransfer")
44704 "). "))
44705 (entry (% (heading (code "GL_LUMINANCE")))
44706 (para "
44707 Each element is a single luminance value.
44708 The GL converts it to floating point,
44709 then assembles it into an RGBA element by replicating the luminance value
44710 three times for red, green, and blue and attaching 1 for alpha.
44711 Each component is then multiplied by the signed scale factor "
44712 (code "GL_c_SCALE")
44713 ",
44714 added to the signed bias "
44715 (code "GL_c_BIAS")
44716 ",
44717 and clamped to the range [0,1]
44718 (see "
44719 (code "glPixelTransfer")
44720 "). "))
44721 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
44722 (para "
44723 Each element is a luminance/alpha pair.
44724 The GL converts it to floating point,
44725 then assembles it into an RGBA element by replicating the luminance value
44726 three times for red, green, and blue.
44727 Each component is then multiplied by the signed scale factor "
44728 (code "GL_c_SCALE")
44729 ",
44730 added to the signed bias "
44731 (code "GL_c_BIAS")
44732 ",
44733 and clamped to the range [0,1] (see "
44734 (code "glPixelTransfer")
44735 "). "))
44736 (entry (% (heading (code "GL_DEPTH_COMPONENT")))
44737 (para "
44738 Each element is a single depth value.
44739 The GL converts it to floating point, multiplies by the signed scale factor "
44740 (code "GL_DEPTH_SCALE")
44741 ", adds the signed bias "
44742 (code "GL_DEPTH_BIAS")
44743 ",
44744 and clamps to the range [0,1] (see "
44745 (code "glPixelTransfer")
44746 "). ")))
44747 (para "
44748 Refer to the "
44749 (code "glDrawPixels")
44750 " reference page for a description of
44751 the acceptable values for the "
44752 (var "type")
44753 " parameter. ")
44754 (para "
44755 If an application wants to store the texture at a certain
44756 resolution or in a certain format, it can request the resolution
44757 and format with "
44758 (var "internalFormat")
44759 ". The GL will choose an internal
44760 representation that closely approximates that requested by "
44761 (var "internalFormat")
44762 ", but
44763 it may not match exactly.
44764 (The representations specified by "
44765 (code "GL_LUMINANCE")
44766 ", "
44767 (code "GL_LUMINANCE_ALPHA")
44768 ", "
44769 (code "GL_RGB")
44770 ",
44771 and "
44772 (code "GL_RGBA")
44773 " must match exactly. The numeric values 1, 2, 3, and 4
44774 may also be used to specify the above representations.) ")
44775 (para "
44776 If the "
44777 (var "internalFormat")
44778 " parameter is one of the generic compressed formats,\t"
44779 (code "GL_COMPRESSED_ALPHA")
44780 ",\t"
44781 (code "GL_COMPRESSED_INTENSITY")
44782 ",\t"
44783 (code "GL_COMPRESSED_LUMINANCE")
44784 ",\t"
44785 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
44786 ",\t"
44787 (code "GL_COMPRESSED_RGB")
44788 ", or\t"
44789 (code "GL_COMPRESSED_RGBA")
44790 ", the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format. ")
44791 (para "
44792 If the "
44793 (var "internalFormat")
44794 " parameter is "
44795 (code "GL_SRGB")
44796 ",\t"
44797 (code "GL_SRGB8")
44798 ",\t"
44799 (code "GL_SRGB_ALPHA")
44800 ",\t"
44801 (code "GL_SRGB8_ALPHA8")
44802 ",\t"
44803 (code "GL_SLUMINANCE")
44804 ",\t"
44805 (code "GL_SLUMINANCE8")
44806 ",\t"
44807 (code "GL_SLUMINANCE_ALPHA")
44808 ", or\t"
44809 (code "GL_SLUMINANCE8_ALPHA8")
44810 ", the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component\t"
44811 (math (var "c") "_" (var "s"))
44812 "
44813 to a linear component\t"
44814 (math (var "c") "_" (var "l"))
44815 "
44816 is:\t")
44817 (para (math (var "c")
44818 "_"
44819 (var "l")
44820 "="
44821 "{"
44822 "("
44823 (var "c")
44824 "_"
44825 (var "s")
44826 "/"
44827 "12.92"
44828 " "
44829 " "
44830 "if"
44831 " "
44832 (var "c")
44833 "_"
44834 (var "s")
44835 "≤"
44836 "0.04045"
44837 ")"
44838 ", "
44839 "("
44840 "("
44841 (code "c")
44842 "_"
44843 (code "s")
44844 "+"
44845 "0.055"
44846 "/"
44847 "1.055"
44848 ")"
44849 "^"
44850 "2.4"
44851 " "
44852 " "
44853 "if"
44854 " "
44855 (var "c")
44856 "_"
44857 (var "s")
44858 ">"
44859 "0.04045"
44860 ")"))
44861 (para "
44862 Assume\t"
44863 (math (var "c") "_" (var "s"))
44864 "
44865 is the sRGB component in the range [0,1]. ")
44866 (para "
44867 Use the "
44868 (code "GL_PROXY_TEXTURE_1D")
44869 " target to try out a resolution and
44870 format. The implementation will
44871 update and recompute its best match for the requested storage resolution
44872 and format. To then query this state, call "
44873 (code "glGetTexLevelParameter")
44874 ".
44875 If the texture cannot be accommodated, texture state is set to 0. ")
44876 (para "
44877 A one-component texture image uses only the red component of the RGBA
44878 color from "
44879 (var "data")
44880 ".
44881 A two-component image uses the R and A values.
44882 A three-component image uses the R, G, and B values.
44883 A four-component image uses all of the RGBA components. ")
44884 (para "
44885 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to generate a boolean result. See "
44886 (code "glTexParameter")
44887 " for details on texture comparison. ")
44888 (heading "Errors")
44889 (para (code "GL_INVALID_ENUM")
44890 " is generated if "
44891 (var "target")
44892 " is not "
44893 (code "GL_TEXTURE_1D")
44894 "
44895 or "
44896 (code "GL_PROXY_TEXTURE_1D")
44897 ". ")
44898 (para (code "GL_INVALID_ENUM")
44899 " is generated if "
44900 (var "format")
44901 " is not an accepted
44902 format constant. Format constants other than "
44903 (code "GL_STENCIL_INDEX")
44904 "
44905 are accepted. ")
44906 (para (code "GL_INVALID_ENUM")
44907 " is generated if "
44908 (var "type")
44909 " is not a type constant. ")
44910 (para (code "GL_INVALID_ENUM")
44911 " is generated if "
44912 (var "type")
44913 " is "
44914 (code "GL_BITMAP")
44915 " and "
44916 (var "format")
44917 " is not "
44918 (code "GL_COLOR_INDEX")
44919 ". ")
44920 (para (code "GL_INVALID_VALUE")
44921 " is generated if "
44922 (var "level")
44923 " is less than 0. ")
44924 (para (code "GL_INVALID_VALUE")
44925 " may be generated if "
44926 (var "level")
44927 " is greater than "
44928 (math (var "log")
44929 "_"
44930 "2"
44931 "\u2061"
44932 "("
44933 (var "max")
44934 ","
44935 ")")
44936 ",
44937 where "
44938 (var "max")
44939 " is the returned value of "
44940 (code "GL_MAX_TEXTURE_SIZE")
44941 ". ")
44942 (para (code "GL_INVALID_VALUE")
44943 " is generated if "
44944 (var "internalFormat")
44945 " is not 1, 2, 3, 4, or
44946 one of the accepted resolution and format symbolic constants. ")
44947 (para (code "GL_INVALID_VALUE")
44948 " is generated if "
44949 (var "width")
44950 " is less than 0
44951 or greater than 2 + "
44952 (code "GL_MAX_TEXTURE_SIZE")
44953 ". ")
44954 (para (code "GL_INVALID_VALUE")
44955 " is generated if non-power-of-two textures are not supported and the "
44956 (var "width")
44957 " cannot be represented as\t"
44958 (math "2"
44959 "^"
44960 (var "n")
44961 "+"
44962 "2"
44963 "\u2061"
44964 "("
44965 (var "border")
44966 ","
44967 ")")
44968 "
44969 for some integer value of "
44970 (var "n")
44971 ". ")
44972 (para (code "GL_INVALID_VALUE")
44973 " is generated if "
44974 (var "border")
44975 " is not 0 or 1. ")
44976 (para (code "GL_INVALID_OPERATION")
44977 " is generated if "
44978 (var "type")
44979 " is one of "
44980 (code "GL_UNSIGNED_BYTE_3_3_2")
44981 ", "
44982 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
44983 ", "
44984 (code "GL_UNSIGNED_SHORT_5_6_5")
44985 ", or "
44986 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
44987 "
44988 and "
44989 (var "format")
44990 " is not "
44991 (code "GL_RGB")
44992 ". ")
44993 (para (code "GL_INVALID_OPERATION")
44994 " is generated if "
44995 (var "type")
44996 " is one of "
44997 (code "GL_UNSIGNED_SHORT_4_4_4_4")
44998 ", "
44999 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
45000 ", "
45001 (code "GL_UNSIGNED_SHORT_5_5_5_1")
45002 ", "
45003 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
45004 ", "
45005 (code "GL_UNSIGNED_INT_8_8_8_8")
45006 ", "
45007 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
45008 ", "
45009 (code "GL_UNSIGNED_INT_10_10_10_2")
45010 ", or "
45011 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
45012 "
45013 and "
45014 (var "format")
45015 " is neither "
45016 (code "GL_RGBA")
45017 " nor "
45018 (code "GL_BGRA")
45019 ". ")
45020 (para (code "GL_INVALID_OPERATION")
45021 " is generated if "
45022 (var "format")
45023 " is "
45024 (code "GL_DEPTH_COMPONENT")
45025 " and "
45026 (var "internalFormat")
45027 " is not "
45028 (code "GL_DEPTH_COMPONENT")
45029 ", "
45030 (code "GL_DEPTH_COMPONENT16")
45031 ", "
45032 (code "GL_DEPTH_COMPONENT24")
45033 ", or "
45034 (code "GL_DEPTH_COMPONENT32")
45035 ". ")
45036 (para (code "GL_INVALID_OPERATION")
45037 " is generated if "
45038 (var "internalFormat")
45039 " is "
45040 (code "GL_DEPTH_COMPONENT")
45041 ", "
45042 (code "GL_DEPTH_COMPONENT16")
45043 ", "
45044 (code "GL_DEPTH_COMPONENT24")
45045 ", or "
45046 (code "GL_DEPTH_COMPONENT32")
45047 ", and "
45048 (var "format")
45049 " is
45050 not "
45051 (code "GL_DEPTH_COMPONENT")
45052 ". ")
45053 (para (code "GL_INVALID_OPERATION")
45054 " is generated if a non-zero buffer object name is bound to the "
45055 (code "GL_PIXEL_UNPACK_BUFFER")
45056 " target and the buffer object's data store is currently mapped. ")
45057 (para (code "GL_INVALID_OPERATION")
45058 " is generated if a non-zero buffer object name is bound to the "
45059 (code "GL_PIXEL_UNPACK_BUFFER")
45060 " target and the data would be unpacked from the buffer
45061 object such that the memory reads required would exceed the data store size. ")
45062 (para (code "GL_INVALID_OPERATION")
45063 " is generated if a non-zero buffer object name is bound to the "
45064 (code "GL_PIXEL_UNPACK_BUFFER")
45065 " target and "
45066 (var "data")
45067 " is not evenly divisible
45068 into the number of bytes needed to store in memory a datum indicated by "
45069 (var "type")
45070 ". ")
45071 (para (code "GL_INVALID_OPERATION")
45072 " is generated if "
45073 (code "glTexImage1D")
45074 "
45075 is executed between the execution of "
45076 (code "glBegin")
45077 "
45078 and the corresponding execution of "
45079 (code "glEnd")
45080 ". ")))
45081
45082 (define-gl-procedure
45083 glTexImage2D
45084 "glTexImage2D"
45085 (funcsynopsis
45086 (funcprototype
45087 (funcdef "void " (function "glTexImage2D"))
45088 (paramdef "GLenum " (parameter "target"))
45089 (paramdef "GLint " (parameter "level"))
45090 (paramdef "GLint " (parameter "internalFormat"))
45091 (paramdef "GLsizei " (parameter "width"))
45092 (paramdef "GLsizei " (parameter "height"))
45093 (paramdef "GLint " (parameter "border"))
45094 (paramdef "GLenum " (parameter "format"))
45095 (paramdef "GLenum " (parameter "type"))
45096 (paramdef "const GLvoid * " (parameter "data"))))
45097 '(*fragment*
45098 (heading
45099 "specify a two-dimensional texture image")
45100 (heading "Parameters")
45101 (table (% (formatter (asis)))
45102 (entry (% (heading (var "target")))
45103 (para "
45104 Specifies the target texture.
45105 Must be "
45106 (code "GL_TEXTURE_2D")
45107 ", "
45108 (code "GL_PROXY_TEXTURE_2D")
45109 ", "
45110 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
45111 ", "
45112 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
45113 ", "
45114 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
45115 ", "
45116 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
45117 ", "
45118 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
45119 ", "
45120 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
45121 ", or "
45122 (code "GL_PROXY_TEXTURE_CUBE_MAP")
45123 ". "))
45124 (entry (% (heading (var "level")))
45125 (para "
45126 Specifies the level-of-detail number.
45127 Level 0 is the base image level.
45128 Level "
45129 (var "n")
45130 " is the "
45131 (var "n")
45132 "th mipmap reduction image. "))
45133 (entry (% (heading (var "internalFormat")))
45134 (para "
45135 Specifies the number of color components in the texture.
45136 Must be 1, 2, 3, or 4, or one of the following symbolic constants: "
45137 (code "GL_ALPHA")
45138 ", "
45139 (code "GL_ALPHA4")
45140 ", "
45141 (code "GL_ALPHA8")
45142 ", "
45143 (code "GL_ALPHA12")
45144 ", "
45145 (code "GL_ALPHA16")
45146 ", "
45147 (code "GL_COMPRESSED_ALPHA")
45148 ", "
45149 (code "GL_COMPRESSED_LUMINANCE")
45150 ", "
45151 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
45152 ", "
45153 (code "GL_COMPRESSED_INTENSITY")
45154 ", "
45155 (code "GL_COMPRESSED_RGB")
45156 ", "
45157 (code "GL_COMPRESSED_RGBA")
45158 ", "
45159 (code "GL_DEPTH_COMPONENT")
45160 ", "
45161 (code "GL_DEPTH_COMPONENT16")
45162 ", "
45163 (code "GL_DEPTH_COMPONENT24")
45164 ", "
45165 (code "GL_DEPTH_COMPONENT32")
45166 ", "
45167 (code "GL_LUMINANCE")
45168 ", "
45169 (code "GL_LUMINANCE4")
45170 ", "
45171 (code "GL_LUMINANCE8")
45172 ", "
45173 (code "GL_LUMINANCE12")
45174 ", "
45175 (code "GL_LUMINANCE16")
45176 ", "
45177 (code "GL_LUMINANCE_ALPHA")
45178 ", "
45179 (code "GL_LUMINANCE4_ALPHA4")
45180 ", "
45181 (code "GL_LUMINANCE6_ALPHA2")
45182 ", "
45183 (code "GL_LUMINANCE8_ALPHA8")
45184 ", "
45185 (code "GL_LUMINANCE12_ALPHA4")
45186 ", "
45187 (code "GL_LUMINANCE12_ALPHA12")
45188 ", "
45189 (code "GL_LUMINANCE16_ALPHA16")
45190 ", "
45191 (code "GL_INTENSITY")
45192 ", "
45193 (code "GL_INTENSITY4")
45194 ", "
45195 (code "GL_INTENSITY8")
45196 ", "
45197 (code "GL_INTENSITY12")
45198 ", "
45199 (code "GL_INTENSITY16")
45200 ", "
45201 (code "GL_R3_G3_B2")
45202 ", "
45203 (code "GL_RGB")
45204 ", "
45205 (code "GL_RGB4")
45206 ", "
45207 (code "GL_RGB5")
45208 ", "
45209 (code "GL_RGB8")
45210 ", "
45211 (code "GL_RGB10")
45212 ", "
45213 (code "GL_RGB12")
45214 ", "
45215 (code "GL_RGB16")
45216 ", "
45217 (code "GL_RGBA")
45218 ", "
45219 (code "GL_RGBA2")
45220 ", "
45221 (code "GL_RGBA4")
45222 ", "
45223 (code "GL_RGB5_A1")
45224 ", "
45225 (code "GL_RGBA8")
45226 ", "
45227 (code "GL_RGB10_A2")
45228 ", "
45229 (code "GL_RGBA12")
45230 ", "
45231 (code "GL_RGBA16")
45232 ", "
45233 (code "GL_SLUMINANCE")
45234 ", "
45235 (code "GL_SLUMINANCE8")
45236 ", "
45237 (code "GL_SLUMINANCE_ALPHA")
45238 ", "
45239 (code "GL_SLUMINANCE8_ALPHA8")
45240 ", "
45241 (code "GL_SRGB")
45242 ", "
45243 (code "GL_SRGB8")
45244 ", "
45245 (code "GL_SRGB_ALPHA")
45246 ", or "
45247 (code "GL_SRGB8_ALPHA8")
45248 ". "))
45249 (entry (% (heading (var "width")))
45250 (para "
45251 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
45252 (math "2"
45253 "^"
45254 (var "n")
45255 "+"
45256 "2"
45257 "\u2061"
45258 "("
45259 (var "border")
45260 ","
45261 ")")
45262 "
45263 for some integer "
45264 (math (var "n"))
45265 ".
45266 All
45267 implementations support texture images that are at least 64 texels
45268 wide. "))
45269 (entry (% (heading (var "height")))
45270 (para "
45271 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
45272 (math "2"
45273 "^"
45274 (var "m")
45275 "+"
45276 "2"
45277 "\u2061"
45278 "("
45279 (var "border")
45280 ","
45281 ")")
45282 "
45283 for some integer "
45284 (math (var "m"))
45285 ".
45286 All
45287 implementations support texture images that are at least 64 texels
45288 high. "))
45289 (entry (% (heading (var "border")))
45290 (para "
45291 Specifies the width of the border.
45292 Must be either 0 or 1. "))
45293 (entry (% (heading (var "format")))
45294 (para "
45295 Specifies the format of the pixel data.
45296 The following symbolic values are accepted: "
45297 (code "GL_COLOR_INDEX")
45298 ", "
45299 (code "GL_RED")
45300 ", "
45301 (code "GL_GREEN")
45302 ", "
45303 (code "GL_BLUE")
45304 ", "
45305 (code "GL_ALPHA")
45306 ", "
45307 (code "GL_RGB")
45308 ", "
45309 (code "GL_BGR")
45310 ", "
45311 (code "GL_RGBA")
45312 ", "
45313 (code "GL_BGRA")
45314 ", "
45315 (code "GL_LUMINANCE")
45316 ", and "
45317 (code "GL_LUMINANCE_ALPHA")
45318 ". "))
45319 (entry (% (heading (var "type")))
45320 (para "
45321 Specifies the data type of the pixel data.
45322 The following symbolic values are accepted: "
45323 (code "GL_UNSIGNED_BYTE")
45324 ", "
45325 (code "GL_BYTE")
45326 ", "
45327 (code "GL_BITMAP")
45328 ", "
45329 (code "GL_UNSIGNED_SHORT")
45330 ", "
45331 (code "GL_SHORT")
45332 ", "
45333 (code "GL_UNSIGNED_INT")
45334 ", "
45335 (code "GL_INT")
45336 ", "
45337 (code "GL_FLOAT")
45338 ", "
45339 (code "GL_UNSIGNED_BYTE_3_3_2")
45340 ", "
45341 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
45342 ", "
45343 (code "GL_UNSIGNED_SHORT_5_6_5")
45344 ", "
45345 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
45346 ", "
45347 (code "GL_UNSIGNED_SHORT_4_4_4_4")
45348 ", "
45349 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
45350 ", "
45351 (code "GL_UNSIGNED_SHORT_5_5_5_1")
45352 ", "
45353 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
45354 ", "
45355 (code "GL_UNSIGNED_INT_8_8_8_8")
45356 ", "
45357 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
45358 ", "
45359 (code "GL_UNSIGNED_INT_10_10_10_2")
45360 ", and "
45361 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
45362 ". "))
45363 (entry (% (heading (var "data")))
45364 (para "
45365 Specifies a pointer to the image data in memory. ")))
45366 (heading "Description")
45367 (para "
45368 Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable two-dimensional texturing, call "
45369 (code "glEnable")
45370 " and "
45371 (code "glDisable")
45372 " with argument "
45373 (code "GL_TEXTURE_2D")
45374 ". To enable and disable texturing using cube-mapped texture, call "
45375 (code "glEnable")
45376 " and "
45377 (code "glDisable")
45378 " with argument "
45379 (code "GL_TEXTURE_CUBE_MAP")
45380 ". ")
45381 (para "
45382 To define texture images, call "
45383 (code "glTexImage2D")
45384 ".
45385 The arguments describe the parameters of the texture image,
45386 such as height,
45387 width,
45388 width of the border,
45389 level-of-detail number
45390 (see "
45391 (code "glTexParameter")
45392 "),
45393 and number of color components provided.
45394 The last three arguments describe how the image is represented in memory;
45395 they are identical to the pixel formats used for "
45396 (code "glDrawPixels")
45397 ". ")
45398 (para "
45399 If "
45400 (var "target")
45401 " is "
45402 (code "GL_PROXY_TEXTURE_2D")
45403 " or "
45404 (code "GL_PROXY_TEXTURE_CUBE_MAP")
45405 ", no data is read from "
45406 (var "data")
45407 ", but
45408 all of the texture image state is recalculated, checked for
45409 consistency, and checked
45410 against the implementation's capabilities. If the implementation cannot
45411 handle a texture of the requested texture size, it sets
45412 all of the image state to 0,
45413 but does not generate an error (see "
45414 (code "glGetError")
45415 "). To query for an
45416 entire mipmap array, use an image array level greater than or equal to
45417 1. ")
45418 (para "
45419 If "
45420 (var "target")
45421 " is "
45422 (code "GL_TEXTURE_2D")
45423 ", or one of the "
45424 (code "GL_TEXTURE_CUBE_MAP")
45425 "
45426 targets, data is read from "
45427 (var "data")
45428 " as a sequence of signed or unsigned
45429 bytes, shorts, or longs, or single-precision floating-point values,
45430 depending on "
45431 (var "type")
45432 ". These values are grouped into sets of one, two,
45433 three, or four values, depending on "
45434 (var "format")
45435 ", to form elements. If "
45436 (var "type")
45437 "
45438 is "
45439 (code "GL_BITMAP")
45440 ", the data is considered as a string of unsigned bytes
45441 (and "
45442 (var "format")
45443 " must be "
45444 (code "GL_COLOR_INDEX")
45445 ").
45446 Each data byte is treated as eight 1-bit elements,
45447 with bit ordering determined by "
45448 (code "GL_UNPACK_LSB_FIRST")
45449 "
45450 (see "
45451 (code "glPixelStore")
45452 "). ")
45453 (para "
45454 If a non-zero named buffer object is bound to the "
45455 (code "GL_PIXEL_UNPACK_BUFFER")
45456 " target
45457 (see "
45458 (code "glBindBuffer")
45459 ") while a texture image is
45460 specified, "
45461 (var "data")
45462 " is treated as a byte offset into the buffer object's data store. ")
45463 (para "
45464 The first element corresponds to the lower left corner of the texture
45465 image.
45466 Subsequent elements progress left-to-right through the remaining texels
45467 in the lowest row of the texture image, and then in successively higher
45468 rows of the texture image.
45469 The final element corresponds to the upper right corner of the texture
45470 image. ")
45471 (para (var "format")
45472 " determines the composition of each element in "
45473 (var "data")
45474 ".
45475 It can assume one of these symbolic values: ")
45476 (table (% (formatter (asis)))
45477 (entry (% (heading (code "GL_COLOR_INDEX")))
45478 (para "
45479 Each element is a single value,
45480 a color index.
45481 The GL converts it to fixed point
45482 (with an unspecified number of zero bits to the right of the binary point),
45483 shifted left or right depending on the value and sign of "
45484 (code "GL_INDEX_SHIFT")
45485 ",
45486 and added to "
45487 (code "GL_INDEX_OFFSET")
45488 "
45489 (see "
45490 (code "glPixelTransfer")
45491 ").
45492 The resulting index is converted to a set of color components
45493 using the "
45494 (code "GL_PIXEL_MAP_I_TO_R")
45495 ", "
45496 (code "GL_PIXEL_MAP_I_TO_G")
45497 ", "
45498 (code "GL_PIXEL_MAP_I_TO_B")
45499 ", and "
45500 (code "GL_PIXEL_MAP_I_TO_A")
45501 " tables,
45502 and clamped to the range [0,1]. "))
45503 (entry (% (heading (code "GL_RED")))
45504 (para "
45505 Each element is a single red component.
45506 The GL converts it to floating point and assembles it into an RGBA element
45507 by attaching 0 for green and blue, and 1 for alpha.
45508 Each component is then multiplied by the signed scale factor "
45509 (code "GL_c_SCALE")
45510 ",
45511 added to the signed bias "
45512 (code "GL_c_BIAS")
45513 ",
45514 and clamped to the range [0,1]
45515 (see "
45516 (code "glPixelTransfer")
45517 "). "))
45518 (entry (% (heading (code "GL_GREEN")))
45519 (para "
45520 Each element is a single green component.
45521 The GL converts it to floating point and assembles it into an RGBA element
45522 by attaching 0 for red and blue, and 1 for alpha.
45523 Each component is then multiplied by the signed scale factor "
45524 (code "GL_c_SCALE")
45525 ",
45526 added to the signed bias "
45527 (code "GL_c_BIAS")
45528 ",
45529 and clamped to the range [0,1]
45530 (see "
45531 (code "glPixelTransfer")
45532 "). "))
45533 (entry (% (heading (code "GL_BLUE")))
45534 (para "
45535 Each element is a single blue component.
45536 The GL converts it to floating point and assembles it into an RGBA element
45537 by attaching 0 for red and green, and 1 for alpha.
45538 Each component is then multiplied by the signed scale factor "
45539 (code "GL_c_SCALE")
45540 ",
45541 added to the signed bias "
45542 (code "GL_c_BIAS")
45543 ",
45544 and clamped to the range [0,1]
45545 (see "
45546 (code "glPixelTransfer")
45547 "). "))
45548 (entry (% (heading (code "GL_ALPHA")))
45549 (para "
45550 Each element is a single alpha component.
45551 The GL converts it to floating point and assembles it into an RGBA element
45552 by attaching 0 for red, green, and blue.
45553 Each component is then multiplied by the signed scale factor "
45554 (code "GL_c_SCALE")
45555 ",
45556 added to the signed bias "
45557 (code "GL_c_BIAS")
45558 ",
45559 and clamped to the range [0,1]
45560 (see "
45561 (code "glPixelTransfer")
45562 "). "))
45563 (entry (% (heading (code "GL_INTENSITY")))
45564 (para "
45565 Each element is a single intensity value.
45566 The GL converts it to floating point,
45567 then assembles it into an RGBA element by replicating the intensity value
45568 three times for red, green, blue, and alpha.
45569 Each component is then multiplied by the signed scale factor "
45570 (code "GL_c_SCALE")
45571 ",
45572 added to the signed bias "
45573 (code "GL_c_BIAS")
45574 ",
45575 and clamped to the range [0,1]
45576 (see "
45577 (code "glPixelTransfer")
45578 "). "))
45579 (entry (% (heading (code "GL_RGB"))))
45580 (entry (% (heading (code "GL_BGR")))
45581 (para "
45582 Each element is an RGB triple.
45583 The GL converts it to floating point and assembles it into an RGBA element
45584 by attaching 1 for alpha.
45585 Each component is then multiplied by the signed scale factor "
45586 (code "GL_c_SCALE")
45587 ",
45588 added to the signed bias "
45589 (code "GL_c_BIAS")
45590 ",
45591 and clamped to the range [0,1]
45592 (see "
45593 (code "glPixelTransfer")
45594 "). "))
45595 (entry (% (heading (code "GL_RGBA"))))
45596 (entry (% (heading (code "GL_BGRA")))
45597 (para "
45598 Each element contains all four components.
45599 Each component is multiplied by the signed scale factor "
45600 (code "GL_c_SCALE")
45601 ",
45602 added to the signed bias "
45603 (code "GL_c_BIAS")
45604 ",
45605 and clamped to the range [0,1]
45606 (see "
45607 (code "glPixelTransfer")
45608 "). "))
45609 (entry (% (heading (code "GL_LUMINANCE")))
45610 (para "
45611 Each element is a single luminance value.
45612 The GL converts it to floating point,
45613 then assembles it into an RGBA element by replicating the luminance value
45614 three times for red, green, and blue and attaching 1 for alpha.
45615 Each component is then multiplied by the signed scale factor "
45616 (code "GL_c_SCALE")
45617 ",
45618 added to the signed bias "
45619 (code "GL_c_BIAS")
45620 ",
45621 and clamped to the range [0,1]
45622 (see "
45623 (code "glPixelTransfer")
45624 "). "))
45625 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
45626 (para "
45627 Each element is a luminance/alpha pair.
45628 The GL converts it to floating point,
45629 then assembles it into an RGBA element by replicating the luminance value
45630 three times for red, green, and blue.
45631 Each component is then multiplied by the signed scale factor "
45632 (code "GL_c_SCALE")
45633 ",
45634 added to the signed bias "
45635 (code "GL_c_BIAS")
45636 ",
45637 and clamped to the range [0,1] (see "
45638 (code "glPixelTransfer")
45639 "). "))
45640 (entry (% (heading (code "GL_DEPTH_COMPONENT")))
45641 (para "
45642 Each element is a single depth value.
45643 The GL converts it to floating point, multiplies by the signed scale factor "
45644 (code "GL_DEPTH_SCALE")
45645 ", adds the signed bias "
45646 (code "GL_DEPTH_BIAS")
45647 ",
45648 and clamps to the range [0,1] (see "
45649 (code "glPixelTransfer")
45650 "). ")))
45651 (para "
45652 Refer to the "
45653 (code "glDrawPixels")
45654 " reference page for a description of
45655 the acceptable values for the "
45656 (var "type")
45657 " parameter. ")
45658 (para "
45659 If an application wants to store the texture at a certain
45660 resolution or in a certain format, it can request the resolution
45661 and format with "
45662 (var "internalFormat")
45663 ". The GL will choose an internal
45664 representation that closely approximates that requested by "
45665 (var "internalFormat")
45666 ", but
45667 it may not match exactly.
45668 (The representations specified by "
45669 (code "GL_LUMINANCE")
45670 ", "
45671 (code "GL_LUMINANCE_ALPHA")
45672 ", "
45673 (code "GL_RGB")
45674 ",
45675 and "
45676 (code "GL_RGBA")
45677 " must match exactly. The numeric values 1, 2, 3, and 4
45678 may also be used to specify the above representations.) ")
45679 (para "
45680 If the "
45681 (var "internalFormat")
45682 " parameter is one of the generic compressed formats,\t"
45683 (code "GL_COMPRESSED_ALPHA")
45684 ",\t"
45685 (code "GL_COMPRESSED_INTENSITY")
45686 ",\t"
45687 (code "GL_COMPRESSED_LUMINANCE")
45688 ",\t"
45689 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
45690 ",\t"
45691 (code "GL_COMPRESSED_RGB")
45692 ", or\t"
45693 (code "GL_COMPRESSED_RGBA")
45694 ", the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format. ")
45695 (para "
45696 If the "
45697 (var "internalFormat")
45698 " parameter is "
45699 (code "GL_SRGB")
45700 ",\t"
45701 (code "GL_SRGB8")
45702 ",\t"
45703 (code "GL_SRGB_ALPHA")
45704 ",\t"
45705 (code "GL_SRGB8_ALPHA8")
45706 ",\t"
45707 (code "GL_SLUMINANCE")
45708 ",\t"
45709 (code "GL_SLUMINANCE8")
45710 ",\t"
45711 (code "GL_SLUMINANCE_ALPHA")
45712 ", or\t"
45713 (code "GL_SLUMINANCE8_ALPHA8")
45714 ", the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component\t"
45715 (math (var "c") "_" (var "s"))
45716 "
45717 to a linear component\t"
45718 (math (var "c") "_" (var "l"))
45719 "
45720 is:\t")
45721 (para (math (var "c")
45722 "_"
45723 (var "l")
45724 "="
45725 "{"
45726 "("
45727 (var "c")
45728 "_"
45729 (var "s")
45730 "/"
45731 "12.92"
45732 " "
45733 " "
45734 "if"
45735 " "
45736 (var "c")
45737 "_"
45738 (var "s")
45739 "≤"
45740 "0.04045"
45741 ")"
45742 ", "
45743 "("
45744 "("
45745 (code "c")
45746 "_"
45747 (code "s")
45748 "+"
45749 "0.055"
45750 "/"
45751 "1.055"
45752 ")"
45753 "^"
45754 "2.4"
45755 " "
45756 " "
45757 "if"
45758 " "
45759 (var "c")
45760 "_"
45761 (var "s")
45762 ">"
45763 "0.04045"
45764 ")"))
45765 (para "
45766 Assume\t"
45767 (math (var "c") "_" (var "s"))
45768 "
45769 is the sRGB component in the range [0,1]. ")
45770 (para "
45771 Use the "
45772 (code "GL_PROXY_TEXTURE_2D")
45773 " or "
45774 (code "GL_PROXY_TEXTURE_CUBE_MAP")
45775 " target to try out a resolution and
45776 format. The implementation will
45777 update and recompute its best match for the requested storage resolution
45778 and format. To then query this state, call "
45779 (code "glGetTexLevelParameter")
45780 ".
45781 If the texture cannot be accommodated, texture state is set to 0. ")
45782 (para "
45783 A one-component texture image uses only the red component of the RGBA
45784 color extracted from "
45785 (var "data")
45786 ".
45787 A two-component image uses the R and A values.
45788 A three-component image uses the R, G, and B values.
45789 A four-component image uses all of the RGBA components. ")
45790 (para "
45791 Depth textures can be treated as LUMINANCE, INTENSITY or ALPHA textures during texture filtering and application.\xa0Image-based shadowing\xa0can\xa0be\xa0enabled\xa0by\xa0comparing texture r coordinates to depth texture values to generate a boolean result. See "
45792 (code "glTexParameter")
45793 " for details on texture comparison. ")
45794 (heading "Errors")
45795 (para (code "GL_INVALID_ENUM")
45796 " is generated if "
45797 (var "target")
45798 " is not "
45799 (code "GL_TEXTURE_2D")
45800 ", "
45801 (code "GL_PROXY_TEXTURE_2D")
45802 ", "
45803 (code "GL_PROXY_TEXTURE_CUBE_MAP")
45804 ",\t"
45805 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
45806 ",\t"
45807 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
45808 ",\t"
45809 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
45810 ",\t"
45811 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
45812 ",\t"
45813 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
45814 ", or\t"
45815 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
45816 ". ")
45817 (para (code "GL_INVALID_ENUM")
45818 " is generated if "
45819 (var "target")
45820 " is one of the six cube map 2D image targets and the width and height parameters are not equal. ")
45821 (para (code "GL_INVALID_ENUM")
45822 " is generated if "
45823 (var "type")
45824 " is not a type constant. ")
45825 (para (code "GL_INVALID_ENUM")
45826 " is generated if "
45827 (var "type")
45828 " is "
45829 (code "GL_BITMAP")
45830 " and "
45831 (var "format")
45832 " is not "
45833 (code "GL_COLOR_INDEX")
45834 ". ")
45835 (para (code "GL_INVALID_VALUE")
45836 " is generated if "
45837 (var "width")
45838 " or "
45839 (var "height")
45840 " is less than 0
45841 or greater than 2 + "
45842 (code "GL_MAX_TEXTURE_SIZE")
45843 ". ")
45844 (para (code "GL_INVALID_VALUE")
45845 " is generated if "
45846 (var "level")
45847 " is less than 0. ")
45848 (para (code "GL_INVALID_VALUE")
45849 " may be generated if "
45850 (var "level")
45851 " is greater than "
45852 (math (var "log")
45853 "_"
45854 "2"
45855 "\u2061"
45856 "("
45857 (var "max")
45858 ","
45859 ")")
45860 ",
45861 where "
45862 (var "max")
45863 " is the returned value of "
45864 (code "GL_MAX_TEXTURE_SIZE")
45865 ". ")
45866 (para (code "GL_INVALID_VALUE")
45867 " is generated if "
45868 (var "internalFormat")
45869 " is not 1, 2, 3, 4, or one of the
45870 accepted resolution and format symbolic constants. ")
45871 (para (code "GL_INVALID_VALUE")
45872 " is generated if "
45873 (var "width")
45874 " or "
45875 (var "height")
45876 " is less than 0
45877 or greater than 2 + "
45878 (code "GL_MAX_TEXTURE_SIZE")
45879 ". ")
45880 (para (code "GL_INVALID_VALUE")
45881 " is generated if non-power-of-two textures are not supported and the "
45882 (var "width")
45883 " or "
45884 (var "height")
45885 " cannot be represented as "
45886 (math "2"
45887 "^"
45888 (var "k")
45889 "+"
45890 "2"
45891 "\u2061"
45892 "("
45893 (var "border")
45894 ","
45895 ")")
45896 "
45897 for some
45898 integer value of "
45899 (var "k")
45900 ". ")
45901 (para (code "GL_INVALID_VALUE")
45902 " is generated if "
45903 (var "border")
45904 " is not 0 or 1. ")
45905 (para (code "GL_INVALID_OPERATION")
45906 " is generated if "
45907 (var "type")
45908 " is one of "
45909 (code "GL_UNSIGNED_BYTE_3_3_2")
45910 ", "
45911 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
45912 ", "
45913 (code "GL_UNSIGNED_SHORT_5_6_5")
45914 ", or "
45915 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
45916 "
45917 and "
45918 (var "format")
45919 " is not "
45920 (code "GL_RGB")
45921 ". ")
45922 (para (code "GL_INVALID_OPERATION")
45923 " is generated if "
45924 (var "type")
45925 " is one of "
45926 (code "GL_UNSIGNED_SHORT_4_4_4_4")
45927 ", "
45928 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
45929 ", "
45930 (code "GL_UNSIGNED_SHORT_5_5_5_1")
45931 ", "
45932 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
45933 ", "
45934 (code "GL_UNSIGNED_INT_8_8_8_8")
45935 ", "
45936 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
45937 ", "
45938 (code "GL_UNSIGNED_INT_10_10_10_2")
45939 ", or "
45940 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
45941 "
45942 and "
45943 (var "format")
45944 " is neither "
45945 (code "GL_RGBA")
45946 " nor "
45947 (code "GL_BGRA")
45948 ". ")
45949 (para (code "GL_INVALID_OPERATION")
45950 " is generated if "
45951 (var "target")
45952 " is not "
45953 (code "GL_TEXTURE_2D")
45954 " or "
45955 (code "GL_PROXY_TEXTURE_2D")
45956 " and "
45957 (var "internalFormat")
45958 " is "
45959 (code "GL_DEPTH_COMPONENT")
45960 ", "
45961 (code "GL_DEPTH_COMPONENT16")
45962 ", "
45963 (code "GL_DEPTH_COMPONENT24")
45964 ", or "
45965 (code "GL_DEPTH_COMPONENT32")
45966 ". ")
45967 (para (code "GL_INVALID_OPERATION")
45968 " is generated if "
45969 (var "format")
45970 " is "
45971 (code "GL_DEPTH_COMPONENT")
45972 " and "
45973 (var "internalFormat")
45974 " is not "
45975 (code "GL_DEPTH_COMPONENT")
45976 ", "
45977 (code "GL_DEPTH_COMPONENT16")
45978 ", "
45979 (code "GL_DEPTH_COMPONENT24")
45980 ", or "
45981 (code "GL_DEPTH_COMPONENT32")
45982 ". ")
45983 (para (code "GL_INVALID_OPERATION")
45984 " is generated if "
45985 (var "internalFormat")
45986 " is "
45987 (code "GL_DEPTH_COMPONENT")
45988 ", "
45989 (code "GL_DEPTH_COMPONENT16")
45990 ", "
45991 (code "GL_DEPTH_COMPONENT24")
45992 ", or "
45993 (code "GL_DEPTH_COMPONENT32")
45994 ", and "
45995 (var "format")
45996 " is
45997 not "
45998 (code "GL_DEPTH_COMPONENT")
45999 ". ")
46000 (para (code "GL_INVALID_OPERATION")
46001 " is generated if a non-zero buffer object name is bound to the "
46002 (code "GL_PIXEL_UNPACK_BUFFER")
46003 " target and the buffer object's data store is currently mapped. ")
46004 (para (code "GL_INVALID_OPERATION")
46005 " is generated if a non-zero buffer object name is bound to the "
46006 (code "GL_PIXEL_UNPACK_BUFFER")
46007 " target and the data would be unpacked from the buffer
46008 object such that the memory reads required would exceed the data store size. ")
46009 (para (code "GL_INVALID_OPERATION")
46010 " is generated if a non-zero buffer object name is bound to the "
46011 (code "GL_PIXEL_UNPACK_BUFFER")
46012 " target and "
46013 (var "data")
46014 " is not evenly divisible
46015 into the number of bytes needed to store in memory a datum indicated by "
46016 (var "type")
46017 ". ")
46018 (para (code "GL_INVALID_OPERATION")
46019 " is generated if "
46020 (code "glTexImage2D")
46021 "
46022 is executed between the execution of "
46023 (code "glBegin")
46024 "
46025 and the corresponding execution of "
46026 (code "glEnd")
46027 ". ")))
46028
46029 (define-gl-procedure
46030 glTexImage3D
46031 "glTexImage3D"
46032 (funcsynopsis
46033 (funcprototype
46034 (funcdef "void " (function "glTexImage3D"))
46035 (paramdef "GLenum " (parameter "target"))
46036 (paramdef "GLint " (parameter "level"))
46037 (paramdef "GLint " (parameter "internalFormat"))
46038 (paramdef "GLsizei " (parameter "width"))
46039 (paramdef "GLsizei " (parameter "height"))
46040 (paramdef "GLsizei " (parameter "depth"))
46041 (paramdef "GLint " (parameter "border"))
46042 (paramdef "GLenum " (parameter "format"))
46043 (paramdef "GLenum " (parameter "type"))
46044 (paramdef "const GLvoid * " (parameter "data"))))
46045 '(*fragment*
46046 (heading
46047 "specify a three-dimensional texture image")
46048 (heading "Parameters")
46049 (table (% (formatter (asis)))
46050 (entry (% (heading (var "target")))
46051 (para "
46052 Specifies the target texture.
46053 Must be "
46054 (code "GL_TEXTURE_3D")
46055 " or "
46056 (code "GL_PROXY_TEXTURE_3D")
46057 ". "))
46058 (entry (% (heading (var "level")))
46059 (para "
46060 Specifies the level-of-detail number.
46061 Level 0 is the base image level.
46062 Level "
46063 (math (var "n"))
46064 "
46065 is the "
46066 (math (var "n") "^" (var "th"))
46067 "
46068 mipmap reduction image. "))
46069 (entry (% (heading (var "internalFormat")))
46070 (para "
46071 Specifies the number of color components in the texture.
46072 Must be 1, 2, 3, or 4, or one of the following symbolic constants: "
46073 (code "GL_ALPHA")
46074 ", "
46075 (code "GL_ALPHA4")
46076 ", "
46077 (code "GL_ALPHA8")
46078 ", "
46079 (code "GL_ALPHA12")
46080 ", "
46081 (code "GL_ALPHA16")
46082 ", "
46083 (code "GL_COMPRESSED_ALPHA")
46084 ", "
46085 (code "GL_COMPRESSED_LUMINANCE")
46086 ", "
46087 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
46088 ", "
46089 (code "GL_COMPRESSED_INTENSITY")
46090 ", "
46091 (code "GL_COMPRESSED_RGB")
46092 ", "
46093 (code "GL_COMPRESSED_RGBA")
46094 ", "
46095 (code "GL_LUMINANCE")
46096 ", "
46097 (code "GL_LUMINANCE4")
46098 ", "
46099 (code "GL_LUMINANCE8")
46100 ", "
46101 (code "GL_LUMINANCE12")
46102 ", "
46103 (code "GL_LUMINANCE16")
46104 ", "
46105 (code "GL_LUMINANCE_ALPHA")
46106 ", "
46107 (code "GL_LUMINANCE4_ALPHA4")
46108 ", "
46109 (code "GL_LUMINANCE6_ALPHA2")
46110 ", "
46111 (code "GL_LUMINANCE8_ALPHA8")
46112 ", "
46113 (code "GL_LUMINANCE12_ALPHA4")
46114 ", "
46115 (code "GL_LUMINANCE12_ALPHA12")
46116 ", "
46117 (code "GL_LUMINANCE16_ALPHA16")
46118 ", "
46119 (code "GL_INTENSITY")
46120 ", "
46121 (code "GL_INTENSITY4")
46122 ", "
46123 (code "GL_INTENSITY8")
46124 ", "
46125 (code "GL_INTENSITY12")
46126 ", "
46127 (code "GL_INTENSITY16")
46128 ", "
46129 (code "GL_R3_G3_B2")
46130 ", "
46131 (code "GL_RGB")
46132 ", "
46133 (code "GL_RGB4")
46134 ", "
46135 (code "GL_RGB5")
46136 ", "
46137 (code "GL_RGB8")
46138 ", "
46139 (code "GL_RGB10")
46140 ", "
46141 (code "GL_RGB12")
46142 ", "
46143 (code "GL_RGB16")
46144 ", "
46145 (code "GL_RGBA")
46146 ", "
46147 (code "GL_RGBA2")
46148 ", "
46149 (code "GL_RGBA4")
46150 ", "
46151 (code "GL_RGB5_A1")
46152 ", "
46153 (code "GL_RGBA8")
46154 ", "
46155 (code "GL_RGB10_A2")
46156 ", "
46157 (code "GL_RGBA12")
46158 ", "
46159 (code "GL_RGBA16")
46160 ", "
46161 (code "GL_SLUMINANCE")
46162 ", "
46163 (code "GL_SLUMINANCE8")
46164 ", "
46165 (code "GL_SLUMINANCE_ALPHA")
46166 ", "
46167 (code "GL_SLUMINANCE8_ALPHA8")
46168 ", "
46169 (code "GL_SRGB")
46170 ", "
46171 (code "GL_SRGB8")
46172 ", "
46173 (code "GL_SRGB_ALPHA")
46174 ", or "
46175 (code "GL_SRGB8_ALPHA8")
46176 ". "))
46177 (entry (% (heading (var "width")))
46178 (para "
46179 Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
46180 (math "2"
46181 "^"
46182 (var "n")
46183 "+"
46184 "2"
46185 "\u2061"
46186 "("
46187 (var "border")
46188 ","
46189 ")")
46190 "
46191 for some integer "
46192 (math (var "n"))
46193 ".
46194 All
46195 implementations support 3D texture images that are at least 16 texels
46196 wide. "))
46197 (entry (% (heading (var "height")))
46198 (para "
46199 Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
46200 (math "2"
46201 "^"
46202 (var "m")
46203 "+"
46204 "2"
46205 "\u2061"
46206 "("
46207 (var "border")
46208 ","
46209 ")")
46210 "
46211 for some integer "
46212 (math (var "m"))
46213 ".
46214 All
46215 implementations support 3D texture images that are at least 16 texels
46216 high. "))
46217 (entry (% (heading (var "depth")))
46218 (para "
46219 Specifies the depth of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be "
46220 (math "2"
46221 "^"
46222 (var "k")
46223 "+"
46224 "2"
46225 "\u2061"
46226 "("
46227 (var "border")
46228 ","
46229 ")")
46230 "
46231 for some integer "
46232 (math (var "k"))
46233 ".
46234 All
46235 implementations support 3D texture images that are at least 16 texels
46236 deep. "))
46237 (entry (% (heading (var "border")))
46238 (para "
46239 Specifies the width of the border.
46240 Must be either 0 or 1. "))
46241 (entry (% (heading (var "format")))
46242 (para "
46243 Specifies the format of the pixel data.
46244 The following symbolic values are accepted: "
46245 (code "GL_COLOR_INDEX")
46246 ", "
46247 (code "GL_RED")
46248 ", "
46249 (code "GL_GREEN")
46250 ", "
46251 (code "GL_BLUE")
46252 ", "
46253 (code "GL_ALPHA")
46254 ", "
46255 (code "GL_RGB")
46256 ", "
46257 (code "GL_BGR")
46258 ", "
46259 (code "GL_RGBA")
46260 ", "
46261 (code "GL_BGRA")
46262 ", "
46263 (code "GL_LUMINANCE")
46264 ", and "
46265 (code "GL_LUMINANCE_ALPHA")
46266 ". "))
46267 (entry (% (heading (var "type")))
46268 (para "
46269 Specifies the data type of the pixel data.
46270 The following symbolic values are accepted: "
46271 (code "GL_UNSIGNED_BYTE")
46272 ", "
46273 (code "GL_BYTE")
46274 ", "
46275 (code "GL_BITMAP")
46276 ", "
46277 (code "GL_UNSIGNED_SHORT")
46278 ", "
46279 (code "GL_SHORT")
46280 ", "
46281 (code "GL_UNSIGNED_INT")
46282 ", "
46283 (code "GL_INT")
46284 ", "
46285 (code "GL_FLOAT")
46286 ", "
46287 (code "GL_UNSIGNED_BYTE_3_3_2")
46288 ", "
46289 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
46290 ", "
46291 (code "GL_UNSIGNED_SHORT_5_6_5")
46292 ", "
46293 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
46294 ", "
46295 (code "GL_UNSIGNED_SHORT_4_4_4_4")
46296 ", "
46297 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
46298 ", "
46299 (code "GL_UNSIGNED_SHORT_5_5_5_1")
46300 ", "
46301 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
46302 ", "
46303 (code "GL_UNSIGNED_INT_8_8_8_8")
46304 ", "
46305 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
46306 ", "
46307 (code "GL_UNSIGNED_INT_10_10_10_2")
46308 ", and "
46309 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
46310 ". "))
46311 (entry (% (heading (var "data")))
46312 (para "
46313 Specifies a pointer to the image data in memory. ")))
46314 (heading "Description")
46315 (para "
46316 Texturing maps a portion of a specified texture image
46317 onto each graphical primitive for which texturing is enabled.
46318 To enable and disable three-dimensional texturing, call "
46319 (code "glEnable")
46320 "
46321 and "
46322 (code "glDisable")
46323 " with argument "
46324 (code "GL_TEXTURE_3D")
46325 ". ")
46326 (para "
46327 To define texture images, call "
46328 (code "glTexImage3D")
46329 ".
46330 The arguments describe the parameters of the texture image,
46331 such as height,
46332 width, depth,
46333 width of the border,
46334 level-of-detail number
46335 (see "
46336 (code "glTexParameter")
46337 "),
46338 and number of color components provided.
46339 The last three arguments describe how the image is represented in memory;
46340 they are identical to the pixel formats used for "
46341 (code "glDrawPixels")
46342 ". ")
46343 (para "
46344 If "
46345 (var "target")
46346 " is "
46347 (code "GL_PROXY_TEXTURE_3D")
46348 ", no data is read from "
46349 (var "data")
46350 ", but
46351 all of the texture image state is recalculated, checked for
46352 consistency, and checked
46353 against the implementation's capabilities. If the implementation cannot
46354 handle a texture of the requested texture size, it sets
46355 all of the image state to 0,
46356 but does not generate an error (see "
46357 (code "glGetError")
46358 "). To query for an
46359 entire mipmap array, use an image array level greater than or equal to
46360 1. ")
46361 (para "
46362 If "
46363 (var "target")
46364 " is "
46365 (code "GL_TEXTURE_3D")
46366 ",
46367 data is read from "
46368 (var "data")
46369 " as a sequence of signed or unsigned bytes,
46370 shorts,
46371 or longs,
46372 or single-precision floating-point values,
46373 depending on "
46374 (var "type")
46375 ".
46376 These values are grouped into sets of one,
46377 two,
46378 three,
46379 or four values,
46380 depending on "
46381 (var "format")
46382 ",
46383 to form elements.
46384 If "
46385 (var "type")
46386 " is "
46387 (code "GL_BITMAP")
46388 ",
46389 the data is considered as a string of unsigned bytes (and "
46390 (var "format")
46391 " must be "
46392 (code "GL_COLOR_INDEX")
46393 ").
46394 Each data byte is treated as eight 1-bit elements,
46395 with bit ordering determined by "
46396 (code "GL_UNPACK_LSB_FIRST")
46397 "
46398 (see "
46399 (code "glPixelStore")
46400 "). ")
46401 (para "
46402 If a non-zero named buffer object is bound to the "
46403 (code "GL_PIXEL_UNPACK_BUFFER")
46404 " target
46405 (see "
46406 (code "glBindBuffer")
46407 ") while a texture image is
46408 specified, "
46409 (var "data")
46410 " is treated as a byte offset into the buffer object's data store. ")
46411 (para "
46412 The first element corresponds to the lower left corner of the texture
46413 image.
46414 Subsequent elements progress left-to-right through the remaining texels
46415 in the lowest row of the texture image, and then in successively higher
46416 rows of the texture image.
46417 The final element corresponds to the upper right corner of the texture
46418 image. ")
46419 (para (var "format")
46420 " determines the composition of each element in "
46421 (var "data")
46422 ".
46423 It can assume one of these symbolic values: ")
46424 (table (% (formatter (asis)))
46425 (entry (% (heading (code "GL_COLOR_INDEX")))
46426 (para "
46427 Each element is a single value,
46428 a color index.
46429 The GL converts it to fixed point
46430 (with an unspecified number of zero bits to the right of the binary point),
46431 shifted left or right depending on the value and sign of "
46432 (code "GL_INDEX_SHIFT")
46433 ",
46434 and added to "
46435 (code "GL_INDEX_OFFSET")
46436 "
46437 (see "
46438 (code "glPixelTransfer")
46439 ").
46440 The resulting index is converted to a set of color components
46441 using the "
46442 (code "GL_PIXEL_MAP_I_TO_R")
46443 ", "
46444 (code "GL_PIXEL_MAP_I_TO_G")
46445 ", "
46446 (code "GL_PIXEL_MAP_I_TO_B")
46447 ", and "
46448 (code "GL_PIXEL_MAP_I_TO_A")
46449 " tables,
46450 and clamped to the range [0,1]. "))
46451 (entry (% (heading (code "GL_RED")))
46452 (para "
46453 Each element is a single red component.
46454 The GL converts it to floating point and assembles it into an RGBA element
46455 by attaching 0 for green and blue, and 1 for alpha.
46456 Each component is then multiplied by the signed scale factor "
46457 (code "GL_c_SCALE")
46458 ",
46459 added to the signed bias "
46460 (code "GL_c_BIAS")
46461 ",
46462 and clamped to the range [0,1]
46463 (see "
46464 (code "glPixelTransfer")
46465 "). "))
46466 (entry (% (heading (code "GL_GREEN")))
46467 (para "
46468 Each element is a single green component.
46469 The GL converts it to floating point and assembles it into an RGBA element
46470 by attaching 0 for red and blue, and 1 for alpha.
46471 Each component is then multiplied by the signed scale factor "
46472 (code "GL_c_SCALE")
46473 ",
46474 added to the signed bias "
46475 (code "GL_c_BIAS")
46476 ",
46477 and clamped to the range [0,1]
46478 (see "
46479 (code "glPixelTransfer")
46480 "). "))
46481 (entry (% (heading (code "GL_BLUE")))
46482 (para "
46483 Each element is a single blue component.
46484 The GL converts it to floating point and assembles it into an RGBA element
46485 by attaching 0 for red and green, and 1 for alpha.
46486 Each component is then multiplied by the signed scale factor "
46487 (code "GL_c_SCALE")
46488 ",
46489 added to the signed bias "
46490 (code "GL_c_BIAS")
46491 ",
46492 and clamped to the range [0,1]
46493 (see "
46494 (code "glPixelTransfer")
46495 "). "))
46496 (entry (% (heading (code "GL_ALPHA")))
46497 (para "
46498 Each element is a single alpha component.
46499 The GL converts it to floating point and assembles it into an RGBA element
46500 by attaching 0 for red, green, and blue.
46501 Each component is then multiplied by the signed scale factor "
46502 (code "GL_c_SCALE")
46503 ",
46504 added to the signed bias "
46505 (code "GL_c_BIAS")
46506 ",
46507 and clamped to the range [0,1]
46508 (see "
46509 (code "glPixelTransfer")
46510 "). "))
46511 (entry (% (heading (code "GL_INTENSITY")))
46512 (para "
46513 Each element is a single intensity value.
46514 The GL converts it to floating point,
46515 then assembles it into an RGBA element by replicating the intensity value
46516 three times for red, green, blue, and alpha.
46517 Each component is then multiplied by the signed scale factor "
46518 (code "GL_c_SCALE")
46519 ",
46520 added to the signed bias "
46521 (code "GL_c_BIAS")
46522 ",
46523 and clamped to the range [0,1]
46524 (see "
46525 (code "glPixelTransfer")
46526 "). "))
46527 (entry (% (heading (code "GL_RGB"))))
46528 (entry (% (heading (code "GL_BGR")))
46529 (para "
46530 Each element is an RGB triple.
46531 The GL converts it to floating point and assembles it into an RGBA element
46532 by attaching 1 for alpha.
46533 Each component is then multiplied by the signed scale factor "
46534 (code "GL_c_SCALE")
46535 ",
46536 added to the signed bias "
46537 (code "GL_c_BIAS")
46538 ",
46539 and clamped to the range [0,1]
46540 (see "
46541 (code "glPixelTransfer")
46542 "). "))
46543 (entry (% (heading (code "GL_RGBA"))))
46544 (entry (% (heading (code "GL_BGRA")))
46545 (para "
46546 Each element contains all four components.
46547 Each component is multiplied by the signed scale factor "
46548 (code "GL_c_SCALE")
46549 ",
46550 added to the signed bias "
46551 (code "GL_c_BIAS")
46552 ",
46553 and clamped to the range [0,1]
46554 (see "
46555 (code "glPixelTransfer")
46556 "). "))
46557 (entry (% (heading (code "GL_LUMINANCE")))
46558 (para "
46559 Each element is a single luminance value.
46560 The GL converts it to floating point,
46561 then assembles it into an RGBA element by replicating the luminance value
46562 three times for red, green, and blue and attaching 1 for alpha.
46563 Each component is then multiplied by the signed scale factor "
46564 (code "GL_c_SCALE")
46565 ",
46566 added to the signed bias "
46567 (code "GL_c_BIAS")
46568 ",
46569 and clamped to the range [0,1]
46570 (see "
46571 (code "glPixelTransfer")
46572 "). "))
46573 (entry (% (heading (code "GL_LUMINANCE_ALPHA")))
46574 (para "
46575 Each element is a luminance/alpha pair.
46576 The GL converts it to floating point,
46577 then assembles it into an RGBA element by replicating the luminance value
46578 three times for red, green, and blue.
46579 Each component is then multiplied by the signed scale factor "
46580 (code "GL_c_SCALE")
46581 ",
46582 added to the signed bias "
46583 (code "GL_c_BIAS")
46584 ",
46585 and clamped to the range [0,1] (see "
46586 (code "glPixelTransfer")
46587 "). ")))
46588 (para "
46589 Refer to the "
46590 (code "glDrawPixels")
46591 " reference page for a description of
46592 the acceptable values for the "
46593 (var "type")
46594 " parameter. ")
46595 (para "
46596 If an application wants to store the texture at a certain
46597 resolution or in a certain format, it can request the resolution
46598 and format with "
46599 (var "internalFormat")
46600 ". The GL will choose an internal
46601 representation that closely approximates that requested by "
46602 (var "internalFormat")
46603 ", but
46604 it may not match exactly.
46605 (The representations specified by "
46606 (code "GL_LUMINANCE")
46607 ", "
46608 (code "GL_LUMINANCE_ALPHA")
46609 ", "
46610 (code "GL_RGB")
46611 ",
46612 and "
46613 (code "GL_RGBA")
46614 " must match exactly. The numeric values 1, 2, 3, and 4
46615 may also be used to specify the above representations.) ")
46616 (para "
46617 If the "
46618 (var "internalFormat")
46619 " parameter is one of the generic compressed formats,\t"
46620 (code "GL_COMPRESSED_ALPHA")
46621 ",\t"
46622 (code "GL_COMPRESSED_INTENSITY")
46623 ",\t"
46624 (code "GL_COMPRESSED_LUMINANCE")
46625 ",\t"
46626 (code "GL_COMPRESSED_LUMINANCE_ALPHA")
46627 ",\t"
46628 (code "GL_COMPRESSED_RGB")
46629 ", or\t"
46630 (code "GL_COMPRESSED_RGBA")
46631 ", the GL will replace the internal format with the symbolic constant for a specific internal format and compress the texture before storage. If no corresponding internal format is available, or the GL can not compress that image for any reason, the internal format is instead replaced with a corresponding base internal format. ")
46632 (para "
46633 If the "
46634 (var "internalFormat")
46635 " parameter is "
46636 (code "GL_SRGB")
46637 ",\t"
46638 (code "GL_SRGB8")
46639 ",\t"
46640 (code "GL_SRGB_ALPHA")
46641 ",\t"
46642 (code "GL_SRGB8_ALPHA8")
46643 ",\t"
46644 (code "GL_SLUMINANCE")
46645 ",\t"
46646 (code "GL_SLUMINANCE8")
46647 ",\t"
46648 (code "GL_SLUMINANCE_ALPHA")
46649 ", or\t"
46650 (code "GL_SLUMINANCE8_ALPHA8")
46651 ", the texture is treated as if the red, green, blue, or luminance components are encoded in the sRGB color space. Any alpha component is left unchanged. The conversion from the sRGB encoded component\t"
46652 (math (var "c") "_" (var "s"))
46653 "
46654 to a linear component\t"
46655 (math (var "c") "_" (var "l"))
46656 "
46657 is:\t")
46658 (para (math (var "c")
46659 "_"
46660 (var "l")
46661 "="
46662 "{"
46663 "("
46664 (var "c")
46665 "_"
46666 (var "s")
46667 "/"
46668 "12.92"
46669 " "
46670 " "
46671 "if"
46672 " "
46673 (var "c")
46674 "_"
46675 (var "s")
46676 "≤"
46677 "0.04045"
46678 ")"
46679 ", "
46680 "("
46681 "("
46682 (code "c")
46683 "_"
46684 (code "s")
46685 "+"
46686 "0.055"
46687 "/"
46688 "1.055"
46689 ")"
46690 "^"
46691 "2.4"
46692 " "
46693 " "
46694 "if"
46695 " "
46696 (var "c")
46697 "_"
46698 (var "s")
46699 ">"
46700 "0.04045"
46701 ")"))
46702 (para "
46703 Assume\t"
46704 (math (var "c") "_" (var "s"))
46705 "
46706 is the sRGB component in the range [0,1]. ")
46707 (para "
46708 Use the "
46709 (code "GL_PROXY_TEXTURE_3D")
46710 " target to try out a resolution and
46711 format. The implementation will
46712 update and recompute its best match for the requested storage resolution
46713 and format. To then query this state, call "
46714 (code "glGetTexLevelParameter")
46715 ".
46716 If the texture cannot be accommodated, texture state is set to 0. ")
46717 (para "
46718 A one-component texture image uses only the red component of the RGBA
46719 color extracted from "
46720 (var "data")
46721 ".
46722 A two-component image uses the R and A values.
46723 A three-component image uses the R, G, and B values.
46724 A four-component image uses all of the RGBA components. ")
46725 (heading "Errors")
46726 (para (code "GL_INVALID_ENUM")
46727 " is generated if "
46728 (var "target")
46729 " is not "
46730 (code "GL_TEXTURE_3D")
46731 "
46732 or "
46733 (code "GL_PROXY_TEXTURE_3D")
46734 ". ")
46735 (para (code "GL_INVALID_ENUM")
46736 " is generated if "
46737 (var "format")
46738 " is not an accepted
46739 format constant. Format constants other than "
46740 (code "GL_STENCIL_INDEX")
46741 " and "
46742 (code "GL_DEPTH_COMPONENT")
46743 "
46744 are accepted. ")
46745 (para (code "GL_INVALID_ENUM")
46746 " is generated if "
46747 (var "type")
46748 " is not a type constant. ")
46749 (para (code "GL_INVALID_ENUM")
46750 " is generated if "
46751 (var "type")
46752 " is "
46753 (code "GL_BITMAP")
46754 " and "
46755 (var "format")
46756 " is not "
46757 (code "GL_COLOR_INDEX")
46758 ". ")
46759 (para (code "GL_INVALID_VALUE")
46760 " is generated if "
46761 (var "level")
46762 " is less than 0. ")
46763 (para (code "GL_INVALID_VALUE")
46764 " may be generated if "
46765 (var "level")
46766 " is greater than "
46767 (math (var "log")
46768 "_"
46769 "2"
46770 "\u2061"
46771 "("
46772 (var "max")
46773 ","
46774 ")")
46775 ",
46776 where "
46777 (var "max")
46778 " is the returned value of "
46779 (code "GL_MAX_TEXTURE_SIZE")
46780 ". ")
46781 (para (code "GL_INVALID_VALUE")
46782 " is generated if "
46783 (var "internalFormat")
46784 " is not 1, 2, 3, 4, or one of the
46785 accepted resolution and format symbolic constants. ")
46786 (para (code "GL_INVALID_VALUE")
46787 " is generated if "
46788 (var "width")
46789 ", "
46790 (var "height")
46791 ", or "
46792 (var "depth")
46793 " is less than 0 or greater than 2 + "
46794 (code "GL_MAX_TEXTURE_SIZE")
46795 ". ")
46796 (para (code "GL_INVALID_VALUE")
46797 " is generated if non-power-of-two textures are not supported and the "
46798 (var "width")
46799 ", "
46800 (var "height")
46801 ", or "
46802 (var "depth")
46803 " cannot be represented as "
46804 (math "2"
46805 "^"
46806 (var "k")
46807 "+"
46808 "2"
46809 "\u2061"
46810 "("
46811 (var "border")
46812 ","
46813 ")")
46814 "
46815 for some
46816 integer value of "
46817 (var "k")
46818 ". ")
46819 (para (code "GL_INVALID_VALUE")
46820 " is generated if "
46821 (var "border")
46822 " is not 0 or 1. ")
46823 (para (code "GL_INVALID_OPERATION")
46824 " is generated if "
46825 (var "type")
46826 " is one of "
46827 (code "GL_UNSIGNED_BYTE_3_3_2")
46828 ", "
46829 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
46830 ", "
46831 (code "GL_UNSIGNED_SHORT_5_6_5")
46832 ", or "
46833 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
46834 "
46835 and "
46836 (var "format")
46837 " is not "
46838 (code "GL_RGB")
46839 ". ")
46840 (para (code "GL_INVALID_OPERATION")
46841 " is generated if "
46842 (var "type")
46843 " is one of "
46844 (code "GL_UNSIGNED_SHORT_4_4_4_4")
46845 ", "
46846 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
46847 ", "
46848 (code "GL_UNSIGNED_SHORT_5_5_5_1")
46849 ", "
46850 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
46851 ", "
46852 (code "GL_UNSIGNED_INT_8_8_8_8")
46853 ", "
46854 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
46855 ", "
46856 (code "GL_UNSIGNED_INT_10_10_10_2")
46857 ", or "
46858 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
46859 "
46860 and "
46861 (var "format")
46862 " is neither "
46863 (code "GL_RGBA")
46864 " nor "
46865 (code "GL_BGRA")
46866 ". ")
46867 (para (code "GL_INVALID_OPERATION")
46868 " is generated if "
46869 (var "format")
46870 " or "
46871 (var "internalFormat")
46872 " is "
46873 (code "GL_DEPTH_COMPONENT")
46874 ", "
46875 (code "GL_DEPTH_COMPONENT16")
46876 ", "
46877 (code "GL_DEPTH_COMPONENT24")
46878 ", or "
46879 (code "GL_DEPTH_COMPONENT32")
46880 ". ")
46881 (para (code "GL_INVALID_OPERATION")
46882 " is generated if a non-zero buffer object name is bound to the "
46883 (code "GL_PIXEL_UNPACK_BUFFER")
46884 " target and the buffer object's data store is currently mapped. ")
46885 (para (code "GL_INVALID_OPERATION")
46886 " is generated if a non-zero buffer object name is bound to the "
46887 (code "GL_PIXEL_UNPACK_BUFFER")
46888 " target and the data would be unpacked from the buffer
46889 object such that the memory reads required would exceed the data store size. ")
46890 (para (code "GL_INVALID_OPERATION")
46891 " is generated if a non-zero buffer object name is bound to the "
46892 (code "GL_PIXEL_UNPACK_BUFFER")
46893 " target and "
46894 (var "data")
46895 " is not evenly divisible
46896 into the number of bytes needed to store in memory a datum indicated by "
46897 (var "type")
46898 ". ")
46899 (para (code "GL_INVALID_OPERATION")
46900 " is generated if "
46901 (code "glTexImage3D")
46902 "
46903 is executed between the execution of "
46904 (code "glBegin")
46905 "
46906 and the corresponding execution of "
46907 (code "glEnd")
46908 ". ")))
46909
46910 (define-gl-procedure
46911 glTexParameter
46912 "glTexParameter"
46913 (funcsynopsis
46914 (funcprototype
46915 (funcdef "void " (function "glTexParameterf"))
46916 (paramdef "GLenum " (parameter "target"))
46917 (paramdef "GLenum " (parameter "pname"))
46918 (paramdef "GLfloat " (parameter "param"))))
46919 '(*fragment*
46920 (heading "set texture parameters")
46921 (heading "Parameters")
46922 (table (% (formatter (asis)))
46923 (entry (% (heading (var "target")))
46924 (para "
46925 Specifies the target texture,
46926 which must be either "
46927 (code "GL_TEXTURE_1D")
46928 ", "
46929 (code "GL_TEXTURE_2D")
46930 ", "
46931 (code "GL_TEXTURE_3D")
46932 ", or "
46933 (code "GL_TEXTURE_CUBE_MAP")
46934 ". "))
46935 (entry (% (heading (var "pname")))
46936 (para "
46937 Specifies the symbolic name of a single-valued texture parameter. "
46938 (var "pname")
46939 " can be one of the following: "
46940 (code "GL_TEXTURE_MIN_FILTER")
46941 ", "
46942 (code "GL_TEXTURE_MAG_FILTER")
46943 ", "
46944 (code "GL_TEXTURE_MIN_LOD")
46945 ", "
46946 (code "GL_TEXTURE_MAX_LOD")
46947 ", "
46948 (code "GL_TEXTURE_BASE_LEVEL")
46949 ", "
46950 (code "GL_TEXTURE_MAX_LEVEL")
46951 ", "
46952 (code "GL_TEXTURE_WRAP_S")
46953 ", "
46954 (code "GL_TEXTURE_WRAP_T")
46955 ", "
46956 (code "GL_TEXTURE_WRAP_R")
46957 ", "
46958 (code "GL_TEXTURE_PRIORITY")
46959 ", "
46960 (code "GL_TEXTURE_COMPARE_MODE")
46961 ", "
46962 (code "GL_TEXTURE_COMPARE_FUNC")
46963 ", "
46964 (code "GL_DEPTH_TEXTURE_MODE")
46965 ", or "
46966 (code "GL_GENERATE_MIPMAP")
46967 ". "))
46968 (entry (% (heading (var "param")))
46969 (para "
46970 Specifies the value of "
46971 (var "pname")
46972 ". ")))
46973 (heading "Description")
46974 (para "
46975 Texture mapping is a technique that applies an image onto an object's surface
46976 as if the image were a decal or cellophane shrink-wrap.
46977 The image is created in texture space,
46978 with an
46979 ("
46980 (math (var "s"))
46981 ", "
46982 (math (var "t"))
46983 ")
46984 coordinate system.
46985 A texture is a one- or two-dimensional image and a set of parameters
46986 that determine how samples are derived from the image. ")
46987 (para (code "glTexParameter")
46988 " assigns the value or values in "
46989 (var "params")
46990 " to the texture parameter
46991 specified as "
46992 (var "pname")
46993 ". "
46994 (var "target")
46995 " defines the target texture,
46996 either "
46997 (code "GL_TEXTURE_1D")
46998 ", "
46999 (code "GL_TEXTURE_2D")
47000 ", or "
47001 (code "GL_TEXTURE_3D")
47002 ".
47003 The following symbols are accepted in "
47004 (var "pname")
47005 ": ")
47006 (table (% (formatter (asis)))
47007 (entry (% (heading (code "GL_TEXTURE_MIN_FILTER")))
47008 (para "
47009 The texture minifying function is used whenever the pixel being textured
47010 maps to an area greater than one texture element.
47011 There are six defined minifying functions.
47012 Two of them use the nearest one or nearest four texture elements
47013 to compute the texture value.
47014 The other four use mipmaps. ")
47015 (para "
47016 A mipmap is an ordered set of arrays representing the same image
47017 at progressively lower resolutions.
47018 If the texture has dimensions "
47019 (math "2" "^" (var "n") "×" "2" "^" (var "m"))
47020 ",
47021 there are "
47022 (math (var "max")
47023 "\u2061"
47024 "("
47025 (var "n")
47026 ","
47027 (var "m")
47028 ")"
47029 "+"
47030 "1")
47031 "
47032 mipmaps.
47033 The first mipmap is the original texture,
47034 with dimensions "
47035 (math "2" "^" (var "n") "×" "2" "^" (var "m"))
47036 ".
47037 Each subsequent mipmap has dimensions "
47038 (math "2"
47039 "^"
47040 (var "k")
47041 "-"
47042 "1"
47043 ","
47044 "×"
47045 "2"
47046 "^"
47047 (var "l")
47048 "-"
47049 "1"
47050 ",")
47051 ",
47052 where "
47053 (math "2" "^" (var "k") "×" "2" "^" (var "l"))
47054 "
47055 are the dimensions of the previous mipmap,
47056 until either "
47057 (math (var "k") "=" "0")
47058 "
47059 or "
47060 (math (var "l") "=" "0")
47061 ".
47062 At that point,
47063 subsequent mipmaps have dimension "
47064 (math "1" "×" "2" "^" (var "l") "-" "1" ",")
47065 "
47066 or "
47067 (math "2" "^" (var "k") "-" "1" "," "×" "1")
47068 "
47069 until the final mipmap,
47070 which has dimension "
47071 (math "1" "×" "1")
47072 ".
47073 To define the mipmaps, call "
47074 (code "glTexImage1D")
47075 ", "
47076 (code "glTexImage2D")
47077 ", "
47078 (code "glTexImage3D")
47079 ", "
47080 (code "glCopyTexImage1D")
47081 ", or "
47082 (code "glCopyTexImage2D")
47083 "
47084 with the "
47085 (var "level")
47086 " argument indicating the order of the mipmaps.
47087 Level 0 is the original texture;
47088 level "
47089 (math (var "max")
47090 "\u2061"
47091 "("
47092 (var "n")
47093 ","
47094 (var "m")
47095 ")")
47096 "
47097 is the final "
47098 (math "1" "×" "1")
47099 "
47100 mipmap. ")
47101 (para (var "params")
47102 " supplies a function for minifying the texture as one of the
47103 following: ")
47104 (para "
47105 As more texture elements are sampled in the minification process,
47106 fewer aliasing artifacts will be apparent.
47107 While the "
47108 (code "GL_NEAREST")
47109 " and "
47110 (code "GL_LINEAR")
47111 " minification functions can be
47112 faster than the other four,
47113 they sample only one or four texture elements to determine the texture value
47114 of the pixel being rendered and can produce moire patterns
47115 or ragged transitions.
47116 The initial value of "
47117 (code "GL_TEXTURE_MIN_FILTER")
47118 " is "
47119 (code "GL_NEAREST_MIPMAP_LINEAR")
47120 ". "))
47121 (entry (% (heading (code "GL_TEXTURE_MAG_FILTER")))
47122 (para "
47123 The texture magnification function is used when the pixel being textured
47124 maps to an area less than or equal to one texture element.
47125 It sets the texture magnification function to either "
47126 (code "GL_NEAREST")
47127 "
47128 or "
47129 (code "GL_LINEAR")
47130 " (see below). "
47131 (code "GL_NEAREST")
47132 " is generally faster
47133 than "
47134 (code "GL_LINEAR")
47135 ",
47136 but it can produce textured images with sharper edges
47137 because the transition between texture elements is not as smooth.
47138 The initial value of "
47139 (code "GL_TEXTURE_MAG_FILTER")
47140 " is "
47141 (code "GL_LINEAR")
47142 ". "
47143 (para))))
47144 (table (% (formatter (asis)))
47145 (entry (% (heading (code "GL_NEAREST")))
47146 (para "
47147 Returns the value of the texture element that is nearest
47148 (in Manhattan distance)
47149 to the center of the pixel being textured. "))
47150 (entry (% (heading (code "GL_LINEAR")))
47151 (para "
47152 Returns the weighted average of the four texture elements
47153 that are closest to the center of the pixel being textured.
47154 These can include border texture elements,
47155 depending on the values of "
47156 (code "GL_TEXTURE_WRAP_S")
47157 " and "
47158 (code "GL_TEXTURE_WRAP_T")
47159 ",
47160 and on the exact mapping. "))
47161 (entry (% (heading (code "GL_NEAREST_MIPMAP_NEAREST")))
47162 (para "
47163 Chooses the mipmap that most closely matches the size of the pixel
47164 being textured and uses the "
47165 (code "GL_NEAREST")
47166 " criterion
47167 (the texture element nearest to the center of the pixel)
47168 to produce a texture value. "))
47169 (entry (% (heading (code "GL_LINEAR_MIPMAP_NEAREST")))
47170 (para "
47171 Chooses the mipmap that most closely matches the size of the pixel
47172 being textured and uses the "
47173 (code "GL_LINEAR")
47174 " criterion
47175 (a weighted average of the four texture elements that are closest
47176 to the center of the pixel)
47177 to produce a texture value. "))
47178 (entry (% (heading (code "GL_NEAREST_MIPMAP_LINEAR")))
47179 (para "
47180 Chooses the two mipmaps that most closely match the size of the pixel
47181 being textured and uses the "
47182 (code "GL_NEAREST")
47183 " criterion
47184 (the texture element nearest to the center of the pixel)
47185 to produce a texture value from each mipmap.
47186 The final texture value is a weighted average of those two values. "))
47187 (entry (% (heading (code "GL_LINEAR_MIPMAP_LINEAR")))
47188 (para "
47189 Chooses the two mipmaps that most closely match the size of the pixel
47190 being textured and uses the "
47191 (code "GL_LINEAR")
47192 " criterion
47193 (a weighted average of the four texture elements that are closest
47194 to the center of the pixel)
47195 to produce a texture value from each mipmap.
47196 The final texture value is a weighted average of those two values. ")))
47197 (table (% (formatter (asis)))
47198 (entry (% (heading (code "GL_NEAREST")))
47199 (para "
47200 Returns the value of the texture element that is nearest
47201 (in Manhattan distance)
47202 to the center of the pixel being textured. "))
47203 (entry (% (heading (code "GL_LINEAR")))
47204 (para "
47205 Returns the weighted average of the four texture elements
47206 that are closest to the center of the pixel being textured.
47207 These can include border texture elements,
47208 depending on the values of "
47209 (code "GL_TEXTURE_WRAP_S")
47210 " and "
47211 (code "GL_TEXTURE_WRAP_T")
47212 ",
47213 and on the exact mapping. ")))
47214 (para)
47215 (table (% (formatter (asis)))
47216 (entry (% (heading (code "GL_TEXTURE_MIN_LOD")))
47217 (para "
47218 Sets the minimum level-of-detail parameter. This floating-point value
47219 limits the selection of highest resolution mipmap (lowest mipmap
47220 level). The initial value is -1000. ")))
47221 (para)
47222 (table (% (formatter (asis)))
47223 (entry (% (heading (code "GL_TEXTURE_MAX_LOD")))
47224 (para "
47225 Sets the maximum level-of-detail parameter. This floating-point value
47226 limits the selection of the lowest resolution mipmap (highest mipmap
47227 level). The initial value is 1000. ")))
47228 (para)
47229 (table (% (formatter (asis)))
47230 (entry (% (heading (code "GL_TEXTURE_BASE_LEVEL")))
47231 (para "
47232 Specifies the index of the lowest defined mipmap level. This is an
47233 integer value. The initial value is 0. ")))
47234 (para)
47235 (table (% (formatter (asis)))
47236 (entry (% (heading (code "GL_TEXTURE_MAX_LEVEL")))
47237 (para "
47238 Sets the index of the highest defined mipmap level. This is an integer
47239 value. The initial value is 1000. ")))
47240 (para)
47241 (table (% (formatter (asis)))
47242 (entry (% (heading (code "GL_TEXTURE_WRAP_S")))
47243 (para "
47244 Sets the wrap parameter for texture coordinate "
47245 (math (var "s"))
47246 "
47247 to either "
47248 (code "GL_CLAMP")
47249 ", "
47250 (code "GL_CLAMP_TO_BORDER")
47251 ", "
47252 (code "GL_CLAMP_TO_EDGE")
47253 ", "
47254 (code "GL_MIRRORED_REPEAT")
47255 ", or "
47256 (code "GL_REPEAT")
47257 ". "
47258 (code "GL_CLAMP")
47259 " causes "
47260 (math (var "s"))
47261 "
47262 coordinates to be clamped to the
47263 range [0,1] and is useful for preventing wrapping artifacts when mapping a
47264 single image onto an object. "
47265 (code "GL_CLAMP_TO_BORDER")
47266 " causes the "
47267 (math (var "s"))
47268 "
47269 coordinate to be clamped to the range "
47270 (math "["
47271 "-1"
47272 "/"
47273 "2"
47274 (var "N")
47275 ","
47276 ","
47277 "1"
47278 "+"
47279 "1"
47280 "/"
47281 "2"
47282 (var "N")
47283 ","
47284 "]")
47285 ",
47286 where "
47287 (math (var "N"))
47288 "
47289 is the size of the texture in the direction of
47290 clamping."
47291 (code "GL_CLAMP_TO_EDGE")
47292 " causes "
47293 (math (var "s"))
47294 "
47295 coordinates to be clamped to the
47296 range "
47297 (math "["
47298 "1"
47299 "/"
47300 "2"
47301 (var "N")
47302 ","
47303 ","
47304 "1"
47305 "-"
47306 "1"
47307 "/"
47308 "2"
47309 (var "N")
47310 ","
47311 "]")
47312 ",
47313 where "
47314 (math (var "N"))
47315 "
47316 is the size
47317 of the texture in the direction of clamping. "
47318 (code "GL_REPEAT")
47319 " causes the
47320 integer part of the "
47321 (math (var "s"))
47322 "
47323 coordinate to be ignored; the GL uses only the
47324 fractional part, thereby creating a repeating pattern. "
47325 (code "GL_MIRRORED_REPEAT")
47326 " causes the "
47327 (math (var "s"))
47328 "
47329 coordinate to be set to the
47330 fractional part of the texture coordinate if the integer part of "
47331 (math (var "s"))
47332 "
47333 is
47334 even; if the integer part of "
47335 (math (var "s"))
47336 "
47337 is odd, then the "
47338 (math (var "s"))
47339 "
47340 texture coordinate is
47341 set to "
47342 (math "1"
47343 "-"
47344 (var "frac")
47345 "\u2061"
47346 "("
47347 (var "s")
47348 ","
47349 ")")
47350 ",
47351 where "
47352 (math (var "frac")
47353 "\u2061"
47354 "("
47355 (var "s")
47356 ","
47357 ")")
47358 "
47359 represents the fractional part of "
47360 (math (var "s"))
47361 ".
47362 Border texture
47363 elements are accessed only if wrapping is set to "
47364 (code "GL_CLAMP")
47365 " or "
47366 (code "GL_CLAMP_TO_BORDER")
47367 ". Initially, "
47368 (code "GL_TEXTURE_WRAP_S")
47369 " is set to "
47370 (code "GL_REPEAT")
47371 ". ")))
47372 (para)
47373 (table (% (formatter (asis)))
47374 (entry (% (heading (code "GL_TEXTURE_WRAP_T")))
47375 (para "
47376 Sets the wrap parameter for texture coordinate "
47377 (math (var "t"))
47378 "
47379 to either "
47380 (code "GL_CLAMP")
47381 ", "
47382 (code "GL_CLAMP_TO_BORDER")
47383 ", "
47384 (code "GL_CLAMP_TO_EDGE")
47385 ", "
47386 (code "GL_MIRRORED_REPEAT")
47387 ", or "
47388 (code "GL_REPEAT")
47389 ". See the discussion under "
47390 (code "GL_TEXTURE_WRAP_S")
47391 ".
47392 Initially, "
47393 (code "GL_TEXTURE_WRAP_T")
47394 " is set to "
47395 (code "GL_REPEAT")
47396 ". "))
47397 (entry (% (heading (code "GL_TEXTURE_WRAP_R")))
47398 (para "
47399 Sets the wrap parameter for texture coordinate "
47400 (math (var "r"))
47401 "
47402 to either "
47403 (code "GL_CLAMP")
47404 ", "
47405 (code "GL_CLAMP_TO_BORDER")
47406 ", "
47407 (code "GL_CLAMP_TO_EDGE")
47408 ", "
47409 (code "GL_MIRRORED_REPEAT")
47410 ", or "
47411 (code "GL_REPEAT")
47412 ". See the discussion under "
47413 (code "GL_TEXTURE_WRAP_S")
47414 ".
47415 Initially, "
47416 (code "GL_TEXTURE_WRAP_R")
47417 " is set to "
47418 (code "GL_REPEAT")
47419 ". "))
47420 (entry (% (heading (code "GL_TEXTURE_BORDER_COLOR")))
47421 (para "
47422 Sets a border color. "
47423 (var "params")
47424 " contains four values that comprise the RGBA
47425 color of the texture border. Integer color components are interpreted
47426 linearly such that the most positive integer maps to 1.0, and the most
47427 negative integer maps to -1.0. The values are clamped to the range [0,1]
47428 when they are specified. Initially, the border color is (0, 0, 0, 0). "))
47429 (entry (% (heading (code "GL_TEXTURE_PRIORITY")))
47430 (para "
47431 Specifies the texture residence priority of the currently bound texture.
47432 Permissible values are in the range "
47433 (math "[" "0" "," "1" "]")
47434 ".
47435 See "
47436 (code "glPrioritizeTextures")
47437 " and "
47438 (code "glBindTexture")
47439 " for more information. "))
47440 (entry (% (heading (code "GL_TEXTURE_COMPARE_MODE")))
47441 (para "
47442 Specifies the texture comparison mode for currently bound depth textures.
47443 That is, a texture whose internal format is "
47444 (code "GL_DEPTH_COMPONENT_*")
47445 "; see "
47446 (code "glTexImage2D")
47447 ")
47448 Permissible values are: "))
47449 (entry (% (heading (code "GL_TEXTURE_COMPARE_FUNC")))
47450 (para "
47451 Specifies the comparison operator used when "
47452 (code "GL_TEXTURE_COMPARE_MODE")
47453 " is
47454 set to "
47455 (code "GL_COMPARE_R_TO_TEXTURE")
47456 ". Permissible values are: "
47457 "
47458 where "
47459 (math (var "r"))
47460 "
47461 is the current interpolated texture coordinate, and "
47462 (math (var "D") "_" (var "t"))
47463 "
47464 is the depth texture value sampled from the currently bound depth texture. "
47465 (math (var "result"))
47466 "
47467 is assigned to the either the luminance, intensity, or alpha (as
47468 specified by "
47469 (code "GL_DEPTH_TEXTURE_MODE")
47470 ".) "))
47471 (entry (% (heading (code "GL_DEPTH_TEXTURE_MODE")))
47472 (para "
47473 Specifies a single symbolic constant indicating how depth values should be
47474 treated during filtering and texture application. Accepted values are "
47475 (code "GL_LUMINANCE")
47476 ", "
47477 (code "GL_INTENSITY")
47478 ", and "
47479 (code "GL_ALPHA")
47480 ". The initial value
47481 is "
47482 (code "GL_LUMINANCE")
47483 ". "))
47484 (entry (% (heading (code "GL_GENERATE_MIPMAP")))
47485 (para "
47486 Specifies a boolean value that indicates if all levels of a mipmap array
47487 should be automatically updated when any modification to the base level
47488 mipmap is done. The initial value is "
47489 (code "GL_FALSE")
47490 ". ")))
47491 (table (% (formatter (asis)))
47492 (entry (% (heading (code "GL_COMPARE_R_TO_TEXTURE")))
47493 (para "
47494 Specifies that the interpolated and clamped "
47495 (math (var "r"))
47496 "
47497 texture coordinate should
47498 be compared to the value in the currently bound depth texture. See the
47499 discussion of "
47500 (code "GL_TEXTURE_COMPARE_FUNC")
47501 " for details of how the comparison
47502 is evaluated. The result of the comparison is assigned to luminance,
47503 intensity, or alpha (as specified by "
47504 (code "GL_DEPTH_TEXTURE_MODE")
47505 "). "))
47506 (entry (% (heading (code "GL_NONE")))
47507 (para "
47508 Specifies that the luminance, intensity, or alpha (as specified by "
47509 (code "GL_DEPTH_TEXTURE_MODE")
47510 ") should be assigned the
47511 appropriate value from the currently bound depth texture. ")))
47512 (table (% (formatter (asis)))
47513 (entry (% (heading (strong "Texture Comparison Function")))
47514 (para (strong "Computed result")))
47515 (entry (% (heading (code "GL_LEQUAL")))
47516 (para (math (var "result")
47517 "="
47518 "{"
47519 "("
47520 "1.0"
47521 ")"
47522 ", "
47523 "("
47524 "0.0"
47525 ")"
47526 "\u2062\xa0"
47527 "("
47528 (var "r")
47529 "<="
47530 (var "D")
47531 "_"
47532 (var "t")
47533 ","
47534 ")"
47535 ", "
47536 "("
47537 (var "r")
47538 ">"
47539 (var "D")
47540 "_"
47541 (var "t")
47542 ","
47543 ")"
47544 ",")))
47545 (entry (% (heading (code "GL_GEQUAL")))
47546 (para (math (var "result")
47547 "="
47548 "{"
47549 "("
47550 "1.0"
47551 ")"
47552 ", "
47553 "("
47554 "0.0"
47555 ")"
47556 "\u2062\xa0"
47557 "("
47558 (var "r")
47559 ">="
47560 (var "D")
47561 "_"
47562 (var "t")
47563 ","
47564 ")"
47565 ", "
47566 "("
47567 (var "r")
47568 "<"
47569 (var "D")
47570 "_"
47571 (var "t")
47572 ","
47573 ")"
47574 ",")))
47575 (entry (% (heading (code "GL_LESS")))
47576 (para (math (var "result")
47577 "="
47578 "{"
47579 "("
47580 "1.0"
47581 ")"
47582 ", "
47583 "("
47584 "0.0"
47585 ")"
47586 "\u2062\xa0"
47587 "("
47588 (var "r")
47589 "<"
47590 (var "D")
47591 "_"
47592 (var "t")
47593 ","
47594 ")"
47595 ", "
47596 "("
47597 (var "r")
47598 ">="
47599 (var "D")
47600 "_"
47601 (var "t")
47602 ","
47603 ")"
47604 ",")))
47605 (entry (% (heading (code "GL_GREATER")))
47606 (para (math (var "result")
47607 "="
47608 "{"
47609 "("
47610 "1.0"
47611 ")"
47612 ", "
47613 "("
47614 "0.0"
47615 ")"
47616 "\u2062\xa0"
47617 "("
47618 (var "r")
47619 ">"
47620 (var "D")
47621 "_"
47622 (var "t")
47623 ","
47624 ")"
47625 ", "
47626 "("
47627 (var "r")
47628 "<="
47629 (var "D")
47630 "_"
47631 (var "t")
47632 ","
47633 ")"
47634 ",")))
47635 (entry (% (heading (code "GL_EQUAL")))
47636 (para (math (var "result")
47637 "="
47638 "{"
47639 "("
47640 "1.0"
47641 ")"
47642 ", "
47643 "("
47644 "0.0"
47645 ")"
47646 "\u2062\xa0"
47647 "("
47648 (var "r")
47649 "="
47650 (var "D")
47651 "_"
47652 (var "t")
47653 ","
47654 ")"
47655 ", "
47656 "("
47657 (var "r")
47658 "≠"
47659 (var "D")
47660 "_"
47661 (var "t")
47662 ","
47663 ")"
47664 ",")))
47665 (entry (% (heading (code "GL_NOTEQUAL")))
47666 (para (math (var "result")
47667 "="
47668 "{"
47669 "("
47670 "1.0"
47671 ")"
47672 ", "
47673 "("
47674 "0.0"
47675 ")"
47676 "\u2062\xa0"
47677 "("
47678 (var "r")
47679 "≠"
47680 (var "D")
47681 "_"
47682 (var "t")
47683 ","
47684 ")"
47685 ", "
47686 "("
47687 (var "r")
47688 "="
47689 (var "D")
47690 "_"
47691 (var "t")
47692 ","
47693 ")"
47694 ",")))
47695 (entry (% (heading (code "GL_ALWAYS")))
47696 (para (math (var "result") "=" (code "1.0"))))
47697 (entry (% (heading (code "GL_NEVER")))
47698 (para (math (var "result") "=" (code "0.0")))))
47699 (heading "Errors")
47700 (para (code "GL_INVALID_ENUM")
47701 " is generated if "
47702 (var "target")
47703 " or "
47704 (var "pname")
47705 " is not
47706 one of the accepted defined values. ")
47707 (para (code "GL_INVALID_ENUM")
47708 " is generated if "
47709 (var "params")
47710 " should have a defined
47711 constant value (based on the value of "
47712 (var "pname")
47713 ") and does not. ")
47714 (para (code "GL_INVALID_OPERATION")
47715 " is generated if "
47716 (code "glTexParameter")
47717 " is executed between the
47718 execution of "
47719 (code "glBegin")
47720 " and the corresponding execution of "
47721 (code "glEnd")
47722 ". ")))
47723
47724 (define-gl-procedure
47725 glTexSubImage1D
47726 "glTexSubImage1D"
47727 (funcsynopsis
47728 (funcprototype
47729 (funcdef "void " (function "glTexSubImage1D"))
47730 (paramdef "GLenum " (parameter "target"))
47731 (paramdef "GLint " (parameter "level"))
47732 (paramdef "GLint " (parameter "xoffset"))
47733 (paramdef "GLsizei " (parameter "width"))
47734 (paramdef "GLenum " (parameter "format"))
47735 (paramdef "GLenum " (parameter "type"))
47736 (paramdef "const GLvoid * " (parameter "data"))))
47737 '(*fragment*
47738 (heading
47739 "specify a one-dimensional texture subimage")
47740 (heading "Parameters")
47741 (table (% (formatter (asis)))
47742 (entry (% (heading (var "target")))
47743 (para "
47744 Specifies the target texture.
47745 Must be "
47746 (code "GL_TEXTURE_1D")
47747 ". "))
47748 (entry (% (heading (var "level")))
47749 (para "
47750 Specifies the level-of-detail number.
47751 Level 0 is the base image level.
47752 Level "
47753 (var "n")
47754 " is the "
47755 (var "n")
47756 "th mipmap reduction image. "))
47757 (entry (% (heading (var "xoffset")))
47758 (para "
47759 Specifies a texel offset in the x direction within the texture array. "))
47760 (entry (% (heading (var "width")))
47761 (para "
47762 Specifies the width of the texture subimage. "))
47763 (entry (% (heading (var "format")))
47764 (para "
47765 Specifies the format of the pixel data.
47766 The following symbolic values are accepted: "
47767 (code "GL_COLOR_INDEX")
47768 ", "
47769 (code "GL_RED")
47770 ", "
47771 (code "GL_GREEN")
47772 ", "
47773 (code "GL_BLUE")
47774 ", "
47775 (code "GL_ALPHA")
47776 ", "
47777 (code "GL_RGB")
47778 ", "
47779 (code "GL_BGR")
47780 ", "
47781 (code "GL_RGBA")
47782 ", "
47783 (code "GL_BGRA")
47784 ", "
47785 (code "GL_LUMINANCE")
47786 ", and "
47787 (code "GL_LUMINANCE_ALPHA")
47788 ". "))
47789 (entry (% (heading (var "type")))
47790 (para "
47791 Specifies the data type of the pixel data.
47792 The following symbolic values are accepted: "
47793 (code "GL_UNSIGNED_BYTE")
47794 ", "
47795 (code "GL_BYTE")
47796 ", "
47797 (code "GL_BITMAP")
47798 ", "
47799 (code "GL_UNSIGNED_SHORT")
47800 ", "
47801 (code "GL_SHORT")
47802 ", "
47803 (code "GL_UNSIGNED_INT")
47804 ", "
47805 (code "GL_INT")
47806 ", "
47807 (code "GL_FLOAT")
47808 ", "
47809 (code "GL_UNSIGNED_BYTE_3_3_2")
47810 ", "
47811 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
47812 ", "
47813 (code "GL_UNSIGNED_SHORT_5_6_5")
47814 ", "
47815 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
47816 ", "
47817 (code "GL_UNSIGNED_SHORT_4_4_4_4")
47818 ", "
47819 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
47820 ", "
47821 (code "GL_UNSIGNED_SHORT_5_5_5_1")
47822 ", "
47823 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
47824 ", "
47825 (code "GL_UNSIGNED_INT_8_8_8_8")
47826 ", "
47827 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
47828 ", "
47829 (code "GL_UNSIGNED_INT_10_10_10_2")
47830 ", and "
47831 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
47832 ". "))
47833 (entry (% (heading (var "data")))
47834 (para "
47835 Specifies a pointer to the image data in memory. ")))
47836 (heading "Description")
47837 (para "
47838 Texturing maps a portion of a specified texture image
47839 onto each graphical primitive for which texturing is enabled.
47840 To enable or disable one-dimensional texturing, call "
47841 (code "glEnable")
47842 "
47843 and "
47844 (code "glDisable")
47845 " with argument "
47846 (code "GL_TEXTURE_1D")
47847 ". ")
47848 (para (code "glTexSubImage1D")
47849 " redefines a contiguous subregion of an existing one-dimensional
47850 texture image.
47851 The texels referenced by "
47852 (var "data")
47853 " replace the portion of the
47854 existing texture array with x indices "
47855 (var "xoffset")
47856 " and "
47857 (math (var "xoffset") "+" (var "width") "-" "1")
47858 ",
47859 inclusive.
47860 This region may not include any texels outside the range of the
47861 texture array as it was originally specified.
47862 It is not an error to specify a subtexture with width of 0, but
47863 such a specification has no effect. ")
47864 (para "
47865 If a non-zero named buffer object is bound to the "
47866 (code "GL_PIXEL_UNPACK_BUFFER")
47867 " target
47868 (see "
47869 (code "glBindBuffer")
47870 ") while a texture image is
47871 specified, "
47872 (var "data")
47873 " is treated as a byte offset into the buffer object's data store. ")
47874 (heading "Errors")
47875 (para (code "GL_INVALID_ENUM")
47876 " is generated if "
47877 (var "target")
47878 " is not one of the
47879 allowable values. ")
47880 (para (code "GL_INVALID_ENUM")
47881 " is generated if "
47882 (var "format")
47883 " is not an accepted
47884 format constant. ")
47885 (para (code "GL_INVALID_ENUM")
47886 " is generated if "
47887 (var "type")
47888 " is not a type constant. ")
47889 (para (code "GL_INVALID_ENUM")
47890 " is generated if "
47891 (var "type")
47892 " is "
47893 (code "GL_BITMAP")
47894 " and "
47895 (var "format")
47896 " is not "
47897 (code "GL_COLOR_INDEX")
47898 ". ")
47899 (para (code "GL_INVALID_VALUE")
47900 " is generated if "
47901 (var "level")
47902 " is less than 0. ")
47903 (para (code "GL_INVALID_VALUE")
47904 " may be generated if "
47905 (var "level")
47906 " is greater
47907 than "
47908 (math (var "log") "_" "2")
47909 (var "max")
47910 ",
47911 where "
47912 (var "max")
47913 " is the returned value of "
47914 (code "GL_MAX_TEXTURE_SIZE")
47915 ". ")
47916 (para (code "GL_INVALID_VALUE")
47917 " is generated if "
47918 (math (var "xoffset") "<" "-" (var "b"))
47919 ",
47920 or if "
47921 (math "("
47922 (var "xoffset")
47923 "+"
47924 (var "width")
47925 ","
47926 ")"
47927 ">"
47928 "("
47929 (var "w")
47930 "-"
47931 (var "b")
47932 ","
47933 ")")
47934 ",
47935 where "
47936 (math (var "w"))
47937 "
47938 is the "
47939 (code "GL_TEXTURE_WIDTH")
47940 ", and "
47941 (math (var "b"))
47942 "
47943 is
47944 the width of the "
47945 (code "GL_TEXTURE_BORDER")
47946 "
47947 of the texture image being modified.
47948 Note that "
47949 (math (var "w"))
47950 "
47951 includes twice the border width. ")
47952 (para (code "GL_INVALID_VALUE")
47953 " is generated if "
47954 (var "width")
47955 " is less than 0. ")
47956 (para (code "GL_INVALID_OPERATION")
47957 " is generated if the texture array has not
47958 been defined by a previous "
47959 (code "glTexImage1D")
47960 " operation. ")
47961 (para (code "GL_INVALID_OPERATION")
47962 " is generated if "
47963 (var "type")
47964 " is one of "
47965 (code "GL_UNSIGNED_BYTE_3_3_2")
47966 ", "
47967 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
47968 ", "
47969 (code "GL_UNSIGNED_SHORT_5_6_5")
47970 ", or "
47971 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
47972 "
47973 and "
47974 (var "format")
47975 " is not "
47976 (code "GL_RGB")
47977 ". ")
47978 (para (code "GL_INVALID_OPERATION")
47979 " is generated if "
47980 (var "type")
47981 " is one of "
47982 (code "GL_UNSIGNED_SHORT_4_4_4_4")
47983 ", "
47984 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
47985 ", "
47986 (code "GL_UNSIGNED_SHORT_5_5_5_1")
47987 ", "
47988 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
47989 ", "
47990 (code "GL_UNSIGNED_INT_8_8_8_8")
47991 ", "
47992 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
47993 ", "
47994 (code "GL_UNSIGNED_INT_10_10_10_2")
47995 ", or "
47996 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
47997 "
47998 and "
47999 (var "format")
48000 " is neither "
48001 (code "GL_RGBA")
48002 " nor "
48003 (code "GL_BGRA")
48004 ". ")
48005 (para (code "GL_INVALID_OPERATION")
48006 " is generated if a non-zero buffer object name is bound to the "
48007 (code "GL_PIXEL_UNPACK_BUFFER")
48008 " target and the buffer object's data store is currently mapped. ")
48009 (para (code "GL_INVALID_OPERATION")
48010 " is generated if a non-zero buffer object name is bound to the "
48011 (code "GL_PIXEL_UNPACK_BUFFER")
48012 " target and the data would be unpacked from the buffer
48013 object such that the memory reads required would exceed the data store size. ")
48014 (para (code "GL_INVALID_OPERATION")
48015 " is generated if a non-zero buffer object name is bound to the "
48016 (code "GL_PIXEL_UNPACK_BUFFER")
48017 " target and "
48018 (var "data")
48019 " is not evenly divisible
48020 into the number of bytes needed to store in memory a datum indicated by "
48021 (var "type")
48022 ". ")
48023 (para (code "GL_INVALID_OPERATION")
48024 " is generated if "
48025 (code "glTexSubImage1D")
48026 " is executed
48027 between the execution of "
48028 (code "glBegin")
48029 " and the corresponding
48030 execution of "
48031 (code "glEnd")
48032 ". ")))
48033
48034 (define-gl-procedure
48035 glTexSubImage2D
48036 "glTexSubImage2D"
48037 (funcsynopsis
48038 (funcprototype
48039 (funcdef "void " (function "glTexSubImage2D"))
48040 (paramdef "GLenum " (parameter "target"))
48041 (paramdef "GLint " (parameter "level"))
48042 (paramdef "GLint " (parameter "xoffset"))
48043 (paramdef "GLint " (parameter "yoffset"))
48044 (paramdef "GLsizei " (parameter "width"))
48045 (paramdef "GLsizei " (parameter "height"))
48046 (paramdef "GLenum " (parameter "format"))
48047 (paramdef "GLenum " (parameter "type"))
48048 (paramdef "const GLvoid * " (parameter "data"))))
48049 '(*fragment*
48050 (heading
48051 "specify a two-dimensional texture subimage")
48052 (heading "Parameters")
48053 (table (% (formatter (asis)))
48054 (entry (% (heading (var "target")))
48055 (para "
48056 Specifies the target texture.
48057 Must be "
48058 (code "GL_TEXTURE_2D")
48059 ", "
48060 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
48061 ", "
48062 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
48063 ", "
48064 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
48065 ", "
48066 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
48067 ", "
48068 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
48069 ", or "
48070 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
48071 ". "))
48072 (entry (% (heading (var "level")))
48073 (para "
48074 Specifies the level-of-detail number.
48075 Level 0 is the base image level.
48076 Level "
48077 (var "n")
48078 " is the "
48079 (var "n")
48080 "th mipmap reduction image. "))
48081 (entry (% (heading (var "xoffset")))
48082 (para "
48083 Specifies a texel offset in the x direction within the texture array. "))
48084 (entry (% (heading (var "yoffset")))
48085 (para "
48086 Specifies a texel offset in the y direction within the texture array. "))
48087 (entry (% (heading (var "width")))
48088 (para "
48089 Specifies the width of the texture subimage. "))
48090 (entry (% (heading (var "height")))
48091 (para "
48092 Specifies the height of the texture subimage. "))
48093 (entry (% (heading (var "format")))
48094 (para "
48095 Specifies the format of the pixel data.
48096 The following symbolic values are accepted: "
48097 (code "GL_COLOR_INDEX")
48098 ", "
48099 (code "GL_RED")
48100 ", "
48101 (code "GL_GREEN")
48102 ", "
48103 (code "GL_BLUE")
48104 ", "
48105 (code "GL_ALPHA")
48106 ", "
48107 (code "GL_RGB")
48108 ", "
48109 (code "GL_BGR")
48110 ", "
48111 (code "GL_RGBA")
48112 ", "
48113 (code "GL_BGRA")
48114 ", "
48115 (code "GL_LUMINANCE")
48116 ", and "
48117 (code "GL_LUMINANCE_ALPHA")
48118 ". "))
48119 (entry (% (heading (var "type")))
48120 (para "
48121 Specifies the data type of the pixel data.
48122 The following symbolic values are accepted: "
48123 (code "GL_UNSIGNED_BYTE")
48124 ", "
48125 (code "GL_BYTE")
48126 ", "
48127 (code "GL_BITMAP")
48128 ", "
48129 (code "GL_UNSIGNED_SHORT")
48130 ", "
48131 (code "GL_SHORT")
48132 ", "
48133 (code "GL_UNSIGNED_INT")
48134 ", "
48135 (code "GL_INT")
48136 ", "
48137 (code "GL_FLOAT")
48138 ", "
48139 (code "GL_UNSIGNED_BYTE_3_3_2")
48140 ", "
48141 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
48142 ", "
48143 (code "GL_UNSIGNED_SHORT_5_6_5")
48144 ", "
48145 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
48146 ", "
48147 (code "GL_UNSIGNED_SHORT_4_4_4_4")
48148 ", "
48149 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
48150 ", "
48151 (code "GL_UNSIGNED_SHORT_5_5_5_1")
48152 ", "
48153 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
48154 ", "
48155 (code "GL_UNSIGNED_INT_8_8_8_8")
48156 ", "
48157 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
48158 ", "
48159 (code "GL_UNSIGNED_INT_10_10_10_2")
48160 ", and "
48161 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
48162 ". "))
48163 (entry (% (heading (var "data")))
48164 (para "
48165 Specifies a pointer to the image data in memory. ")))
48166 (heading "Description")
48167 (para "
48168 Texturing maps a portion of a specified texture image
48169 onto each graphical primitive for which texturing is enabled.
48170 To enable and disable two-dimensional texturing, call "
48171 (code "glEnable")
48172 "
48173 and "
48174 (code "glDisable")
48175 " with argument "
48176 (code "GL_TEXTURE_2D")
48177 ". ")
48178 (para (code "glTexSubImage2D")
48179 " redefines a contiguous subregion of an existing two-dimensional
48180 texture image.
48181 The texels referenced by "
48182 (var "data")
48183 " replace the portion of the
48184 existing texture array with x indices "
48185 (var "xoffset")
48186 " and "
48187 (math (var "xoffset") "+" (var "width") "-" "1")
48188 ",
48189 inclusive,
48190 and y indices "
48191 (var "yoffset")
48192 " and "
48193 (math (var "yoffset") "+" (var "height") "-" "1")
48194 ",
48195 inclusive.
48196 This region may not include any texels outside the range of the
48197 texture array as it was originally specified.
48198 It is not an error to specify a subtexture with zero width or height, but
48199 such a specification has no effect. ")
48200 (para "
48201 If a non-zero named buffer object is bound to the "
48202 (code "GL_PIXEL_UNPACK_BUFFER")
48203 " target
48204 (see "
48205 (code "glBindBuffer")
48206 ") while a texture image is
48207 specified, "
48208 (var "data")
48209 " is treated as a byte offset into the buffer object's data store. ")
48210 (heading "Errors")
48211 (para (code "GL_INVALID_ENUM")
48212 " is generated if "
48213 (var "target")
48214 " is not "
48215 (code "GL_TEXTURE_2D")
48216 ", "
48217 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_X")
48218 ", "
48219 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_X")
48220 ", "
48221 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Y")
48222 ", "
48223 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y")
48224 ", "
48225 (code "GL_TEXTURE_CUBE_MAP_POSITIVE_Z")
48226 ", or "
48227 (code "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z")
48228 ". ")
48229 (para (code "GL_INVALID_ENUM")
48230 " is generated if "
48231 (var "format")
48232 " is not an accepted
48233 format constant. ")
48234 (para (code "GL_INVALID_ENUM")
48235 " is generated if "
48236 (var "type")
48237 " is not a type constant. ")
48238 (para (code "GL_INVALID_ENUM")
48239 " is generated if "
48240 (var "type")
48241 " is "
48242 (code "GL_BITMAP")
48243 " and "
48244 (var "format")
48245 " is not "
48246 (code "GL_COLOR_INDEX")
48247 ". ")
48248 (para (code "GL_INVALID_VALUE")
48249 " is generated if "
48250 (var "level")
48251 " is less than 0. ")
48252 (para (code "GL_INVALID_VALUE")
48253 " may be generated if "
48254 (var "level")
48255 " is greater
48256 than "
48257 (math (var "log") "_" "2")
48258 (var "max")
48259 ",
48260 where "
48261 (var "max")
48262 " is the returned value of "
48263 (code "GL_MAX_TEXTURE_SIZE")
48264 ". ")
48265 (para (code "GL_INVALID_VALUE")
48266 " is generated if "
48267 (math (var "xoffset") "<" "-" (var "b"))
48268 ", "
48269 (math "("
48270 (var "xoffset")
48271 "+"
48272 (var "width")
48273 ","
48274 ")"
48275 ">"
48276 "("
48277 (var "w")
48278 "-"
48279 (var "b")
48280 ","
48281 ")")
48282 ", "
48283 (math (var "yoffset") "<" "-" (var "b"))
48284 ",
48285 or "
48286 (math "("
48287 (var "yoffset")
48288 "+"
48289 (var "height")
48290 ","
48291 ")"
48292 ">"
48293 "("
48294 (var "h")
48295 "-"
48296 (var "b")
48297 ","
48298 ")")
48299 ",
48300 where "
48301 (math (var "w"))
48302 "
48303 is the "
48304 (code "GL_TEXTURE_WIDTH")
48305 ", "
48306 (math (var "h"))
48307 "
48308 is the "
48309 (code "GL_TEXTURE_HEIGHT")
48310 ", and "
48311 (math (var "b"))
48312 "
48313 is the border width
48314 of the texture image being modified.
48315 Note that "
48316 (math (var "w"))
48317 "
48318 and "
48319 (math (var "h"))
48320 "
48321 include twice the border width. ")
48322 (para (code "GL_INVALID_VALUE")
48323 " is generated if "
48324 (var "width")
48325 " or "
48326 (var "height")
48327 " is less than 0. ")
48328 (para (code "GL_INVALID_OPERATION")
48329 " is generated if the texture array has not
48330 been defined by a previous "
48331 (code "glTexImage2D")
48332 " operation. ")
48333 (para (code "GL_INVALID_OPERATION")
48334 " is generated if "
48335 (var "type")
48336 " is one of "
48337 (code "GL_UNSIGNED_BYTE_3_3_2")
48338 ", "
48339 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
48340 ", "
48341 (code "GL_UNSIGNED_SHORT_5_6_5")
48342 ", or "
48343 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
48344 "
48345 and "
48346 (var "format")
48347 " is not "
48348 (code "GL_RGB")
48349 ". ")
48350 (para (code "GL_INVALID_OPERATION")
48351 " is generated if "
48352 (var "type")
48353 " is one of "
48354 (code "GL_UNSIGNED_SHORT_4_4_4_4")
48355 ", "
48356 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
48357 ", "
48358 (code "GL_UNSIGNED_SHORT_5_5_5_1")
48359 ", "
48360 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
48361 ", "
48362 (code "GL_UNSIGNED_INT_8_8_8_8")
48363 ", "
48364 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
48365 ", "
48366 (code "GL_UNSIGNED_INT_10_10_10_2")
48367 ", or "
48368 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
48369 "
48370 and "
48371 (var "format")
48372 " is neither "
48373 (code "GL_RGBA")
48374 " nor "
48375 (code "GL_BGRA")
48376 ". ")
48377 (para (code "GL_INVALID_OPERATION")
48378 " is generated if a non-zero buffer object name is bound to the "
48379 (code "GL_PIXEL_UNPACK_BUFFER")
48380 " target and the buffer object's data store is currently mapped. ")
48381 (para (code "GL_INVALID_OPERATION")
48382 " is generated if a non-zero buffer object name is bound to the "
48383 (code "GL_PIXEL_UNPACK_BUFFER")
48384 " target and the data would be unpacked from the buffer
48385 object such that the memory reads required would exceed the data store size. ")
48386 (para (code "GL_INVALID_OPERATION")
48387 " is generated if a non-zero buffer object name is bound to the "
48388 (code "GL_PIXEL_UNPACK_BUFFER")
48389 " target and "
48390 (var "data")
48391 " is not evenly divisible
48392 into the number of bytes needed to store in memory a datum indicated by "
48393 (var "type")
48394 ". ")
48395 (para (code "GL_INVALID_OPERATION")
48396 " is generated if "
48397 (code "glTexSubImage2D")
48398 " is executed
48399 between the execution of "
48400 (code "glBegin")
48401 " and the corresponding
48402 execution of "
48403 (code "glEnd")
48404 ". ")))
48405
48406 (define-gl-procedure
48407 glTexSubImage3D
48408 "glTexSubImage3D"
48409 (funcsynopsis
48410 (funcprototype
48411 (funcdef "void " (function "glTexSubImage3D"))
48412 (paramdef "GLenum " (parameter "target"))
48413 (paramdef "GLint " (parameter "level"))
48414 (paramdef "GLint " (parameter "xoffset"))
48415 (paramdef "GLint " (parameter "yoffset"))
48416 (paramdef "GLint " (parameter "zoffset"))
48417 (paramdef "GLsizei " (parameter "width"))
48418 (paramdef "GLsizei " (parameter "height"))
48419 (paramdef "GLsizei " (parameter "depth"))
48420 (paramdef "GLenum " (parameter "format"))
48421 (paramdef "GLenum " (parameter "type"))
48422 (paramdef "const GLvoid * " (parameter "data"))))
48423 '(*fragment*
48424 (heading
48425 "specify a three-dimensional texture subimage")
48426 (heading "Parameters")
48427 (table (% (formatter (asis)))
48428 (entry (% (heading (var "target")))
48429 (para "
48430 Specifies the target texture.
48431 Must be "
48432 (code "GL_TEXTURE_3D")
48433 ". "))
48434 (entry (% (heading (var "level")))
48435 (para "
48436 Specifies the level-of-detail number.
48437 Level 0 is the base image level.
48438 Level "
48439 (var "n")
48440 " is the "
48441 (var "n")
48442 "th mipmap reduction image. "))
48443 (entry (% (heading (var "xoffset")))
48444 (para "
48445 Specifies a texel offset in the x direction within the texture array. "))
48446 (entry (% (heading (var "yoffset")))
48447 (para "
48448 Specifies a texel offset in the y direction within the texture array. "))
48449 (entry (% (heading (var "zoffset")))
48450 (para "
48451 Specifies a texel offset in the z direction within the texture array. "))
48452 (entry (% (heading (var "width")))
48453 (para "
48454 Specifies the width of the texture subimage. "))
48455 (entry (% (heading (var "height")))
48456 (para "
48457 Specifies the height of the texture subimage. "))
48458 (entry (% (heading (var "depth")))
48459 (para "
48460 Specifies the depth of the texture subimage. "))
48461 (entry (% (heading (var "format")))
48462 (para "
48463 Specifies the format of the pixel data.
48464 The following symbolic values are accepted: "
48465 (code "GL_COLOR_INDEX")
48466 ", "
48467 (code "GL_RED")
48468 ", "
48469 (code "GL_GREEN")
48470 ", "
48471 (code "GL_BLUE")
48472 ", "
48473 (code "GL_ALPHA")
48474 ", "
48475 (code "GL_RGB")
48476 ", "
48477 (code "GL_BGR")
48478 ", "
48479 (code "GL_RGBA")
48480 ", "
48481 (code "GL_BGRA")
48482 ", "
48483 (code "GL_LUMINANCE")
48484 ", and "
48485 (code "GL_LUMINANCE_ALPHA")
48486 ". "))
48487 (entry (% (heading (var "type")))
48488 (para "
48489 Specifies the data type of the pixel data.
48490 The following symbolic values are accepted: "
48491 (code "GL_UNSIGNED_BYTE")
48492 ", "
48493 (code "GL_BYTE")
48494 ", "
48495 (code "GL_BITMAP")
48496 ", "
48497 (code "GL_UNSIGNED_SHORT")
48498 ", "
48499 (code "GL_SHORT")
48500 ", "
48501 (code "GL_UNSIGNED_INT")
48502 ", "
48503 (code "GL_INT")
48504 ", "
48505 (code "GL_FLOAT")
48506 ", "
48507 (code "GL_UNSIGNED_BYTE_3_3_2")
48508 ", "
48509 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
48510 ", "
48511 (code "GL_UNSIGNED_SHORT_5_6_5")
48512 ", "
48513 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
48514 ", "
48515 (code "GL_UNSIGNED_SHORT_4_4_4_4")
48516 ", "
48517 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
48518 ", "
48519 (code "GL_UNSIGNED_SHORT_5_5_5_1")
48520 ", "
48521 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
48522 ", "
48523 (code "GL_UNSIGNED_INT_8_8_8_8")
48524 ", "
48525 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
48526 ", "
48527 (code "GL_UNSIGNED_INT_10_10_10_2")
48528 ", and "
48529 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
48530 ". "))
48531 (entry (% (heading (var "data")))
48532 (para "
48533 Specifies a pointer to the image data in memory. ")))
48534 (heading "Description")
48535 (para "
48536 Texturing maps a portion of a specified texture image
48537 onto each graphical primitive for which texturing is enabled.
48538 To enable and disable three-dimensional texturing, call "
48539 (code "glEnable")
48540 "
48541 and "
48542 (code "glDisable")
48543 " with argument "
48544 (code "GL_TEXTURE_3D")
48545 ". ")
48546 (para (code "glTexSubImage3D")
48547 " redefines a contiguous subregion of an existing three-dimensional
48548 texture image.
48549 The texels referenced by "
48550 (var "data")
48551 " replace the portion of the
48552 existing texture array with x indices "
48553 (var "xoffset")
48554 " and "
48555 (math (var "xoffset") "+" (var "width") "-" "1")
48556 ",
48557 inclusive,
48558 y indices "
48559 (var "yoffset")
48560 " and "
48561 (math (var "yoffset") "+" (var "height") "-" "1")
48562 ",
48563 inclusive,
48564 and z indices "
48565 (var "zoffset")
48566 " and "
48567 (math (var "zoffset") "+" (var "depth") "-" "1")
48568 ",
48569 inclusive.
48570 This region may not include any texels outside the range of the
48571 texture array as it was originally specified.
48572 It is not an error to specify a subtexture with zero width, height, or
48573 depth but such a specification has no effect. ")
48574 (para "
48575 If a non-zero named buffer object is bound to the "
48576 (code "GL_PIXEL_UNPACK_BUFFER")
48577 " target
48578 (see "
48579 (code "glBindBuffer")
48580 ") while a texture image is
48581 specified, "
48582 (var "data")
48583 " is treated as a byte offset into the buffer object's data store. ")
48584 (heading "Errors")
48585 (para (code "GL_INVALID_ENUM")
48586 " is generated if /"
48587 (var "target")
48588 " is not "
48589 (code "GL_TEXTURE_3D")
48590 ". ")
48591 (para (code "GL_INVALID_ENUM")
48592 " is generated if "
48593 (var "format")
48594 " is not an accepted
48595 format constant. ")
48596 (para (code "GL_INVALID_ENUM")
48597 " is generated if "
48598 (var "type")
48599 " is not a type constant. ")
48600 (para (code "GL_INVALID_ENUM")
48601 " is generated if "
48602 (var "type")
48603 " is "
48604 (code "GL_BITMAP")
48605 " and "
48606 (var "format")
48607 " is not "
48608 (code "GL_COLOR_INDEX")
48609 ". ")
48610 (para (code "GL_INVALID_VALUE")
48611 " is generated if "
48612 (var "level")
48613 " is less than 0. ")
48614 (para (code "GL_INVALID_VALUE")
48615 " may be generated if "
48616 (var "level")
48617 " is greater
48618 than "
48619 (math (var "log") "_" "2")
48620 (var "max")
48621 ",
48622 where "
48623 (var "max")
48624 " is the returned value of "
48625 (code "GL_MAX_TEXTURE_SIZE")
48626 ". ")
48627 (para (code "GL_INVALID_VALUE")
48628 " is generated if "
48629 (math (var "xoffset") "<" "-" (var "b"))
48630 ", "
48631 (math "("
48632 (var "xoffset")
48633 "+"
48634 (var "width")
48635 ","
48636 ")"
48637 ">"
48638 "("
48639 (var "w")
48640 "-"
48641 (var "b")
48642 ","
48643 ")")
48644 ", "
48645 (math (var "yoffset") "<" "-" (var "b"))
48646 ",
48647 or "
48648 (math "("
48649 (var "yoffset")
48650 "+"
48651 (var "height")
48652 ","
48653 ")"
48654 ">"
48655 "("
48656 (var "h")
48657 "-"
48658 (var "b")
48659 ","
48660 ")")
48661 ",
48662 or "
48663 (math (var "zoffset") "<" "-" (var "b"))
48664 ",
48665 or "
48666 (math "("
48667 (var "zoffset")
48668 "+"
48669 (var "depth")
48670 ","
48671 ")"
48672 ">"
48673 "("
48674 (var "d")
48675 "-"
48676 (var "b")
48677 ","
48678 ")")
48679 ",
48680 where "
48681 (math (var "w"))
48682 "
48683 is the "
48684 (code "GL_TEXTURE_WIDTH")
48685 ", "
48686 (math (var "h"))
48687 "
48688 is the "
48689 (code "GL_TEXTURE_HEIGHT")
48690 ", "
48691 (math (var "d"))
48692 "
48693 is the "
48694 (code "GL_TEXTURE_DEPTH")
48695 "
48696 and "
48697 (math (var "b"))
48698 "
48699 is the border width of the texture image being modified.
48700 Note that "
48701 (math (var "w"))
48702 ", "
48703 (math (var "h"))
48704 ",
48705 and "
48706 (math (var "d"))
48707 "
48708 include twice the border width. ")
48709 (para (code "GL_INVALID_VALUE")
48710 " is generated if "
48711 (var "width")
48712 ", "
48713 (var "height")
48714 ", or "
48715 (var "depth")
48716 "
48717 is less than 0. ")
48718 (para (code "GL_INVALID_OPERATION")
48719 " is generated if the texture array has not
48720 been defined by a previous "
48721 (code "glTexImage3D")
48722 " operation. ")
48723 (para (code "GL_INVALID_OPERATION")
48724 " is generated if "
48725 (var "type")
48726 " is one of "
48727 (code "GL_UNSIGNED_BYTE_3_3_2")
48728 ", "
48729 (code "GL_UNSIGNED_BYTE_2_3_3_REV")
48730 ", "
48731 (code "GL_UNSIGNED_SHORT_5_6_5")
48732 ", or "
48733 (code "GL_UNSIGNED_SHORT_5_6_5_REV")
48734 "
48735 and "
48736 (var "format")
48737 " is not "
48738 (code "GL_RGB")
48739 ". ")
48740 (para (code "GL_INVALID_OPERATION")
48741 " is generated if "
48742 (var "type")
48743 " is one of "
48744 (code "GL_UNSIGNED_SHORT_4_4_4_4")
48745 ", "
48746 (code "GL_UNSIGNED_SHORT_4_4_4_4_REV")
48747 ", "
48748 (code "GL_UNSIGNED_SHORT_5_5_5_1")
48749 ", "
48750 (code "GL_UNSIGNED_SHORT_1_5_5_5_REV")
48751 ", "
48752 (code "GL_UNSIGNED_INT_8_8_8_8")
48753 ", "
48754 (code "GL_UNSIGNED_INT_8_8_8_8_REV")
48755 ", "
48756 (code "GL_UNSIGNED_INT_10_10_10_2")
48757 ", or "
48758 (code "GL_UNSIGNED_INT_2_10_10_10_REV")
48759 "
48760 and "
48761 (var "format")
48762 " is neither "
48763 (code "GL_RGBA")
48764 " nor "
48765 (code "GL_BGRA")
48766 ". ")
48767 (para (code "GL_INVALID_OPERATION")
48768 " is generated if a non-zero buffer object name is bound to the "
48769 (code "GL_PIXEL_UNPACK_BUFFER")
48770 " target and the buffer object's data store is currently mapped. ")
48771 (para (code "GL_INVALID_OPERATION")
48772 " is generated if a non-zero buffer object name is bound to the "
48773 (code "GL_PIXEL_UNPACK_BUFFER")
48774 " target and the data would be unpacked from the buffer
48775 object such that the memory reads required would exceed the data store size. ")
48776 (para (code "GL_INVALID_OPERATION")
48777 " is generated if a non-zero buffer object name is bound to the "
48778 (code "GL_PIXEL_UNPACK_BUFFER")
48779 " target and "
48780 (var "data")
48781 " is not evenly divisible
48782 into the number of bytes needed to store in memory a datum indicated by "
48783 (var "type")
48784 ". ")
48785 (para (code "GL_INVALID_OPERATION")
48786 " is generated if "
48787 (code "glTexSubImage3D")
48788 " is executed
48789 between the execution of "
48790 (code "glBegin")
48791 " and the corresponding
48792 execution of "
48793 (code "glEnd")
48794 ". ")))
48795
48796 (define-gl-procedure
48797 glTranslate
48798 "glTranslate"
48799 (funcsynopsis
48800 (funcprototype
48801 (funcdef "void " (function "glTranslated"))
48802 (paramdef "GLdouble " (parameter "x"))
48803 (paramdef "GLdouble " (parameter "y"))
48804 (paramdef "GLdouble " (parameter "z"))))
48805 '(*fragment*
48806 (heading
48807 "multiply the current matrix by a translation matrix")
48808 (heading "Parameters")
48809 (table (% (formatter (asis)))
48810 (entry (% (heading (var "x")))
48811 (itemx (var "y"))
48812 (itemx (var "z"))
48813 (para "
48814 Specify the "
48815 (var "x")
48816 ", "
48817 (var "y")
48818 ", and "
48819 (var "z")
48820 " coordinates of a translation vector. ")))
48821 (heading "Description")
48822 (para (code "glTranslate")
48823 " produces a translation by "
48824 (math "(" (var "x") "," (var "y") (var "z") ")")
48825 ".
48826 The current matrix
48827 (see "
48828 (code "glMatrixMode")
48829 ")
48830 is multiplied by this translation matrix,
48831 with the product replacing the current matrix, as if "
48832 (code "glMultMatrix")
48833 " were called with the following matrix
48834 for its argument: ")
48835 (para (math "("
48836 "("
48837 "1"
48838 " "
48839 "0"
48840 " "
48841 "0"
48842 " "
48843 (var "x")
48844 ")"
48845 ", "
48846 "("
48847 "0"
48848 " "
48849 "1"
48850 " "
48851 "0"
48852 " "
48853 (var "y")
48854 ")"
48855 ", "
48856 "("
48857 "0"
48858 " "
48859 "0"
48860 " "
48861 "1"
48862 " "
48863 (var "z")
48864 ")"
48865 ", "
48866 "("
48867 "0"
48868 " "
48869 "0"
48870 " "
48871 "0"
48872 " "
48873 "1"
48874 ")"
48875 ","
48876 ")"))
48877 (para)
48878 (para "
48879 If the matrix mode is either "
48880 (code "GL_MODELVIEW")
48881 " or "
48882 (code "GL_PROJECTION")
48883 ",
48884 all objects drawn after a call to "
48885 (code "glTranslate")
48886 " are translated. ")
48887 (para "
48888 Use "
48889 (code "glPushMatrix")
48890 " and "
48891 (code "glPopMatrix")
48892 " to save and restore
48893 the untranslated coordinate system. ")
48894 (heading "Errors")
48895 (para (code "GL_INVALID_OPERATION")
48896 " is generated if "
48897 (code "glTranslate")
48898 "
48899 is executed between the execution of "
48900 (code "glBegin")
48901 "
48902 and the corresponding execution of "
48903 (code "glEnd")
48904 ". ")))
48905
48906 (define-gl-procedure
48907 glUniform1f
48908 "glUniform1f"
48909 (funcsynopsis
48910 (funcprototype
48911 (funcdef "void " (function "glUniform1f"))
48912 (paramdef "GLint " (parameter "location"))
48913 (paramdef "GLfloat " (parameter "v0")))
48914 (funcprototype
48915 (funcdef "void " (function "glUniform2f"))
48916 (paramdef "GLint " (parameter "location"))
48917 (paramdef "GLfloat " (parameter "v0"))
48918 (paramdef "GLfloat " (parameter "v1")))
48919 (funcprototype
48920 (funcdef "void " (function "glUniform3f"))
48921 (paramdef "GLint " (parameter "location"))
48922 (paramdef "GLfloat " (parameter "v0"))
48923 (paramdef "GLfloat " (parameter "v1"))
48924 (paramdef "GLfloat " (parameter "v2")))
48925 (funcprototype
48926 (funcdef "void " (function "glUniform4f"))
48927 (paramdef "GLint " (parameter "location"))
48928 (paramdef "GLfloat " (parameter "v0"))
48929 (paramdef "GLfloat " (parameter "v1"))
48930 (paramdef "GLfloat " (parameter "v2"))
48931 (paramdef "GLfloat " (parameter "v3")))
48932 (funcprototype
48933 (funcdef "void " (function "glUniform1i"))
48934 (paramdef "GLint " (parameter "location"))
48935 (paramdef "GLint " (parameter "v0")))
48936 (funcprototype
48937 (funcdef "void " (function "glUniform2i"))
48938 (paramdef "GLint " (parameter "location"))
48939 (paramdef "GLint " (parameter "v0"))
48940 (paramdef "GLint " (parameter "v1")))
48941 (funcprototype
48942 (funcdef "void " (function "glUniform3i"))
48943 (paramdef "GLint " (parameter "location"))
48944 (paramdef "GLint " (parameter "v0"))
48945 (paramdef "GLint " (parameter "v1"))
48946 (paramdef "GLint " (parameter "v2")))
48947 (funcprototype
48948 (funcdef "void " (function "glUniform4i"))
48949 (paramdef "GLint " (parameter "location"))
48950 (paramdef "GLint " (parameter "v0"))
48951 (paramdef "GLint " (parameter "v1"))
48952 (paramdef "GLint " (parameter "v2"))
48953 (paramdef "GLint " (parameter "v3"))))
48954 '(*fragment*
48955 (heading
48956 "Specify the value of a uniform variable for the current program object")
48957 (heading "Parameters")
48958 (table (% (formatter (asis)))
48959 (entry (% (heading (var "location")))
48960 (para "Specifies the location of the uniform variable
48961 \t\t to be modified."))
48962 (entry (% (heading
48963 (var "v0")
48964 ", "
48965 (var "v1")
48966 ", "
48967 (var "v2")
48968 ", "
48969 (var "v3")))
48970 (para "Specifies the new values to be used for the
48971 \t\t specified uniform variable.")))
48972 (heading "Description")
48973 (para (code "glUniform")
48974 " modifies the value of a
48975 \tuniform variable or a uniform variable array. The location of
48976 \tthe uniform variable to be modified is specified by\t"
48977 (var "location")
48978 ", which should be a value
48979 \treturned by\t"
48980 (code "glGetUniformLocation")
48981 ".\t"
48982 (code "glUniform")
48983 " operates on the program object
48984 \tthat was made part of current state by calling\t"
48985 (code "glUseProgram")
48986 ".")
48987 (para "The commands "
48988 (code "glUniform{1|2|3|4}{f|i}")
48989 "
48990 are used to change the value of the uniform variable specified
48991 \tby "
48992 (var "location")
48993 " using the values passed as
48994 \targuments. The number specified in the command should match the
48995 \tnumber of components in the data type of the specified uniform
48996 \tvariable (e.g., "
48997 (code "1")
48998 " for float, int, bool;\t"
48999 (code "2")
49000 " for vec2, ivec2, bvec2, etc.). The suffix\t"
49001 (code "f")
49002 " indicates that floating-point values are
49003 \tbeing passed; the suffix "
49004 (code "i")
49005 " indicates that
49006 \tinteger values are being passed, and this type should also match
49007 \tthe data type of the specified uniform variable. The\t"
49008 (code "i")
49009 " variants of this function should be used
49010 \tto provide values for uniform variables defined as int, ivec2,
49011 \tivec3, ivec4, or arrays of these. The "
49012 (code "f")
49013 "
49014 variants should be used to provide values for uniform variables
49015 \tof type float, vec2, vec3, vec4, or arrays of these. Either the\t"
49016 (code "i")
49017 " or the "
49018 (code "f")
49019 " variants
49020 \tmay be used to provide values for uniform variables of type
49021 \tbool, bvec2, bvec3, bvec4, or arrays of these. The uniform
49022 \tvariable will be set to false if the input value is 0 or 0.0f,
49023 \tand it will be set to true otherwise.")
49024 (para "All active uniform variables defined in a program object
49025 \tare initialized to 0 when the program object is linked
49026 \tsuccessfully. They retain the values assigned to them by a call
49027 \tto "
49028 (code "glUniform ")
49029 " until the next successful
49030 \tlink operation occurs on the program object, when they are once
49031 \tagain initialized to 0.")
49032 (para "The commands "
49033 (code "glUniform{1|2|3|4}{f|i}v")
49034 "
49035 can be used to modify a single uniform variable or a uniform
49036 \tvariable array. These commands pass a count and a pointer to the
49037 \tvalues to be loaded into a uniform variable or a uniform
49038 \tvariable array. A count of 1 should be used if modifying the
49039 \tvalue of a single uniform variable, and a count of 1 or greater
49040 \tcan be used to modify an entire array or part of an array. When
49041 \tloading "
49042 (var "n")
49043 " elements starting at an arbitrary
49044 \tposition "
49045 (var "m")
49046 " in a uniform variable array,
49047 \telements "
49048 (var "m")
49049 " + "
49050 (var "n")
49051 " - 1 in
49052 \tthe array will be replaced with the new values. If\t"
49053 (var "m")
49054 " + "
49055 (var "n")
49056 " - 1 is
49057 \tlarger than the size of the uniform variable array, values for
49058 \tall array elements beyond the end of the array will be ignored.
49059 \tThe number specified in the name of the command indicates the
49060 \tnumber of components for each element in\t"
49061 (var "value")
49062 ", and it should match the number of
49063 \tcomponents in the data type of the specified uniform variable
49064 \t(e.g., "
49065 (code "1")
49066 " for float, int, bool;\t"
49067 (code "2")
49068 " for vec2, ivec2, bvec2, etc.). The data
49069 \ttype specified in the name of the command must match the data
49070 \ttype for the specified uniform variable as described previously
49071 \tfor "
49072 (code "glUniform{1|2|3|4}{f|i}")
49073 ".")
49074 (para "For uniform variable arrays, each element of the array is
49075 \tconsidered to be of the type indicated in the name of the
49076 \tcommand (e.g., "
49077 (code "glUniform3f")
49078 " or\t"
49079 (code "glUniform3fv")
49080 " can be used to load a uniform
49081 \tvariable array of type vec3). The number of elements of the
49082 \tuniform variable array to be modified is specified by\t"
49083 (var "count"))
49084 (para "The commands\t"
49085 (code "glUniformMatrix{2|3|4|2x3|3x2|2x4|4x2|3x4|4x3}fv")
49086 " are used to modify a matrix or an array of matrices. The numbers in the
49087 \tcommand name are interpreted as the dimensionality of the matrix.
49088 \tThe number "
49089 (code "2")
49090 " indicates a 2 × 2 matrix
49091 \t(i.e., 4 values), the number "
49092 (code "3")
49093 " indicates a
49094 \t3 × 3 matrix (i.e., 9 values), and the number\t"
49095 (code "4")
49096 " indicates a 4 × 4 matrix (i.e., 16
49097 \tvalues). Non-square matrix dimensionality is explicit, with the first
49098 number representing the number of columns and the second number
49099 representing the number of rows. For example, "
49100 (code "2x4")
49101 " indicates a 2 × 4 matrix with 2 columns
49102 and 4 rows (i.e., 8 values).
49103 If "
49104 (var "transpose")
49105 " is\t"
49106 (code "GL_FALSE")
49107 ", each matrix is assumed to be
49108 \tsupplied in column major order. If\t"
49109 (var "transpose")
49110 " is\t"
49111 (code "GL_TRUE")
49112 ", each matrix is assumed to be
49113 \tsupplied in row major order. The "
49114 (var "count")
49115 "
49116 argument indicates the number of matrices to be passed. A count
49117 \tof 1 should be used if modifying the value of a single matrix,
49118 \tand a count greater than 1 can be used to modify an array of
49119 \tmatrices.")
49120 (heading "Errors")
49121 (para (code "GL_INVALID_OPERATION")
49122 " is generated if there
49123 \tis no current program object.")
49124 (para (code "GL_INVALID_OPERATION")
49125 " is generated if the
49126 \tsize of the uniform variable declared in the shader does not
49127 \tmatch the size indicated by the "
49128 (code "glUniform")
49129 "
49130 command.")
49131 (para (code "GL_INVALID_OPERATION")
49132 " is generated if one of
49133 \tthe integer variants of this function is used to load a uniform
49134 \tvariable of type float, vec2, vec3, vec4, or an array of these,
49135 \tor if one of the floating-point variants of this function is
49136 \tused to load a uniform variable of type int, ivec2, ivec3, or
49137 \tivec4, or an array of these.")
49138 (para (code "GL_INVALID_OPERATION")
49139 " is generated if\t"
49140 (var "location")
49141 " is an invalid uniform location
49142 \tfor the current program object and\t"
49143 (var "location")
49144 " is not equal to -1.")
49145 (para (code "GL_INVALID_VALUE")
49146 " is generated if\t"
49147 (var "count")
49148 " is less than 0.")
49149 (para (code "GL_INVALID_OPERATION")
49150 " is generated if\t"
49151 (var "count")
49152 " is greater than 1 and the indicated
49153 \tuniform variable is not an array variable.")
49154 (para (code "GL_INVALID_OPERATION")
49155 " is generated if a
49156 \tsampler is loaded using a command other than\t"
49157 (code "glUniform1i")
49158 " and\t"
49159 (code "glUniform1iv")
49160 ".")
49161 (para (code "GL_INVALID_OPERATION")
49162 " is generated if\t"
49163 (code "glUniform")
49164 " is executed between the execution
49165 \tof\t"
49166 (code "glBegin")
49167 "
49168 and the corresponding execution of\t"
49169 (code "glEnd")
49170 ".")))
49171
49172 (define-gl-procedure
49173 glUseProgram
49174 "glUseProgram"
49175 (funcsynopsis
49176 (funcprototype
49177 (funcdef "void " (function "glUseProgram"))
49178 (paramdef "GLuint " (parameter "program"))))
49179 '(*fragment*
49180 (heading
49181 "Installs a program object as part of current rendering state")
49182 (heading "Parameters")
49183 (table (% (formatter (asis)))
49184 (entry (% (heading (var "program")))
49185 (para "Specifies the handle of the program object
49186 \t\t whose executables are to be used as part of current
49187 \t\t rendering state.")))
49188 (heading "Description")
49189 (para (code "glUseProgram")
49190 " installs the program
49191 \tobject specified by "
49192 (var "program")
49193 " as part of
49194 \tcurrent rendering state. One or more executables are created in
49195 \ta program object by successfully attaching shader objects to it
49196 \twith\t"
49197 (code "glAttachShader")
49198 ",
49199 \tsuccessfully compiling the shader objects with\t"
49200 (code "glCompileShader")
49201 ",
49202 \tand successfully linking the program object with\t"
49203 (code "glLinkProgram")
49204 ".\t")
49205 (para "A program object will contain an executable that will run
49206 \ton the vertex processor if it contains one or more shader
49207 \tobjects of type "
49208 (code "GL_VERTEX_SHADER")
49209 " that have
49210 \tbeen successfully compiled and linked. Similarly, a program
49211 \tobject will contain an executable that will run on the fragment
49212 \tprocessor if it contains one or more shader objects of type\t"
49213 (code "GL_FRAGMENT_SHADER")
49214 " that have been
49215 \tsuccessfully compiled and linked.")
49216 (para "Successfully installing an executable on a programmable
49217 \tprocessor will cause the corresponding fixed functionality of
49218 \tOpenGL to be disabled. Specifically, if an executable is
49219 \tinstalled on the vertex processor, the OpenGL fixed
49220 \tfunctionality will be disabled as follows.")
49221 (itemize
49222 (item (para "The modelview matrix is not applied to vertex
49223 \t\tcoordinates."))
49224 (item (para "The projection matrix is not applied to vertex
49225 \t\tcoordinates."))
49226 (item (para "The texture matrices are not applied to texture
49227 \t\tcoordinates."))
49228 (item (para "Normals are not transformed to eye
49229 \t\tcoordinates."))
49230 (item (para "Normals are not rescaled or normalized."))
49231 (item (para "Normalization of\t"
49232 (code "GL_AUTO_NORMAL")
49233 " evaluated normals is
49234 \t\tnot performed."))
49235 (item (para "Texture coordinates are not generated
49236 \t\tautomatically."))
49237 (item (para "Per-vertex lighting is not performed."))
49238 (item (para "Color material computations are not
49239 \t\tperformed."))
49240 (item (para "Color index lighting is not performed."))
49241 (item (para "This list also applies when setting the current
49242 \t\traster position.")))
49243 (para "The executable that is installed on the vertex processor
49244 \tis expected to implement any or all of the desired functionality
49245 \tfrom the preceding list. Similarly, if an executable is
49246 \tinstalled on the fragment processor, the OpenGL fixed
49247 \tfunctionality will be disabled as follows.")
49248 (itemize
49249 (item (para "Texture environment and texture functions are not
49250 \t\tapplied."))
49251 (item (para "Texture application is not applied."))
49252 (item (para "Color sum is not applied."))
49253 (item (para "Fog is not applied.")))
49254 (para "Again, the fragment shader that is installed is expected
49255 \tto implement any or all of the desired functionality from the
49256 \tpreceding list.")
49257 (para "While a program object is in use, applications are free to
49258 \tmodify attached shader objects, compile attached shader objects,
49259 \tattach additional shader objects, and detach or delete shader
49260 \tobjects. None of these operations will affect the executables
49261 \tthat are part of the current state. However, relinking the
49262 \tprogram object that is currently in use will install the program
49263 \tobject as part of the current rendering state if the link
49264 \toperation was successful (see\t"
49265 (code "glLinkProgram")
49266 "
49267 ). If the program object currently in use is relinked
49268 \tunsuccessfully, its link status will be set to\t"
49269 (code "GL_FALSE")
49270 ", but the executables and
49271 \tassociated state will remain part of the current state until a
49272 \tsubsequent call to "
49273 (code "glUseProgram")
49274 " removes it
49275 \tfrom use. After it is removed from use, it cannot be made part
49276 \tof current state until it has been successfully relinked.")
49277 (para "If "
49278 (var "program")
49279 " contains shader objects
49280 \tof type "
49281 (code "GL_VERTEX_SHADER")
49282 " but it does not
49283 \tcontain shader objects of type\t"
49284 (code "GL_FRAGMENT_SHADER")
49285 ", an executable will be
49286 \tinstalled on the vertex processor, but fixed functionality will
49287 \tbe used for fragment processing. Similarly, if\t"
49288 (var "program")
49289 " contains shader objects of type\t"
49290 (code "GL_FRAGMENT_SHADER")
49291 " but it does not contain
49292 \tshader objects of type "
49293 (code "GL_VERTEX_SHADER")
49294 ", an
49295 \texecutable will be installed on the fragment processor, but
49296 \tfixed functionality will be used for vertex processing. If\t"
49297 (var "program")
49298 " is 0, the programmable processors
49299 \twill be disabled, and fixed functionality will be used for both
49300 \tvertex and fragment processing.")
49301 (heading "Errors")
49302 (para (code "GL_INVALID_VALUE")
49303 " is generated if\t"
49304 (var "program")
49305 " is neither 0 nor a value
49306 \tgenerated by OpenGL.")
49307 (para (code "GL_INVALID_OPERATION")
49308 " is generated if\t"
49309 (var "program")
49310 " is not a program object.")
49311 (para (code "GL_INVALID_OPERATION")
49312 " is generated if\t"
49313 (var "program")
49314 " could not be made part of current
49315 \tstate.")
49316 (para (code "GL_INVALID_OPERATION")
49317 " is generated if\t"
49318 (code "glUseProgram")
49319 " is executed between the
49320 \texecution of\t"
49321 (code "glBegin")
49322 "
49323 and the corresponding execution of\t"
49324 (code "glEnd")
49325 ".")))
49326
49327 (define-gl-procedure
49328 glValidateProgram
49329 "glValidateProgram"
49330 (funcsynopsis
49331 (funcprototype
49332 (funcdef "void " (function "glValidateProgram"))
49333 (paramdef "GLuint " (parameter "program"))))
49334 '(*fragment*
49335 (heading "Validates a program object")
49336 (heading "Parameters")
49337 (table (% (formatter (asis)))
49338 (entry (% (heading (var "program")))
49339 (para "Specifies the handle of the program object to
49340 \t\t be validated.")))
49341 (heading "Description")
49342 (para (code "glValidateProgram")
49343 " checks to see
49344 \twhether the executables contained in\t"
49345 (var "program")
49346 " can execute given the current
49347 \tOpenGL state. The information generated by the validation
49348 \tprocess will be stored in "
49349 (var "program")
49350 "'s
49351 \tinformation log. The validation information may consist of an
49352 \tempty string, or it may be a string containing information about
49353 \thow the current program object interacts with the rest of
49354 \tcurrent OpenGL state. This provides a way for OpenGL
49355 \timplementers to convey more information about why the current
49356 \tprogram is inefficient, suboptimal, failing to execute, and so
49357 \ton.")
49358 (para "The status of the validation operation will be stored as
49359 \tpart of the program object's state. This value will be set to\t"
49360 (code "GL_TRUE")
49361 " if the validation succeeded, and\t"
49362 (code "GL_FALSE")
49363 " otherwise. It can be queried by
49364 \tcalling\t"
49365 (code "glGetProgram")
49366 "
49367 with arguments "
49368 (var "program")
49369 " and\t"
49370 (code "GL_VALIDATE_STATUS")
49371 ". If validation is
49372 \tsuccessful, "
49373 (var "program")
49374 " is guaranteed to
49375 \texecute given the current state. Otherwise,\t"
49376 (var "program")
49377 " is guaranteed to not execute.")
49378 (para "This function is typically useful only during application
49379 \tdevelopment. The informational string stored in the information
49380 \tlog is completely implementation dependent; therefore, an
49381 \tapplication should not expect different OpenGL implementations
49382 \tto produce identical information strings.")
49383 (heading "Errors")
49384 (para (code "GL_INVALID_VALUE")
49385 " is generated if\t"
49386 (var "program")
49387 " is not a value generated by
49388 \tOpenGL.")
49389 (para (code "GL_INVALID_OPERATION")
49390 " is generated if\t"
49391 (var "program")
49392 " is not a program object.")
49393 (para (code "GL_INVALID_OPERATION")
49394 " is generated if\t"
49395 (code "glValidateProgram")
49396 " is executed between the
49397 \texecution of\t"
49398 (code "glBegin")
49399 "
49400 and the corresponding execution of\t"
49401 (code "glEnd")
49402 ".")))
49403
49404 (define-gl-procedure
49405 glVertexAttribPointer
49406 "glVertexAttribPointer"
49407 (funcsynopsis
49408 (funcprototype
49409 (funcdef
49410 "void "
49411 (function "glVertexAttribPointer"))
49412 (paramdef "GLuint " (parameter "index"))
49413 (paramdef "GLint " (parameter "size"))
49414 (paramdef "GLenum " (parameter "type"))
49415 (paramdef "GLboolean " (parameter "normalized"))
49416 (paramdef "GLsizei " (parameter "stride"))
49417 (paramdef
49418 "const GLvoid * "
49419 (parameter "pointer"))))
49420 '(*fragment*
49421 (heading
49422 "define an array of generic vertex attribute data")
49423 (heading "Parameters")
49424 (table (% (formatter (asis)))
49425 (entry (% (heading (var "index")))
49426 (para "Specifies the index of the generic vertex
49427 \t\t attribute to be modified."))
49428 (entry (% (heading (var "size")))
49429 (para "Specifies the number of components per
49430 \t\t generic vertex attribute. Must
49431 \t\t be 1, 2, 3, or 4. The initial value is 4."))
49432 (entry (% (heading (var "type")))
49433 (para "Specifies the data type of each component in
49434 \t\t the array. Symbolic constants "
49435 (code "GL_BYTE")
49436 ", "
49437 (code "GL_UNSIGNED_BYTE")
49438 ", "
49439 (code "GL_SHORT")
49440 ", "
49441 (code "GL_UNSIGNED_SHORT")
49442 ", "
49443 (code "GL_INT")
49444 ", "
49445 (code "GL_UNSIGNED_INT")
49446 ", "
49447 (code "GL_FLOAT")
49448 ", or "
49449 (code "GL_DOUBLE")
49450 " are
49451 \t\t accepted. The initial value is "
49452 (code "GL_FLOAT")
49453 "."))
49454 (entry (% (heading (var "normalized")))
49455 (para "Specifies whether fixed-point data values
49456 \t\t should be normalized ("
49457 (code "GL_TRUE")
49458 ")
49459 \t\t or converted directly as fixed-point values
49460 \t\t ("
49461 (code "GL_FALSE")
49462 ") when they are
49463 \t\t accessed."))
49464 (entry (% (heading (var "stride")))
49465 (para "Specifies the byte offset between consecutive
49466 \t\t generic vertex attributes. If "
49467 (var "stride")
49468 "
49469 is 0, the generic vertex attributes are
49470 \t\t understood to be tightly packed in the
49471 \t\t array. The initial value is 0."))
49472 (entry (% (heading (var "pointer")))
49473 (para "Specifies a pointer to the first component of
49474 \t\t the first generic vertex attribute in the array. The initial value is 0.")))
49475 (heading "Description")
49476 (para (code "glVertexAttribPointer")
49477 " specifies the
49478 \tlocation and data format of the array of generic vertex attributes at index "
49479 (var "index")
49480 "
49481 to use when rendering. "
49482 (var "size")
49483 "
49484 specifies the number of components per attribute and must be 1,
49485 \t2, 3, or 4. "
49486 (var "type")
49487 " specifies the data type
49488 \tof each component, and "
49489 (var "stride")
49490 " specifies
49491 \tthe byte stride from one attribute to the next, allowing vertices and
49492 \tattributes to be packed into a single array or
49493 \tstored in separate arrays.
49494 If set to "
49495 (code "GL_TRUE")
49496 ",\t"
49497 (var "normalized")
49498 " indicates that values stored
49499 \tin an integer format are to be mapped to the range [-1,1] (for
49500 \tsigned values) or [0,1] (for unsigned values) when they are
49501 \taccessed and converted to floating point. Otherwise, values will
49502 \tbe converted to floats directly without normalization.")
49503 (para "If a non-zero named buffer object is bound to the "
49504 (code "GL_ARRAY_BUFFER")
49505 " target
49506 (see "
49507 (code "glBindBuffer")
49508 ") while a generic vertex attribute array is
49509 specified, "
49510 (var "pointer")
49511 " is treated as a byte offset into the buffer object's data store.
49512 Also, the buffer object binding ("
49513 (code "GL_ARRAY_BUFFER_BINDING")
49514 ") is saved as generic vertex attribute array
49515 client-side state ("
49516 (code "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING")
49517 ") for index "
49518 (var "index")
49519 ".")
49520 (para "When a generic vertex attribute array is specified,\t"
49521 (var "size")
49522 ", "
49523 (var "type")
49524 ",\t"
49525 (var "normalized")
49526 ",\t"
49527 (var "stride")
49528 ", and\t"
49529 (var "pointer")
49530 " are saved as client-side
49531 \tstate, in addition to the current vertex array buffer object binding.")
49532 (para "To enable and disable a generic vertex attribute array,
49533 \tcall\t"
49534 (code "glEnableVertexAttribArray")
49535 "
49536 and\t"
49537 (code "glDisableVertexAttribArray")
49538 "
49539 with "
49540 (var "index")
49541 ". If enabled, the generic
49542 \tvertex attribute array is used when "
49543 (code "glArrayElement")
49544 ", "
49545 (code "glDrawArrays")
49546 ", "
49547 (code "glMultiDrawArrays")
49548 ", "
49549 (code "glDrawElements")
49550 ", "
49551 (code "glMultiDrawElements")
49552 ", or "
49553 (code "glDrawRangeElements")
49554 "
49555 is called.")
49556 (heading "Errors")
49557 (para (code "GL_INVALID_VALUE")
49558 " is generated if\t"
49559 (var "index")
49560 " is greater than or equal to\t"
49561 (code "GL_MAX_VERTEX_ATTRIBS")
49562 ".")
49563 (para (code "GL_INVALID_VALUE")
49564 " is generated if\t"
49565 (var "size")
49566 " is not 1, 2, 3, or 4.")
49567 (para (code "GL_INVALID_ENUM")
49568 " is generated if\t"
49569 (var "type")
49570 " is not an accepted value.")
49571 (para (code "GL_INVALID_VALUE")
49572 " is generated if\t"
49573 (var "stride")
49574 " is negative.")))
49575
49576 (define-gl-procedure
49577 glVertexAttrib
49578 "glVertexAttrib"
49579 (funcsynopsis
49580 (funcprototype
49581 (funcdef "void " (function "glVertexAttrib1f"))
49582 (paramdef "GLuint " (parameter "index"))
49583 (paramdef "GLfloat " (parameter "v0")))
49584 (funcprototype
49585 (funcdef "void " (function "glVertexAttrib1s"))
49586 (paramdef "GLuint " (parameter "index"))
49587 (paramdef "GLshort " (parameter "v0")))
49588 (funcprototype
49589 (funcdef "void " (function "glVertexAttrib1d"))
49590 (paramdef "GLuint " (parameter "index"))
49591 (paramdef "GLdouble " (parameter "v0")))
49592 (funcprototype
49593 (funcdef "void " (function "glVertexAttrib2f"))
49594 (paramdef "GLuint " (parameter "index"))
49595 (paramdef "GLfloat " (parameter "v0"))
49596 (paramdef "GLfloat " (parameter "v1")))
49597 (funcprototype
49598 (funcdef "void " (function "glVertexAttrib2s"))
49599 (paramdef "GLuint " (parameter "index"))
49600 (paramdef "GLshort " (parameter "v0"))
49601 (paramdef "GLshort " (parameter "v1")))
49602 (funcprototype
49603 (funcdef "void " (function "glVertexAttrib2d"))
49604 (paramdef "GLuint " (parameter "index"))
49605 (paramdef "GLdouble " (parameter "v0"))
49606 (paramdef "GLdouble " (parameter "v1")))
49607 (funcprototype
49608 (funcdef "void " (function "glVertexAttrib3f"))
49609 (paramdef "GLuint " (parameter "index"))
49610 (paramdef "GLfloat " (parameter "v0"))
49611 (paramdef "GLfloat " (parameter "v1"))
49612 (paramdef "GLfloat " (parameter "v2")))
49613 (funcprototype
49614 (funcdef "void " (function "glVertexAttrib3s"))
49615 (paramdef "GLuint " (parameter "index"))
49616 (paramdef "GLshort " (parameter "v0"))
49617 (paramdef "GLshort " (parameter "v1"))
49618 (paramdef "GLshort " (parameter "v2")))
49619 (funcprototype
49620 (funcdef "void " (function "glVertexAttrib3d"))
49621 (paramdef "GLuint " (parameter "index"))
49622 (paramdef "GLdouble " (parameter "v0"))
49623 (paramdef "GLdouble " (parameter "v1"))
49624 (paramdef "GLdouble " (parameter "v2")))
49625 (funcprototype
49626 (funcdef "void " (function "glVertexAttrib4f"))
49627 (paramdef "GLuint " (parameter "index"))
49628 (paramdef "GLfloat " (parameter "v0"))
49629 (paramdef "GLfloat " (parameter "v1"))
49630 (paramdef "GLfloat " (parameter "v2"))
49631 (paramdef "GLfloat " (parameter "v3")))
49632 (funcprototype
49633 (funcdef "void " (function "glVertexAttrib4s"))
49634 (paramdef "GLuint " (parameter "index"))
49635 (paramdef "GLshort " (parameter "v0"))
49636 (paramdef "GLshort " (parameter "v1"))
49637 (paramdef "GLshort " (parameter "v2"))
49638 (paramdef "GLshort " (parameter "v3")))
49639 (funcprototype
49640 (funcdef "void " (function "glVertexAttrib4d"))
49641 (paramdef "GLuint " (parameter "index"))
49642 (paramdef "GLdouble " (parameter "v0"))
49643 (paramdef "GLdouble " (parameter "v1"))
49644 (paramdef "GLdouble " (parameter "v2"))
49645 (paramdef "GLdouble " (parameter "v3")))
49646 (funcprototype
49647 (funcdef "void " (function "glVertexAttrib4Nub"))
49648 (paramdef "GLuint " (parameter "index"))
49649 (paramdef "GLubyte " (parameter "v0"))
49650 (paramdef "GLubyte " (parameter "v1"))
49651 (paramdef "GLubyte " (parameter "v2"))
49652 (paramdef "GLubyte " (parameter "v3"))))
49653 '(*fragment*
49654 (heading
49655 "Specifies the value of a generic vertex attribute")
49656 (heading "Parameters")
49657 (table (% (formatter (asis)))
49658 (entry (% (heading (var "index")))
49659 (para "Specifies the index of the generic vertex
49660 \t\t attribute to be modified."))
49661 (entry (% (heading
49662 (var "v0")
49663 ", "
49664 (var "v1")
49665 ", "
49666 (var "v2")
49667 ", "
49668 (var "v3")))
49669 (para "Specifies the new values to be used for the
49670 \t\t specified vertex attribute.")))
49671 (heading "Description")
49672 (para "OpenGL defines a number of standard vertex attributes that
49673 \tapplications can modify with standard API entry points (color,
49674 \tnormal, texture coordinates, etc.). The\t"
49675 (code "glVertexAttrib")
49676 " family of entry points
49677 \tallows an application to pass generic vertex attributes in
49678 \tnumbered locations.")
49679 (para "Generic attributes are defined as four-component values
49680 \tthat are organized into an array. The first entry of this array
49681 \tis numbered 0, and the size of the array is specified by the
49682 \timplementation-dependent constant\t"
49683 (code "GL_MAX_VERTEX_ATTRIBS")
49684 ". Individual elements
49685 \tof this array can be modified with a\t"
49686 (code "glVertexAttrib")
49687 " call that specifies the
49688 \tindex of the element to be modified and a value for that
49689 \telement.")
49690 (para "These commands can be used to specify one, two, three, or
49691 \tall four components of the generic vertex attribute specified by\t"
49692 (var "index")
49693 ". A "
49694 (code "1")
49695 " in the
49696 \tname of the command indicates that only one value is passed, and
49697 \tit will be used to modify the first component of the generic
49698 \tvertex attribute. The second and third components will be set to
49699 \t0, and the fourth component will be set to 1. Similarly, a\t"
49700 (code "2")
49701 " in the name of the command indicates that
49702 \tvalues are provided for the first two components, the third
49703 \tcomponent will be set to 0, and the fourth component will be set
49704 \tto 1. A "
49705 (code "3")
49706 " in the name of the command
49707 \tindicates that values are provided for the first three
49708 \tcomponents and the fourth component will be set to 1, whereas a\t"
49709 (code "4")
49710 " in the name indicates that values are
49711 \tprovided for all four components.")
49712 (para "The letters "
49713 (code "s")
49714 ",\t"
49715 (code "f")
49716 ", "
49717 (code "i")
49718 ",\t"
49719 (code "d")
49720 ", "
49721 (code "ub")
49722 ",\t"
49723 (code "us")
49724 ", and "
49725 (code "ui")
49726 " indicate
49727 \twhether the arguments are of type short, float, int, double,
49728 \tunsigned byte, unsigned short, or unsigned int. When\t"
49729 (code "v")
49730 " is appended to the name, the commands can
49731 \ttake a pointer to an array of such values. The commands
49732 \tcontaining "
49733 (code "N")
49734 " indicate that the arguments
49735 \twill be passed as fixed-point values that are scaled to a
49736 \tnormalized range according to the component conversion rules
49737 \tdefined by the OpenGL specification. Signed values are
49738 \tunderstood to represent fixed-point values in the range [-1,1],
49739 \tand unsigned values are understood to represent fixed-point
49740 \tvalues in the range [0,1].")
49741 (para "OpenGL Shading Language attribute variables are allowed to
49742 \tbe of type mat2, mat3, or mat4. Attributes of these types may be
49743 \tloaded using the "
49744 (code "glVertexAttrib")
49745 " entry
49746 \tpoints. Matrices must be loaded into successive generic
49747 \tattribute slots in column major order, with one column of the
49748 \tmatrix in each generic attribute slot.")
49749 (para "A user-defined attribute variable declared in a vertex
49750 \tshader can be bound to a generic attribute index by calling\t"
49751 (code "glBindAttribLocation")
49752 ".
49753 \tThis allows an application to use more descriptive variable
49754 \tnames in a vertex shader. A subsequent change to the specified
49755 \tgeneric vertex attribute will be immediately reflected as a
49756 \tchange to the corresponding attribute variable in the vertex
49757 \tshader.")
49758 (para "The binding between a generic vertex attribute index and a
49759 \tuser-defined attribute variable in a vertex shader is part of
49760 \tthe state of a program object, but the current value of the
49761 \tgeneric vertex attribute is not. The value of each generic
49762 \tvertex attribute is part of current state, just like standard
49763 \tvertex attributes, and it is maintained even if a different
49764 \tprogram object is used.")
49765 (para "An application may freely modify generic vertex attributes
49766 \tthat are not bound to a named vertex shader attribute variable.
49767 \tThese values are simply maintained as part of current state and
49768 \twill not be accessed by the vertex shader. If a generic vertex
49769 \tattribute bound to an attribute variable in a vertex shader is
49770 \tnot updated while the vertex shader is executing, the vertex
49771 \tshader will repeatedly use the current value for the generic
49772 \tvertex attribute.")
49773 (para "The generic vertex attribute with index 0 is the same as
49774 \tthe vertex position attribute previously defined by OpenGL. A\t"
49775 (code "glVertex2")
49776 ",\t"
49777 (code "glVertex3")
49778 ",
49779 \tor\t"
49780 (code "glVertex4")
49781 "
49782 command is completely equivalent to the corresponding\t"
49783 (code "glVertexAttrib")
49784 " command with an index
49785 \targument of 0. A vertex shader can access generic vertex
49786 \tattribute 0 by using the built-in attribute variable\t"
49787 (var "gl_Vertex")
49788 ". There are no current values
49789 \tfor generic vertex attribute 0. This is the only generic vertex
49790 \tattribute with this property; calls to set other standard vertex
49791 \tattributes can be freely mixed with calls to set any of the
49792 \tother generic vertex attributes.")
49793 (heading "Errors")
49794 (para (code "GL_INVALID_VALUE")
49795 " is generated if\t"
49796 (var "index")
49797 " is greater than or equal to\t"
49798 (code "GL_MAX_VERTEX_ATTRIBS")
49799 ".")))
49800
49801 (define-gl-procedure
49802 glVertexPointer
49803 "glVertexPointer"
49804 (funcsynopsis
49805 (funcprototype
49806 (funcdef "void " (function "glVertexPointer"))
49807 (paramdef "GLint " (parameter "size"))
49808 (paramdef "GLenum " (parameter "type"))
49809 (paramdef "GLsizei " (parameter "stride"))
49810 (paramdef
49811 "const GLvoid * "
49812 (parameter "pointer"))))
49813 '(*fragment*
49814 (heading "define an array of vertex data")
49815 (heading "Parameters")
49816 (table (% (formatter (asis)))
49817 (entry (% (heading (var "size")))
49818 (para "
49819 Specifies the number of coordinates per vertex. Must be 2, 3, or
49820 4. The initial value is 4. "))
49821 (entry (% (heading (var "type")))
49822 (para "
49823 Specifies the data type of each coordinate in the array.
49824 Symbolic constants "
49825 (code "GL_SHORT")
49826 ", "
49827 (code "GL_INT")
49828 ", "
49829 (code "GL_FLOAT")
49830 ",
49831 or "
49832 (code "GL_DOUBLE")
49833 "
49834 are accepted. The initial value is "
49835 (code "GL_FLOAT")
49836 ". "))
49837 (entry (% (heading (var "stride")))
49838 (para "
49839 Specifies the byte offset between consecutive
49840 vertices. If "
49841 (var "stride")
49842 " is 0, the vertices are understood to be tightly packed in
49843 the array. The initial value
49844 is 0. "))
49845 (entry (% (heading (var "pointer")))
49846 (para "
49847 Specifies a pointer to the first coordinate of the first vertex in the
49848 array. The initial value is 0. ")))
49849 (heading "Description")
49850 (para (code "glVertexPointer")
49851 " specifies the location and data format of an array of vertex coordinates
49852 to use when rendering. "
49853 (var "size")
49854 " specifies the number of coordinates per vertex, and must be 2, 3, or 4. "
49855 (var "type")
49856 " specifies the data type of each coordinate, and "
49857 (var "stride")
49858 " specifies the byte stride from one
49859 vertex to the next, allowing vertices and attributes
49860 to be packed into a single array or stored in separate arrays.
49861 (Single-array storage may be more efficient on some implementations;
49862 see "
49863 (code "glInterleavedArrays")
49864 ".) ")
49865 (para "
49866 If a non-zero named buffer object is bound to the "
49867 (code "GL_ARRAY_BUFFER")
49868 " target
49869 (see "
49870 (code "glBindBuffer")
49871 ") while a vertex array is
49872 specified, "
49873 (var "pointer")
49874 " is treated as a byte offset into the buffer object's data store.
49875 Also, the buffer object binding ("
49876 (code "GL_ARRAY_BUFFER_BINDING")
49877 ") is saved as vertex array
49878 client-side state ("
49879 (code "GL_VERTEX_ARRAY_BUFFER_BINDING")
49880 "). ")
49881 (para "
49882 When a vertex array is specified, "
49883 (var "size")
49884 ", "
49885 (var "type")
49886 ", "
49887 (var "stride")
49888 ", and "
49889 (var "pointer")
49890 " are saved as client-side
49891 state, in addition to the current vertex array buffer object binding. ")
49892 (para "
49893 To enable and disable the vertex array, call "
49894 (code "glEnableClientState")
49895 " and "
49896 (code "glDisableClientState")
49897 " with the argument "
49898 (code "GL_VERTEX_ARRAY")
49899 ". If
49900 enabled, the vertex array is used when "
49901 (code "glArrayElement")
49902 ", "
49903 (code "glDrawArrays")
49904 ", "
49905 (code "glMultiDrawArrays")
49906 ", "
49907 (code "glDrawElements")
49908 ", "
49909 (code "glMultiDrawElements")
49910 ", or "
49911 (code "glDrawRangeElements")
49912 "
49913 is called. ")
49914 (heading "Errors")
49915 (para (code "GL_INVALID_VALUE")
49916 " is generated if "
49917 (var "size")
49918 " is not 2, 3, or 4. ")
49919 (para (code "GL_INVALID_ENUM")
49920 " is generated if "
49921 (var "type")
49922 " is not an accepted value. ")
49923 (para (code "GL_INVALID_VALUE")
49924 " is generated if "
49925 (var "stride")
49926 " is negative. ")))
49927
49928 (define-gl-procedure
49929 glVertex
49930 "glVertex"
49931 (funcsynopsis
49932 (funcprototype
49933 (funcdef "void " (function "glVertex2s"))
49934 (paramdef "GLshort " (parameter "x"))
49935 (paramdef "GLshort " (parameter "y"))))
49936 '(*fragment*
49937 (heading "specify a vertex")
49938 (heading "Parameters")
49939 (table (% (formatter (asis)))
49940 (entry (% (heading (var "x")))
49941 (itemx (var "y"))
49942 (itemx (var "z"))
49943 (itemx (var "w"))
49944 (para "
49945 Specify "
49946 (var "x")
49947 ", "
49948 (var "y")
49949 ", "
49950 (var "z")
49951 ", and "
49952 (var "w")
49953 " coordinates of a vertex.
49954 Not all parameters are present in all forms of the command. ")))
49955 (heading "Description")
49956 (para (code "glVertex")
49957 " commands are used within "
49958 (code "glBegin")
49959 "/"
49960 (code "glEnd")
49961 " pairs to specify
49962 point, line, and polygon vertices. The current color, normal, texture
49963 coordinates, and fog coordinate are associated with the vertex when "
49964 (code "glVertex")
49965 "
49966 is called. ")
49967 (para "
49968 When only "
49969 (math (var "x"))
49970 "
49971 and "
49972 (math (var "y"))
49973 "
49974 are specified, "
49975 (math (var "z"))
49976 "
49977 defaults to 0 and "
49978 (math (var "w"))
49979 "
49980 defaults to 1. When "
49981 (math (var "x"))
49982 ", "
49983 (math (var "y"))
49984 ",
49985 and "
49986 (math (var "z"))
49987 "
49988 are specified, "
49989 (math (var "w"))
49990 "
49991 defaults to 1. ")))
49992
49993 (define-gl-procedure
49994 glViewport
49995 "glViewport"
49996 (funcsynopsis
49997 (funcprototype
49998 (funcdef "void " (function "glViewport"))
49999 (paramdef "GLint " (parameter "x"))
50000 (paramdef "GLint " (parameter "y"))
50001 (paramdef "GLsizei " (parameter "width"))
50002 (paramdef "GLsizei " (parameter "height"))))
50003 '(*fragment*
50004 (heading "set the viewport")
50005 (heading "Parameters")
50006 (table (% (formatter (asis)))
50007 (entry (% (heading (var "x")))
50008 (itemx (var "y"))
50009 (para "
50010 Specify the lower left corner of the viewport rectangle,
50011 in pixels. The initial value is (0,0). "))
50012 (entry (% (heading (var "width")))
50013 (itemx (var "height"))
50014 (para "
50015 Specify the width and height
50016 of the viewport.
50017 When a GL context is first attached to a window, "
50018 (var "width")
50019 " and "
50020 (var "height")
50021 " are set to the dimensions of that
50022 window. ")))
50023 (heading "Description")
50024 (para (code "glViewport")
50025 " specifies the affine transformation of "
50026 (math (var "x"))
50027 "
50028 and "
50029 (math (var "y"))
50030 "
50031 from
50032 normalized device coordinates to window coordinates.
50033 Let "
50034 (math "("
50035 (var "x")
50036 "_"
50037 (var "nd")
50038 ","
50039 (var "y")
50040 "_"
50041 (var "nd")
50042 ")")
50043 "
50044 be normalized device coordinates.
50045 Then the window coordinates "
50046 (math "("
50047 (var "x")
50048 "_"
50049 (var "w")
50050 ","
50051 (var "y")
50052 "_"
50053 (var "w")
50054 ")")
50055 "
50056 are computed as follows: ")
50057 (para (math (var "x")
50058 "_"
50059 (var "w")
50060 "="
50061 "("
50062 (var "x")
50063 "_"
50064 (var "nd")
50065 "+"
50066 "1"
50067 ","
50068 ")"
50069 "\u2062"
50070 "("
50071 (var "width")
50072 "/"
50073 "2"
50074 ","
50075 ")"
50076 "+"
50077 (var "x")))
50078 (para (math (var "y")
50079 "_"
50080 (var "w")
50081 "="
50082 "("
50083 (var "y")
50084 "_"
50085 (var "nd")
50086 "+"
50087 "1"
50088 ","
50089 ")"
50090 "\u2062"
50091 "("
50092 (var "height")
50093 "/"
50094 "2"
50095 ","
50096 ")"
50097 "+"
50098 (var "y")))
50099 (para "
50100 Viewport width and height are silently clamped
50101 to a range that depends on the implementation.
50102 To query this range, call "
50103 (code "glGet")
50104 " with argument "
50105 (code "GL_MAX_VIEWPORT_DIMS")
50106 ". ")
50107 (heading "Errors")
50108 (para (code "GL_INVALID_VALUE")
50109 " is generated if either "
50110 (var "width")
50111 " or "
50112 (var "height")
50113 " is negative. ")
50114 (para (code "GL_INVALID_OPERATION")
50115 " is generated if "
50116 (code "glViewport")
50117 "
50118 is executed between the execution of "
50119 (code "glBegin")
50120 "
50121 and the corresponding execution of "
50122 (code "glEnd")
50123 ". ")))
50124
50125 (define-gl-procedure
50126 glWindowPos
50127 "glWindowPos"
50128 (funcsynopsis
50129 (funcprototype
50130 (funcdef "void " (function "glWindowPos2s"))
50131 (paramdef "GLshort " (parameter "x"))
50132 (paramdef "GLshort " (parameter "y"))))
50133 '(*fragment*
50134 (heading
50135 "specify the raster position in window coordinates for pixel operations")
50136 (heading "Parameters")
50137 (table (% (formatter (asis)))
50138 (entry (% (heading (var "x")))
50139 (itemx (var "y"))
50140 (itemx (var "z"))
50141 (para "
50142 Specify the "
50143 (math (var "x"))
50144 ", "
50145 (math (var "y"))
50146 ", "
50147 (math (var "z"))
50148 "
50149 coordinates for the raster position. ")))
50150 (heading "Description")
50151 (para "
50152 The GL maintains a 3D position in window coordinates. This position,
50153 called the raster position, is used to position pixel and bitmap write
50154 operations. It is maintained with subpixel accuracy. See "
50155 (code "glBitmap")
50156 ", "
50157 (code "glDrawPixels")
50158 ", and "
50159 (code "glCopyPixels")
50160 ". ")
50161 (para (code "glWindowPos2")
50162 " specifies the "
50163 (math (var "x"))
50164 "
50165 and "
50166 (math (var "y"))
50167 "
50168 coordinates, while "
50169 (math (var "z"))
50170 "
50171 is
50172 implicitly set to 0. "
50173 (code "glWindowPos3")
50174 " specifies all three coordinates.
50175 The "
50176 (math (var "w"))
50177 "
50178 coordinate of the current raster position is always set to 1.0. ")
50179 (para (code "glWindowPos")
50180 " directly updates the "
50181 (math (var "x"))
50182 "
50183 and "
50184 (math (var "y"))
50185 "
50186 coordinates of the current raster
50187 position with the values specified. That is, the values are neither
50188 transformed by the current modelview and projection matrices, nor by
50189 the viewport-to-window transform. The "
50190 (math (var "z"))
50191 "
50192 coordinate of the current raster
50193 position is updated in the following manner: ")
50194 (para (math (var "z")
50195 "="
50196 "{"
50197 "("
50198 (var "n")
50199 ")"
50200 ", "
50201 "("
50202 (var "f")
50203 ")"
50204 ", "
50205 "("
50206 (var "n")
50207 "+"
50208 (var "z")
50209 "×"
50210 "("
50211 (var "f")
50212 "-"
50213 (var "n")
50214 ","
50215 ")"
50216 ","
50217 ")"
50218 "\u2062"
50219 "("
50220 (var "if")
50221 "\u2062"
50222 (var "z")
50223 "<="
50224 "0"
50225 ")"
50226 ", "
50227 "("
50228 (var "if")
50229 "\u2062"
50230 (var "z")
50231 ">="
50232 "1"
50233 ")"
50234 ", "
50235 "("
50236 (code "otherwise")
50237 ","
50238 ")"
50239 ","))
50240 (para)
50241 (para "
50242 where "
50243 (math (var "n"))
50244 "
50245 is "
50246 (code "GL_DEPTH_RANGE")
50247 "'s near value, and "
50248 (math (var "f"))
50249 "
50250 is "
50251 (code "GL_DEPTH_RANGE")
50252 "'s far value. See "
50253 (code "glDepthRange")
50254 ". ")
50255 (para "
50256 The specified coordinates are not clip-tested, causing the raster position
50257 to always be valid. ")
50258 (para "
50259 The current raster position also includes some associated color data and
50260 texture coordinates. If lighting is enabled, then "
50261 (code "GL_CURRENT_RASTER_COLOR")
50262 " (in RGBA mode) or "
50263 (code "GL_CURRENT_RASTER_INDEX")
50264 "
50265 (in color index mode) is set to the color produced by the lighting
50266 calculation (see "
50267 (code "glLight")
50268 ", "
50269 (code "glLightModel")
50270 ", and "
50271 (code "glShadeModel")
50272 ").
50273 If lighting is disabled, current color (in RGBA mode, state variable "
50274 (code "GL_CURRENT_COLOR")
50275 ") or color index (in color index mode, state variable "
50276 (code "GL_CURRENT_INDEX")
50277 ") is used to update the current raster color. "
50278 (code "GL_CURRENT_RASTER_SECONDARY_COLOR")
50279 " (in RGBA mode) is likewise updated. ")
50280 (para "
50281 Likewise, "
50282 (code "GL_CURRENT_RASTER_TEXTURE_COORDS")
50283 " is updated as a function of "
50284 (code "GL_CURRENT_TEXTURE_COORDS")
50285 ", based on the texture matrix and the texture
50286 generation functions (see "
50287 (code "glTexGen")
50288 "). The "
50289 (code "GL_CURRENT_RASTER_DISTANCE")
50290 " is set to the "
50291 (code "GL_CURRENT_FOG_COORD")
50292 ". ")
50293 (para)
50294 (heading "Errors")
50295 (para (code "GL_INVALID_OPERATION")
50296 " is generated if "
50297 (code "glWindowPos")
50298 "
50299 is executed between the execution of "
50300 (code "glBegin")
50301 "
50302 and the corresponding execution of "
50303 (code "glEnd")
50304 ". ")))
50305